4

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.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149

2 Answers2

4

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}

enter image description here

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}
Herr K.
  • 17,946
  • 4
  • 61
  • 118
2

Is this what you mean?

enter image description here

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}