<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\subsection{Crossing bonds}

The cubane molecule contains several bonds that cross each other:

\lstinputlisting{cubane-n.sh}

\cfpic{cubane-n.tex}

Use the  \lstinline!--cross-bond! or \lstinline!-k! option to specify which bonds should go into the foreground:

\lstinputlisting{cubane-cross-n.sh}

\cfpic{eschers-cubane.tex}

The implementation of this feature is a bit of a hack, I'm afraid; the following code listing (with hand-written comments) illustrates the contortions it adds to the generated code. 

\lstinputlisting{hand-coded-tex/twisted-commented.tex}

The styling of the bond in the foreground can be adjusted by tweaking the \lstinline!mcfcrossbond! \tkz key in the \lstinline!mol2chemfig.sty! package. Alternatively, as of version 1.2b, \lstinline!mol2chemfig.sty! patches \chf's \lstinline!\setbondstyle! macro, such that the background for crossing bonds can be passed as an optional argument:

\lstinputlisting{setbondstyle.tex}\input{setbondstyle.tex}

\cfpic{eschers-cubane.tex}
</pre></body></html>