TransWikia.com

How to typeset aligned equation with annotations in amsart class?

TeX - LaTeX Asked on June 7, 2021

I wish to typeset something like this in amsart class:

enter image description here

However, since hfill doesn’t work in align environment, I didn’t find a nice way to write this. Below is a cumbersome method that requires manually adjust some lengths:

begin{align*}
    hspace{.35linewidth}
    A &= BB &hspace{.25linewidth}(text{Due to E...})
      &= CCC &hspace{.25linewidth}(text{Due to FF...})
      &= DDDD &hspace{.25linewidth}(text{Due to GGG...})
end{align*}

Is there a better way to do this?


Below is a MWE:

documentclass{amsart}

usepackage{blindtext}

begin{document}

begin{align*} % Doesn't work
    A &= BB hfill text{(Due to ...)}
      &= CCC hfill text{(Due to ...)}
      &= DDDD hfill text{(Due to ...)}
end{align*}
begin{align*}
    hspace{.35linewidth}
    A &= BB &hspace{.25linewidth}(text{Due to E...})
      &= CCC &hspace{.25linewidth}(text{Due to FF...})
      &= DDDD &hspace{.25linewidth}(text{Due to GGG...})
end{align*}

blindtext

end{document}

One Answer

You might (ab)use flalign, but I'd prefer the realization in the middle or the one at the bottom.

documentclass{amsart}

usepackage{lipsum}

begin{document}

lipsum[1][1-3]
begin{flalign*} % Doesn't work
&&    A &= BB   & makebox[0pt][r]{(Due to E...)}
&&      &= CCC  & makebox[0pt][r]{(Due to FF...)}
&&      &= DDDD & makebox[0pt][r]{(Due to GGG...)}
end{flalign*}
lipsum[2][1-3]
begin{alignat*}{2}
    A &= BB   &qquad& (text{Due to E...})
      &= CCC  &qquad& (text{Due to FF...})
      &= DDDD &qquad& (text{Due to GGG...})
end{alignat*}
lipsum[3][1-3]
begin{align*}
    A &= BB   && (text{Due to E...})
      &= CCC  && (text{Due to FF...})
      &= DDDD && (text{Due to GGG...})
end{align*}
lipsum[4][1-3]
end{document}

enter image description here

Correct answer by egreg on June 7, 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