\dim command is good at deciding how to space things following it: for example, both
$\dim M$ and
$\dim_A M$ look right (the subscript immediately follows the
dim, whereas the non-subscripted version has a space before the
I'd like to make a similarly-acting command
\depth. I've been using:
but this forces a space, so
$\depth_A M$ doesn't look good. I tried using
\xspace as per this question:
but it doesn't seem to do anything (there is no difference between using it and not, in the above command).
How can I get the right behavior?