# Improve spacing around equality = and other math relation symbols

I find that LaTeX puts too much space around equality = and other relation symbols. I realise that I can brace symbols, e.g. typing ${=}$ instead of $=$. However, this goes too far in the other direction, and anyway, spacing is context-dependent. For instance I might want this to typeset this = with less space

$x=5$

and this = to typeset with more space

$longexpression = evenlongerexpression$

Similarly for other relation symbols and binary operators.

My question is: is there a LaTeX typesetting package that will intelligently automate some of this (even if human judgement may be required in some cases.)

• Sometimes "too much in LaTeX" means "more than I'm used to seeing in Word", but probably better. TeX was created mainly to make beautiful math books and it has survived so long for this reason. Think twice if your taste will be better than the defaults.
– Fran
Commented Jul 5 at 10:02
• Thank you @Fran. What is Word, please? I've not heard of it. Sounds like it's not very good; I doubt it'll catch on.
– Jim
Commented Jul 6 at 12:59

TeX inserts \thickmuskip (math) glue around relation symbols and LaTeX sets, by default

\thickmuskip=5mu plus 5mu

If you reduce it, you should also take into account \medmuskip which is inserted around binary operation symbols

\medmuskip=4mu plus 2mu minus 4mu

because \thickmuskip must be wider than \medmuskip.

\documentclass{article}

\begin{document}

$a=b+c$

\thickmuskip=4mu plus 3mu
\medmuskip=3mu plus 1.5mu minus 3mu

$a=b+c$

\end{document}

Quite likely, though, you just want to reduce the amount of stretchability, say

\thickmuskip=5mu plus 2.5mu

The space around relation or operation symbols is stretchable in order to help justification and sometimes the comparatively large stretchability of \thickmuskip can lead to wide space. Always check for “Underfull \hbox” messages and reword the paragraphs involved.