# equations inside matrix/array — aligning on charater

Suppose I have a system of equations I'd like to present as a vector. Using amsmath, something like

\begin{equation}
\begin{pmatrix}
(2)(2)+(-1)(-3)  \\
(4)(2)+(3)(-3)
\end{pmatrix}
\end{equation}


What I'd like to do is not simply 'center the equations' within the vector (easy enough), but have them center-aligned on the '+' sign. I've tried embedding align within pmatrix, but that doesn't seem to work. In the end, it isn't critical that the equations are presented within a formal 'matrix' structure -- I'd be satisfied with a 'large enough' left and right delimiter.

Any suggestions welcomed.

• Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or hit Ctrl+K. – Claudio Fiandrino Oct 23 '13 at 13:12

## 2 Answers

You can use the aligned environment, which is like align but to be used inside another math environment

\begin{equation}
\begin{pmatrix}
\begin{aligned}
(2)(2)&+(-1)(-3)  \\
(4)(2)&+(3)(-3)
\end{aligned}
\end{pmatrix}
\end{equation} Alternatively, without using pmatrix, you can get large left/right delimiters by using \left/\right before the delimiters. For example, the following will produce the same result

\begin{equation}
\left(
\begin{aligned}
(2)(2)&+(-1)(-3)  \\
(4)(2)&+(3)(-3)
\end{aligned}
\right)
\end{equation}


Is this what you mean? If so, here is the code which uses my beta-version package \tabstackengine.sty, found at Writing a table with equally spaced columns, based on the widest column

\documentclass{article}
\usepackage{tabstackengine}
\begin{document}
\left( \alignVectorstack{ (2)(2) +& (-1)(-3)\\ (4)(2) +& (3)(-3) } \right)
\end{document}