5

I would like to put something on the left and right side of an equation. I know that I can use \tag{ } to label the equation on the right side.

\sum\limits_{n=0}^{\infty} x^n = \frac{1}{1-x} \tag{$|x|$<1}

I know you can write \documentclass[leqno]{article} at the beginning of the code to make the labels appear on the left instead of the right everywhere. But how do you put two labels on an equation, one on the left and another on the right? For example, I would like to label

\sum\limits_{n=0}^{\infty} x^n = \frac{1}{1-x} \tag{$|x|$<1}

with the label "(1.1)" on the left.

1
  • As the side condition is part of the equation, I’d not push it to the far right, but set it next to the main part, with a not so wide separation, such as \quad or \qquad
    – egreg
    Dec 14, 2020 at 8:46

2 Answers 2

4

You have to do some manual intervention since it's not the usual way of doing things:

enter image description here

\documentclass[leqno]{article}

\usepackage{amsmath}

\makeatletter
\newcommand{\ltxlabel}{\ltx@label}
\makeatother

\begin{document}
See \eqref{eqn:sum_x_n_1}.
\[
  \refstepcounter{equation}\ltxlabel{eqn:sum_x_n_1}
  \makebox[\linewidth]{%
    \rlap{(\theequation)}\hfill
    $\displaystyle \sum_{n = 0}^\infty x^n = \frac{1}{1 - x}$\hfill
    \llap{($\lvert x\rvert < 1$)}%
  }
\]
And also see \eqref{eqn:sum_x_n_2}.
\begin{equation}
  \sum_{n = 0}^\infty x^n = \frac{1}{1 - x} \label{eqn:sum_x_n_2}
\end{equation}

\end{document}

A more typical way of managing conditions is via a \quad (or \qquad) separation:

enter image description here

\begin{equation}
  \sum_{n = 0}^\infty x^n = \frac{1}{1 - x} \qquad (\lvert x \rvert < 1)
\end{equation}
0
5

This could be an overkill. Yet you only need to say \rtag{stuff} to get the a tag on the right. Note also that amsmath makes some efforts that the tag does not overlap with the equation. This solution does not make such efforts.

\documentclass{article}
\usepackage[leqno]{amsmath}
\usepackage{tikzpagenodes}
\newcommand{\rtag}[1]{\begin{tikzpicture}[baseline=(tmp.base),remember picture]
\node[inner sep=0pt](tmp){\vphantom{1}};
\begin{scope}[overlay]
 \path (current page text area.east|-tmp.base)
  node[anchor=base east,inner sep=0pt,outer sep=0pt]{(#1)};
\end{scope}
\end{tikzpicture}}
\begin{document}
\begin{equation}
 \sum\limits_{n=0}^{\infty} x^n = \frac{1}{1-x} \rtag{$|x|<1$}
\end{equation}

\begin{equation}
  \rtag{$|y|<1$}2\sum\limits_{n=0}^{\infty} y^n = \frac{2}{1-y}
\end{equation}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.