In TeX and LaTeX, the math binary relations (like =, \parallel, <, \le ...) have a default (rubber-length) spacing to either side, which is too large for my liking. How can reduce it?

  • @Werner thanks for your answer! Now I know what to do (of course setting these skips to 0em is not what I want either).
    – Walter
    Commented May 13, 2012 at 16:31

2 Answers 2


This answer doesn't encourage modifying the spaces, since TeX does a great job already. It merely discusses the concepts of spacing around math elements.

Spacing around math operators are discussed in the mathmode documentation (section 11 Space, p 28). Here's an example:

enter image description here

\newcommand{\func}{f(x) = x^2 + 3x_0 \cdot \sin x}% Function
    \mbox{default} & \func \\
    \verb|\thinmuskip=0mu| & \setlength{\thinmuskip}{0mu} \func \\
    \verb|\medmuskip=0mu| & \setlength{\medmuskip}{0mu} \func \\
    \verb|\thickmuskip=0mu| & \setlength{\thickmuskip}{0mu} \func \\
    \mbox{all set to zero} & \setlength{\thinmuskip}{0mu}\setlength{\medmuskip}{0mu}
      \setlength{\thickmuskip}{0mu} \func

To manually adjust the amount of space around a symbol, you can change it to an ordinal symbol by wrapping it in braces - for example {=} - and then add the space your want around it: \,{=}\,. Here's another example:

enter image description here

      \mbox{default} & x = x \\
      \verb|\mathbin| & x \mathbin{=} x \\
      \verb|\mathrel| & x \mathrel{=} x \\
      \verb|\mathord| & x \mathord{=} x \\
      \verb|{ }| & x {=} x \\
      \verb|\,{ }\,| & x\,{=}\,x \\
      \verb|\;{ }\;| & x\;{=}\;x \\
      \verb|\:{ }\:| & x\:{=}\:x

Negative spaces, although not shown is obtainable via \!. Of course, you can also use other spacing macros like \hspace.

Also see What is the difference between \mathbin vs. \mathrel? for a discussion between the difference in spacing around binary and relational operators.


Werner already explained that you have to change \thickmuskip if you want to change the default. However, I don't quite agree with Werner that TeX does a great job already; I also think that sometimes the spacing to either side is too large. The default \thickmuskip is

5mu plus 5mu

so it can stretch from 5mu up to as much as 10mu. (This stretching will only happen for inline math, not in displayed math.) While I like the 5mu, I think the added stretch is too much, and I think a little shrink is OK, too. So my preamble usually contains

\thickmuskip=5mu plus 3mu minus 1mu

Thus, I don't change the "standard" 5mu, but the space can only stretch to 8mu, and I allow it to shrink to 4mu. (If you wonder what a mu is: it's one 18th of an em from family 2, the symbols family.)

For comparison, the following picture shows in the first line how it looks with the defaults, and in the second line how it looks with my modifications

maximum stretch and shrink

It's not much of a difference, but I like the second line better. Note that the default \medmuskip (used around binary operations) is

4mu plus 2mu minus 4mu

i.e., it can shrink to zero. Personally, I don't like that either, so I have

\medmuskip=4mu plus 2mu minus 3mu

in my preamble – see the difference in the picture, too!

  • 1
    Yes, yes, and yes! I wholeheartedly agree with you, good sir. It might be nice to add that 1 \fam2 em is 18mu (or maybe putting it the other way around)?
    – morbusg
    Commented Jun 5, 2012 at 13:46
  • 1
    @morbusg: Is it OK like I did? Commented Jun 5, 2012 at 13:55
  • Yes, that's actually much nicer way to put it. :-)
    – morbusg
    Commented Jun 5, 2012 at 14:11
  • @HendrikVogt: Very good disagreement!
    – Werner
    Commented Jun 8, 2012 at 17:53
  • 1
    @HendrikVogt: I think your modification of \thickmuskip is agreeable. Do I still disagree? I never have. +1!
    – Werner
    Commented Jun 8, 2012 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .