summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mcite/mcite.sty
blob: 045f06d66fe8fad61bdd0bba49c85c737f9f311c (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
%%
%% This is file `mcite.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mcite.dtx  (with options: `package')
%% 
%% Copyright (C) 1994 by Thorsten.Ohl@Physik.TH-Darmstadt.de
%% 
%% This file is NOT the source for mcite, because almost all comments
%% have been stripped from it.  It is NOT the preferred form of mcite
%% for making modifications to it.
%% 
%% Therefore you can NOT redistribute and/or modify THIS file.  You can
%% however redistribute the complete source (mcite.dtx and mcite.ins)
%% and/or modify it under the terms of the GNU General Public License as
%% published by  the Free Software Foundation; either version 2, or (at
%% your option) any later version.
%% 
%% Mcite is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \CheckSum{212}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\fileversion{v0.04}
\NeedsTeXFormat{LaTeX2e}
{\def\RCS#1#2\endRCS{%
  \ifx$#1%
    \@RCS $#2 \endRCS
  \else
    \@RCS $*: #1#2$ \endRCS
  \fi}%
 \def\@RCS $#1: #2,v #3 #4 #5 #6$ \endRCS{%
   \gdef\filename{#2}%
   \gdef\filerevision{v#3}%
   \gdef\filedate{#4}%
   \gdef\docdate{#4}}%
\RCS $Id: mcite.dtx,v 1.6 1996/01/01 23:52:29 ohl Exp $ \endRCS}%
\ProvidesPackage{mcite}[\filedate\space multiple citations]
\typeout{Package: `mcite'
   \fileversion\space <\filedate> (tho) PRELIMINARY TEST RELEASE}
\wlog{English documentation \@spaces<\docdate> (tho)}
\def\@enamedef#1{\expandafter\edef\csname #1\endcsname}
\def\mc@single#1{\global\@enamedef{mc*sg*#1}{}}
\def\mc@head#1#2{\global\@enamedef{mc*hd*#1}{#2}}
\def\mc@tail#1#2{\global\@enamedef{mc*tl*#1}{#2}}
\def\mc@ifsingle#1#2#3{\@ifundefined{mc*sg*#1}{#3}{#2}}
\def\mc@ifhead#1#2#3{\@ifundefined{mc*hd*#1}{#3}{#2}}
\def\mc@iftail#1#2#3{\@ifundefined{mc*tl*#1}{#3}{#2}}
\def\mc@thehead#1{\@nameuse{mc*tl*#1}}
\def\mc@thetail#1{\@nameuse{mc*hd*#1}}
\let\orig@cite\cite
\def\mcite{%
  \@ifnextchar[%
    {\PackageWarning{mcite}%
       {optional argument to \protect\cite\space not supported}%
     \@tempswatrue
     \expandafter\mc@citex\mc@gobbleopt}%
    {\@tempswatrue
     \mc@cite}}
\def\mc@gobbleopt[#1]{}
\AtBeginDocument{\let\cite\mcite}
\def\mc@cite#1{%
  \edef\mc@temp{#1}%
  \expandafter\mc@cite@\expandafter{\mc@temp}}
\def\mc@cite@#1{%
  \mc@firsttrue
  \@for\mc@@@:=#1\do{%
    \expandafter\mc@ifstar\mc@@@\sentinel%
      {\ifmc@first
         \PackageWarning{mcite}%
           {tail `\mc@key' appears as first item in \protect\cite}%
         \mc@dohead
       \else
         \mc@dotail
       \fi}%
      {\mc@dohead}%
    \if@filesw
      \immediate\write\@auxout{\string\citation{\mc@key}}%
    \fi}%
  \expandafter\orig@cite\expandafter{\mc@list}}
\def\mc@dohead{%
  \mc@iftail{\mc@key}%
    {\PackageWarning{mcite}%
       {head `\mc@key' already used as tail of `\mc@thehead{\mc@key}'}}%
    {}%
  \mc@head{\mc@key}{}%
  \edef\mc@curhead{\mc@key}%
  \ifmc@first
    \mc@firstfalse
    \edef\mc@list{\mc@key}%
  \else
    \edef\mc@list{\mc@list,\mc@key}%
  \fi}
\def\mc@dotail{%
  \mc@ifhead{\mc@key}%
    {\PackageWarning{mcite}%
       {tail `\mc@key' already used as head}}%
    {}%
  \mc@tail{\mc@key}{\mc@curhead}}
\def\mc@ifstar#1#2\sentinel#3#4{%
  \ifx*#1%
    \def\mc@key{#2}%
    #3%
  \else
    \def\mc@key{#1#2}%
    #4%
  \fi}
\newif\ifmc@first
\let\orig@bibitem\@bibitem
\def\@bibitem#1{%
  \ifmc@bstsupport
    \mc@iftail{#1}%
      {;\space\ignorespaces}%
      {\ifmc@first\else.\fi\orig@bibitem{#1}}
    \mc@firstfalse
  \else
    \mc@iftail{#1}%
      {\ignorespaces}%
      {\orig@bibitem{#1}}%
  \fi}%
\newif\ifmc@bstsupport
\mc@bstsupportfalse
\def\@lbibitem[#1]#2{%
  \PackageError{mcite}%
    {You can't use the optional argument of \protect\bibitem}%
    {Hey, *I* have to fool around with the labels!}%
  \@bibitem{#2}}
\def\mcbibliography{%
  \mc@bstsupporttrue
  \mc@firsttrue
  \thebibliography}
\def\endmcbibliography{%
  .%
  \endthebibliography}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput
%%
%% End of file `mcite.sty'.