Is there a way to get a spacing which is half or quarter the length of \quad in mathmode? Maybe there's an easy way to define a shortcut for such command?
2 Answers
A \quad corresponds to a length of 1em. In math mode, 1em=18mu. Use \mkern<n>mu, where <n> can be either a positive or a negative number, to exert very fine control over spacing. Note: no curly braces around <n>mu.
To space ahead by half a quad while in math mode, simply write \mkern9mu.
Two macros that provide standard abbreviations for math-mode spacing directives are
\, -- \mkern3mu ("thinspace")
\! -- \mkern-3mu ("negative thinspace")
Is there a meaningful difference between a\hspace{0.5em}b and a\mkern9mu b? It usually will not make a difference for display-math material. However, it could make a difference for inline-math material. This is because TeX never discards explicit kerns (and \mkern is a kern); in contrast, \hspace could get discarded at the start and end of lines. Thus, if your document happens to have a longish inline math equation that's allowed to break across lines, using \mkern or \hspace inside the formula could make a difference. (If you wanted to allow potential line breaks while using mu-based spacing directives, don't use \mkern; instead, use \mskip instead.)
- 506,678
-
1Mico, Hi. I think that the question is similar or duplicate of https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing – Sebastiano Feb 26 '18 at 11:27
-
@Sebastiano - Thanks for this pointer. I've voted to close the query as a duplicate. – Mico Feb 26 '18 at 11:35
Citing the comment from @egreg:
" A quad is 1em; just use \hspace{0.5em} or \hspace{0.25em}. Indeed \quad means the same as \hspace{1em}. – egreg "
Thanks!
Therefore, might or not be helpful for some (for me it is convenient):
\newcommand{\Hquad}{\hspace{0.5em}}
- 385
-
Description of spacing commands
LATEX code Description \quad space equal to the current font size (= 18 mu) , 3/18 of \quad (= 3 mu) : 4/18 of \quad (= 4 mu) ; 5/18 of \quad (= 5 mu) ! -3/18 of \quad (= -3 mu) \ (space after backslash!) equivalent of space in normal text \qquad twice of \quad (= 36 mu)
– Sebastiano Feb 26 '18 at 10:09 -
-
https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing – Sebastiano Feb 26 '18 at 11:25
-
1From @Sebastiano's link, \enspace should give you this half-1em space, either in math mode or in regular mode. – Aubergine May 23 '23 at 22:20
\hspace{0.5em}or\hspace{0.25em}. Indeed\quadmeans the same as\hspace{1em}. – egreg Feb 26 '18 at 10:02\enspaceis a half quad, and it works in math mode. Another short spacing command is\,= \mspace{3 mu}=\hspace{1/6 em}. – Bernard Feb 26 '18 at 10:50