2

The affiliations of the authors are by default referenced with single numbers 1,2,3. How is it possible to get compressed numbers, i.e.1-3 as in the picture ? Answers are of interest that use classes Revtex4, article, or report.

\documentclass[superscriptaddress]{revtex4-1}
\begin{document}
\title{Title}
\author{Author}
\affiliation{Affiliation A}
\affiliation{Affiliation B}
\affiliation{Affiliation C}
\maketitle
\end{document}

enter image description here enter image description here enter image description here

0

1 Answer 1

2
+50

you could try something like that. But be aware that revtex is a quite complex class and changes can affect other places. Normally you should better leave such classes alone or sent a feature request to the maintainers instead of messing with their internals.


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .