Matrices (\mat
)
Shortcut for inserting block matrices with an option for adjusting the vertical scale.
Examples
Code | Output |
---|---|
\mat{1 \\ 2} |
$$\begin{bmatrix} 1 \\ 2 \end{bmatrix} $$ |
\mat[3]{1 \\ 2} |
$$\begin{bmatrix} \\ 1\\ \\ 2 \\ \ \end{bmatrix} $$ |
Definition
Code:
% Insert a matrix. Usage: \mat{a & b \\ c & d} or \mat[Output:]{a & b \\ c & d} \newcommand{\mat}[2][1]{\begingroup \renewcommand*{\arraystretch}{#1} \begin{bmatrix}#2\end{bmatrix} \endgroup}
More LaTeX macros are available at paulwintz.com/latex-macros.