I was working on some calculus today and tried to typeset a matrix of partial derivatives and ran into some trouble. Here is my code:
\documentclass{minimal}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{pmatrix}
\frac{\partial f^1}{\partial x_1} & \frac{\partial f^1}{\partial x_2}\\
\frac{\partial f^2}{\partial x_1} & \frac{\partial f^2}{\partial x_2}
\end{pmatrix}
\end{equation}
\end{document}
As can be seen, the output results in the subscripts from the denominators of the top row on the matrix with the superscripts from the numerators of the bottom row on the matrix. Is there an easy way to avoid this?
Best Answer
The
cellspace
package defines 2 lengths,\cellspacetoplimit
and\cellspacebottomlimit
that are the minimal vertical white space between the top of a cell and the bottom of the above cell, and between the bottom of a cell and the top of the below cell. Here is a example:It works with the amsmath environments (matrix, &c.), but not, unfortunately, with their starred versions defined by
mathtools
.