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?

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

1 Answer 1

2
\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)

0

Your Answer

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