1

Consider the following MWE:

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\chemfig{
    X
    -[:30,,,2]^{18}\chemabove{O}{H}
    -[:-30]X
}

\end{document}

This code returns an error:

Package chemfig Error: no atom found at position 2, pershaps you mispelled the optional argument of the bond.. }

Elimination of the number 2 as an argument for the arrival oxygen atom resolves that issue, but the left X-O bond is placed incorrectly:

\chemfig{
    X
    -[:30]^{18}\chemabove{O}{H}
    -[:-30]X
}

enter image description here

I've been playing around a bit and the best hack I've came up so far is to use a shortened invisible O-H bond:

\chemfig{
    X
    -[:30,,,2]^{18}O(-[:90,0.3,2,,draw=none]H)
    -[:-30]X
}

enter image description here

Still, I find the latter solution less robust and elegant. Is there a way to still use \chemabove or \chembelow in tandem with departure/arriving atom numbering arguments?

1

I guess, you need to put the 18 into the stack and reduce its bounding box to zero using \llap (a similar example using \rlap is provided in the current documentation [v1.33] on page 42):

\documentclass[border=5mm]{standalone}
\usepackage{chemfig}

\begin{document}

\chemfig{
    X
    -[:30]\chemabove{\llap{$^{18}$}O}{H}
    -[:-30]X
}

\end{document}

enter image description here

5

You should use | to start the 2nd atom after ^{18}:

\chemfig{
    X
    -[:30,,,2]^{18}|\chemabove{O}{H}
    -[:-30]X
}
  • Nice! I forgot this one! Thanks for pointing it out – Jasper Habicht Dec 8 '18 at 14:07

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.