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}
1
  • 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}$. Jul 4, 2021 at 22:41

1 Answer 1

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.

3
  • +1: Maybe I am not seeing the obvious but isn't \medmuskip=1\medmuskip the same as \medmuskip=\medmuskip ("1" removed). Jul 4, 2021 at 22:53
  • 6
    @Dr.ManuelKuehner no it removes the stretch and shrink components, try \showthe\medmuskip before and after. Jul 5, 2021 at 6:41
  • @DavidCarlisle I see, thanks for the explanation. Jul 5, 2021 at 7:03

You must log in to answer this question.

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