# Indent tag of equation to the left

I need an equation in which the equation itself is centered and the equation number (a custom tag) is located more to the left.

\documentclass[a4paper,12pt,numbers=noenddot]{scrartcl}
\usepackage{mathtools}
\usepackage{amsmath}
\begin{document}
%here the equation number is at the far right
\begin{align}
\tag{\text{tag}}
2 + 2 = 4

%and here the equation number is indented, but the equation itself is not centered
\begin{align*}
2 + 2 &= 4
&&\text{tag}

%and here a bracket remains on the right side
$$\tag{\text{tag}\qquad\quad} 2 + 2 = 4$$
\end{document}


How can I fix this?

• that's fixable but I'll delete the comment (better just to redefine the tagformat (why do you want this seems abit odd:-) – David Carlisle May 19 '20 at 10:00
• I want to recall an equation and I want only increasing equation numbers to be at the far right side. Because this repeated equation has a low equation number I want it to be indented. – Sven May 19 '20 at 10:03
• In that case I wouldn'tdo what I just suggested in an answer, just use \begin{quote}$$...$$\end{quote} which (in most classes) will set the equation in a narrower text block/ – David Carlisle May 19 '20 at 10:08

Something like this?

Employ \usetagform{indented} to switch to the alternative tag format, \mytag{...} to generate the alternative tag, and \usetagform{default} to switch back to the default tag format.

\documentclass[a4paper,12pt,numbers=noenddot]{scrartcl}
\usepackage{mathtools} % for '\newtagform' and '\usetagform' macros
\newtagform{indented}{}{\hspace*{15mm}} % set the desired indentation amount
\newcommand\mytag[1]{\tag{\llap{(#1)}}}
\begin{document}

$$2 + 2 = 4$$

\usetagform{indented}
\stepcounter{equation}
$$2 + 2 = 4$$\mytag{\theequation}

$$2 + 2 = 4$$\mytag{Message of the Day}

\usetagform{default} % switch back to default
$$2 + 2 = 4$$

\end{document}


If you really need this you can add the space to the command that sets the tag:

\documentclass{article}

\usepackage{amsmath}
\begin{document}

zzz
$$1=0$$

\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)\hspace{1cm}}}
\makeatother

zzz
$$1=0$$

\end{document}


Or perhaps you are just looking for a quote that indents both sides:

\documentclass{article}

\usepackage{amsmath}
\begin{document}

zzz
$$1=0$$

\begin{quote}
zzz
$$1=0$$
\end{quote}

\end{document}

• When I use quote, the equation is placed 1 cm lower than originally, and when I use the solution with \makeatletter all subsequent tags are indented as well. – Sven May 19 '20 at 10:20
• @Sven the quote environment is a display enviornment it sets off the quoted text with vertical space (although that's settable, depends a bit on the class, the definition in article class is only a line so not so hard to change) it should not affect anything after \end{quote} the tagform@ redefinition is a local definition you can do it inside an environment or inside {....} or any other way of keeping settings local to a group. – David Carlisle May 19 '20 at 10:26