# Making matrix elements larger vertically

Currently I have a matrix like this:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
\nabla\Psi \times \mathbf{\hat{\theta}} / r
=
\begin{pmatrix}
\frac{\partial \Psi}{\partial r} \\
0 \\
\frac{\partial \Psi}{\partial z} \\
\end{pmatrix}
\times
\begin{pmatrix}
0   \\
1/r \\
0   \\
\end{pmatrix}
\end{equation*}

\end{document}


and this is what it looks like:

The matrix elements seem to be compressed vertically slightly because they are partial differentiations and therefore quite large. Is there any way to increase the size of the matrix elements vertically so they don't seem as compressed? I have looked around online.

-
Would this help? tex.stackexchange.com/q/14071/34618 –  Jesse Mar 6 '14 at 13:48
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. New users can’t post images, so I’ve added one for you. –  alexwlchan Mar 6 '14 at 13:50
Is there a reason why you don't accept any of the answers? –  Svend Tveskæg Mar 10 '14 at 6:33

I also used \dfrac:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
\nabla\Psi \times \mathbf{\hat{\theta}} / r
=\def\arraystretch{2}%%%%%%%%%%  change the value to whatever you want
\begin{pmatrix}
\dfrac{\partial \Psi}{\partial r} \\
0 \\
\dfrac{\partial \Psi}{\partial z} \\
\end{pmatrix}
\times
\begin{pmatrix}
0   \\
1/r \\
0   \\
\end{pmatrix}
\end{equation*}

\end{document}


-

Here's one way, using a \parenMatrixstack{} instead of a pmatrix:

\documentclass{article}
\usepackage{tabstackengine}
\begin{document}
$\setstackgap{L}{2\baselineskip} \nabla\Psi \times\mathbf{\hat{\theta}}/r = \parenMatrixstack{ \displaystyle\frac{\partial \Psi}{\partial r}\\ 0\\ \displaystyle\frac{\partial \Psi}{\partial z} } \times \parenMatrixstack{% 0\\ 1/r\\ 0 }$
\end{document}


If you want the vertical paren sizes to match, then a few \vphantoms will help:

\documentclass{article}
\usepackage{tabstackengine}
\begin{document}
$\setstackgap{L}{2\baselineskip} \nabla\Psi \times\mathbf{\hat{\theta}}/r = \parenVectorstack{ \displaystyle\frac{\partial \Psi}{\partial r}\\ 0\\ \displaystyle\frac{\partial \Psi}{\partial z} } \times \parenVectorstack{% 0\vphantom{\displaystyle\frac{0}{0}}\\ 1/r\\ 0\vphantom{\displaystyle\frac{0}{0}} }$
\end{document}


-
Thanks, I seem to be having issues installing tabstackengine though. As far as I can tell it's a relatively new package, but I can't add packages directly to the program files MikTex since I'm on school computers. –  Stefan Mar 6 '14 at 13:53
@stefan You can always just place the .sty file in your current working directory. It is available at ctan.org/pkg/tabstackengine (i.e., ctan.org/tex-archive/macros/latex/contrib/tabstackengine) –  Steven B. Segletes Mar 6 '14 at 13:58

Here is another possible solution:

\documentclass{article}

\usepackage{amsmath}

\newcommand*\diffPart[3][\partial]{\frac{#1#2}{#1#3}}

\begin{document}

\renewcommand*\arraystretch{1.2}% change value according to need
\begin{equation*}
\nabla\Psi \times \mathbf{\hat{\theta}}/r
=
{\mkern -5mu}
\begin{pmatrix}
\diffPart{\Psi}{r} \\
0                  \\
\diffPart{\Psi}{z}
\end{pmatrix}
{\mkern -7mu}
\times
{\mkern -7mu}
\begin{pmatrix}
0   \\
1/r \\
0
\end{pmatrix}
{\mkern -5mu}
\end{equation*}

\end{document}


Notes

• You don't need \\ at the end of the last line in each matrix.

• The distance between the elements in the vectors is determined by \arraystretch.

• The spacing surrounding the matrices are shrunk using \mkern.

• The {\mkern -5mu} after the last matrix can't be seen dirctly in the output but it makes the equation centered instead of being pushed slightly to the left.

-