2

i've a problem with chemfig-package. I want to draw some mulecules above an \arrow{-U>}, but i can't scale them in the right way. Does anybody has an idea to work around or do I just made a mistake?

Here's some code for you:

\documentclass[draft=yes,oneside]{scrbook}
\usepackage{chemfig}
\begin{document}

\begin{figure}[h!tbp,width=\textwidth]
\schemedebug{true}
\schemestart
  \chemfig[][scale=.7]{*6((-O_{2}N)-=-(-([::-60]-H)([::+60]=O))=-=)}\arrow{0}[,0]\+\arrow{0}[,0]
  \chemfig[][scale=.7]{[:75]HO-(=[::+60]O)-[::-60]-[::-60](=[::+60]O)-[::-60]HO}
  \arrow{-U>[\chemfig{N*6(-=-=-=)}][\chemfig{N*6(-=-=-=)}]}
\schemestop
\end{figure}
\end{document}

As you see, the molecule does appear above the arrow, but it isn't scaleable with [scale=.2], i.e.

1

Turning my comment into an answer (just to remove this question from the unanswered ones):

As always when you want to use square brackets in an optional argument you have to enclose the argument in an extra pair of braces. There are quite a number of questions related to this fact:

probably the most complete answer being the one by Frank Mittelbach to the second of the linked questions.

Let's see that it works:

\documentclass[draft=yes,oneside]{scrbook}
\usepackage{chemfig}
\begin{document}

\begin{figure}[h!tbp,width=\textwidth]
\schemedebug{true}
\schemestart
  \chemfig[][scale=.7]{*6((-O_{2}N)-=-(-([::-60]-H)([::+60]=O))=-=)}\arrow{0}[,0]\+\arrow{0}[,0]
  \chemfig[][scale=.7]{[:75]HO-(=[::+60]O)-[::-60]-[::-60](=[::+60]O)-[::-60]HO}
  \arrow{-U>[{\chemfig[][scale=.4]{N*6(-=-=-=)}}][{\chemfig[][scale=.4]{N*6(-=-=-=)}}]}
\schemestop
\end{figure}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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