1

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
\end{equation}

%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
\begin{equation}
\tag{\text{tag}\qquad\quad}
2 + 2 = 4
\end{equation}
\end{document}

How can I fix this?

3
  • 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
  • 1
    In that case I wouldn'tdo what I just suggested in an answer, just use \begin{quote}\begin{equation}...\end{equation}\end{quote} which (in most classes) will set the equation in a narrower text block/ – David Carlisle May 19 '20 at 10:08
1

Something like this?

enter image description here

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}

\begin{equation} 2 + 2 = 4 \end{equation}

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

\begin{equation} 2 + 2 = 4 \mytag{Message of the Day}\end{equation}

\usetagform{default} % switch back to default
\begin{equation} 2 + 2 = 4 \end{equation}

\end{document}
1

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

enter image description here

\documentclass{article}

\usepackage{amsmath}
\begin{document}

zzz
\begin{equation}
  1=0
\end{equation}


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

zzz
\begin{equation}
  1=0
\end{equation}

\end{document}

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

enter image description here

\documentclass{article}

\usepackage{amsmath}
\begin{document}

zzz
\begin{equation}
  1=0
\end{equation}


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


\end{document}
2
  • 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

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.