1 |
% Copyright 2003 by Thomas M. Widmann |
% Copyright 2003 by Thomas M. Widmann and Palle Jørgensen |
2 |
|
|
3 |
% This file is free software; you can redistribute it and/or modify |
% This file is free software; you can redistribute it and/or modify |
4 |
% it under the terms of the GNU General Public License as published by |
% it under the terms of the GNU General Public License as published by |
21 |
% We don't do anything here, we just write things to the aux file. |
% We don't do anything here, we just write things to the aux file. |
22 |
\def\bibulus#1{\write\@auxout{\protect\b@bulus{#1}}} |
\def\bibulus#1{\write\@auxout{\protect\b@bulus{#1}}} |
23 |
\def\b@bulus#1{} |
\def\b@bulus#1{} |
24 |
|
\def\bibadd#1#2{\write\@auxout{\protect\b@badd{#1}{#2}}} |
25 |
|
\def\b@badd#1{} |
26 |
|
|
27 |
|
% Now some real macros, due to PJ: |
28 |
|
|
29 |
|
\newcount\b@bulctr |
30 |
|
\b@bulctr0 |
31 |
|
\def\b@bulcit#1#2#3#4#5#6{\relax} |
32 |
|
|
33 |
|
%% Checking which sectioning level to write to the aux-file |
34 |
|
\@ifundefined{thechapter}{% |
35 |
|
\@ifundefined{thesection}{% |
36 |
|
\gdef\b@secnum{}% |
37 |
|
}{% |
38 |
|
\gdef\b@secnum{\thesection}% |
39 |
|
}}{% |
40 |
|
\gdef\b@secnum{\thechapter}} |
41 |
|
|
42 |
|
|
43 |
|
\def\b@citewrite#1[#2]#3[#4]{% |
44 |
|
\b@bulcite{#3}{#4} |
45 |
|
\immediate\write\@auxout{\noexpand\b@bulcit{#3}{#1}{\b@secnum}{\thepage}{#4}{#2}}% |
46 |
|
% Removed /TW: |
47 |
|
% \immediate\write\@auxout{\noexpand\newlabel{#4}{{#3}{\thepage}}} |
48 |
|
} |
49 |
|
|
50 |
|
\def\b@cite#1{% |
51 |
|
\@ifnextchar[%] |
52 |
|
{\b@@cite{#1}}{\b@@cite{#1}[]}% |
53 |
|
} |
54 |
|
|
55 |
|
\def\b@@cite#1[#2]#3{% |
56 |
|
\advance\b@bulctr\@ne% |
57 |
|
\@ifnextchar[%] |
58 |
|
{\b@citewrite#1[#2]#3}{\b@citewrite#1[#2]#3[\number\b@bulctr]}% |
59 |
|
} |
60 |
|
|
61 |
|
\def\cite{\b@cite{}} |
62 |
|
\def\citet{\b@cite{t}} |
63 |
|
\def\citep{\b@cite{p}} |
64 |
|
|
65 |
|
\def\b@bulref#1#2#3{% #1: Citation key; #2: Citation number; |
66 |
|
% #3: Citation contents |
67 |
|
\expandafter\gdef\csname b@bul@#1@#2\endcsname{#3}} |
68 |
|
|
69 |
|
\def\b@bulcite#1#2{% #1: Citation key; #2: Citation number |
70 |
|
\@ifundefined{b@bul@#1@#2}{\textbf{??}\PackageWarning{bibulus}{% |
71 |
|
Undefined citation #1}}% |
72 |
|
{\csname b@bul@#1@#2\endcsname}} |
73 |
|
|
74 |
\endinput |
\endinput |