0

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}

enter image description here

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
3
\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}

enter image description here

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)

  • So simple; I feel silly for not even trying this. Thank you! – Servaes Apr 19 '17 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.