Q: Spacing in commands for math mode I would like to define commands with semantics similar to e.g. + in math mode. For instance,
$(x+y)$

produces an equation with some spacing around +, whereas
$(+)$

produces an equation with less (or no) spacing around +.
The reason is that I would like to write something like
$\token{repeat} \token{skip} \token{until} b$
$\token{skip}$

Where tokens are follwed by a space in the first case, but are not in the second. In a way, I'd like something similar to xspace, in math mode.
Any suggestions?

A: Perhaps mathop spacing is what you are looking for.

\def\token#1{\mathop{\hbox{#1}}}

.$\token{repeat} \token{skip} \token{until} b$.


.$\token{skip}$.

\bye

\DeclareMathOperator in amsmath package for LaTeX.
