I have a document with equations containing many mathematically not strictly necessary brackets. These brackets are customary in order to simplify the identification of certain blocks of the equations. However, they also bring a lot of noise into the document. I was considering to replace the brackets with a spaces around these blocks. In order to play around with this idea I want to define a macro that defines something like a new math atom that ensures that there is a space whenever two of these new atoms are next to each other or next to a mathord atom. However, when this new atom is next to a mathrel, mathbin or another of the usual math atoms it should just behave like a mathord.
\documentclass{article}
\begin{document}
The $abc$ and $def$ are distinct blocks within the equations.
They are highlighted using brackets.
\[y = x (abc)(def) z\]
\[y = (abc) x + (def) xz\]
I would like to automatically highlight them with spaces using a macro.
The outcome should look similar to this.
\[y = x \;\, abc \;\, def \;\, z\]
\[y = abc \;\, x + def \;\, xz\]
\end{document}
\mathop
spacing, with a larger\thinmuskip
. Alas, you can only have one value of\thinmuskip
in a formula. – egreg May 27 '20 at 10:34