개체에 아래 첨자와 위 첨자를 붙이는 명령을 정의했습니다. 개별적으로는 잘 작동하지만 함께 사용하면 예상할 수 있는 바람직하지 않은 간격이 발생합니다. 불행히도 나는 이 문제를 해결하는 방법에 대한 가장 희미한 단서가 없습니다. 다음은 간단한 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}
명령을 결합할 때 간격을 피하는 방법은 무엇입니까?
답변1
\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}
참고로 \rm
LaTeX에서는 사용하면 안 되지만 사용한다면 인자를 취하지 않으므로 사용 {\rm tor}
하지 \rm{tor}
않겠지만 사용하지 마세요(Latex에서는 기본적으로 정의되어 있지 않습니다)