Fractional alignment
The commath
package provides a highly questionable implementation of \abs
. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtools
package instead of theamsmath
package. Themathtools
package is, for all intents and purposes, a superset of theamsmath
package; andissue the instruction
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
in the preamble. This sets up a proper implementation of
\abs{...}
. If you need to auto-size the vertical bars, simply use\abs*{...}
.
*Addendum": More about how commath
implements \envert
(\abs
is just an alias for \envert
): If \envert{<arg>}
is invoked without an optional sizing argument (a whole number between 0
and 4
), the following code gets executed:
\!\left\lvert#2\right\rvert
It's the \!
("negative thinspace") instruction that messes up the symmetry of the full expression. Either write \abs[0]{<arg>}
to execute \lvert#2\rvert
or, more safely, don't load commath
at all and go for a cleaner definition of \abs
. The definitions of \abs[1]{...}
thru \abs[4]{...}
are also messed up, by the way, as are the definitions of \norm
and \norm[1]
thru \norm]4]
. While it's possible, in principle, to correct the faulty definitions of \envert
, \abs
, \enVert
, and \norm
, one is better off going for a setup that avoids these complications...