Reputation: 121
I'm new to LaTeX and I'm having issues with aligning this equation system. I'm trying to align it in a way such that the x's, +'s, y's and ='s are all aligned. I don't know if that's possible or not, but I couldn't find help online.
I've tried using \systeme*, this way it aligned the ='s.
\[
\systeme*{ax + by=c,dx^2 + ey^2=f}
\]
My next attempt was to use &, which I've noticed you can only use once to change the alignment.
\[
\systeme*{ax& + by=c,dx&^2 + ey^2=f}
\]
This way it aligned the x's.
Thanks for you help.
Upvotes: 2
Views: 4937
Reputation: 7345
Another alternative: the environment array
where you can align each column left (l
), centered (c
) or right (r
).
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{array}{llll}
ax & + & by & = c\\
dx^2 & + & ey^2 & = f
\end{array}
\]
\end{document}
Here I aligned all of the four columns to the left ({llll}
).
Upvotes: 2
Reputation: 81
You can use the alignat environment from amsmath to align multiple points along the same line. So for instance, with your example, you could use the alignat environment with double ampersands in front of each alignment character:
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{5}
&a && x && + b && y && =c\\
&d && x^2 && + e && y^2 && =f
\end{alignat*}
\end{document}
This produces an aligned result:
Upvotes: 3