6

I find the extra space added before and after matrices quite ugly:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$f\begin{pmatrix}
    1&2\\
    3&4
\end{pmatrix}.$
\end{document}

I would like to reduce it. While I am aware that creating a custom matrix environment (e.g., mymatrix) with negative space adjustments is a possible solution, this approach causes issues when taking powers of matrices: it misplaces the exponent.

Is there an alternative method or package that allows for reducing the space around matrices without affecting the placement of exponents when taking powers of matrices?

0

2 Answers 2

4

You may use mleftright, that avoids the additional space around \left and \right.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mleftright}
\mleftright

\begin{document}

$f\begin{pmatrix}
    1&2\\
    3&4
\end{pmatrix}.$
\end{document}

enter image description here

5

You can add a brace group to remove the mathinner spacing

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$f\begin{pmatrix}
    1&2\\
    3&4
\end{pmatrix}.$


$f{\begin{pmatrix}
    1&2\\
    3&4
\end{pmatrix}}.$
\end{document}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .