20

In the align below the last element of the first row is slightly off compared to the next rows. It looks like the root cause is mostly the distance between minus and zero, but also between the equal sign and minus. Why are they so different?

\begin{align}
\cee{Fe^2+_{(aq)} + 2e- -> Fe_{(s)}&(reduction) &E^0&= -0.41V}\\
\cee{Al_{(s)} -> Al^3+_{(aq)} + 3e- &(oxidation) &E^0&= +1.66V}\\
\cee{3Fe^2+_{(aq)} + 2Al_{(s)} -> 2Al^3+_{(aq)} + 3Fe_{(s)}&(overall) &E_{cell}&= +1.25V}
\end{align}

enter image description here

aiag
  • 721
  • 1
    If you know Italian, see this: https://youtu.be/VPsS5_b5U30 – CarLaTeX Feb 09 '17 at 04:49
  • 2
    Completely off topic to your question, but relevant for how you deal with your text later on: seeing that you align the equals signs and the descriptive parentheses, I, as a reader of chemistry texts, would like to request that you please align the reaction arrows as well. This is a completely personal opinion, but I find it easier (and more beautiful) to read reactions where the arrows are aligned (do keep the other alignments you have already). – Mrkvička Feb 09 '17 at 13:00
  • 1
    @Mrkvička: I've added that option in my answer. – Werner Feb 09 '17 at 21:04

2 Answers2

23

The reason is that \cee does a different scanning than usual and gets tricked by +, which does have a special meaning inside \ce or \cee, because it's used for reactions.

Indeed, if you try putting that part outside \cee (which it should be), the problem doesn't show.

Here's a better version.

\documentclass{article}

\usepackage[version=3]{mhchem}
\usepackage{siunitx}
\sisetup{retain-explicit-plus}

\begin{document}
\begin{align}
E&=-0.1\\
F&=+0.1
\end{align}

\begin{align}
  \cee{Fe^2+_{(aq)} + 2e- -> Fe_{(s)} &\ (reduction)}  & E^0 &= \SI{-0.41}{\V} \\
  \cee{Al_{(s)} -> Al^3+_{(aq)} + 3e- &\ (oxidation)} & E^0 &= \SI{+1.66}{\V} \\
  \cee{3Fe^2+_{(aq)} + 2Al_{(s)} -> 2Al^3+_{(aq)} + 3Fe_{(s)} & \ (overall)} &
    E_{\mathrm{cell}} &= \SI{+1.25}{\V}
\end{align}

\end{document}

enter image description here

egreg
  • 1,121,712
17

+ and - have special meaning within \cee since it relates to charges of atoms/particles and is therefore treated differently. The - visually defaults to a unary minus while + defaults to a binary relation (for joining atoms in a reaction). In this instance one can force it to be unary using {+}, as in E^0 &= {+}1.66V.

Here is an alternative with some adjusted horizontal alignment:

enter image description here

\documentclass{article}

\usepackage[version=3]{mhchem}

\newcommand{\BRR}{\makebox{\phantom{\cee{2Al^3+_{(aq)} + 3Fe_{(s)}}}}}

\begin{document}

Adjusted alignments:
\begin{align}
  \cee{        Fe^2+_{(aq)} + 2e-} & \cee{ -> Fe_{(s)}                 } && \text{(reduction)} &             E^0 &= -0.41V \\
  \cee{                  Al_{(s)}} & \cee{ -> Al^3+_{(aq)} + 3e-       } && \text{(oxidation)} &             E^0 &= +1.66V \\
  \cee{ 3Fe^2+_{(aq)} + 2Al_{(s)}} & \cee{ -> 2Al^3+_{(aq)} + 3Fe_{(s)}} && \text{(overall)}   & E_{\text{cell}} &= +1.25V
\end{align}

Using \verb|\phantom|s:
\begin{align}
  \cee{ \llap{\cee{Fe^2+_{(aq)} + 2e-}} -> \rlap{\cee{Fe_{(s)}}} \BRR} & 
    \text{ (reduction)} &      E^0 &= -0.41V \\
  \cee{           \llap{\cee{Al_{(s)}}} -> \rlap{\cee{Al^3+_{(aq)} + 3e-}} \BRR} & 
    \text{ (oxidation)} &      E^0 &= +1.66V \\
  \cee{                     3Fe^2+_{(aq)} + 2Al_{(s)} -> 2Al^3+_{(aq)} + 3Fe_{(s)}} & 
    \text{ (overall)}   & E_{\text{cell}} &= +1.25V
\end{align}

\end{document}

Due to the right-left alignment of align, we push the reactions over by the width of the maximum of the right hand side (or 2Al^3+_{(aq)} + 3Fe_{(s)}).

Werner
  • 603,163
  • 4
    No, the reason is very different. If you try a simple \begin{align}A&=-2\\B&=+2\end{align}, you can see what I mean. – egreg Feb 09 '17 at 09:19
  • @egreg: True, \cee influences the way + (and -) functions; I'll re-word. – Werner Feb 09 '17 at 16:51