2

I have an array of equations which looks like this:

\documentclass{article}

\begin{document}

$$
\begin{array}{cc}
x=1 & y=1 \\
x=10 & y=20
\end{array}
$$

\end{document}

I'd like to align the equals sign vertically. I tried doing this, which I felt should work:

\documentclass{article}
\usepackage{amsmath}    

\begin{document}

$$
\begin{array}{cc}
\begin{align} x&=1 \\ x&=10 \end{align} & 
\begin{align} y&=1 \\ y&=10 \end{align} \\
\end{array}
$$

\end{document}

However, that did not work at all and threw me a million errors. Does anyone have any suggestions for me?

6

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

align
\begin{align*}
x&=1 & y&=1 \\
x&=10 & y&=20
\end{align*}

alignat
\begin{alignat*}{2}
x&=1 &\qquad y&=1 \\
x&=10 & y&=20
\end{alignat*}


\end{document}

array is intended for arrays of values, not for aligned expressions. (The terms are set in inline math mode, and the spacing is all wrong). Also $$ is not LaTeX syntax.

You can use align (or for more control over the space between the two equations, alignat)

  • Wow, I should have thought of that – Skeleton Bow Sep 24 '17 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.