Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted
  • 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

share|improve this answer
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.