1

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:

Using split environment

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*}

Using align environment

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

5

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} 

enter image description here

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*}
3
  • 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.
    – Bernard
    Feb 19 '21 at 10:34
  • The edited version is perfect! Thanks a lot Feb 19 '21 at 10:46

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.