答案1
你可以尝试类似的东西。但请注意,这revtex
是一个相当复杂的类,更改可能会影响其他地方。通常你最好不要管这些类,或者向维护者发送功能请求,而不是弄乱它们的内部结构。
\documentclass[superscriptaddress]{revtex4-2}
\ExplSyntaxOn\makeatletter
\def\@affil@present@script{%
\let\@tempa\@empty
\@affil@present@script@{\@affilID@temp}\relax
}%
\def\@affil@present@script@#1{%
\tl_set:Nx\l_tmpa_tl{\tl_item:Nn#1{1}}
\tl_set:Nx\l_tmpb_tl{\tl_item:Nn#1{-1}}
\tl_if_eq:NNTF\l_tmpa_tl\l_tmpb_tl
{\textsuperscript{\l_tmpa_tl}}
{\textsuperscript{\l_tmpa_tl--\l_tmpb_tl}}
}
\ExplSyntaxOff\makeatother
\begin{document}
\title{Title}
\author{Author}
\affiliation{Affiliation A}
\affiliation{Affiliation B}
\affiliation{Affiliation C}
\author{AuthorB}
\affiliation{Affiliation D}
\affiliation{Affiliation E}
\affiliation{Affiliation F}
\author{AuthorC}
\affiliation{Affiliation G}
\maketitle
\end{document}