# Tag placing with amsmath

I'm using amsmath and its \tag command to tag equations. I remember having a situation where I liked having the tag on the left better than on the right. So I gave my class (which is report btw) the leqno options. Now, however, I find myself wanting to revert to reqno. However, I fear actually removing leqno will make the above mentioned situation look worse. I found that the solution in Switch between leqno and reqno options (of amsmath) in the same document does not work with equation:

\documentclass{report}
\usepackage[leqno]{amsmath}

\makeatletter
\newcommand{\leqnomode}{\tagsleft@true}
\newcommand{\reqnomode}{\tagsleft@false}
\makeatother
\begin{document}

\begin{align}
f(x) &= ax^2 + bx + c \\
g(x) &= dx^2 + ex + f
\end{align}

\reqnomode

\begin{align}
f(x) &= ax^2 + bx + c \\
g(x) &= dx^2 + ex + f \tag{e}
\end{align}

$$a^2+b^2=c^2.\tag{1}$$

\leqnomode

$$-\Delta\phi=4\pi k\rho.\tag{2}$$

\end{document}


Output:

The first equation should still be in \reqnomode (alias \tagsleft@false) from the second align, yet the tag is on the left. How do I solve the problem without using an align or such which are for multiline display and would therefore be out of place on a single one-line equation?

• And yes, I should not use two s in a row, but rather use a multiline environment. I usually do, but that is an MWE so I kept it as short as possible. Nov 13 '14 at 21:43
• @tohecz why is that so? Nov 13 '14 at 21:46
• @tohecz OK, but the problem persists with equation. Nov 13 '14 at 21:49
• Interesting. I cleaned up the question, I hope you don't mind, and voted for re-opening.
– yo'
Nov 13 '14 at 21:52

\documentclass{report}

\usepackage[leqno]{amsmath}

\makeatletter
\newcommand{\leqnomode}{\tagsleft@true\let\veqno\@@leqno}
\newcommand{\reqnomode}{\tagsleft@false\let\veqno\@@eqno}
\makeatother
\begin{document}

\begin{align}
f(x) &= ax^2 + bx + c \\
g(x) &= dx^2 + ex + f
\end{align}

\reqnomode

\begin{align}
f(x) &= ax^2 + bx + c \\
g(x) &= dx^2 + ex + f \tag{e}
\end{align}

$$a^2+b^2=c^2.\tag{1}$$

\leqnomode

$$-\Delta\phi=4\pi k\rho.\tag{2}$$

\end{document}

• Great, that works @DavidCarlisle. Could you expand on why \let\veqno\@@eqno makes it work with equation and without that extra command it doesn't? Nov 14 '14 at 7:27
• equation is really  unlike align which is really a table with \displaystyle in each cell. \eqno and \leqno are the tex primitives to set eqn numbers in  amsmath sets \veqno to one or the other depending on leqno option @MickG Nov 14 '14 at 8:32