% -*-tex-*- % /u/macleod/tex/latex/citexp.sty % from the CITE.STY file .2, 10-May-89 10:51:16, Edit by BEEBE % % TeXhax Digest Friday, April 21, 1989, Volume 89 : Issue 37 % % Date: Fri, 14 Apr 89 21:59:44 PDT % From: Donald_Arseneau@mtsg.ubc.ca % Subject: Re: Line breaking within a citation % Keywords: LaTeX, citations % % Here is my style file for numeric citations. Not only % does it allow line breaks, but it shortens long lists % of citations to make those breaks unnecessary: % % - - - - - - CITEXP.STY - - - - - - % % Replacement for \@citex % % Allow, but strongly discourage, line breaks within a long % series of citations. Compress lists of successive numbers % to one number range, e.g., 5,6,7,8,9 --> 5--9. Compatible % with versions of \@cite that use exponents. % -- Donald Arseneau 1989 % \def\@citex[#1]#2{% \if@filesw \immediate \write \@auxout {\string \citation {#2}}\fi \@tempcntb\m@ne \let\@h@ld\relax \def\@citea{}% \@cite{% \@for \@citeb:=#2\do {% \@ifundefined {b@\@citeb}% {\@h@ld\@citea\@tempcntb\m@ne{\bf ?}% \@warning {Citation `\@citeb ' on page \thepage \space undefined}}% % else {\@tempcnta\@tempcntb \advance\@tempcnta\@ne \@tempcntb\number\csname b@\@citeb \endcsname \relax \ifnum\@tempcnta=\@tempcntb % Number follows previous--hold on to it \ifx\@h@ld\relax % % first pair of successives \edef \@h@ld{\@citea\csname b@\@citeb\endcsname}% \else % % compressible list of successives \edef\@h@ld{\ifmmode{-}\else--\fi\csname b@\@citeb\endcsname} \fi \else % non-successor--dump what's held and do this one \@h@ld\@citea\csname b@\@citeb \endcsname \let\@h@ld\relax \fi}% \def\@citea{,\penalty\@highpenalty\,}% }\@h@ld }{#1}} % % % Example of alternate \@cite macro using exponents: % \def\@cite#1#2{{$^{#1}$\if@tempswa , #2\fi }}