# Align equations in cases around the equal sign

So I'm trying to do a simple thing with cases:

$\begin{cases} -x+5y&=6\\ x-3y&=-4\\ \end{cases} \\ \begin{cases} -x+5y&=6\\ x&=3y-4\\ \end{cases}$


And of course, LaTeX doesn't do what it should. For some reason, the "x" is far to the left. How to make it look centered around the equal sign?

• The alignment point in cases is for the “conditions”, not for aligning equals signs. Nov 14 '20 at 15:48
• .... So how do I write the system of equations like people do?! Nov 14 '20 at 15:49
• 'LaTeX doesn't do what it should' --- It did what your code told it to do. Also you don't have to dig through a mountain of websites. Try starting with the Not So Short Guide and the Short Math Guide. Nov 14 '20 at 16:15
• I dug through the first one years ago. My point is that it's not intuitive, unlike regular word processors. Nov 14 '20 at 16:28
• It's intuitive once you get to grips with it. It's like a programming language: it does what you tell it to. Nov 14 '20 at 16:31

The cases environment is not meant for systems of equations as the name itself hints.

You want a proper alignment environment, most likely aligned:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
&\left\{
\begin{aligned}
-x+5y&=6\\
x-3y&=-4\\
\end{aligned}
\right.
\\
&\left\{
\begin{aligned}
-x+5y&=6\\
x&=3y-4\\
\end{aligned}
\right.
\end{align*}

\end{document} • Well, okay, that works, Cases automatically added the curly brackets, so I wouldn't have to reinvent the wheel. One more problem, now the whole thing is in the center of the page, previously it was to the left of the oage like I wanted. Nov 14 '20 at 16:02
• Also, what about the columns? What if I'd like to insert second system of equations next to it? Nov 14 '20 at 16:25

For the first ‘cases’, thez systeme package yields a nicer layout (and a simpler code). For the second “cases’, you can use the aligned environment inside cases:

\documentclass[12pt,a4paper]{article}

\usepackage{systeme}
\usepackage{mathtools}

\begin{document}

\noindent\systeme{-x+5y=6, x-3y=-4} \\[1ex] \begin{cases} \begin{aligned} -x+5y & =6,\\ x & =3y-4 \end{aligned} \end{cases}

\end{document} • Oh, cool, aligned inside cases. That simplifies things. Thanks! Nov 14 '20 at 16:19
• Don't forget that cases adds unwanted space on the right. Nov 14 '20 at 16:20