11

I need to number atoms using chemfig. I thought I could use \chembelow and \chemabove to place numbers above and below but adding these commands changes the look of the drawing and does not simply only add the number.

\documentclass{minimal}
\usepackage{chemfig}
\begin{document}

\chemfig{*6(\chembelow{}{1}=\chembelow{}{5}-\chembelow{}{9}(*6(-=-=-=-=))--=\chemabove{}{2}-)}

\end{document}

Chemfig example

The lines are broken where the numbers are added. How can I add numbers without breaking the lines? Also, the numbers are placed very close -- could that be related?

8

You can use invisible bonds:

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\definesubmol\QQ{-[,0.2,,,draw=none]\scriptstyle}
\chemfig{*6((!\QQ1)=(!\QQ5)-(-[6,0.2,,,draw=none]\scriptstyle9)*6(-=-=-=)-[,,,,draw=none]-=(!\QQ2)-)}
\end{document}

enter image description here

8
  • To avoid breaking the lines, create an empty bond and attach it
  • To raise or lower an argument of \chemabove or \chembelow, use the optional argument

The chemfig manual recommends \definesubmol\nobond{[,0.2,,,draw=none]} in 12.2 Add a superscript without modifying a bond and using this:

\documentclass{minimal}
\usepackage{chemfig}
\definesubmol\nobond{[,0.2,,,draw=none]}
\begin{document}
\chemfig{*6((!\nobond\chembelow[1ex]{}{1})=
  (!\nobond\chembelow[1ex]{}{5})-(!\nobond\chembelow[1ex]{}{9})
  (*6(-=-=-=-=))--=(!\nobond\chemabove[1ex]{}{2})-)}
\end{document}

numbered atoms

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.