我正在尝试重现这一点:
到目前为止我已经:
\documentclass{memoir}
\usepackage{tikz}
\usepackage{chemfig}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\chemfig{*5(5-1-2(-((-[:90,1,,,decorate,decoration=snake])-[:-90,1,,,decorate,decoration=snake]))-3-4*6(-6-7-8-9-5-)-)}
\end{document}
答案1
你可能想要使用complete sines
来自使用 TikZ 绘制更漂亮的波浪线正如我所用在我之前的一篇博客文章中:
\documentclass{article}
\usepackage{tikz}
\usepackage{chemfig}
\usetikzlibrary{decorations.pathmorphing}
\pgfdeclaredecoration{complete sines}{initial}{
\state{initial}[
width=+0pt,
next state=sine,
persistent precomputation={
\pgfmathsetmacro\matchinglength{
\pgfdecoratedinputsegmentlength /
int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)
}
\setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
}]{}
\state{sine}[width=\pgfdecorationsegmentlength]{
\pgfpathsine{
\pgfpoint
{0.25\pgfdecorationsegmentlength}
{0.5\pgfdecorationsegmentamplitude}
}
\pgfpathcosine{
\pgfpoint
{0.25\pgfdecorationsegmentlength}
{-0.5\pgfdecorationsegmentamplitude}
}
\pgfpathsine{
\pgfpoint
{0.25\pgfdecorationsegmentlength}
{-0.5\pgfdecorationsegmentamplitude}
}
\pgfpathcosine{
\pgfpoint
{0.25\pgfdecorationsegmentlength}
{0.5\pgfdecorationsegmentamplitude}
}
}
\state{final}{}
}
\tikzset{wv/.style={decorate,decoration=complete sines}}
\begin{document}
\chemfig{*5(5-1-2(-((-[:90,1,,,wv])-[:-90,1,,,wv]))-3-4*6(-6-7-8-9-5-))}
\end{document}
为了重现图片我可能还会定义一个子模型:
\tikzset{wv/.style={decorate,decoration=complete sines}}
\definesubmol{R}{-[,.5]((-[::90,.5,,,wv])-[::-90,.5,,,wv])}
进而:
\chemfig{*5(9-1-2(!R)-3(!R)-4*6(-5-6-7-8-9-))}
如果想了解更多关于波浪键的定制,你可能会对 Joseph Wright 的这篇博客文章感兴趣:探索 ChemFig:更进一步