7

Is there a way to join the wedges with single bonds in chemfig in a "smooth way"?

\documentclass{article}
\usepackage{chemfig}

\begin{document}
    \setchemfig{angle increment=30, bond join = true}
    \chemfig{-[-1](-[1])<[-3]-[-1]}
\end{document}

Gives out:

Is it possible to have it trim the wedge at the single bond as:

enter image description here

  • 1
    Obviously you were able to produce the result as you want. How did you create the second picture? – pisoir Mar 27 '18 at 20:38
  • 1
    Chemdraw. I would rather have my figures in chemfig rather than in chemdraw for future edits if necessary. – ralk912 Mar 27 '18 at 20:51
3

I am not really an expert on pgf and tikz but I find a (partial) solution. Modifying the chemfig default values with setchemfig produces:

Create modifying setchemfig

\documentclass{article}
\usepackage{chemfig}
\begin{document}
    \setchemfig{
         atom sep=15pt,
         cram width=3.0pt,
         cram dash width=0.75pt,
         cram dash sep=2.0pt
         bond offset=0.75pt
         bond style={line width=0.75pt}
    }
    \chemfig{-[::-30](-[::60])<[::-60]-[::60]}
\end{document}

I use usetikzlibrary{decorations} to create a custom Cram bond, based on @pisoir answer in How to make only one part of double bond bold with chemfig?.

\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{decorations}

\pgfdeclaredecoration{crambond1side}{initial}{%
    \state{initial}[width=\pgfdecoratedpathlength]{%
        \pgfsetfillcolor{black}
        \pgfpathlineto{\pgfpoint{0pt}{0.3pt}}
        \pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{2pt}}
        \pgfpathlineto{\pgfpoint{0.96*\pgfdecoratedpathlength}{-2pt}}
        \pgfpathlineto{\pgfpoint{0pt}{-0.3pt}}
        \pgfusepath{fill}
    }
}
\tikzset{CramRight/.style={decorate, decoration=crambond1side}}
\tikzset{CramLeft/.style={decorate, decoration={crambond1side, mirror}}}

\pgfdeclaredecoration{crambond2sides}{initial}{%
    \state{initial}[width=\pgfdecoratedpathlength]{%
        \pgfsetfillcolor{black}
        \pgfpathlineto{\pgfpoint{0pt}{0.3pt}}
        \pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{2pt}}
        \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
        \pgfpathlineto{\pgfpoint{1.10*\pgfdecoratedpathlength}{-2pt}}
        \pgfpathlineto{\pgfpoint{0pt}{-0.3pt}}
        \pgfusepath{fill}
    }
}
\tikzset{Cram2Sides/.style={decorate, decoration=crambond2sides}}

\begin{document}
    \setchemfig{
        atom sep=15pt,
        cram width=3.0pt, cram dash width=0.75pt, cram dash sep=2.0pt,
        bond offset=0.75pt,
        bond style={line width=0.75pt}
    }
    \chemfig{-[::-30](-[::+60])-[::-60,,,,CramLeft]-[::-60]}\quad
    \chemfig{-[::-30](-[::+60])-[::-60,,,,CramRight]-[::+60]}\quad
    \chemfig{-[::-30](-[::+60])-[::-60,,,,Cram2Sides](-[::-60])-[::60]}\quad
\end{document}

The final result

enter image description here

1

This is probably not an ideal solution, but after little bit of tweaking you might get something similar to what you want. Notice that I added the cram width, line width, and shorten parameters to your code.

\documentclass{article}
\usepackage{chemfig}

\begin{document}
    \setchemfig{angle increment=30, bond join = true, cram width = 2.4pt}
    \chemfig{-[-1](-[1])<[-3]-[-1,,,,line width=1.5pt, shorten <=-1pt]}
\end{document}

which produces this:

enter image description here

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.