# Multiple tags/right-justified text in unaligned environments using amsmath

How can I use multiple tags or right-justified text elements in an equation environment with many lines while keeping all equations centered? Unfortunately, I can only use packages accepted by the ACM TAPS system. It would be great if you could provide answers for the aforementioned package list. But also general answers are very welcome!

So far I have the following:

\begin{gather*}
\begin{split}
d(x) + e(x) + f(x) < a(x) * b(x) * c(x)  \\
* d(x) * e(x) * f(x) \\ \hfill\text{Explained here}
\end{split}\\
\begin{split}
b(x) + c(x) + d(x) + e(x) + f(x) < a(x) * b(x) * c(x)  \\
* d(x) * e(x) * f(x) \\ \hfill\text{And explained further here}
\end{split}
\end{gather*}


This keeps the equations centered, however, the text is not right justified but aligned to the right of the equation:

Also if I use the align environment, the equations are right-justified even without using an &:

\begin{align*}
d(x) + e(x) + f(x) < a(x) * b(x) * c(x) * d(x) \\
* e(x) * f(x) \tag*{Explained here} \\
a(x) + b(x) + c(x) + d(x) + e(x) + f(x) < a(x) * b(x) * c(x)  \\
* d(x) * e(x) * f(x) \tag*{And explained further here}
\end{align*}


Note: I don't want to use the & because the equations have different lengths on the left side.

## 1 Answer

Is this what you want? I used \shortintertext from mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{gather*}
\begin{split}
d(x) + e(x) + f(x) < a(x) * b(x) * c(x) \\
{} * d(x) * e(x) * f(x)
\end{split}
\shortintertext{\raggedleft Explained here}
\begin{split}
b(x) + c(x) + d(x) + e(x) + f(x) < a(x) * b(x) * c(x) \\
{} * d(x) * e(x) * f(x)
\end{split}
\shortintertext{\raggedleft And explained further here}
\end{gather*}

\end{document}


Edit: another possible code, with only amsmath:

   \begin{gather*}
\begin{split}
d(x) + e(x) + f(x) < a(x) * b(x) * c(x) \\
{} * d(x) * e(x) * f(x)
\end{split}\\
\makebox[\textwidth][r]{Explained here}\\
\begin{split}
b(x) + c(x) + d(x) + e(x) + f(x) < a(x) * b(x) * c(x) \\
{} * d(x) * e(x) * f(x)
\end{split}\\
\makebox[\textwidth][r]{And explained further here}
\end{gather*}

• Yes, but forgot to mention that I can only use a certain list of packages, mathtools unfortunately is not a part of it :( Nevertheless, it does help a lot! Feb 19 '21 at 10:31
• It's only an extension of amsmath (and a quite useful one!). You can use \intertext, but will have to adjust the vertical spacing by hand. Feb 19 '21 at 10:34
• The edited version is perfect! Thanks a lot Feb 19 '21 at 10:46