# Spacing of subscripts and superscripts in macro

I have defined commands that stick subscripts and superscripts onto objects. Individually they work just fine, but together they give undesirable spacing, which is to be expected. Unfortunately I haven't the faintest clue how to fix this. Here's a simple MWE:

\documentclass{article}
\newcommand{\U}[1]{{#1}^{\times}}
\newcommand{\tor}[1]{{#1}_{\rm{tor}}}

\begin{document}
\noindent
Individually: $\U{A}$ and $\tor{A}$.\\
Together: $\tor{\U{A}}$ an $\U{\tor{A}}$.
\end{document}


How to avoid the spacing when the commands are combined?

• Note that \rm has been deprecated for more than 20 years. – egreg Apr 19 '17 at 20:56

\documentclass{article}
\newcommand{\U}[1]{#1^{\times}}
\newcommand{\tor}[1]{#1_{\mathrm{tor}}}

\begin{document}
\noindent
Individually: $\U{A}$ and $\tor{A}$.\\
Together: $\tor{\U{A}}$ an $\U{\tor{A}}$.
\end{document}


Note that \rm should not be used in LaTeX, but if it is used, it does not take an argument so it would be {\rm tor} not \rm{tor} but don't use it (it is not defined by default in latex)