# How do you label an equation with something on the left and on the right?

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.

• 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 Dec 14, 2020 at 8:46

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

\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}.
$$\sum_{n = 0}^\infty x^n = \frac{1}{1 - x} \label{eqn:sum_x_n_2}$$

\end{document}


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

$$\sum_{n = 0}^\infty x^n = \frac{1}{1 - x} \qquad (\lvert x \rvert < 1)$$


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}
$$\sum\limits_{n=0}^{\infty} x^n = \frac{1}{1-x} \rtag{|x|<1}$$

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

\end{document}