# How to force the left hand of an equation against an equal sign?

I can't find a proper way to force the left hand of the equalities on the second row of the first the equation to stick against the equal sign. Ideally, I would like something that looks like the second equation in terms of the alignment.

Here is the code I used for the first equation using in the LibreOffice extension for Latex:

\begin{alignat*}{3}
\end{alignat*}

• Welcome to the site, Your code has a compilation error, plus the fact that it is just a snippet and not a complete example starting with \documentclass. Please edit Jan 18 at 2:04
• I am using a LibreOffice extension for Latex that will compile the code into an image, it is not a snippet. I think that the \documentclass is implemented through the GUI. Jan 18 at 2:59

Each & provides a right and left alignment point. That is, the content on the left of & is right aligned and the content to the right is left aligned. So, if something ends up being aligned on the wrong side you need to add or remove an & to change that:

### Code:

\documentclass[11pt]{article}
\usepackage{mathtools}

\begin{document}
\begin{alignat*}{5}
\end{alignat*}
\end{document}

• Thank you very much, your answer was very well explained. Jan 18 at 3:09

I'm sure there is a proper way using alignat, but here, I use facilities of the tabstackengine package.

\documentclass{article}
\usepackage{amsmath,tabstackengine}
\TABstackMath
\setstackgap{L}{1.2\normalbaselineskip}
\setstacktabulargap{0pt}
\TABbinary
\begin{document}
$\tabularCenterstack{rlrlcrl}{ (x-2)(5-2x)=0 \quad &\Leftrightarrow \quad& x-2&=0 \quad &\text{ou}& \quad 5-2x&=0 \\ &\Leftrightarrow &x&=22 \quad &\text{ou}& \quad x&=\frac{5}{2} }$
\end{document}