TransWikia.com

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

TeX - LaTeX Asked by Mike van Dyke on June 19, 2021

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)  hfilltext{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)  hfilltext{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.

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

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

Correct answer by Bernard on June 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP