2

EDIT: I now know what causes the problem. I failed to mention in this post that I used a header file and the command \include. I thought it would make no difference, and I was wrong. \input, however, works as expected.


I'm trying to put curvedarrows in my chemfig diagrams but the curved arrows are placed beside the whole scheme instead of on top.

Screenshot of my unfinished reaction scheme:

incomplete reaction scheme

You can see the curved arrow to the right of the imine molecule, even though I've placed the nodes on the aldehyde.

I tried to draw the aldehyde on its own with the curved arrow too, but it failed just the same.

enter image description here

And the relevant code:

\documentclass[a4paper]{article}

\usepackage{chemfig} \usepackage{mhchem}

\begin{document}

\setchemfig{atom sep=2em}

\begin{figure}[h] \centering \scriptsize \sffamily \mhchemoptions{font=sf} \schemestart \chemfig{(-[:-150]R)(=[@{db}:90]@{o}O)-[:-30]H} + \chemfig{N(-[:-150]H)(-[:90]H)-[:-30]R} \arrow(s1--int){<=>[\ce{H+}]} \chemname{\chemfig{(-[:-150]R)(-[:120]HO)(-[:60]N(-[:120]H)-[:0]R)-[:-30]H}}{hemiaminal} + \arrow{<=>[\ce{H+}]} \chemname{\chemfig{(-[:-150]R)(=[:90]N-[:30]R)-[:-30]H}}{imine} \arrow(@s1--s2){<=>[\ce{H+}]}[-90] \schemestop \chemmove{\draw(db)..controls +(-30:4mm) and +(0:4mm)..(o);} \end{figure}

\end{document}

\documentclass[a4paper]{article}

\usepackage{chemfig}
\usepackage{mhchem}

\begin{document}

\setchemfig{atom sep=2em}

\begin{figure}[h]
    \centering
    \scriptsize
    \sffamily
    \mhchemoptions{font=sf}
    \schemestart
    \chemfig{(-[:-150]R)(=[@{db}:90]@{o}O)-[:-30]H}
    \schemestop
    \chemmove{\draw(db)..controls +(-30:4mm) and +(0:4mm)..(o);}
\end{figure}

\end{document}

The chemfig manual mentions something about the viewer supporting "picture remembering", but I have no idea what this means.

Thanks for any and all help.

Edited to make the code compilable

ajzcole
  • 31
  • 2
    Could it be possible that you just compiled your example document once? If I do so, I get the output you show in your question. Just compile the document again to get the expected output. The documentation explicitly mentions "It is assumed [...] that the compilation is done twice." (See section 13 Representing electron movements, currently on page 21 of the manual.) – leandriis May 24 '21 at 08:07
  • @leandriis I use latexmk for auto-compilation, so that shouldn't be an issue. I've also tried with pdflatex and even Overleaf as a desperate last-attempt. Recompiling does not fix the issue. – ajzcole May 24 '21 at 22:40

0 Answers0