I have a chemfig command which involves the use of #. It compiles properly on itself.
\chemfig{**[135,405,dash pattern=on 2pt off 2pt]6(----#(,0pt)\chembelow[2.5em]{}{+}(-#(0pt)[3]H)(-#(0pt)[1]NO_3)-#(0pt)-)}
But when I put it into the align block, pdfLaTeX gives error.
\begin{align*}
\chemfig{**[135,405,dash pattern=on 2pt off 2pt]6(----#(,0pt)\chembelow[2.5em]{}{+}(-#(0pt)[3]H)(-#(0pt)[1]NO_3)-#(0pt)-)}
\end{align*}
The error message is here: http://pastebin.com/3FLzX4RP
MWE:
\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{chemfig}
\pagestyle{empty}
\begin{document}
\begin{align*}
\chemfig{**[135,405,dash pattern=on 2pt off 2pt]6(----#(,0pt)\chembelow[2.5em]{}{+}(-#(0pt)[3]H)(-#(0pt)[1]NO_3)-#(0pt)-)}
\end{align*}
\end{document}
In chemfig, # is used to adjust the bond shortening. The following example is from the chemfig documentation, pg. 6

I've tried using \#(0pt), but instead of adjusting the bond, it outputs the string directly.


\documentclass{...}and ending with\end{document}.What does#do in chemfig? Perhaps it's required literally, i.e.\#within align? – Feb 22 '15 at 11:28150,390? – Manuel Feb 22 '15 at 12:04