# Decrease length of spaces in inline math

It is a requirement of the journal I'm submitting to that inline math be formatted as $x\!=\!3$, i.e. that we insert a thin negative space around operators.

Is there a way that I can set this document-wide, so that I don't have to go over my 30-page manuscript line-by-line?

Let me emphasize that in principle, I want to be able to edit the spacing for inline math only.

• Should the normal spacing of operators be kept the original in display math? Also, should the negative space be added on top of the normal spacing, or should it be the only spacing between operators and operands? – siracusa Jul 9 '19 at 10:02
• Try some like \thickmuskip1.75mu – Fran Jul 9 '19 at 10:08
• @siracusa yes, in display math, the original spacing should be kept. I am not sure whether the possible duplicate question addresses this. Not sure about your second question. – Kappie001 Jul 9 '19 at 11:35

You can use \everymath and \everydisplay:

\documentclass{article}
\usepackage{amsmath}

\newmuskip\normalthickmuskip
\newmuskip\normalthinmuskip
\AtBeginDocument{%
\normalthickmuskip=\thickmuskip
\normalthinmuskip=\thinmuskip
}
\everymath{%
\thickmuskip=\muexpr\normalthickmuskip-(1\normalthinmuskip plus 1\normalthinmuskip)\relax
}
\everydisplay{\thickmuskip=\normalthickmuskip}
\let\texdisplaystyle\displaystyle
\renewcommand{\displaystyle}{\texdisplaystyle\the\everydisplay}

\begin{document}

\begin{center} % just for easing comparisons with below formulas
$a=b$
\end{center}
$a=b$
\begin{align*}
a&=b
\end{align*}

\end{document}


The redefinition of \displaystyle is necessary because amsmath environments don't generally evaluate \everydisplay.

This will affect all relations, not only =. You may possibly want to decrease also \medmuskip in inline formulas.

Since the value of \thickmuskip -- the parameter which governs the amount of whitespace that's inserted between adjacent math atoms of type math-ord and math-rel -- is 5mu in all document classes I'm familiar with, and since \! inserts -3mu of (negative) whitespace, you may achieve your journal's formatting objective by issuing the instruction

\everymath{\thickmuskip=2mu minus 2mu}


in the preamble. Note that the value of \thickmuskip that's employed in displayed equations is not affected by this directive. (Aside: If the amsmath package is loaded, then you will need to reset the value of \thickmuskip to its default value explicitly for displayed equations, along the lines shown in @egreg's answer.)

I can't help but remark that the journal's requirement to reduce the value of \thickmuskip while not also requiring a reduction in the value of \medmuskip -- the parameter which governs the amount of whitespace that's inserted between adjacent math atoms of type math-ord and math-bin (such as + and -) -- verges on being bizarre or preposterous. Take, say, the equation

1+1=2


The default value of \medmuskip is 4mu. I think it's a very bad idea to reduce \thickmuskip to 2mu while leaving \medmuskip unchanged. I would therefore suggest that you also execute something like

\everymath{\medmuskip=1.5mu minus 1.5mu}


in the preamble

A full MWE:

\documentclass{article}
\begin{document}
$1+1=2$ --- normal look

\everymath{\thickmuskip=2mu minus 2mu}
$1+1=2$ --- bizarre look

\everymath{\medmuskip=1.5mu minus 1.5mu\thickmuskip=2mu minus 2mu}
$1+1=2$ --- cramped (but not bizarre) look
\end{document}