summaryrefslogtreecommitdiff
path: root/info/biblio/xcite.sty
blob: 60e68fe8b1d73f033466ec0b1f09481da6b0467d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
% -*-tex-*-
% /u/sy/beebe/tex/bib/xcite.sty, Sat Sep 24 17:37:41 1994
% Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
% Modified cite.sty to reduce line-breaking penalty.
% /usr/local/lib/tex/latex/cite.sty, Thu Jul 16 15:53:59 1992
% Edit by Nelson H. F. Beebe <beebe@csc-sun.math.utah.edu>
% Add missing % on one line that was responsible for spurious
% whitespace creeping into a collapsed number list.
%
%<TEX.LATEX>CITE.STY.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:
%
% - - - - - - CITE.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\,}%
%% The only difference between xcite.sty and cite.sty is the
%% reduction of the after-comma penalty from \@highpenalty to 0.
  \def\@citea{,\penalty0\,}%
  }\@h@ld
}{#1}}
%
%
%    Example of alternate \@cite macro using exponents:
%
%\def\@cite#1#2{{$^{#1}$\if@tempswa , #2\fi }}