0

Minimal example

\documentclass[leqno]{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
    x+(y+z) = (x+y)+z
\end{equation*}

\begin{gather}
\tag*{This pushes it} 
    x+(y+z) = (x+y)+z \\
\tag*{This doesn't} 
    x+(y+z) = (x+y)+z
\end{gather}

\end{document}

Looking for a way to put text to the left of gathered equations without pushing them out of the center.

Edit. The equations should be centered but not aligned.

1 Answer 1

3

I'm not exactly sure if this is what you want, but I don't think you mean for your text to be a tag. If you want the gathered equations aligned with the equation above, I suggest using flalign together with \text. To keep the text from pushing the equation, put it in an \rlap.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
    x+(y+z) = (x+y)+z
\end{equation*}
\begin{flalign*}
  &&  x+(y+z) &= (x+y)+z& \\ &\rlap{\text{This doesn't push it}} & x+(y+z) &= (x+y)+z \\ &\rlap{\text{Neither does this}} & x+(y+z) &= (x+y)+z
\end{flalign*}

\end{document}
1
  • Using \rlap fixes the problem. In my real document the equations don't align nicely. It looks better for them all to be centered. So I might have to use gather with tag*. Would be nice to not use tag* in case I also need equation numbers. Mar 31, 2022 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .