I last used chemfig a while ago. Much has changed since then, especially the \charge
command.
I'm trying to draw a simple molecule. In number 3 it looks exactly as I want, but I'd like to be able to be able to have the methyl first in the code. I do this in #2 (works well) and #4 (adding \charge
causes an error. Why is this? How can I avoid it?
! Package chemfig Error: no atom found at position 2, pershaps you mispelled the optional argument of the bond...\CF_error ...e {Package \CFname \space Error: #1.} -[:-30]F}
MWE:
\documentclass[11pt,tikz,margin=1.5mm]{standalone}
\usepackage{chemfig}
\begin{document}
% works with methyl as branch
\chemfig{H_2N(-[:90,,2])
-[:-30]F}
% correct, but without charge
\chemfig{-[:270,,,2]H_2N
-[:-30]F}
% #1 with charge
\chemfig{H_2\charge{45:2pt=$+$}{N}(-[:90,,2])
-[:-30]F}
% #2 with charge
\chemfig{-[:270,,,2]H_2\charge{45:2pt=$+$}{N}
-[:-30]F}
\end{document}