Created
September 14, 2015 08:56
-
-
Save rwirth/b3d68e5786b08d019691 to your computer and use it in GitHub Desktop.
Limit LaTeX natbib author lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\newcounter{@maxauthors} | |
\setcounter{@maxauthors}{3} | |
\newcounter{@authors} | |
\def\BibitemOpen{ | |
\setcounter{@authors}{0} | |
\bibitemOpen | |
} | |
%\NewDocumentCommand{\@gobbletoend}{u{,\ }}{\fi\fi\showtokens{#1}} | |
\NewDocumentCommand{\@gobbletoend}{u{,\ }}{\fi\fi} | |
\newcommand{\bibinfo@X@author}[1]{% | |
% \showtokens{#1} | |
\ifnum \value{@authors} < \value{@maxauthors}% | |
\stepcounter{@authors}% | |
#1,% | |
\else\ifnum \value{@authors} = \value{@maxauthors}% | |
\stepcounter{@authors}% | |
\emph{et~al.},\ \@gobbletoend% | |
\fi\fi% | |
\@ifnextchar,\@gobble\relax | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First try, doesn't work in all cases