Increasing Line Spacing in LaTeX
Code
$$
\begin{vmatrix}
\dfrac{ \partial x}{ \partial r} & \dfrac{ \partial x}{ \partial \theta}
\\[1em] \dfrac{ \partial y}{ \partial r} & \dfrac{ \partial y}{ \partial \theta}
\end{vmatrix}
$$
$$ \begin{align*} \begin{vmatrix} \frac{ \partial x}{ \partial r} & \frac{ \partial x}{ \partial \theta} \\ \frac{ \partial y}{ \partial r} & \frac{ \partial y}{ \partial \theta} \end{vmatrix} && \begin{vmatrix} \dfrac{ \partial x}{ \partial r} & \dfrac{ \partial x}{ \partial \theta} \\ \dfrac{ \partial y}{ \partial r} & \dfrac{ \partial y}{ \partial \theta} \end{vmatrix} && \begin{vmatrix} \dfrac{ \partial x}{ \partial r} & \dfrac{ \partial x}{ \partial \theta} \\[1em] \dfrac{ \partial y}{ \partial r} & \dfrac{ \partial y}{ \partial \theta} \end{vmatrix} && \begin{vmatrix} \dfrac{ \partial x}{ \partial r} & \dfrac{ \partial x}{ \partial \theta} \\[1pt] \dfrac{ \partial y}{ \partial r} & \dfrac{ \partial y}{ \partial \theta} \end{vmatrix} && \begin{vmatrix} \dfrac{ \partial x}{ \partial r} & \dfrac{ \partial x}{ \partial \theta} \\[1ex] \dfrac{ \partial y}{ \partial r} & \dfrac{ \partial y}{ \partial \theta} \end{vmatrix} \\ \text{frac \& no margin} && \text{dfrac \& no margin} && \text{dfrac \& [1em]} && \text{dfrac \& [1pt]} && \text{dfrac \& [1ex]} \end{align*} $$
When the space above and below a matrix containing fractions is too narrow, causing the equations to overlap, using \\[1em]
, \\[1pt]
, \\[1ex]
instead of \\
can increase the spacing. This can be applied not only within matrices but also in any place where line breaks are used. The ratio of each unit length applied in $\KaTeX$ is as follows1.
KaTeX Unit | Value | KaTeX Unit | Value |
---|---|---|---|
em | CSS em | bp | 1/72 inch × F × G |
ex | CSS ex | pc | 12 KaTeX pt |
mu | 1/18 CSS em | dd | 1238/1157 KaTeX pt |
pt | 1/72.27 inch × F × G | cc | 14856/1157 KaTeX pt |
mm | 1 mm × F × G | nd | 685/642 KaTeX pt |
cm | 1 cm × F × G | nc | 1370/107 KaTeX pt |
in | 1 inch × F × G | sp | 1/65536 KaTeX pt |