Chemfig – How to Number Atoms

chemfigpositioning

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?

Best Answer

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

Related Question