Simple problem: spacing in math mode can often be awkward, especially with large fences and super- or sub- scripts. Usually, this amounts to exponents being too far from the parenthesized expression, like in the 2nd last example, where it is closer to the enclosing parenthesis than the inner expression it attaches to.
Example 1 is the default behavior, showing both how the superscript is too far from the parenthesis and the large gap it introduces before the equal sign.
Example 2 uses mathtools
' mathXlap
, which just ignores the superscript, and leaves brings everything too close together, leaving the exponent looking awkward.
Example 3 improves upon 2 by adding manual negative spacing to bring the superscript closer to the parenthesis. One might argue it would still be better to add more space to the left of the equal sign.
Example 4 shows bad visuals with nested fences and exponents.
Examples 3 and 5 are what I think looks the best, or at least better than default.
Of course, I can go around manually fixing spacing issues, or manually use smaller-sized fences, but I really hope there's a way for LaTeX to do this automatically, as it is meant to be good at typesetting (mathematics).
I've heard of "staircase kerns" that some math fonts apparently have to improve super- and sub- script placement. This sounds promising, but I have not found any specific info on where to find or how to use such fonts. (I would like to keep the Computer Modern look as well.)
So, I'm just looking for any automatic solution that I might've missed.
Examples MWE: (physcs
is there just to typeset the differentials easier)
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{physics}
\begin{document}
\begin{gather*}
\frac{z}{b} = \left( \dv{v}{t} \right)^{-1} = \frac{1}{a} \\
\frac{z}{b} = \left( \dv{v}{t} \right)^{\mathrlap{-1}} = \frac{1}{a} \\
\frac{z}{b} = \left( \dv{v}{t} \right)^{\mathrlap{\!\!-1}} = \frac{1}{a} \\
\end{gather*}
\begin{gather*}
\left( D\left( \dv[3]{A_{x0}}{A_{y0}} \right)^{2k} \right) \\
\left( D\!\left( \dv[3]{A_{x0}}{A_{y0}} \right)^{\!\!2k}\, \right)
\end{gather*}
\end{document}
\frac{z}{b} = \left( \dv{v}{t} \right)^{\!-1} = \frac{1}{a}
or\frac{z}{b} = \left( \dv{v}{t} \right)^{\!\!-1} = \frac{1}{a}
as well?=
symbol.