I would like to mimic the spacing behavior of DeclareMathOperator without using a macro. I would like there to be a space after Spec when I write (in math mode)
\mathrm{Spec} k.
But I would like there to be no space after Spec when I write
\mathrm{Spec} (k).
Is there a way to do this? Sort of like \xspace but not in a macro.
\operatorname{Spec}would be the easy solution (assuming the ubiquitousamsmath), see https://tex.stackexchange.com/q/84302/35864 – moewe Aug 10 '20 at 06:25