3

Is there some trick to automatically apply the \smash command to all inline math? I've found questions about the \smash command, but nobody is asking how to get the \smash effect both vertically and horizontally. With "horizontally" I mean, for instance, that expressions with binary operators such as $1+1$ should always have the standard spacing, the two symbols "1" should not get closer to or farther from "+".

It's important, though, that this in no way affects display math. It would be nice to also have some way to occasionally use the the standard $...$ command without \smash, but this is just a secondary request.

\documentclass{article}

\begin{document} \textbf{Standard output:}

When we deal with a field of characteristic $2$, we have the property $1+1=0$.

\textbf{Desired output:}

When we deal with a field of characteristic $2$, we have the property $\smash{1+1=0}$. \end{document}

Rain
  • 194
Lele99_DD
  • 588
  • 2
    the \smash in your example is unrelated to the horizonat space difference, you would see the same with simply we have the property ${1+1=0}$. – David Carlisle Jul 04 '21 at 22:41

1 Answers1

9

Of course \smash is not meant for this. Forget it.

If you really want that the space around binary operation symbols is not affected by justification adjustments, simply do

\medmuskip=1\medmuskip

in the document preamble, which will remove stretchability and shrinkability. You might also want to do

\thickmuskip=1\thickmuskip

But after a while, you'll realize that the quality of your documents will be drastically reduced instead of improved.

If you want to preserve the spacing in an occasional formula, just put it between braces.

egreg
  • 1,121,712