1

How can I align the following reaction mechanism of the Aspirin synthesis in chemfig?

Code:

\schemestart
\definesubmol\nobond{-[2,0.2,,,draw=none]}
\chembelow[5mm]{\chemfig[][scale=0.7]{HO-[:-30]@{5}(!\nobond\scriptstyle\oplus)(-[:-90]CH_3)(-[@{2}:30]O-[:-30](-[:-90]CH_3)=[:30]O)}}{\chembelow[5mm]{+}{\chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-@{4}O@{3}H)=-)}}}
\qquad\qquad
\arrow(.base east--.base west){->[\tiny\chemfig{{-}CH_3COOH}][][4pt]}
\chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](-[:90]@{7}O-[@{6}:360]H)(-[:210]CH_3))=-)}
\chemmove[->,shorten <=2pt]{
    \draw[shorten >=8pt](2)..controls +(-50:2.5cm)and+(45:1cm)..(3);}
\chemmove[->,shorten <=2pt]{
    \draw[shorten >=3pt](4)..controls +(180:1cm)and+(-135:1cm)..(5);}
\chemmove[->,shorten <=2pt]{
    \draw[shorten >=5pt](6)..controls +(90:5mm)and+(90:5mm)..(7);}
\arrow{->[\tiny\chemfig{{-}\chemabove{H}\oplus}]}
\chemfig[][scale=0.7]{*6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](=[:90]O)(-[:210]CH_3))=-)}
\schemestop

Thank you for your answer!

Reaction mechanism in the actual state

2
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. How do you want them to align exactly?
    – LaRiFaRi
    Jul 20 '15 at 14:46
  • 1
    Thanks four your comment. Sorry for the inconvenience, I'll add this in the future!
    – Sam
    Jul 21 '15 at 20:55
3

How about this:

\documentclass{article}

\usepackage{chemfig}
\definesubmol\nobond{-[2,0.2,,,draw=none]}

\begin{document}

\schemestart
  \subscheme[-90]{
    \chemfig[atom style={scale=0.7}]{
      HO-[:-30]@{5}(!\nobond\scriptstyle\oplus)(-[:-90]CH_3)(-[@{2}:30]O
      -[:-30](-[:-90]CH_3)=[:30]O)
    }
    \arrow{0[+][][-10pt]}
    \chemfig[atom style={scale=0.7}]{*6(=-=(-([:90]=O)([:-40]-OH))-(-@{4}O@{3}H)=-)}
  }
  \arrow{->[\tiny\chemfig{{-}CH_3COOH}]}[,1.5]
  \chemfig[atom style={scale=0.7}]{
    *6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](-[:90]@{7}O-[@{6}:360]H)(-[:210]CH_3))=-)
  }
  \arrow{->[\tiny\chemfig{{-}\chemabove{H}\oplus}]}
  \chemfig[atom style={scale=0.7}]{
    *6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](=[:90]O)(-[:210]CH_3))=-)
  }
\schemestop
\chemmove[->,shorten <=2pt]{
  \draw[shorten >=8pt](2)..controls +(-50:2.5cm)and+(45:1cm)..(3);
  \draw[shorten >=3pt](4)..controls +(180:1cm)and+(-135:1cm)..(5);
  \draw[shorten >=5pt](6)..controls +(90:5mm)and+(90:5mm)..(7);
}

\end{document}

enter image description here


Despite the scaling and the \tiny fontsize for the arrow labels the scheme stil exceeds the page width. Personally I'd play with chemfig's atom sep (and bond offset) but choose a larger fontsize, \footnotesize maybe. (In the example below showframe visualizes the page dimensions.)

The example uses the chemmacros package (which also loads the chemformula package). It provides the \scrp and offers the possibility to print all charges in chemformula's formulas (\ch) as formal charges (\chemsetup{ charges/circled = all })

\documentclass{article}

\usepackage{chemfig,chemmacros,showframe}
\definesubmol\pchargeup{-[2,0.4,,,draw=none]\scrp}
\definesubmol\pchargedown{-[6,0.4,,,draw=none]\scrp}

\begin{document}

\begin{center}
  \chemsetup{charges/circled=all}
  \setchemfig{atom sep = 1.7em , bond offset = 0.5pt}
  \footnotesize
\schemestart
  \subscheme[-90]{
    \chemfig{
      HO-[:-30]@{C1}(!\pchargeup)
      (-[:-90]CH_3)
      (-[@{b}:30]O-[:-30](-[:-90]CH_3)=[:30]O)
    }
    \arrow{0[+][][-10pt]}
    \chemfig{*6(=-=(-([:90]=O)([:-40]-OH))-(-@{OH}OH)=-)}
  }
  \arrow{->[${}-\ch{CH3COOH}$]}[,1.7]
  \chemfig{
    *6(
      =-=(-([:90]=O)([:-40]-OH))
      -(-O-[:-210]@{C2}(-[:90]O-[@{H}:360]H)(!\pchargedown)-[:210]CH_3)
      =-
    )
  }
  \arrow{->[${}-\ch{H+}$]}
  \chemfig{*6(=-=(-([:90]=O)([:-40]-OH))-(-O-[:-210](=[:90]O)(-[:210]CH_3))=-)}
\schemestop
\chemmove[red,-el,shorten <=2pt,shorten >=2pt]{
  \draw[shorten >=8pt] (b) ..controls +(-50:2.5cm) and +(10:1cm)  .. (OH) ;
  \draw (OH)..controls +(180:1cm)   and +(-135:1cm).. (C1) ;
  \draw (H) ..controls +(-90:3mm)   and +(30:5mm)  .. (C2) ;
}
\end{center}

\end{document}

enter image description here

3
  • Thank you very much for this extremely useful code. I'm totally new in LaTeX (playing around with it for 2 days now) and so I could learn much from your code. But there are still some minor questions: 1. What does "\chemsetup[option]{circled=all}" do? 2. Is it possible to make this vertical alignment without centring the reaction scheme horizontally? 3. What are the parameters of this: "\arrow{->[${}-\ch{CH3COOH}$]}[,1.7]" and what do they do? Again, thank you very much!
    – Sam
    Jul 21 '15 at 20:50
  • 1.) \chemsetup is the setup command for the chemmacros´ package. The circled` option determines how the charges are printed. 2.) I don't understand the question. For the rest I'll add something to my answer tomorrow.
    – cgnieder
    Jul 21 '15 at 22:00
  • @Sam an arrow \arrow{->} with label ${}-\ch{CH3COOH}$ (this is math like $a-b$ but with an empty atom before the minus and a chemformula after it) scaled to 170% of its normal length [,1.7]: \arrow{->[${}-\ch{CH3COOH}$]}[,1.7]
    – cgnieder
    Jul 22 '15 at 9:39

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.