5

Take the following example

\documentclass{article}
\usepackage{chemmacros}
\begin{document}
\begin{reactions*}
NH3 + H2O &<=> NH4+ + OH-\\
Fe^3+ + 3 OH- &-> Fe(OH)3\\
2 Fe(OH)3   &->[heat] Fe2O3 + 3 H2O
\end{reactions*}
\begin{reactions*}
G &-> H + I \\
J + K &-> L
\end{reactions*}
\end{document}

arrow misalign

The first reaction scheme has two different arrow types and alignment only on start of arrow. Ideally I want the LHS ( r) aligned (as it is), the arrows ( c) aligned and the RHS (l ) aligned as it is in the first two lines and the second reaction scheme.

I have tried putting an & after the arrows to align the products side but to no avail. Outside of placing it within an align or tabular environment and encapsulating each segment in \ch{ } is there an alternative?

ps I used \documentclass{article} as minimal or standalone classes have an issue with chemmacros but that's for another day...

4

May I propose something else?

I would not tweak around with the alignments but try to get the arrows all to the same length. The two extreme versions would look like in my MWE. You can, of course, try to find some pleasing middle between those.

% arara: pdflatex

\documentclass{article}
\usepackage{chemmacros}

\begin{document}
    \begin{reactions*}
        NH3 + H2O &<=> NH4+ + OH-\\
        Fe^3+ + 3 OH- &-> Fe(OH)3\\
        2 Fe(OH)3   &->[\makebox[0pt]{heat}] Fe2O3 + 3 H2O
    \end{reactions*}
    \begin{reactions*}
        NH3 + H2O &<=>[\phantom{heat}] NH4+ + OH-\\
        Fe^3+ + 3 OH- &->[\phantom{heat}] Fe(OH)3\\
        2 Fe(OH)3   &->[heat] Fe2O3 + 3 H2O
    \end{reactions*}
\end{document}

enter image description here


If you want to align the terms as you have written in your post, you could do this within an array environment. You could define your custom column types or just write them into the \begin{array}{...} declaration:

% arara: pdflatex

\documentclass{article}
\usepackage{chemmacros}
\usepackage{collcell}
\newcolumntype{R}{>{\collectcell\ch}r<{\endcollectcell}}
\newcolumntype{C}{@{}>{\collectcell\ch}c<{\endcollectcell}@{}}
\newcolumntype{L}{>{\collectcell\ch}l<{\endcollectcell}}

\begin{document}    
\[
\begin{array}{R C L}
    NH3 + H2O &<=> &NH4+ + OH-\\[\jot] % or any other measure. The screen shot below is showing [0pt]
    Fe^3+ + 3 OH- &-> &Fe(OH)3\\[\jot]
    2 Fe(OH)3   &->[heat] &Fe2O3 + 3 H2O
\end{array}
\]
\end{document}

enter image description here

  • Looks good. As you point out it is to do with the arrow lengths. I have upvoted this answer. I'll wait a while before I accept it to see if any other different solutions are suggested. – Leeser May 26 '15 at 12:31

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.