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'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.

share|improve this question
    
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: \arrow{-U>[{\chemfig[][scale=.5]{N*6(-=-=-=)}}][{\chemfig[][scale=.5]{N*6(-=-=-‌​=)}}]}[,2] –  cgnieder Apr 16 '13 at 18:38
    
The extra pair of braces did it. Thanks a lot! –  pharmacist Apr 16 '13 at 18:51
    

1 Answer 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

share|improve this answer

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.