22

I'd like to know if it is possible switch between the leqno and reqno options in the same document keeping the numbering of the equations. Namely i use the reqno option (default for amsmath and the standard article class), but i want that some equations are numbered by the left side (as if I had relied the leqno option) and the others no.

I'd like a commands as \leqnomode and \reqnomode to change the position of \tag in anywhere of the document.

Is this possible?

Werner
  • 603,163
skpblack
  • 8,904
  • 3
  • 31
  • 42

1 Answers1

24

Here you go:

enter image description here

\documentclass{article}
\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
\end{align}

\end{document}
Werner
  • 603,163
  • 1
    What are these \makeatletter and \makeatother? – enthu Oct 16 '14 at 16:04
  • 3
    @EnthusiasticStudent: They are required when using @ symbols in macros. See What do \makeatletter and \makeatother do? – Werner Oct 16 '14 at 16:41
  • Is there a similar way of doing this with equation environment? – Matti Dec 13 '14 at 18:00
  • @Mappi: I can't see a way to achieve that right now. A work-around is to use align, even though it has only a single equation and doesn't require any form of alignment. – Werner Dec 13 '14 at 19:22
  • @Werner: I tried to use your code in a (long) document, and it suppresses the equation number instead of changing on which side it is written. Do you have any idea which packages might be incompatible? – Bernard Feb 15 '16 at 12:24
  • 2
    @Mappi It's a tad late, but I'll leave this here for the convenience of anyone who is wondering about the solution for the equation environment. http://tex.stackexchange.com/a/212099/117534 – Troy Mar 04 '17 at 14:56