chemfig
Advanced usage
5 Delocalized double bonds¶
It is sometimes necessary to draw a double bond so that one line would be full and the other dashed. This feature is not hard-coded in chemfig since TikZ, with its “decorations.markings” library makes it possible.
Delocalized bonds
\catcode`\_=11
\tikzset{
ddbond/.style args={#1}{
draw=none,
decoration={%
markings,
mark=at position 0 with {
\coordinate (CF@startdeloc) at (0,\dimexpr#1\CF_doublesep/2)
coordinate (CF@startaxis) at (0,\dimexpr-#1\CF_doublesep/2);
},
mark=at position 1 with {
\coordinate (CF@enddeloc) at (0,\dimexpr#1\CF_doublesep/2)
coordinate (CF@endaxis) at (0,\dimexpr-#1\CF_doublesep/2);
\draw[dash pattern=on 2pt off 1.5pt] (CF@startdeloc)--(CF@enddeloc);
\draw (CF@startaxis)--(CF@endaxis);
}
},
postaction={decorate}
}
}
\catcode`\_=8
\chemfig{A-[,,,,ddbond={+}]B-[,,,,ddbond={-}]C}