With pdflatex I often used \left(
and \right)
to scale the parenthesis of a function as in
\[\exp\left(\frac{a}{b}\right) \]
But this method was not perfect, because
- the code is difficult to read
- there were problems with spacing
- and problems with superscripts
Is there a modern solution in LuaLaTeX for this? Is there a reason why we do not write
\exp[bigg]{ \frac{a}{b} }
and define a good function with parenthesis?
This could be done for example with DeclarePairedDelimiter
from mathtools.
\exp
to use round parentheses. In the real world, that seems to be too restrictive. There is nothing stopping you from creating your own command for the exponential and other functions, though.\DeclarePairedDelimiter
, but on second reading, I think you are talking about the basic syntax for math, not whatever constructs people might build on top of it for their own use. Am I correct?\abs
for\lvert...\rvert
in my documents, but the answer with\mexp
I already find too much. I doubt that it will add a lot in terms of efficiency in the long run.\DeclarePairedDelimiter\parens()
and similar for other delimiters, though, not because it saves typing (it doesn't), but because it is easier to adjust the sizing of the parentheses in one place rather than two. And for curly braces it is useful because my editor will not match\{
and\}
the way it does ordinary delimiters.