9

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}

\begin{equation} a^2+b^2=c^2.\tag{1} \end{equation}

\leqnomode

\begin{equation} -\Delta\phi=4\pi k\rho.\tag{2} \end{equation}

\end{document}

Output:

enter image description here

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?

MickG
  • 5,426

1 Answers1

15
\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}


\begin{equation}
  a^2+b^2=c^2.\tag{1}
\end{equation}


\leqnomode

\begin{equation}
  -\Delta\phi=4\pi k\rho.\tag{2}
\end{equation}


\end{document}
David Carlisle
  • 757,742
  • 1
    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? – MickG Nov 14 '14 at 07:27
  • 4
    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 – David Carlisle Nov 14 '14 at 08:32