4

I'm using the command \hspace{1pt} as a small space in many maths expressions, to adjust the horizontal spacings to my taste. Frequently, the standard spacing commands \, and \: are too much, and adding a tiny space is enough. However, I don't like to define an absolute space (1pt) since I may need to change the font size (currently, I'm using 11pt standard fonts). So what would be a proper replacement to \hspace{1pt} in terms of other standard spacing commands?

Here's a silly MWE to play with, party, laugh and have fun:

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{tensor}

\newcommand*{\psp}{\hspace{1pt}} % \psp for PointSPace.

\begin{document}

Blabla:
\begin{align}
    y &= (\psp x - y \psp), \\
    y &= (x - y).
\end{align}

\end{document}
  • you said in the text that you use 11pt but your example uses 12pt, since the values in the answer totally depend on the font size, that's rather confusing. – David Carlisle Jan 23 at 16:50
  • @DavidCarlisle, sorry, I edited the MWE. This code is a modification of my various MWE files! :-) – Cham Jan 23 at 16:50
  • 2
    If it's for math mode then use \mspace{2mu} (or whatever value you prefer). The mu (math unit) will scale with the font. – campa Jan 23 at 16:55
  • 1
    1em=18mu but the mu will scale according to the math style. – campa Jan 23 at 16:58
  • 2
    1.5mu is exactly half of \, – David Carlisle Jan 23 at 17:18
5

You are specifically looking at spacing in math. For that, a common spacing measure would be mus. With this in mind, here's an extract from TeX by Topic (section 23.6 Mathematical spacing: mu glue):

Spacing around mathematical objects is measured in mu units. A mu is 1/18th part of \fontdimen6 of the font in family 2 in the current style, the "quad" value of the symbol font.

Under the different document class defaults, 1mu therefore is equivalent to

  • 10pt: 1em = 10.00002pt; 1mu = 0.55554pt
  • 11pt: 1em = 10.95003pt; 1mu = 0.60832pt
  • 12pt: 1em = 11.74988pt; 1mu = 0.66666pt

So, for a (roughly) 1pt space, you'd need (roughly) 2mus under any document class font option. These spaces would scale with the font size, so you could define

\newcommand*{\psp}{\hspace{.1\dimexpr1em}}

or

\newcommand*{\psp}{\mskip2mu}
  • Wow! You guys rock! – Cham Jan 23 at 18:32
5

I would not add space at the points you indicate, so simply not adding space would be my recommendation, however if you add

\showthe\dimexpr 1em /18\relax

In the text of your document you will get

> 0.60834pt.

so 1mu math space is .6pt, a thin space, \, is a space of \thinmuskip which is 3mu in the standard (and most other) classes so 1.8pt at \normalsize. So perhaps you want \mskip2mu

  • So I guess that I need to replace my 1pt with 2mu. What would you suggest as a macro, instead of my \psp in the MWE above? – Cham Jan 23 at 16:58
  • @Cham I would not use anything but if you want to add it it doesn't matter what you call it. \psp, \zzz, \extrathinspace, ... – David Carlisle Jan 23 at 17:00
  • I'm not talking about the name, but the macro itself. What about \newcommand*{\psp}{\mspace{2mu}} ? So this is half \, right? – Cham Jan 23 at 17:03
  • @Cham 2/3 \, not half. – David Carlisle Jan 23 at 17:08
  • 2
    @Cham \mspace{2mu} is probably better latex syntax but requires amsmath package, it is the same as the \mskip2mu I put in my answer. – David Carlisle Jan 23 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.