2
$\begingroup$

I tried adding the following markup to an answer.

$$\ce{Zn(s) + Cu^{2+}(aq) → Zn^{2+}(aq) + Cu(s)}\tag{Open Circuit voltage 1.1018 V}$$

$$\ce{Zn(s) + Cu^{2+}(aq) → Zn^{2+}(aq) + Cu(s)\tag{Open Circuit voltage 1.1018 V}}$$

both of which which render as

$$\ce{Zn(s) + Cu^{2+}(aq) → Zn^{2+}(aq) + Cu(s)}\tag{Open Circuit voltage 1.1018 V}$$

Why does it run off the right side of the view?

I finally switched to

$\quad\quad\quad\quad\ce{Zn(s) + Cu^{2+}(aq) → Zn^{2+}(aq) + Cu(s)}\quad\quad\quad\text{(Open Circuit voltage 1.1018 V)}$

which renders as

$\quad\quad\quad\quad\ce{Zn(s) + Cu^{2+}(aq) → Zn^{2+}(aq) + Cu(s)}\quad\quad\quad\text{(Open Circuit voltage 1.1018 V)}$

There must be some better way to do this.

$\endgroup$
2
  • 1
    $\begingroup$ This issue has explained by the developer of MathJax in a related post on Meta.Math.SE. Also, I've replaced mhchem with mathjax as this does not seem to be an mhchem issue. $\endgroup$ Commented Sep 23, 2018 at 9:56
  • $\begingroup$ @GaurangTandon - Not sure how much mhchem does and what mathjax does. I edited question to note that same problem occurs if \tag{} part is in or out of \ce{}. $\endgroup$
    – MaxW
    Commented Sep 23, 2018 at 14:52

1 Answer 1

3
$\begingroup$

The tag is a tag, it flushes to the right (by default) and is meant to hold a number, letter, symbol, something small. It'll retain the centering of the maths environment, and if the contents becomes too large, it'll simply run over the edge. (I guess the is a hard coded reserved space for it, or something else; if have to test this.)
Since you're using it for something it is not designed, it doesn't work as intended. The best way would be to use an align environment, with three align separators.

\begin{align} \ce{Zn (s) + Cu^2+ (aq) &-> Zn^2+ (aq) + Cu (s)} & \text{Open Circuit voltage} &: \pu{1.1018 V} \tag{1}\label{opencircuitvoltage} \end{align}

\begin{align}
  \ce{Zn (s) + Cu^2+ (aq) &-> Zn^2+ (aq) + Cu (s)} &
  \text{Open Circuit voltage} &: \pu{1.1018 V}
  \tag{1}\label{opencircuitvoltage}
\end{align}

In the above example you can then refer to the tag via the label like \ref{opencircuitvoltage}, \eqref{opencircuitvoltage} to produce \ref{opencircuitvoltage}, \eqref{opencircuitvoltage}.

I have previously written about these environments in the hidden points faq, refer to use environments to cluster mathematical expressions for more details.

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .