Since I'm writing a document with thousands of brackets of all kinds, manually sizing all the brackets or manually add \mleft and \mright every time will be need a lot of time in the end. Moreover, I don't have strict typographic rules to follow since the document is for private use.
So in this case it is not a bad idea to redefine ( and ) as \mleft( and \mright) respectively, and the same also for square and curly brackets (obviously in math mode only).
I'm aware about all the drawbacks about the use of auto resizing brackets (for example Spacing around \left and \right or Why doesn't LaTeX interpret ( as \left( and ) as \right)? or Is it ever bad to use \left and \right?), at least using \mleft and \right the spacing problem is solved.
In the page How to make \{ and \} automatically have \left and \right egreg explains that there is an easy way to achieve the goal in the case of curly brackets. The macro consists in adding \left and \right in the definitions of \{ and \} that are found in latex.ltx file.
\documentclass{article}
\usepackage{amsmath}
\usepackage{mleftright}
\let\{\relax \let\}\relax % to avoid warnings about the redefinition
\DeclareRobustCommand{\{}{\ifmmode\mleft\lbrace\else\textbraceleft\fi}
\DeclareRobustCommand{\}}{\ifmmode\mright\rbrace\else\textbraceright\fi}
\begin{document}
$a\{\dfrac13\}a$
\end{document}
I'm looking for a similar way to redefine the commands of curved and square brackets, but I don't know how to find their definitions in the file latex.ltx since it is a very big file.


fontmath.ltx. – campa Aug 15 '19 at 09:28\DeclarePairedDelimiter, and its variants, command frommathtools`. – Bernard Aug 15 '19 at 09:31physicsprovides automatic bracing option. But the opening bracket has to be preceeded by a function (\abs,\sin, ..) or you have to use\qty. Closing bracket will be automatically paired and adjusted. See 2nd page of the manual – nidhin Aug 15 '19 at 09:43\{redefinition will break any existing use of\left\{x\right\}which occurs in multiple packages, if not in your document, there are really only downsides to this. – David Carlisle Aug 15 '19 at 09:45nathpackage does it by default, butnathdisplay math clashes withamsmath, so it doesn't tend to be used much. – Aditya Aug 15 '19 at 10:48