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.

1
  • 1
    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. Oct 23, 2013 at 13:12

2 Answers 2

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}
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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .