I know that amsmath
package provides extra math spacing commands, like the followings \,
for \thinspace
, \:
for \medspace
and \;
for \thickspace
, there are corresponding negative space as well like \negthinspace
, \negmedspace
and \negthickspace
. But from the package documentation, it says:
For the greatest possible control over math spacing, use \mspace and ‘math
units’.
Besides I tested out that anywhere the \mspace
command takes effect then the \hspace
command takes effect as well. I was wondering what's the difference between these two commands when used in math mode? If there's no difference between them why would I bother using \mspace
as \hspace
is more often used.
Any hints or help on this will be greatly appreciated!
Best Answer
Once having made clear that
\mspace
can only be used in math mode (and requiresamsmath
),\mspace
only accepts a length expressed inmu
units (but theplus
andminus
components also acceptfil[ll]
units) or in terms of amu
based parameter (\thinmuskip
,\medmuskip
and\thickmuskip
),\hspace
doesn't acceptmu
units,we can describe the differences.
Both commands insert space that will not interfere with the automatic spacing between atoms. However,
mu
unit for\mspace
depend on the current math style;em
orex
unit for\hspace
depends on the text font current at the time the formula began.In particular, given that 18mu corresponds to the value of 1em in the symbol font (math group 2), the following two formulas will give quite different result
This is because the former uses the em in
\scriptscriptfont2
(default for 10pt size iscmsy5
) whereas the latter uses the em in the standard text font (defaultcmr10
).