Correct Spacing Around \left(
and \right)
in LaTeX Math
By default, LaTeX inserts some space outside the parentheses when using \left(...\right)
, which often results in awkward spacing, such as when the parentheses contain the argument(s) of a function:
Code:
$$\sin\left(\int_0^t f(t)\right)$$
\sin\left(\int_0^t f(t)\right)Output:
The mleftright
package allows us remove the extra space between “$\sin$” and “$($” without manually adjusting the spacing.
Once mleftright
is loaded, you can remove the spacing for specific parentheses by replacing \left
with \mleft
and \right
with \mright
.
Instead of modifying all of my \left
/\right
pairs, however, I use the following code to replace the definitions of \left
and \right
:
%%%% Fix Spacing Around "\left(\right)" %%%
\usepackage{mleftright}
\mleftright % redefine \left as \mleft and \right as \mright.
Then, the no extra spacing occurs throughout my document:
Code:
$$\sin\hspace{-3mu}\left(\int_0^t f(t)\right)$$
\sin\left(\int_0^t f(t)\right)Output: