11

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?

Mico
  • 506,678
  • 4
    A quad is 1em; just use \hspace{0.5em} or \hspace{0.25em}. Indeed \quad means the same as \hspace{1em}. – egreg Feb 26 '18 at 10:02
  • @egreg Thanks. You can post it as an answer, then I'l delete mien, if u want.. – user1611107 Feb 26 '18 at 10:09
  • \enspace is 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

2 Answers2

11

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.)

Mico
  • 506,678
  • 1
    Mico, 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
5

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}} 
  • 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
  • @Sebastiano hmm, can you explain in simple words please? – user1611107 Feb 26 '18 at 10:12
  • https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing – Sebastiano Feb 26 '18 at 11:25
  • 1
    From @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