6

I am trying to reproduce this:

enter image description here

So far I have:

\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}

But the wavy line really doesn't look very good. Can someone think of a better way of doing that? Also, looking at the number 5 there is something strange going on there. What's wrong with that? enter image description here

7

You might want to use the decoration complete sines from Nicer wavy line with TikZ as I've used in a blog post of mine a while ago:

enter image description here

\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}

For reproducing the picture I'd probably also define a submol:

\tikzset{wv/.style={decorate,decoration=complete sines}}
\definesubmol{R}{-[,.5]((-[::90,.5,,,wv])-[::-90,.5,,,wv])}

and then:

\chemfig{*5(9-1-2(!R)-3(!R)-4*6(-5-6-7-8-9-))}

enter image description here

For more customization of the wavy bond you might be interested in this blog post by Joseph Wright: Exploring ChemFig: Going further

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.