TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a quite large matrix multiplication:

\mathrm{Var}(\alpha)&\approx \begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}  
\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}
\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) \\\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}\\-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}

Since this does not fit a single line I am wondering how I could typeset this in the best way? So that the logic of the matrix multiplication is still visible?

share|improve this question
up vote 9 down vote accepted

Please always post complete documents, not just fragments. It is shorter and clearer if you highlight the fact that this is VAV^T:

enter image description here



V\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}V^T
\[V=\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix} \]

share|improve this answer
Probably a \dfrac instead of \frac is better looking here? – karlkoeller Aug 18 '13 at 13:45
Using \DeclareMathOperator for “Var” and “Cov” should be recommended – egreg Aug 18 '13 at 13:47

Like David Carlisle does in his answer, I would also reduce the overall visual complexity of the main equation by rewriting it in the form V(a)=V <some matrix> V^T and providing a separate equation to explain the structure of V^T. Furthermore, in order to enhance the appearance of the components of the 3x3 matrix and the 3x1 column vector I would suggest that you do not use the pmatrix environment, which centers the contents of each column. Instead, it may be better to use the more general array environment to left-align the columns in the matrix and to right-align the column vector. Additionally, the legibility of the code (and look of the output) are enhanced, I think, if one defines the math operator terms \Var and \Cov in the preamble and then uses them throughout the equations.

enter image description here

If you feel so inclined, you can simplify the expression for V^T further by factoring out the common term \exp(-\delta^{*}+\zeta^{*}).

\Var(\alpha) &\approx V
\left( \begin{array}{lll} 
\Var(\zeta^{*})            &\Cov(\zeta^{*},\pi)   & \Cov(\zeta^{*},\delta^{*}) \\
\Cov(\pi,\zeta^{*})        & \Var(\pi)            & \Cov(\pi, \delta^{*}) \\
\Cov(\delta^{*},\zeta^{*}) & \Cov(\delta^{*},\pi) & \Var(\delta^{*}) 
\end{array} \right)
V^T &= 
\left( \begin{array}{@{}r}
\sqrt{1+\pi^{2}}\,\exp(-\delta^{*}+\zeta^{*}) \\
\pi/(\sqrt{1+\pi^{2}})\, \exp(-\delta^{*}+\zeta^{*})\\
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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