1

I want the code below to appear in one line but the last array (the transposed one) appears on the line below. What should I do?

\begin{equation}

 X'X=(V_r,V_{p-r}) \[ \left( \begin{array}{cc}
 \Lambda_r & 0 \\
 0 & \Lambda_{p-r} \end{array} \right)\] \[ \left( \begin{array}{c}
 V'_r\\
 V'_{p-r} \end{array} \right)\]

 \end{equation}

1 Answer 1

2

\[...\] initiates a display math environment, which you don't need inside the equation environment, since you're already inside math mode.

enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
  X'X = (V_r, V_{p-r}) \left( \begin{array}{cc}
    \Lambda_r & 0 \\
    0 & \Lambda_{p-r}
  \end{array} \right) \left( \begin{array}{c}
    V'_r \\
    V'_{p-r}
  \end{array} \right)
\end{equation}
\end{document}

Also see Where is the \matrix command? for more ways of typesetting matrices.


Here is a minor adjustment that uses the \biggl/\biggr pair rather than \left/\right, and also reduces the outer column specification:

enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
  X'X = (V_r, V_{p-r}) \biggl( \begin{array}{@{}cc@{}}
    \Lambda_r & 0 \\
    0 & \Lambda_{p-r}
  \end{array} \biggr) \biggl( \begin{array}{@{}c@{}}
    V'_r \\
    V'_{p-r}
  \end{array} \biggr)
\end{equation}
\end{document}
3
  • 2
    One might as well replace the \biggl(\begin{array}{@{}cc@{}}...\end{array}\biggr) with \begin{pmatrix}...\end'pmatrix} from amsmath so as to have something lighter to type, I think.
    – Bernard
    Jan 31, 2014 at 21:29
  • @Bernard: ...hence the reference to Where is the \matrix command?
    – Werner
    Jan 31, 2014 at 21:30
  • Oops! I apologise not to have seen all the details – just wondered why you hadn't proposed this environment.
    – Bernard
    Jan 31, 2014 at 22:25

You must log in to answer this question.

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