1 |
%\iffalse THIS IS A META COMMENT |
2 |
%==================================================================== |
3 |
% Master Bibliography Style |
4 |
% for customizing bibliographic style files (.bst) |
5 |
% with the help of docstrip.tex |
6 |
% and the auxiliary program makebst.tex |
7 |
%-------------------------------------------------------------------- |
8 |
% (See version and date in the \ProvidesFile command below) |
9 |
%-------------------------------------------------------------------- |
10 |
% This file supports numerical and author-year citation styles |
11 |
% for natbib, harvard, astronom, authordate, apalike |
12 |
% It also supports languages other than English |
13 |
%-------------------------------------------------------------------- |
14 |
% This file is self-documenting: simply LaTeX it! |
15 |
% (Alternatively, extract documentation driver with option `driver') |
16 |
%==================================================================== |
17 |
% |
18 |
%<*!tail> |
19 |
%------------------------------------------------------------------- |
20 |
% The original source file contains the following version information: |
21 |
%\fi |
22 |
% \ProvidesFile{merlin.mbs}[1996/12/16 3.82 (PWD)] |
23 |
%\iffalse |
24 |
% |
25 |
% NOTICE: |
26 |
% This file may be used for non-profit purposes. |
27 |
% It may not be distributed in exchange for money, |
28 |
% other than distribution costs. |
29 |
% |
30 |
% The author provides it `as is' and does not guarantee it in any way. |
31 |
% |
32 |
% Copyright (C) 1994, 1995, 1996 Patrick W. Daly |
33 |
% Max-Planck-Institut f\"ur Aeronomie |
34 |
% Postfach 20 |
35 |
% D-37189 Katlenburg-Lindau |
36 |
% Germany |
37 |
% |
38 |
% E-mail: daly@linmpi.mpae.gwdg.de |
39 |
%------------------------------------------------------------------- |
40 |
%</!tail> |
41 |
%<*a&!a> |
42 |
% The following ensures that the driver part is not seen by makebst |
43 |
% The driver part must not contain any \end other than \end{document} ! |
44 |
\ifx\endoptions\undefined\let\tempx=\relax\else |
45 |
\long\def\tempx#1\end#2{}\fi\tempx |
46 |
%</a&!a> |
47 |
%<*driver> |
48 |
\NeedsTeXFormat{LaTeX2e}% |
49 |
\documentclass[a4paper,10pt,twoside]{article}% |
50 |
\usepackage{doc}% |
51 |
\raggedbottom |
52 |
\CodelineNumbered |
53 |
\RecordChanges |
54 |
% Comment out next line to print coding |
55 |
\OnlyDescription |
56 |
\setlength{\oddsidemargin}{0.5\paperwidth} |
57 |
\addtolength{\oddsidemargin}{-0.5\textwidth} |
58 |
\addtolength{\oddsidemargin}{-1in} |
59 |
\setlength{\evensidemargin}{\oddsidemargin} |
60 |
|
61 |
\begin{document} |
62 |
\DocInput{merlin.mbs} |
63 |
\end{document} |
64 |
%</driver> |
65 |
% END OF META COMMENT \fi |
66 |
% \CharacterTable |
67 |
% {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 |
68 |
% 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 |
69 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
70 |
% Exclamation \! Double quote \" Hash (number) \# |
71 |
% Dollar \$ Percent \% Ampersand \& |
72 |
% Acute accent \' Left paren \( Right paren \) |
73 |
% Asterisk \* Plus \+ Comma \, |
74 |
% Minus \- Point \. Solidus \/ |
75 |
% Colon \: Semicolon \; Less than \< |
76 |
% Equals \= Greater than \> Question mark \? |
77 |
% Commercial at \@ Left bracket \[ Backslash \\ |
78 |
% Right bracket \] Circumflex \^ Underscore \_ |
79 |
% Grave accent \` Left brace \{ Vertical bar \| |
80 |
% Right brace \} Tilde \~} |
81 |
% |
82 |
% \CheckSum{277} |
83 |
% \setcounter{StandardModuleDepth}{1} |
84 |
% \setcounter{IndexColumns}{2} |
85 |
% \setlength{\IndexMin}{10cm} |
86 |
% |
87 |
% \changes{1.0}{1993 Aug 16}{Initial version} |
88 |
% \changes{2.0}{1994 Jan 31}{Add multilingual capabilities} |
89 |
% \changes{2.1--2.5}{1995 May 2}{Changes to \texttt{babel.mbs} parallel 1.3--1.7 |
90 |
% in \texttt{genbst.mbs}} |
91 |
% \changes{1.3(2.1)}{1994 Jul 1}{Change documentation to \LaTeXe} |
92 |
% \changes{1.3(2.1)a}{1994 Sep 1}{Alter wording of article title capitalization |
93 |
% choice} |
94 |
% \changes{1.4(2.2)}{1994 Sep 5}{Add full author name possibilities} |
95 |
% \changes{1.4(2.2)}{1994 Sep 5}{Fix up some punctuations} |
96 |
% \changes{1.4(2.2)a}{1994 Sep 7}{Add possibility to put titles in quotes} |
97 |
% \changes{1.5(2.3)}{1994 Sep 15}{Accommodate new \texttt{harvard.sty}} |
98 |
% \changes{1.5(2.3)}{1994 Sep 15}{Add full names for \texttt{natbib} v5.3} |
99 |
% \changes{1.5(2.3)a}{1994 Oct 11}{Add option so year can contain any text} |
100 |
% \changes{1.5(2.3)b}{1995 Jan 18}{Allow edited by to be in parentheses} |
101 |
% \changes{1.5(2.3)b}{1995 Jan 18}{Allow (year) to have no punctuation |
102 |
% following} |
103 |
% \changes{1.5(2.3)c}{1995 Jan 20}{Journal volume numbers with more choice} |
104 |
% \changes{1.6(2.4)}{1995 Feb 2}{Date with no punctuation preceding it} |
105 |
% \changes{1.6(2.4)}{1995 Feb 2}{Editor names can be reversed like authors'} |
106 |
% \changes{1.6(2.4)}{1995 Feb 2}{Can abbreviate `edited by' to `ed(s).'} |
107 |
% \changes{1.6(2.4)}{1995 Feb 2}{Released version} |
108 |
% \changes{1.7(2.5)}{1995 Feb 9}{Add \texttt{seq-key} option} |
109 |
% \changes{3.0}{1995 Mar 15}{Becomes \texttt{merlin.mbs}, with language |
110 |
% support in additional files} |
111 |
% \changes{3.0}{1995 Feb 27}{Allow full author names to be reversed} |
112 |
% \changes{3.0}{1995 Mar 1}{Add \texttt{isbn} field option} |
113 |
% \changes{3.0}{1995 Mar 3}{Citation names can be bold or small caps} |
114 |
% \changes{3.0}{1995 Mar 8}{Colon and space may follow year} |
115 |
% \changes{3.0}{1995 Mar 15}{Names can be reversed, dotless intials} |
116 |
% \changes{3.0}{1995 Mar 17}{Volume, number can be followed by semi-colon} |
117 |
% \changes{3.0}{1995 Mar 20}{Allow word editor or ed to be in parentheses} |
118 |
% \changes{3.0}{1995 Mar 20}{Abbreviated journal names can have dots removed} |
119 |
% \changes{3.1}{1995 May 4}{Fix `edited by' so it is not abbreviated |
120 |
% automatically with `editor'} |
121 |
% \changes{3.1}{1995 May 6}{Re-do head/tail options to allow easy update of |
122 |
% older \texttt{.dbj} files} |
123 |
% \changes{3.2}{1995 May 19}{Minimum number of authors can be up to 6, not 5} |
124 |
% \changes{3.2}{1995 May 19}{Allow date as part of journal spec., for medical |
125 |
% journals} |
126 |
% \changes{3.2}{1995 May 19}{Suppress `pages' and `pp'} |
127 |
% \changes{3.2}{1995 May 19}{Allow date to be `1994 Jul', with or without dot} |
128 |
% \changes{3.2}{1995 Jun 7}{Authors as Jones C.T.} |
129 |
% \changes{3.2}{1995 Jun 16}{Sort without \emph{von} part} |
130 |
% \changes{3.2}{1995 Jul 31}{Release as version 3.2} |
131 |
% \changes{3.3}{1995 Aug 7}{Extra labels put in braces so they are treated |
132 |
% as one unit by natbib} |
133 |
% \changes{3.3}{1995 Aug 7}{Publisher's address can precede name} |
134 |
% \changes{3.3}{1995 Sep 4}{Add full authors only if different from short list} |
135 |
% \changes{3.4}{1995 Sep 5}{Add number of references as argument to |
136 |
% \texttt{thebibliography} environment} |
137 |
% \changes{3.4}{1995 Sep 28}{Fix placement of \texttt{bolden} in |
138 |
% \texttt{format.vol.num.pages}} |
139 |
% \changes{3.4}{1995 Sep 28}{Add possibility of date between volume and pages} |
140 |
% \changes{3.4}{1995 Sep 28}{Word `and' can be in normal font in citations} |
141 |
% \changes{3.5}{1995 Oct 4}{Tech Reports to have titles like books} |
142 |
% \changes{3.5}{1995 Oct 9}{Delimit \texttt{\char`\\harvardyearright} properly} |
143 |
% \changes{3.5}{1995 Oct 9}{Add option to sort by year (numerical only)} |
144 |
% \changes{3.5}{1995 Oct 12}{Allow multiple journal-name files} |
145 |
% \changes{3.5}{1995 Oct 16}{Allow months in dates even for author-year} |
146 |
% \changes{3.5}{1995 Oct 24}{Fix sorting bug for limited number of authors} |
147 |
% \changes{3.5}{1995 Oct 30}{Add \texttt{named} format for author--year cites} |
148 |
% \changes{3.6}{1995 Nov 2}{Blocks can be separated by semi-colons} |
149 |
% \changes{3.6}{1995 Nov 23}{Journal titles in normal font} |
150 |
% \changes{3.6}{1995 Nov 23}{Volume subnumber added to pages} |
151 |
% \changes{3.6}{1995 Nov 24}{Book pages in parentheses} |
152 |
% \changes{3.6}{1995 Dec 7}{Put Jr at end for AGU author style} |
153 |
% \changes{3.6}{1995 Dec 7}{Put `and' in same font in list and citation} |
154 |
% \changes{3.6}{1996 Jan 30}{Allow `et al' to be in normal font} |
155 |
% \changes{3.6a}{1996 Feb 1}{Fix bugs with \texttt{xand} option} |
156 |
% \changes{3.7}{1996 Feb 2}{Fix small caps with NFSS} |
157 |
% \changes{3.7}{1996 Feb 5}{Fix clash of \texttt{emphasize} and |
158 |
% \texttt{purify\$}} |
159 |
% \changes{3.8}{1996 Feb 29}{Add \texttt{alpha}-type style} |
160 |
% \changes{3.8}{1996 Mar 1}{Style alpha is never unsorted} |
161 |
% \changes{3.8}{1996 Mar 12}{Allow blanks between blocks} |
162 |
% \changes{3.8}{1996 Mar 12}{Publisher in parentheses} |
163 |
% \changes{3.8}{1996 Mar 15}{Allow author-year to be sorted by year} |
164 |
% \changes{3.8}{1996 Mar 16}{Cited `and' resets only one attribute} |
165 |
% \changes{3.8}{1996 Mar 19}{Allow date to be between volume and number} |
166 |
% \changes{3.81}{1996 Jun 17}{Add \texttt{\char`\\natexlab} for \texttt{natbib} 6.3} |
167 |
% \changes{3.81}{1996 Jun 19}{Fix coding for adding `page' to journals} |
168 |
% \changes{3.81}{1996 Jun 19}{Add `volume' to journals} |
169 |
% \changes{3.81}{1996 Jun 19}{Remove word `in'} |
170 |
% \changes{3.81}{1996 Jun 19}{Place publisher before chapter/pages} |
171 |
% \changes{3.81}{1996 Jun 25}{Allow period after date} |
172 |
% \changes{3.81}{1996 Jun 26}{Commas between blocks, except for article titles |
173 |
% where period comes} |
174 |
% \changes{3.81}{1996 Sep 12}{Allow comma before date} |
175 |
% \changes{3.81}{1996 Sep 13}{Reorganize incollection organization and |
176 |
% publisher} |
177 |
% \changes{3.81}{1996 Sep 13}{Allow edition to come before publisher} |
178 |
% \changes{3.81}{1996 Sep 16}{Allow author--year to be in citation order} |
179 |
% \changes{3.81}{1996 Sep 16}{Publisher, address, date can all be in |
180 |
% parentheses} |
181 |
% \changes{3.81}{1996 Sep 18}{Remove extraneous hyphen before |
182 |
% \texttt{\char`\\getans}} |
183 |
% \changes{3.82}{1996 Nov 15}{Allow pages at end before notes} |
184 |
% \changes{3.82}{1996 Nov 15}{Fix bug with quoted titles when title missing} |
185 |
% \changes{3.82}{1996 Dec 16}{Fix bug that put comma before publisher in |
186 |
% parentheses} |
187 |
% \changes{3.82}{1996 Dec 16}{Allow AGU author style with full names} |
188 |
% |
189 |
% \pagestyle{myheadings} |
190 |
% \markboth{P. W. Daly}{A General Master Bibliography Style} |
191 |
% |
192 |
% \title{{\bfseries A Master Bibliographic Style File}\\ |
193 |
% for numerical, author--year, multilingual applications} |
194 |
% |
195 |
% \author{Patrick W. Daly} |
196 |
% |
197 |
% \GetFileInfo{merlin.mbs} |
198 |
% \date{This paper describes file \texttt{\filename},\\ |
199 |
% version \fileversion{} from \filedate} |
200 |
% |
201 |
% \maketitle |
202 |
% |
203 |
% \MakeShortVerb{\|} |
204 |
% |
205 |
% \parskip=1ex \parindent=0pt |
206 |
% |
207 |
% \newcommand{\btx}{{\sc Bib}\TeX} |
208 |
% \newcommand{\dtx}{\textsf{docstrip}} |
209 |
% |
210 |
% \section{Introduction} |
211 |
% A problem facing users of \btx{} is that there is no standard for |
212 |
% formatting lists of references. Publishers and journals insist |
213 |
% on completely arbitrary placement of commas, colons, and ordering of |
214 |
% entries. Furthermore, author--year styles of citations are supported by |
215 |
% certain special \LaTeX{} packages, but each for only a very limited |
216 |
% number of bibliographic styles. Finally, most such style files are for |
217 |
% English only, and any adaptations to other languages must duplicate the |
218 |
% entire spectrum of such files. |
219 |
% |
220 |
% All of these obstacles are in principle easily overcome by simply |
221 |
% reprogramming \btx{} by means of an appropriate \emph{bibliographic style |
222 |
% file} (extension \texttt{.bst}). \btx{} is in fact extremely flexible; |
223 |
% unfortunately its programming language is very low-level, permitting only |
224 |
% the most basic of hacks for the normal user. |
225 |
% |
226 |
% The solution to this is a \emph{generic} or \emph{master bibliographic |
227 |
% style file} (extension \texttt{.mbs}) containing \dtx{} options for |
228 |
% alternative coding. By selecting the desired options, one can customize a |
229 |
% \texttt{.bst} file to one's needs. |
230 |
% |
231 |
% This file, \texttt{\filename}, is my latest version of a general-purpose |
232 |
% \texttt{.mbs} file to meet as many bibliographic needs as possible. |
233 |
% It was originally assembled from Oren Patashnik's standard files {\tt |
234 |
% plain.bst} and \texttt{unsrt.bst}, plus his non-standard file {\tt |
235 |
% apalike.bst}, a very basic author--year citation style. |
236 |
% It has since evolved extensively as I have added features found in |
237 |
% available \texttt{.bst} files, and those demanded by publishers or |
238 |
% suggested to me by many user/contributors. |
239 |
% |
240 |
% To produce a customized bibliographic style (\texttt{.bst}) file from this |
241 |
% master file, simply \TeX{} or \LaTeX{} the `program' \texttt{makebst.tex}. |
242 |
% When asked for the name of the master file, answer with |
243 |
% \begin{quote}\tt\filename\end{quote} |
244 |
% and then reply to the questions in the following menus. The last question |
245 |
% is whether you want to generate the \texttt{.bst} file right away. |
246 |
% |
247 |
% More details on this process and on the options available are to be found |
248 |
% in the rest of this article. |
249 |
% |
250 |
% \section{History of this File} |
251 |
% |
252 |
% Since the first release of this generic file, in November 1993, under the |
253 |
% name \texttt{genbst.mbs}, I have received innumerable |
254 |
% suggestions for additions, most of which I have tried to include. Often |
255 |
% this has resulted in reorganizing the coding, and adding new functions. |
256 |
% The resulting \texttt{.bst} files are now quite different from those of |
257 |
% Patashnik, although the underlying ideas are the same. |
258 |
% |
259 |
% A second version was released shortly afterwards that paralleled the first |
260 |
% one except that it included support for languages other than English. |
261 |
% That file was named \texttt{babel.mbs}, following the \texttt{babel} |
262 |
% system of Johannes Braams. Although I always viewed it as version 2 of |
263 |
% \texttt{genbst.mbs}, all additions to the one were also included in the |
264 |
% other. This of course was tedious and prone to error. I looked forward to |
265 |
% the day when \texttt{babel.mbs} would become the only supported version. |
266 |
% The reason I was reluctant to do that before was that the overhead per |
267 |
% language was fairly high, and I dreaded to think how large the file would |
268 |
% become when 20 or 30 languages were added. |
269 |
% |
270 |
% I have now found a way to put the language definitions into separate files, |
271 |
% one per language. This means that new languages do not burden the basic |
272 |
% file, and that users need only keep those support files that might |
273 |
% interest him or her. New ones may also be made up locally by hacking an |
274 |
% existing language definition file. (The file \texttt{english.mbs} is |
275 |
% supplied only for this purpose.) |
276 |
% |
277 |
% For this reason, \texttt{\filename} is released as version~3 of |
278 |
% \texttt{genbst.mbs} and \texttt{babel.mbs}. In spite of the new name, it |
279 |
% should be regarded as their direct successor. Needless to say, this means |
280 |
% that the earlier two \texttt{.mbs} files will no longer be maintained. |
281 |
% |
282 |
% To include language support, all explicit English words like |
283 |
% \textsl{editor} and \textsl{chapter} have been replaced by functions |
284 |
% whose definitions may be altered in the resulting \texttt{.bst} file |
285 |
% (less desirable method) or which may be redefined by an external |
286 |
% language definition file (preferred method). Alternatively, one can select |
287 |
% the pseudo-language named \texttt{babel} which inserts \LaTeX{} commands |
288 |
% for the explicit words, the definitions of which must be |
289 |
% contained in a file called {\tt babelbst.tex}. Only the languages English |
290 |
% and \texttt{babel} are included internally to \texttt{\filename}; all |
291 |
% others are contained in external language definition files. |
292 |
% |
293 |
% Another new feature is the possibility of including a file containing |
294 |
% prestored shorthand designations for certain journal names. Such a file |
295 |
% is provided for physics journals, but others could be made up using this |
296 |
% one as a model. See Section~\ref{sec:jnames}. |
297 |
% |
298 |
% To take advantage of these external files, one must use |
299 |
% \texttt{makebst} version~3; \texttt{\filename} may still be used with |
300 |
% earlier versions, but without the external files. |
301 |
% |
302 |
% \def\temp{merlin.mbs}\ifx\temp\filename |
303 |
% This file is now named after the legendary magician in the hope that it |
304 |
% can produce wonders by incanting the right magic formulas. However, one |
305 |
% should bear in mind that even Merlin was not omnipotent. It would be too |
306 |
% much to hope that all bibliographic wishes will be fulfilled quickly and |
307 |
% easily, but we shall try as best we can. Watch the wizardry at work! |
308 |
% \fi |
309 |
% |
310 |
% \section{About Master Bibliographic Style Files} |
311 |
% |
312 |
% For details about how master bibliography style files are to be |
313 |
% constructed, see the documentation on \texttt{makebst}. Here only a |
314 |
% rough overview is given. |
315 |
% |
316 |
% \subsection{The \dtx{} Program} |
317 |
% The \dtx{} program, written by Frank Mittelbach, is now a fundamental |
318 |
% part of the \LaTeXe{} installation. Its original purpose is to remove |
319 |
% comment lines from documented files, but has the secondary function of |
320 |
% selecting alternative lines of coding. |
321 |
% |
322 |
% A master \btx{} bibliographic style file is one that, when processed by |
323 |
% \dtx{} with selected options, produces a regular \btx{} \texttt{.bst} |
324 |
% file with the desired features. |
325 |
% |
326 |
% In this sense, \dtx{} functions something like a C preprocessor. In fact, |
327 |
% Oren Patashnik's original \texttt{.bst} files were all produced from a single |
328 |
% source file by means of the preprocessor. The advantage of \dtx{} is that |
329 |
% it is portable to all installations with \TeX. |
330 |
% |
331 |
% \subsection{The \dtx{} Batch Job} |
332 |
% |
333 |
% The \dtx{} program can be run either interactively, where the user must |
334 |
% answer questions via the keyboard, or by means of a batch job where all |
335 |
% the inputs are prepared in a file beforehand. For producing a \btx{} |
336 |
% style file from a master file, the batch job method is the only feasible |
337 |
% one, simply because of the large number of options available. (There is |
338 |
% another reason for employing a batch job: the interactive method adds an |
339 |
% |\endinput| command at the end, something that \btx{} will protest |
340 |
% about.) |
341 |
% |
342 |
% The batch job files in general do not have any particular extension but I |
343 |
% use \texttt{.dbj} for \emph{\dtx{} batch job}. These files are useful |
344 |
% because they document the options used to produce the \texttt{.bst} file, |
345 |
% and they may be edited to experiment with alternative options. |
346 |
% |
347 |
% \subsection{The \texttt{makebst} Program} |
348 |
% |
349 |
% It is possible to make up a batch job file by hand using the option |
350 |
% information listed in Section~\ref{sec:options}, but my accompanying |
351 |
% program \texttt{makebst} simplifies the task considerably. It reads menu |
352 |
% information in the master file itself in order to present the user with |
353 |
% an interactive list of choices, translating the answers into appropriate |
354 |
% options that are then written to a batch job file. |
355 |
% |
356 |
% To run it, simply process \texttt{makebst.tex} with \TeX\ or \LaTeX, and |
357 |
% answer the questions. The first of these is whether you want some |
358 |
% instructions or not, and the second is the name of the \texttt{.mbs} that |
359 |
% you want to use. The next query is about the name of the desired |
360 |
% \texttt{.bst} file (which will also be the root name of the batch job). |
361 |
% After that, all further questions come from menu information in the |
362 |
% master file. |
363 |
% |
364 |
% At the very end, \texttt{makebst} asks if it should run the batch job for |
365 |
% you. Isn't that a fine service? |
366 |
% |
367 |
% \section{Multilingual Adaptation} |
368 |
% The original \texttt{.bst} files from Oren Patashnik contain explicit |
369 |
% English words that are output into the final text. Since \LaTeX{} is |
370 |
% increasingly being used for other languages, and since the official |
371 |
% version since December 1991 also uses macros in place of explicit words, |
372 |
% it seems appropriate for \btx{} to follow suit. |
373 |
% |
374 |
% In this master bibliographic style file {\tt\filename}, all explicit |
375 |
% words have been replaced by functions: e.g., the word \textsl{editor} has |
376 |
% become the function \texttt{bbl.editor}. Depending on the language option |
377 |
% chosen, this function is defined to be the text {\tt"editor"}, |
378 |
% {\tt"Redakteur"}, or {\tt"redacteur"}, for English, German, and French, |
379 |
% respectively. |
380 |
% |
381 |
% There is another special `language' called \texttt{babel} that instead inserts |
382 |
% the text |"\bbleditor{}"|; the definitions of these \LaTeX{} commands |
383 |
% must be in a separate file named \texttt{babelbst.tex} that is read in at |
384 |
% the start of the bibliography. |
385 |
% |
386 |
% Only English and \texttt{babel} are supported directly in |
387 |
% \texttt{\filename}; all other language definitions are contained in |
388 |
% separate definition files, e.g., \texttt{french.mbs}, \texttt{german.mbs}. |
389 |
% |
390 |
% The language selection is made during the \texttt{makebst} run, which |
391 |
% asks for the name of the language definition file as the first menu item. If |
392 |
% either English or \texttt{babel} is wanted, reply with the default, which |
393 |
% is \texttt{\filename} itself; otherwise give the name of the desired |
394 |
% language file. |
395 |
% |
396 |
% \begin{quote}\slshape |
397 |
% \textbf{Note:} the language definition files can only be used with |
398 |
% \texttt{makebst} version~3 or later, and |
399 |
% |
400 |
% with an external definition file, the \dtx{} run requires two passes |
401 |
% through \texttt{\filename}, doubling the processing time. |
402 |
% \end{quote} |
403 |
% |
404 |
% \subsection{Adding a New Language Definition File} |
405 |
% |
406 |
% To create a new language definition file, simply take one of the existing |
407 |
% ones, like \texttt{english.mbs}, and replace the explicit English words |
408 |
% with their translations. There are, however, a number of points that can |
409 |
% complicate this procedure. |
410 |
% |
411 |
% \begin{enumerate} |
412 |
% \item |
413 |
% Do not forget to change the documentation in the file, especially |
414 |
% version number, date, author. |
415 |
% |
416 |
% \item |
417 |
% There are option menus that need to be translated too. It might also be |
418 |
% desirable to add or remove options. In most cases, the options in the |
419 |
% language files involve possible abbreviations, like |
420 |
% \begin{quote} |
421 |
% \verb!\mes{^^JABBREVIATE WORD `PAGES':}!\\ |
422 |
% \verb!\optdef{*}{}{`Page(s)'}{(no abbreviation)}!\\ |
423 |
% \verb!\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}!\\ |
424 |
% \verb!\getans! |
425 |
% \end{quote} |
426 |
% |
427 |
% In this example, the option \texttt{pp} appears later in the definition |
428 |
% \begin{quote} |
429 |
% \verb!FUNCTION {bbl.pages}!\\ |
430 |
% \verb+%<!pp>{ "pages" }+\\ |
431 |
% \verb!%<pp>{ "pp." }! |
432 |
% \end{quote} |
433 |
% This a \emph{local} option, that only affects the coding in the definition |
434 |
% file. It is possible to add more local options. |
435 |
% |
436 |
% \item |
437 |
% However, all options, whether activated by the main file or by the |
438 |
% definition file, apply to both. In other words, there really is no such |
439 |
% thing as a local option. In the above example, \texttt{pp} is only |
440 |
% local because it is never used in \texttt{\filename}. |
441 |
% |
442 |
% \item |
443 |
% Add the name of the language as an option, with |
444 |
% \begin{quote} |
445 |
% \verb!\mes{^^JOptions for ENGLISH}!\\ |
446 |
% \verb!\wr{\spsp\spsp\sep english\pc: English language}! |
447 |
% \end{quote} |
448 |
% (This is how options are added without |\optdef| and |\getans|.) The |
449 |
% main file just might recognize it in order to take some |
450 |
% language-specific action. The least it should do is add a comment at |
451 |
% the start of the \texttt{.bst} file stating for which language it is to |
452 |
% be used. |
453 |
% |
454 |
% \item |
455 |
% There could be some problems with edition numbers due to language |
456 |
% dependent ways of treating ordinal numbers (1st, 2nd, 3rd in English; |
457 |
% 1$^{\mbox{\scriptsize re}}$, 2$^{\mbox{\scriptsize e}}$, |
458 |
% 3$^{\mbox{\scriptsize e}}$ in French; 1., 2., 3., in German). Some |
459 |
% accommodation already exists for the oddball language English, and |
460 |
% further hacking may be needed for others. |
461 |
% |
462 |
% \item |
463 |
% If there should be any need for a double-quote character in |
464 |
% the translations (German needs it for umlauts) then there is trouble |
465 |
% because the \btx{} strings do not allow it. Instead, use the command |
466 |
% |\qq|, as in the German word |F\qq{u}nfte| for {\sl F\"unfte} (fifth). |
467 |
% It is then vital to add the option \texttt{umlaut} with |
468 |
% \begin{quote} |
469 |
% \verb!\wr{\spsp\spsp\sep umlaut\pc: Activate umlaut command}! |
470 |
% \end{quote} |
471 |
% |
472 |
% Bernd Raichle points out that |\^^b| can be used in place of |\"| |
473 |
% within \btx{} code. One can thus replace |F\qq{u}nfte| with |F\^^b unfte| |
474 |
% and do away with the \texttt{umlaut} option. |
475 |
% |
476 |
% \end{enumerate} |
477 |
% |
478 |
% \subsection{Changing \texttt{babelbst.tex} for a New Language} |
479 |
% |
480 |
% Alternatively, a new language can be added by |
481 |
% modifying the file \texttt{babelbst.tex} and selecting the language {\tt |
482 |
% babel} for the \texttt{.bst} file. If this is the only language to be used, |
483 |
% then just change the English words in the definitions. |
484 |
% |
485 |
% However, some form of switching would be more desirable. With \TeX\ |
486 |
% version 3, there is a |\language| parameter to control the hyphenation |
487 |
% patterns, and this could be used to select the correct language. For |
488 |
% example, if language 0 is English and language 1 German, then put the |
489 |
% English version of \texttt{babelbst.tex} into \texttt{englbst.tex} and the |
490 |
% German |
491 |
% version in \texttt{germbst.tex}. Then \texttt{babelbst.tex} could contain: |
492 |
% \begin{quote}\begin{verbatim} |
493 |
% \ifcase\language \input{englbst} \or \input{germbst} |
494 |
% \else \input{englbst} \fi |
495 |
% \end{verbatim} |
496 |
% \end{quote} |
497 |
% |
498 |
% This is of course installation dependent. |
499 |
% |
500 |
% \subsection{Extracting the Sample \texttt{babelbst.tex} File} |
501 |
% |
502 |
% A sample \texttt{babelbst.tex} (for English) is contained in this master |
503 |
% file. Extract it with \dtx{} and the option \texttt{bblbst}. It may be |
504 |
% edited (and possibly renamed) for other languages as needed. |
505 |
% |
506 |
% \subsection{Problem with Edition Numbers} |
507 |
% Something to note here is the ordinal numbers for editions. \btx{} |
508 |
% demands that the field \texttt{edition} be given in the database as a word |
509 |
% \textsl{First}, \textsl{Second}, etc., or as \textsl{1st}, \textsl{2nd}, |
510 |
% etc. This is bad policy |
511 |
% because it is language dependent. So what I do is to test for the words |
512 |
% \textsl{first} through \textsl{fifth} (case independently) and replace them |
513 |
% with language-dependent equivalents. If the {\tt<ord>} option is selected, |
514 |
% these equivalents are ordinal numbers for that language. Any other words |
515 |
% cannot be interpreted and must be printed as is. |
516 |
% |
517 |
% However, if the \texttt{edition} is given as a number, with or without |
518 |
% following letters, then the numbers 1 through 5 are replaced by their |
519 |
% words; any higher numbers just have the ordinal ending (\textsl{th} |
520 |
% in English) added to them. |
521 |
% |
522 |
% These numbers are only used with the word \textsl{edition} or |
523 |
% its equivalent in other languages, so the translators need |
524 |
% to provide only the one gender, e.g., feminine for both German and |
525 |
% French. |
526 |
% |
527 |
% \section{Prestoring Names of Journals}\label{sec:jnames} |
528 |
% |
529 |
% The standard \texttt{.bst} files contain the names of some 20 journals |
530 |
% in the field of computing, stored as macros for easy reference within the |
531 |
% database \texttt{.bib} files. For example, the \textsl{Journal of |
532 |
% Computer and System Sciences} can be referred to as \texttt{jcss}. |
533 |
% With the option \texttt{jabr} (for journal abbreviation) this same |
534 |
% shorthand produces \textsl{J.~Comput. Syst. Sci.}. |
535 |
% |
536 |
% Some \texttt{.bst} files for physics journals include additional journal |
537 |
% names, and it is conceivable that other faculties might wish to prepare |
538 |
% their own such lists, with each name present in a full or abbreviated |
539 |
% form. Such an external file can now be added with \texttt{\filename} and |
540 |
% \texttt{makebst} version~3. |
541 |
% |
542 |
% As a model, I supply a file \texttt{physjour.mbs} with the names of |
543 |
% physics journals which I have taken from other \texttt{.bst} files. |
544 |
% I also have a contributed file \texttt{photjour.mbs} containing names of |
545 |
% optics journals. |
546 |
% |
547 |
% In fact, version~3.5 can even include multiple journal-name files. |
548 |
% Thus one can decide whether to include both, one, or none of the above |
549 |
% files. |
550 |
% |
551 |
% \section{Updating Older \texttt{.dbj} Files}\label{sec:update} |
552 |
% If you have existing \texttt{.dbj} files for generating \texttt{.bst} |
553 |
% files from the older version \texttt{genbst.mbs}, these may be run with |
554 |
% \texttt{\filename} by simply changing the name of the source |
555 |
% \texttt{.mbs} file. For example, where the older \texttt{.dbj} file contains |
556 |
% the line |
557 |
% \begin{quote} |
558 |
% |\generateFile{mystyle.bst}{f}{\from{genbst.mbs}{%| |
559 |
% \end{quote} |
560 |
% edit the file so that \texttt{genbst.mbs} is replaced by |
561 |
% \texttt{\filename}. The resulting \texttt{mystyle.bst} file will then be |
562 |
% an updated version of the older one, containing all the same features. |
563 |
% |
564 |
% \section{Acknowledgements} |
565 |
% I wish to thank all the people who have taken the trouble to send me |
566 |
% suggestions or special requests. Admittedly, it has been out of |
567 |
% self-interest on their part, since they had bibliographic needs to be |
568 |
% met. And I have often questioned the need for many of their demands. Yet, |
569 |
% that is part of the bibliographic jungle that I am trying to eliminate. |
570 |
% If I thought that bibliographies were arbitrarily formatted before I |
571 |
% started this project, I have more than sufficient confirmation since |
572 |
% then. The fault lies not with the poor contributors, but with the |
573 |
% publishers who cannot agree on a decent standard. |
574 |
% |
575 |
% I especially want to thank Frank Mittelbach, not only for creating \dtx{} |
576 |
% in the first place, but also for sending me his bibliographic requirements, |
577 |
% and for suggesting an improvement to \texttt{makebst}. |
578 |
% |
579 |
% And finally, all of us must thank Oren Patashnik for providing \btx; |
580 |
% without its flexibility and programmability (in spite of the complexity |
581 |
% of the language) the master bibliographic styles would not be possible at |
582 |
% all. |
583 |
% |
584 |
% \section{The Options}\label{sec:options} |
585 |
% Here I present a list of all the \dtx{} options that are |
586 |
% available in this file {\tt\filename}. |
587 |
% The normal user can skip this section since he will probably make use |
588 |
% of the menus via \texttt{makebst}. These are described in |
589 |
% Section~\ref{sec:menu}. The menus provide much more informative prompts |
590 |
% than the heavily abbreviated option names listed here. In other words, |
591 |
% the options described in this section are meant for internal (programmer) |
592 |
% usage, while the normal interface for the user is the menus. |
593 |
% |
594 |
% I have tried to avoid |
595 |
% conflicts with mutually exclusive options by always letting one dominate if |
596 |
% more than one has been specified. Such options have the same prefix, such |
597 |
% as \texttt{nm-rev} and \texttt{nm-init}. |
598 |
% If one uses \texttt{makebst} to produce the |
599 |
% \dtx{} batch job, then it is impossible to give mutually |
600 |
% exclusive options unless one edits the batch file oneself afterwards. |
601 |
% (Anything is possible with computer freaks!) |
602 |
% |
603 |
% Most mutually exclusive options have the same prefix before the hyphen. |
604 |
% |
605 |
% \newenvironment{opt}{% |
606 |
% \begin{list}{}{\labelwidth2cm \leftmargin2.5cm \labelsep1em \rightmargin0pt |
607 |
% \def\makelabel##1{\ttfamily##1 \hfill}}}{\end{list}} |
608 |
% \textbf{Citation style:} whether or not a numerical or author--year system |
609 |
% is to be used. |
610 |
% \begin{opt} |
611 |
% \item[--] default is numerical, standard \LaTeX, as for {\tt |
612 |
% plain.bst}.\\ |
613 |
% |\bibitem{key}...| |
614 |
% \item[cite] special for listing entire databases; the cite key is used |
615 |
% as the label so it may be listed.\\ |
616 |
% |\bibitem[key]{key}...| |
617 |
% \item[ay] for author--year style of citations. Various forms of |\bibitem| |
618 |
% are provided under this option, to support different types |
619 |
% of \LaTeX{} styles for interfacing with the author--year system. |
620 |
% \item[alph] for \texttt{alpha.bst} style of citations; essentially numerical |
621 |
% but an abbreviation of the author names plus year is used as |
622 |
% the label. |
623 |
% \end{opt} |
624 |
% |
625 |
% If \texttt{ay} has been selected, then the type of author--year interface |
626 |
% is selectable. Some of these, like \texttt{natbib} and \texttt{harvard} |
627 |
% exist in two versions because of updates in these systems. |
628 |
% \begin{opt} |
629 |
% \item[--] default is the system I invented for my \texttt{natbib.sty}.\\ |
630 |
% |\bibitem[author(year)]{key}...| |
631 |
% \item[nat] for extended format of \texttt{natbib.sty} version 5.3\\ |
632 |
% |\bibitem[author(year)full author]{key}...| |
633 |
% \item[alk] for the \texttt{apalike.sty} of Oren Patashnik and related |
634 |
% systems\\ |
635 |
% |\bibitem[author, year]{key}...| |
636 |
% \item[har] for the Harvard family of styles (with \texttt{harvard.sty}).\\ |
637 |
% |\harvarditem[short]{long}{year}{key}...| |
638 |
% \item[harnm] for the extended Harvard family, containing some extra commands |
639 |
% used by \LaTeXe\ version 2.0.3 of \texttt{harvard.sty} |
640 |
% \item[ast] for astronomy family of styles (with \texttt{astron.sty}).\\ |
641 |
% |\bibitem[\protect\astroncite{author}{year}]{key}...| |
642 |
% \item[cay] for the Chicago family of styles (with \texttt{chicago.sty}).\\ |
643 |
% |\bibitem[\protect\citeauthoryear{long}{short}{year}]{key}...| |
644 |
% \item[nmd] for the `named' variant of Chicago (with \texttt{named.sty}).\\ |
645 |
% |\bibitem[\protect\citeauthoryear{author}{year}]{key}...| |
646 |
% \item[cn] for the ``author--date'' group of styles (with {\tt |
647 |
% authordate1-4.sty})\\ |
648 |
% |\bibitem[\protect\citename{author, }year]{key}...| |
649 |
% \end{opt} |
650 |
% |
651 |
% \textbf{Sequence:} the order in which the references are listed. |
652 |
% \begin{opt} |
653 |
% \item[--] default is alphabetical by all authors, date, title |
654 |
% \item[seq-yr] order by year, authors, title |
655 |
% \item[seq-no] sequence by citation order |
656 |
% \item[seq-lab] (author--year) by label, date, title (means that Daly |
657 |
% precedes Daly and Williams, precedes Daly et al.) |
658 |
% \item[seq-key] (author--year) like \texttt{seq-lab} except that for |
659 |
% identical authors and year, the cite keyword is used |
660 |
% instead of the title |
661 |
% \item[vonx] ignore \emph{von} part of name when ordering (default is |
662 |
% to consider \emph{von} as part of the whole surname) |
663 |
% \end{opt} |
664 |
% |
665 |
% \textbf{Language selection:} the translations of certain explicit words. |
666 |
% \begin{opt} |
667 |
% \item[--] default is English, for \textsl{and}, \textsl{chapter}, |
668 |
% \textsl{editor}, etc.; |
669 |
% \item[babel] replace words with \LaTeX{} commands that are defined |
670 |
% in the file \texttt{babelbst.tex}; |
671 |
% \end{opt} |
672 |
% |
673 |
% If one of the external language definition files is used, then the name of |
674 |
% its language should be in the list of active options. Many other language |
675 |
% names are already included as options in this main file simply for the |
676 |
% purpose of adding a comment at the start of the \texttt{.bst} file. |
677 |
% |
678 |
% \textbf{Names formatting:} how initials and surnames are to be combined. |
679 |
% \begin{opt} |
680 |
% \item[--] default is full names, given names first |
681 |
% \item[nm-revf] full names, surname first |
682 |
% \item[nm-init] initials plus surname |
683 |
% \item[nm-rev] surname plus initials |
684 |
% \item[nm-rev1] surname plus initials (1st name only) then initials |
685 |
% plus surname |
686 |
% \item[nm-revv1] same as \texttt{nm-rev1} but with full names |
687 |
% \item[nm-rv] as \texttt{nm-rev}, but initials without dots |
688 |
% \item[nm-rvv] as \texttt{nm-rev}, but initials without spaces |
689 |
% \item[nm-rvx] as \texttt{nm-rev}, but initials without dots or spaces |
690 |
% \item[ed-rev] editors' names are reversed the same as authors' |
691 |
% \item[aunm-semi] a semi-colon is placed between author names instead of |
692 |
% a comma |
693 |
% \end{opt} |
694 |
% |
695 |
% \textbf{Number of names:} normally all names listed (in reference list) |
696 |
% \begin{opt} |
697 |
% \item[nmlm] limit number of names |
698 |
% \item[x1...x9] (with \texttt{nmlm}) maximum number of names to appear |
699 |
% \item[m1...m6] (with \texttt{nmlm}) minimum number before \textsl{et al.} |
700 |
% written; |
701 |
% no check for consistency is taken; one \texttt{x} and |
702 |
% one \texttt{m} number must be given, and {\tt x}$\le${\tt m} |
703 |
% \end{opt} |
704 |
% |
705 |
% \textbf{Names font:} in the reference list |
706 |
% \begin{opt} |
707 |
% \item[--] default is names in normal typeface |
708 |
% \item[nmft-sc] names in small caps |
709 |
% \item[nmft-it] names in italics |
710 |
% \item[nmft-bf] names in bold |
711 |
% \item[nmand-rm] `and' in normal font, not same as authors'. |
712 |
% \end{opt} |
713 |
% |
714 |
% \textbf{Block punctuation:} between logical sections (not mutually |
715 |
% exclusive) |
716 |
% \begin{opt} |
717 |
% \item[--] default is period after each logical section, including end |
718 |
% \item[blk-com] use commas, except at very end (changes \textsl{In} to |
719 |
% \textsl{in}) |
720 |
% \item[blk-tit] like \texttt{blk-com} except period follows titles of |
721 |
% articles and books |
722 |
% \item[blk-tita] like \texttt{blk-com} except period follows article title |
723 |
% \item[com-semi] with \texttt{blk-com}, uses semi-colon instead of comma |
724 |
% \item[com-blank] with \texttt{blk-com}, uses blanks instead of comma |
725 |
% \item[in-col] puts a colon after \textsl{In} or \textsl{in} for edited works |
726 |
% \item[in-x] suppresses the word \textsl{in} for edited works |
727 |
% \item[fin-bare] no punctuation at the very end |
728 |
% \item[au-col] puts a colon after the author/editor block |
729 |
% \end{opt} |
730 |
% |
731 |
% \textbf{Date:} position and enclosure |
732 |
% \begin{opt} |
733 |
% \item[--] default is date at end, before notes; for author--year, |
734 |
% date consists only of year, no month |
735 |
% \item[dt-jnl] date at end as for default, except for journal articles |
736 |
% where it follows the journal name as part of specification |
737 |
% \item[dt-end] date goes after any notes |
738 |
% \item[dt-beg] date goes after authors' names |
739 |
% \item[yr-par] date in parentheses () |
740 |
% \item[yr-brk] date in brackets [] |
741 |
% \item[yr-com] date preceded by comma and space |
742 |
% \item[yr-col] date preceded by colon and space |
743 |
% \item[yr-per] date preceded by period and space |
744 |
% \item[yr-blk] date preceded by space |
745 |
% \item[dtrev] date as year month instead of month year |
746 |
% \item[dtbf] date bold face |
747 |
% \item[aymth] include month even for author-year |
748 |
% \item[yrp-x] suppresses punctuation following month, year when date |
749 |
% is just after authors |
750 |
% \item[yrp-col] adds colon and space after date when just after authors |
751 |
% \item[yrp-semi] adds semi-colon and space after date when just after authors |
752 |
% \item[yrp-per] adds period and space after date |
753 |
% \item[yrpp-xsp] removes blank following year punctuation |
754 |
% \item[note-yr] permits text (like ``in press'') in the \texttt{year} field |
755 |
% \end{opt} |
756 |
% |
757 |
% \textbf{Article in journal:} style of title, volume, pages |
758 |
% \begin{opt} |
759 |
% \item[--] default is: Title. \textit{Journal}, vol(num):p1--p2 |
760 |
% \item[volp-sp] as above, but with a space, vol(num):~p1--p2 |
761 |
% \item[volp-semi] semi-colon instead of colon: vol(num);~p1--p2 |
762 |
% \item[volp-com] comma and space instead of colon: vol(num),~p1--p2 |
763 |
% \item[volp-blk] only space instead of colon: vol(num)~p1--p2 |
764 |
% \item[volp-dt] date between volume and pages: vol(num), (1994) p1--p2 |
765 |
% \item[vol-bf] volume in bold |
766 |
% \item[vol-it] volume in italics |
767 |
% \item[vol-2bf] volume and number bold |
768 |
% \item[vnum-x] no number for journals, only volume |
769 |
% \item[vnum-sp] space between, as vol (num) |
770 |
% \item[vnum-cm] replace vol(num) with vol, num |
771 |
% \item[vnum-nr] replace vol(num) with vol, no. num |
772 |
% \item[vnum-h] replace vol(num) with vol, \#num |
773 |
% \item[vnum-dt] as vol (year) num |
774 |
% \item[vnum-pg] as vol, (num)p1--(num)p2 |
775 |
% \item[jpg-1] only starting page given |
776 |
% \item[jwdpg] include `page' or `pp' for articles |
777 |
% \item[jwdvol] include `volume' or `vol' for articles |
778 |
% \item[jnm-x] no punctuation after journal name |
779 |
% \item[tit-it] article title in italics |
780 |
% \item[tit-q] article title in single quotes |
781 |
% \item[tit-qq] article title in double quotes |
782 |
% \item[jtit-x] no article title (applies only to journals and |
783 |
% collections) |
784 |
% \item[atit-u] article title capitalized as in entry, default is |
785 |
% sentence capitalization (first word and words following |
786 |
% colons) |
787 |
% \item[jxper] abbreviated journal names have periods removed, as |
788 |
% `Phys Rev' |
789 |
% \item[jttl-rm] name of journal not in italics |
790 |
% \item[pp-last] pages appear at end, before any notes |
791 |
% \end{opt} |
792 |
% |
793 |
% \textbf{Thesis title:} formatted like a book or article |
794 |
% \begin{opt} |
795 |
% \item[--] default is like a book title |
796 |
% \item[thtit-a] titles of PhD and Master theses formatted like articles |
797 |
% \end{opt} |
798 |
% |
799 |
% \textbf{Technical Report title:} formatted like book or article |
800 |
% \begin{opt} |
801 |
% \item[--] default is like an article title |
802 |
% \item[trtit-b] titles of technical reports formatted like books |
803 |
% \end{opt} |
804 |
% |
805 |
% \textbf{Books:} title font style, pages, and address location |
806 |
% \begin{opt} |
807 |
% \item[--] default is italicized |
808 |
% \item[btit-rm] book title plain |
809 |
% \item[bkpg-par] pages in books place in parentheses |
810 |
% \item[add-pub] publisher's address before name, colon separated |
811 |
% \item[pub-par] publisher and address in parentheses |
812 |
% \item[pub-date] publisher with address and date in parentheses |
813 |
% \item[pre-pub] publisher placed before chapter and page information |
814 |
% \item[pre-edn] edition before publisher |
815 |
% \end{opt} |
816 |
% |
817 |
% \textbf{ISBN number:} include or not |
818 |
% \begin{opt} |
819 |
% \item[--] default is no ISBN number |
820 |
% \item[isbn] include an ISBN number as optional entry for books, booklets, |
821 |
% incollections, inproceedings |
822 |
% \end{opt} |
823 |
% |
824 |
% \textbf{Abbreviations:} of various words, default is no abbreviations |
825 |
% \begin{opt} |
826 |
% \item[pp] abbreviate \textsl{page(s)} as \textsl{p.} and \textsl{pp.} |
827 |
% \item[ppx] no word \textsl{page(s)} or abbreviation |
828 |
% \item[ed] abbreviate \textsl{editor(s)} as \textsl{ed.} and |
829 |
% \textsl{eds.} |
830 |
% \item[abr] abbreviate \textsl{volume}, \textsl{edition}, |
831 |
% \textsl{technical report}, etc. |
832 |
% \item[mth-bare] months abbreviated without dots |
833 |
% \item[jabr] abbreviate names of prestored journals |
834 |
% \item[ord] write edition numbers as 1st, 2nd, instead as words. |
835 |
% \end{opt} |
836 |
% |
837 |
% \textbf{Editor:} alternative for \emph{in edited} work |
838 |
% \begin{opt} |
839 |
% \item[--] ``in \emph{names}, editors, \emph{title}'' |
840 |
% \item[edpar] ``in \emph{names} (editors), \emph{title}'' |
841 |
% \item[edby] ``in \emph{title}, edited by \emph{names}'' |
842 |
% \item[edby-par] ``in \emph{title} (edited by \emph{names})'' |
843 |
% \item[edcap] (with \texttt{edby-par}) capitalizes ``Edited by'' or |
844 |
% ``Editor'' |
845 |
% \item[edbyx] (with \texttt{edby} or \texttt{edby-par}) replaces text |
846 |
% \textsl{edited by} by \textsl{editor(s)} before the names, |
847 |
% \item[edbyy] (with \texttt{edby} or \texttt{edby-par}) replaces text |
848 |
% \textsl{edited by} by \textsl{editor(s)} after the names, |
849 |
% as ``in \emph{title}, \emph{names}, editors''. |
850 |
% \end{opt} |
851 |
% |
852 |
% \textbf{Citation label:} what is written by the |\cite| command |
853 |
% \begin{opt} |
854 |
% \item[--] default is no special font |
855 |
% \item[lab-it] label (names printed by |\cite|) in italics |
856 |
% \item[lab-sc] label in small caps |
857 |
% \item[lab-bf] label in bold face |
858 |
% \item[and-rm] word `and' in labels in normal font |
859 |
% \item[xlab-it] extra label (letter after year) in italics |
860 |
% \end{opt} |
861 |
% |
862 |
% \textbf{Emphasis:} defines what `italicized' really means |
863 |
% \begin{opt} |
864 |
% \item[--] default is |\em| (can switch between |\it| |
865 |
% and |\rm| |
866 |
% \item[em-it] use |\it| instead (always italic) |
867 |
% \item[em-x] no emphasis |
868 |
% \end{opt} |
869 |
% |
870 |
% \textbf{Special punctuation:} |
871 |
% \begin{opt} |
872 |
% \item[amper] use \& in place of \textsl{and} |
873 |
% \item[varand] use command |\BIBand| in place of \textsl{and} |
874 |
% \item[and-xcom] no comma before last \textsl{and} of an author list |
875 |
% (citations and references) |
876 |
% \item[and-com] add comma before \textsl{and} even for two authors (in list of |
877 |
% references) |
878 |
% \item[xand] no \textsl{and} in an author list (references) |
879 |
% \item[etal-it] \textsl{et al.} in italics |
880 |
% \item[etal-rm] \textsl{et al.} in roman |
881 |
% \end{opt} |
882 |
% |
883 |
% \textbf{Font commands:} |
884 |
% \begin{opt} |
885 |
% \item[--] use \LaTeX~2.09 font commands |
886 |
% \item[nfss] use |\textbf|, |\textit|, |\emph| in place of |\bf|, |\it|, |
887 |
% and |\em|; only works then with \LaTeXe |
888 |
% \end{opt} |
889 |
% |
890 |
% \section{The Menu Information}\label{sec:menu} |
891 |
% Here I describe the options and menu information for this particular |
892 |
% master file \texttt{\filename}. To construct a \dtx{} driver file |
893 |
% to generate a desired \texttt{.bst} file, simply process \texttt{makebst.tex} |
894 |
% with \TeX\ or \LaTeX, and give |
895 |
% \begin{quote}\tt\filename\end{quote} |
896 |
% when prompted for the name of the master file. Then answer the questions |
897 |
% in the menus that follow. The menu information is extracted from here. |
898 |
% |
899 |
% All the menu information is nested between \dtx{} guard options |
900 |
% |%<*options>| \dots\ |%</options>|, and the last command is |
901 |
% |\endoptions|. The rest of the file is nested between |
902 |
% \begin{quote} |
903 |
% |%<*!options&!driver&!bblbst>| \dots\ |</!options&!driver&!bblbst>| |
904 |
% \end{quote} |
905 |
% in order to exclude it if \dtx{} is used to |
906 |
% extract the menu information, the documentation driver, or the |
907 |
% \texttt{babelbst.tex} file. |
908 |
% |
909 |
% The main coding is divided into two sections, the \emph{head} and |
910 |
% \emph{tail}; in between come any external language or journal name |
911 |
% support files. The head part is marked with the \dtx{} guard option |
912 |
% |<!tail>| and the tail with |<!head>|. This roundabout means of doing |
913 |
% things makes it possible to process \texttt{\filename} with \texttt{.dbj} |
914 |
% files that were generated for the older \texttt{genbst.mbs} file by |
915 |
% simply changing the name of the source file as shown in |
916 |
% Section~\ref{sec:update}. If both \texttt{head} and \texttt{tail} (and |
917 |
% \texttt{exlang}) options are omitted, as they are in the older |
918 |
% \texttt{.dbj} files, \texttt{\filename} is processed completely in one |
919 |
% pass. To include external files, two passes are needed, one for each |
920 |
% part, with the external file(s) coming in between. |
921 |
% |
922 |
% Note too that if the internal language commands are taken (i.e., if |
923 |
% \texttt{exlang} option is not given) then the default language is |
924 |
% English, which is tested for as |<!babel>|. This too permits the simple |
925 |
% update of older \texttt{.dbj}, at least for English. |
926 |
% |
927 |
% \subsection*{Selecting Language} |
928 |
% Explicit words in the bibliography style, such as \textsl{and}, |
929 |
% \textsl{editor}, etc., |
930 |
% are represented by functions \texttt{bbl.and}, \texttt{bbl.editor}, and so on. |
931 |
% By default these functions translate to the normal English text, but |
932 |
% other languages are also possible. |
933 |
% |
934 |
% The definitions of these functions for other languages are contained in |
935 |
% external files. At this point, we can make use of features in |
936 |
% \texttt{makebst} (version~3.0 or later) to ask for the name of such a |
937 |
% definition file, and store it in |\cfile|. If no external file is |
938 |
% specified, then the internal definitions are taken, for which there are |
939 |
% two possibilities: English or \LaTeX{} commands (Babel). |
940 |
% |
941 |
% The commands |\MBswitch|, |\mes|, |\MBaskfile|, |\wr|, |\pc|, |\spsp| are |
942 |
% defined in \texttt{makebst.tex}. |
943 |
% |
944 |
% If |\MBswitch| does not exist, then the version of \texttt{makebst} |
945 |
% cannot support external files. |
946 |
% |
947 |
% \begin{macrocode} |
948 |
%<*options> |
949 |
\mes{<<< For more information about the meanings of^^J% |
950 |
<<< the various options, see the section on ^^J% |
951 |
<<< Menu Information in the .mbs file documentation.} |
952 |
|
953 |
\mes{^^JEXTERNAL FILES:} |
954 |
\expandafter\ifx\csname MBswitch\endcsname\relax |
955 |
\mes{^^J**************^^J% |
956 |
Makebst version is less than 3.0^^J% |
957 |
Cannot add external file for language definition^^J% |
958 |
**************} |
959 |
\def\cfile{}\def\jfile{}\else |
960 |
\MBaskfile{^^JName of language definition file}(\mroot.\mext)i\cfile |
961 |
\edef\ctemp{\mroot.\mext} |
962 |
\ifx\ctemp\cfile\def\cfile{}\fi |
963 |
% \end{macrocode} |
964 |
% |
965 |
% A second type of external file that can be added is one containing names |
966 |
% of journals that are to be prestored into the \texttt{.bst} file. |
967 |
% Several file names are allowed here, with the root names separated by |
968 |
% commas, and with the common extension added at the end. To assist later |
969 |
% parsing of the names, an additional comma is added before the extension. |
970 |
% |
971 |
% Note that in this case |\MBaskfile| treats the file(s) as output, i.e., |
972 |
% it does not check if the file(s) actually exist. |
973 |
% |
974 |
% The macro |\Mgetnext| allows the root names to be extracted from the |
975 |
% list of file names. |
976 |
% \begin{macrocode} |
977 |
\def\jfile{} |
978 |
\ask{\yn}{^^JInclude file(s) for extra journal names? (NO)} |
979 |
\if!\yn!\else\if\yn n\else\if\yn N\else |
980 |
\MBaskfile{^^JFile to include}(physjour,photjour.mbs)o\jfile |
981 |
\edef\jfile{\froot,.\fext} |
982 |
\fi\fi\fi |
983 |
\fi |
984 |
\def\Mgetnext#1,#2.#3??{\def\froot{#1}\def\Mrest{#2}\def\fext{#3}} |
985 |
% \end{macrocode} |
986 |
% |
987 |
% If no external files are specified, then both |\cfile| and |\jfile| are |
988 |
% empty. In this case, do \emph{not} set the options \texttt{head} and |
989 |
% \texttt{tail}, which control the \dtx{} passes through |
990 |
% \texttt{filename}. Now only one pass is made. |
991 |
% |
992 |
% If there is an external definition file, or if an external list of |
993 |
% journal names, then some extra text must be |
994 |
% written to fit in with that already written by \texttt{makebst}. This is |
995 |
% explained in that documentation. The |\MBswitch| command turns the curly |
996 |
% braces |{..}| into normal characters, and the parentheses |(..)| take on |
997 |
% their grouping functionality. This permits unbalances braces to be |
998 |
% written to the output file. |
999 |
% |
1000 |
% \begin{macrocode} |
1001 |
\if!\cfile\jfile!\else |
1002 |
\begingroup\MBswitch |
1003 |
\wr(\spsp head,\string\MBopta}) |
1004 |
\if!\cfile!\else |
1005 |
\wr(\string\from{\cfile}{\string\MBopta}) |
1006 |
\fi |
1007 |
\if!\jfile!\else |
1008 |
\let\jxfile\jfile |
1009 |
\loop |
1010 |
% \end{macrocode} |
1011 |
% |
1012 |
% Parse the list of journal name files, adding a new |\from| for each one. |
1013 |
% |
1014 |
% \begin{macrocode} |
1015 |
\expandafter\Mgetnext\jxfile?? |
1016 |
\wr(\string\from{\froot.\fext}{\string\MBopta}) |
1017 |
\edef\jxfile(\Mrest.\fext) |
1018 |
\if!\Mrest!\def\Mtst(1)\else\def\Mtst()\fi |
1019 |
\if!\Mtst! |
1020 |
\repeat |
1021 |
\fi |
1022 |
\wr(\string\from{\mroot.\mext}{tail,\string\MBopta}}) |
1023 |
\wr(\string\def\string\MBopta{\pc) |
1024 |
\endgroup |
1025 |
\fi |
1026 |
% \end{macrocode} |
1027 |
% |
1028 |
% Ask whether |
1029 |
% explicit English words wanted or \LaTeX{} commands whose definitions are |
1030 |
% to be found in the file \texttt{babelbst.tex}. |
1031 |
% |
1032 |
% \begin{macrocode} |
1033 |
\if!\cfile! |
1034 |
\mes{^^JINTERNAL LANGUAGE SUPPORT:} |
1035 |
\optdef{*}{}{English}{words used explicitly} |
1036 |
\optdef{b}{babel}{Babel}{(words replaced by commands defined in babelbst.tex)} |
1037 |
\getans |
1038 |
\else |
1039 |
\wr{\spsp\spsp\sep exlang\pc: External language file} |
1040 |
\def\sep{,} |
1041 |
\fi |
1042 |
% \end{macrocode} |
1043 |
% |
1044 |
% \subsection*{Author--year or numerical} |
1045 |
% The first question is whether a numerical or author--year citation style |
1046 |
% is to be used. If the latter, the supporting system is my {\tt |
1047 |
% natbib.sty}, which expects |\bibitem| to have an optional argument |
1048 |
% containing the short form of the authors, plus year in parentheses. |
1049 |
% E.g., |
1050 |
% \begin{quote} |
1051 |
% |\bibitem[Daly et al.(1990)]{key}...| |
1052 |
% \end{quote} |
1053 |
% There is now a newer version of \texttt{natbib.sty} (v5.3) that |
1054 |
% supports an optional full author list too, as |
1055 |
% \begin{quote} |
1056 |
% |\bibitem[Daly et al.(1990)Daly, Keppler, and Williams]{key}...| |
1057 |
% \end{quote} |
1058 |
% Other systems are also supported, such as the Harvard family of |
1059 |
% bibliography styles (with \texttt{harvard.sty}), which have entries in the |
1060 |
% form |
1061 |
% \begin{quote} |
1062 |
% |\harvarditem[Daly et al.]{Daly, Keppler,|\\ |
1063 |
% | and Williams}{1990}{key}...| |
1064 |
% \end{quote} |
1065 |
% or the astronomy family (with \texttt{astron.sty}) with entries like |
1066 |
% \begin{quote} |
1067 |
% |\bibitem[\protect\astroncite{Daly et al.}{1990}]{key}...| |
1068 |
% \end{quote} |
1069 |
% or the Chicago family (with \texttt{chicago.sty}) with entries like |
1070 |
% \begin{quote} |
1071 |
% |\bibitem[\protect\citeautheryear{Daly, Keppler, and|\\ |
1072 |
% | Williams}{Daly et al.}{1990}]{key}...| |
1073 |
% \end{quote} |
1074 |
% or the `named' variant of Chicago (with \texttt{named.sty}) with entries like |
1075 |
% \begin{quote} |
1076 |
% |\bibitem[\protect\citeauthoryear{Daly et al.}{1990}]{key}...| |
1077 |
% \end{quote} |
1078 |
% or the so-called ``author--date'' group (with \texttt{authordate1-4.sty}) |
1079 |
% with entries of the form |
1080 |
% \begin{quote} |
1081 |
% |\bibitem[\protect\citename{Daly et al.}1990]{key}...| |
1082 |
% \end{quote} |
1083 |
% Finally, there is the \texttt{apalike} format of Oren Patashnik, for use |
1084 |
% with \texttt{apalike.sty} that has entries of the form |
1085 |
% \begin{quote} |
1086 |
% |\bibitem[Daly et al., 1990]{key}...| |
1087 |
% \end{quote} |
1088 |
% |
1089 |
% In addition to numerical or author--year citation styles, there is also a |
1090 |
% \texttt{cite} style available in which the label is the same as the cite |
1091 |
% key. This is for listing entire contents of databases with the cite key |
1092 |
% visible. |
1093 |
% |
1094 |
% A flag |\ifnumerical| is established because some of the following menu |
1095 |
% features depend on which system is to be used. |
1096 |
% |
1097 |
% \begin{macrocode} |
1098 |
\newif\ifnumerical \numericalfalse |
1099 |
\newif\ifmytemp\mytempfalse |
1100 |
\mes{^^JSTYLE OF CITATIONS:} |
1101 |
\optdef{*}{}{Numerical}{as in standard LaTeX} |
1102 |
\optdef{a}{ay}{Author-year}{with some non-standard interface} |
1103 |
\optdef{b}{alph}{Alpha style}{(labels like DAL90)} |
1104 |
\optdef{c}{cite}{Cite key}{(special for listing contents of bib file)} |
1105 |
\getans |
1106 |
\numericaltrue |
1107 |
\if\ans a\numericalfalse\fi |
1108 |
\mytemptrue |
1109 |
\if\ans b\mytempfalse\fi |
1110 |
|
1111 |
\ifnumerical\else |
1112 |
\mes{^^JAUTHOR--YEAR SUPPORT SYSTEM:} |
1113 |
\optdef{*}{nat}{Natbib}{for use with natbib.sty v5.3} |
1114 |
\optdef{o}{}{Older Natbib}{without full authors citations} |
1115 |
\optdef{l}{alk}{Apalike}{for use with apalike.sty} |
1116 |
\optdef{h}{har}{Harvard}{system with harvard.sty} |
1117 |
\optdef{a}{ast}{Astronomy}{system with astron.sty} |
1118 |
\optdef{c}{cay}{Chicago}{system with chicago.sty} |
1119 |
\optdef{n}{nmd}{Named}{system with named.sty} |
1120 |
\optdef{d}{cn}{Author-date}{system with authordate1-4.sty} |
1121 |
\getans |
1122 |
|
1123 |
% \end{macrocode} |
1124 |
% The \texttt{harvard} family has been extended for \LaTeXe, and the new |
1125 |
% \texttt{.bst} files allow the word \textsl{and} and the brackets around years |
1126 |
% to be variable with commands. A URL entry is added, for the on-line |
1127 |
% network reference. These features may be added too. |
1128 |
% \begin{macrocode} |
1129 |
\if\ans h% |
1130 |
\mes{^^JHARVARD EXTENSIONS INCLUDED:} |
1131 |
\optdef{*}{harnm}{With Harvard extensions}{for LaTeX2e version of harvard.sty} |
1132 |
\optdef{n}{}{Older Harvard}{style, for LaTeX 2.09} |
1133 |
\getans\fi |
1134 |
\fi |
1135 |
|
1136 |
% \end{macrocode} |
1137 |
% |
1138 |
% \subsection*{Ordering of the listed references} |
1139 |
% Choices here depend on citation style. The default in both cases is |
1140 |
% alphabetical order of all authors. For numerical style, one may also |
1141 |
% choose an unsorted order, which means the order is the same as the original |
1142 |
% citations. This corresponds to \texttt{unsrt.bst}. Order of citation is |
1143 |
% also offered for author--year for \texttt{natbib}-type styles that can |
1144 |
% also be used for numerical listings. |
1145 |
% |
1146 |
% Another possibility is to order first by year, then authors. This too only |
1147 |
% makes sense for numerical citations. However, it is offered for author--year |
1148 |
% in the event that a \texttt{natbib}-type style is used for numerical |
1149 |
% listings. |
1150 |
% |
1151 |
% For the alpha style, the ordering is by label only, so no option is |
1152 |
% offered here (|\ifnumerical| is \meta{true} and |\ifmytemp| is \meta{false}). |
1153 |
% |
1154 |
% For author--year, the second choice is by label. (The label is the |
1155 |
% optional |\bibitem| argument, and is what is printed in place of the |
1156 |
% |\cite| command.) With this option, all the papers with the same first |
1157 |
% author are ordered so that the one-author papers come first, followed by |
1158 |
% the two-author papers, followed by the multiple-author papers. This is a |
1159 |
% more sensible system for author--year citations, and is demanded by some |
1160 |
% journals (like JGR). |
1161 |
% |
1162 |
% One problem that can arise here is when two or more references have the |
1163 |
% same set of authors and year; normally they are then ordered by the |
1164 |
% title, ignoring initial words like \textsl{the} and \textsl{a}, with the |
1165 |
% letters a, b, |
1166 |
% c, \dots, added to the year. This can mean that a set of references with |
1167 |
% a natural sequence will be put into a different order. An alternative is |
1168 |
% to order them by the citation keyword instead of by title. This of course |
1169 |
% assumes that the keywords in this case reflect that natural sequence. |
1170 |
% \begin{macrocode} |
1171 |
\ifnumerical |
1172 |
\ifmytemp |
1173 |
\mes{^^JORDERING OF REFERENCES:} |
1174 |
\optdef{*}{}{Alphabetical}{by all authors} |
1175 |
\optdef{c}{seq-no}{Citation order}{(unsorted, like unsrt.bst)} |
1176 |
\optdef{d}{seq-yr}{Year ordered}{and then by authors} |
1177 |
\getans |
1178 |
\fi |
1179 |
\else |
1180 |
\mes{^^JORDERING OF REFERENCES:} |
1181 |
\optdef{*}{}{Alphabetical}{by all authors} |
1182 |
\optdef{l}{seq-lab}{By label}% |
1183 |
{(Jones before Jones and James before Jones et al)} |
1184 |
\optdef{k}{seq-key}{By label and cite key}{instead of label and title, as above} |
1185 |
\optdef{d}{seq-yr}{Year ordered}{and then by authors (for publication lists)} |
1186 |
\optdef{c}{seq-no}{Citation order}{(unsorted, only meaningful for numericals)} |
1187 |
\getans |
1188 |
\fi |
1189 |
|
1190 |
% \end{macrocode} |
1191 |
% The standard \btx\ styles consider the \emph{von} part of the name to be a |
1192 |
% fixed part of the surname. European usage tends to alphabetize ignoring these |
1193 |
% honorifics. |
1194 |
% \begin{macrocode} |
1195 |
\if\ans c\else |
1196 |
\mes{^^JORDER ON VON PART:} |
1197 |
\optdef{*}{}{Sort on von part}{(de la Maire before Defoe)} |
1198 |
\optdef{x}{vonx}{Sort without von part}{(de la Maire after Mahone)} |
1199 |
\getans |
1200 |
\fi |
1201 |
|
1202 |
% \end{macrocode} |
1203 |
% |
1204 |
% \subsection*{Formatting author names} |
1205 |
% The default is that the full names of the authors are listed, given names |
1206 |
% first, unabbreviated. Of course, if only the initials have been given in |
1207 |
% the \texttt{.bib} file, then that is all that can appear in the list. Other |
1208 |
% possibilities are to use initials (even if full names in the \texttt{.bib} |
1209 |
% file) either before or after the surnames. A specialty of the journals of |
1210 |
% the American Geophysical Union is to have only the first name with |
1211 |
% reversed initials. |
1212 |
% |
1213 |
% If the reference is part of a larger work with editors, then the editor |
1214 |
% names appear later in the reference text, usually as ``edited by \dots'' |
1215 |
% or as ``\emph{names} (editors)''. In these cases, the editor names are |
1216 |
% not usually reversed (surname first) even if the authors' names are. |
1217 |
% An option is provided to format such editor names exactly as the authors'. |
1218 |
% \begin{macrocode} |
1219 |
\mes{^^JAUTHOR NAMES:} |
1220 |
\optdef{*}{}{Full, surname last}{(John Frederick Smith)} |
1221 |
\optdef{f}{nm-revf}{Full, surname first}{(Smith, John Frederick)} |
1222 |
\optdef{i}{nm-init}{Initials + surname}{(J. F. Smith)} |
1223 |
\optdef{r}{nm-rev}{Surname + initials}{(Smith, J. F.)} |
1224 |
\optdef{s}{nm-rv}{Surname + dotless initials}{(Smith J F)} |
1225 |
\optdef{x}{nm-rvx}{Surname + pure initials}{(Smith JF)} |
1226 |
\optdef{y}{nm-rvv}{Surname + spaceless initials}{(Smith J.F.)} |
1227 |
\optdef{a}{nm-rev1}{Only first name reversed, initials}% |
1228 |
{(AGU style: Smith, J. F., H. K. Jones)} |
1229 |
\optdef{b}{nm-revv1}{First name reversed, with full names}% |
1230 |
{(Smith, John Fred, Harry Kab Jones)} |
1231 |
\getans |
1232 |
|
1233 |
\mytempfalse |
1234 |
\if\ans r\mytemptrue\fi |
1235 |
\if\ans s\mytemptrue\fi |
1236 |
\if\ans a\mytemptrue\fi |
1237 |
\if\ans f\mytemptrue\fi |
1238 |
\if\ans x\mytemptrue\fi |
1239 |
\if\ans y\mytemptrue\fi |
1240 |
\ifmytemp |
1241 |
\mes{^^JEDITOR NAMES IN COLLECTIONS:} |
1242 |
\if\ans r |
1243 |
\optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith} |
1244 |
\fi |
1245 |
\if\ans s |
1246 |
\optdef{*}{}{Editor names NOT reversed}{as edited by J J Smith} |
1247 |
\fi |
1248 |
\if\ans a |
1249 |
\optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith} |
1250 |
\fi |
1251 |
\if\ans x |
1252 |
\optdef{*}{}{Editor names NOT reversed}{as edited by JJ Smith} |
1253 |
\fi |
1254 |
\if\ans f |
1255 |
\optdef{*}{}{Editor names NOT reversed}{as edited by John James Smith} |
1256 |
\fi |
1257 |
\if\ans y |
1258 |
\optdef{*}{}{Editor names NOT reversed}{as edited by J.J. Smith} |
1259 |
\fi |
1260 |
\optdef{r}{ed-rev}{Editor names reversed}{just like authors'} |
1261 |
\getans |
1262 |
\fi |
1263 |
|
1264 |
\mes{^^JPUNCTUATION BETWEEN AUTHOR NAMES:} |
1265 |
\optdef{*}{}{Author names separated by commas}{} |
1266 |
\optdef{s}{aunm-semi}{Names separated by semi-colon}{} |
1267 |
\getans |
1268 |
|
1269 |
% \end{macrocode} |
1270 |
% |
1271 |
% \subsection*{Number of authors} |
1272 |
% Normally the complete list of authors as given in the \texttt{.bib} file is |
1273 |
% presented in the reference list. However, some journals prefer to limit |
1274 |
% them to a maximum. If there are more than this maximum number of author |
1275 |
% names, then a minimum number plus \textsl{et al.} are listed. |
1276 |
% |
1277 |
% Because no test for consistency of the numbers is carried out in the |
1278 |
% \texttt{.bst} file itself (it might be possible, but I found it too complex), |
1279 |
% this is done here. |
1280 |
% \begin{macrocode} |
1281 |
\mes{^^JNUMBER OF AUTHORS:} |
1282 |
\optdef{*}{}{All authors}{included in listing} |
1283 |
\optdef{l}{nmlm}{Limited authors}{(et al replaces missing names)} |
1284 |
\getans |
1285 |
\if\ans l |
1286 |
\loop |
1287 |
\ask{\num}{Maximum number of authors (1-9)} |
1288 |
\ifnum\num>9\relax |
1289 |
\mes{*** Must be between 1 and 9} |
1290 |
\repeat |
1291 |
\wr{\spsp\spsp\sep x\num\pc: Maximum of \num\space authors} |
1292 |
\mes{\spsp You have selected maximum \num\space authors} |
1293 |
\ifnum\num>6\def\numx{6}\else\edef\numx{\num}\fi |
1294 |
\loop |
1295 |
\ask{\num}{Minimum number (before et al given) (1-\numx)} |
1296 |
\ifnum\num>\numx |
1297 |
\mes{*** Must be between 1 and \numx} |
1298 |
\repeat |
1299 |
\wr{\spsp\spsp\sep m\num\pc: Minimum of \num\space authors} |
1300 |
\mes{\spsp You have selected minimum \num\space authors} |
1301 |
\fi |
1302 |
|
1303 |
% \end{macrocode} |
1304 |
% |
1305 |
% \subsection*{Typeface of names} |
1306 |
% The author names in the list of references normally appear in the current |
1307 |
% typeface. This may be changed to small caps, bold, or italics. |
1308 |
% \begin{macrocode} |
1309 |
\mes{^^JTYPEFACE FOR AUTHORS IN LIST OF REFERENCES:} |
1310 |
\optdef{*}{}{Normal font for authors}{} |
1311 |
\optdef{s}{nmft-sc}{Small caps authors}{(\string\sc)} |
1312 |
\optdef{i}{nmft-it}{Italic authors}{(\string\it\space or \string\em)} |
1313 |
\optdef{b}{nmft-bf}{Bold authors}{(\string\bf)} |
1314 |
\getans |
1315 |
|
1316 |
\mytempfalse |
1317 |
\if\ans i\mytemptrue\fi |
1318 |
\if\ans s\mytemptrue\fi |
1319 |
\if\ans b\mytemptrue\fi |
1320 |
\ifmytemp |
1321 |
\mes{^^JFONT FOR `AND' THE IN LIST:} |
1322 |
\optdef{*}{}{`And' in author font}{(JONES AND JAMES)} |
1323 |
\optdef{r}{nmand-rm}{`And' in normal font}{(JONES and JAMES)} |
1324 |
\getans |
1325 |
\fi |
1326 |
|
1327 |
% \end{macrocode} |
1328 |
% |
1329 |
% \subsection*{Position of date} |
1330 |
% This applies to author--year style only. It makes sense to put the date |
1331 |
% immediately after the author list, since the two items (author and year) |
1332 |
% are the identifiers of the reference. Default position is at the |
1333 |
% end of the references, before any notes. It is also possible to place |
1334 |
% it even after the notes. |
1335 |
% |
1336 |
% Medical journals have a system where the date is part of the journal |
1337 |
% specification, as Lancet 1994;45(2):34--40. Otherwise the date appears at |
1338 |
% the end. |
1339 |
% \begin{macrocode} |
1340 |
\mes{^^JDATE POSITION:} |
1341 |
\optdef{*}{}{Date at end}{} |
1342 |
\optdef{b}{dt-beg}{Date after authors}{} |
1343 |
\optdef{j}{dt-jnl}{Date part of journal spec.}{(as 1994;45:34-40) else at end} |
1344 |
\optdef{e}{dt-end}{Date at very end}{after any notes} |
1345 |
\getans |
1346 |
|
1347 |
\if\ans b\mytemptrue\else\if\ans j\mytemptrue\else\mytempfalse\fi\fi |
1348 |
% \end{macrocode} |
1349 |
% |
1350 |
% \subsection*{Format of date} |
1351 |
% The year may be enclosed in parentheses, brackets, or preceded by a |
1352 |
% colon. If none of these are selected, the date (month plus year) appears. |
1353 |
% For author--year, the date normally consists only of the year, no month, |
1354 |
% but this may be overridden. |
1355 |
% |
1356 |
% If the date comes just after the authors, then one might want special |
1357 |
% punctuation following it, like a colon, or space only. The latter is |
1358 |
% probably desirable if the date is brackets or parentheses. |
1359 |
% |
1360 |
% The date can even be put into bold face. |
1361 |
% \begin{macrocode} |
1362 |
\ifnumerical |
1363 |
\mes{^^JDATE FORMAT:} |
1364 |
\optdef{*}{}{Plain month and year}{without any brackets} |
1365 |
\optdef{p}{yr-par}{Date in parentheses}{as (May 1993)} |
1366 |
\optdef{b}{yr-brk}{Date in brackets}{as [May 1993]} |
1367 |
\optdef{c}{yr-col}{Date preceded by colon}{as `: May 1993'} |
1368 |
\optdef{d}{yr-per}{Date preceded by period}{as `. May 1993'} |
1369 |
\optdef{m}{yr-com}{Date preceded by comma}{as `, May 1993'} |
1370 |
\optdef{s}{yr-blk}{Date preceded by space}{only, as ` May 1993'} |
1371 |
\getans |
1372 |
|
1373 |
\mes{^^JREVERSED DATE:} |
1374 |
\optdef{*}{}{Date as month year}{} |
1375 |
\optdef{r}{dtrev}{Date as year month}{} |
1376 |
\getans |
1377 |
\else |
1378 |
\mes{^^JDATE FORMAT: (no months for author-year)} |
1379 |
\optdef{*}{}{Year plain}{without any brackets} |
1380 |
\optdef{p}{yr-par}{Year in parentheses}{as (1993)} |
1381 |
\optdef{b}{yr-brk}{Year in brackets}{as [1993]} |
1382 |
\optdef{c}{yr-col}{Year preceded by colon}{as `: 1993'} |
1383 |
\optdef{d}{yr-per}{Year preceded by period}{as `. 1993'} |
1384 |
\optdef{m}{yr-com}{Date preceded by comma}{as `, 1993'} |
1385 |
\optdef{s}{yr-blk}{Year preceded by space}{only, as ` 1993'} |
1386 |
\getans |
1387 |
|
1388 |
\mes{^^JINCLUDE MONTHS:} |
1389 |
\optdef{*}{}{Date is year only}{without the month} |
1390 |
\optdef{m}{aymth}{Include month in date}{} |
1391 |
\getans |
1392 |
|
1393 |
\if\ans m |
1394 |
\mes{^^JREVERSED DATE:} |
1395 |
\optdef{*}{}{Date as month year}{} |
1396 |
\optdef{r}{dtrev}{Date as year month}{} |
1397 |
\getans |
1398 |
\fi |
1399 |
\fi |
1400 |
|
1401 |
\ifmytemp |
1402 |
\mes{^^JDATE PUNCTUATION:} |
1403 |
\optdef{*}{}{Date with standard block punctuation}{(comma or period)} |
1404 |
\optdef{c}{yrp-col}{Colon after date}{as 1994:} |
1405 |
\optdef{s}{yrp-semi}{Semi-colon after date}{as 1994;} |
1406 |
\optdef{p}{yrp-per}{Period after date}{even when blocks use commas} |
1407 |
\optdef{x}{yrp-x}{No punct. after date}{} |
1408 |
\getans |
1409 |
|
1410 |
\mes{^^JBLANK AFTER DATE:} |
1411 |
\optdef{*}{}{Space after date}{and punctuation} |
1412 |
\optdef{x}{yrpp-xsp}{No space after date}{as 1994:45} |
1413 |
\getans |
1414 |
|
1415 |
\fi |
1416 |
|
1417 |
\mes{^^JDATE FONT:} |
1418 |
\optdef{*}{}{Date in normal font}{} |
1419 |
\optdef{b}{dtbf}{Date in bold face}{} |
1420 |
\getans |
1421 |
|
1422 |
% \end{macrocode} |
1423 |
% |
1424 |
% Normally in author--year citations, the \texttt{year} entry is truncated |
1425 |
% to the last 4 characters, which should be the 4 digits of the year. Some |
1426 |
% users have requested the possibility of suppressing this truncation so |
1427 |
% that they may put text in the \texttt{year} field, such as ``in press.'' |
1428 |
% Another use for it is when years are given as ``1968--72''. Actually, |
1429 |
% I have no idea why the year should be truncated at all. |
1430 |
% \begin{macrocode} |
1431 |
\ifnumerical\else |
1432 |
\mes{^^JTRUNCATE YEAR:} |
1433 |
\optdef{*}{note-yr}{Year text full}{as 1990--1993 or `in press'} |
1434 |
\optdef{t}{}{Year truncated}{to last 4 digits} |
1435 |
\getans |
1436 |
\fi |
1437 |
|
1438 |
% \end{macrocode} |
1439 |
% |
1440 |
% \subsection*{Article title in journal} |
1441 |
% The title of an article in a journal or in a collection (a book, or |
1442 |
% conference proceedings) may appear plain, in italics, within single |
1443 |
% or double quotes. |
1444 |
% |
1445 |
% Furthermore, it may have sentence capitalization (first |
1446 |
% word and word following colon) or be capitalized as in the \texttt{.bib} file |
1447 |
% entry. That is why it is recommended to capitalize the entry text as it |
1448 |
% should appear when fully capitalized, putting words that are always |
1449 |
% capitalized in braces. Example: |
1450 |
% \begin{quote} |
1451 |
% |TITLE="The Results of the {Giotto} Mission"| |
1452 |
% \end{quote} |
1453 |
% which produces either ``The results of the Giotto mission'' or ``The |
1454 |
% Results of the Giotto Mission'', depending on option. |
1455 |
% |
1456 |
% Additionally, the article titles may be fully suppressed. |
1457 |
% \begin{macrocode} |
1458 |
\mes{^^JTITLE OF ARTICLE:} |
1459 |
\optdef{*}{}{Title plain}{with no special font} |
1460 |
\optdef{i}{tit-it}{Title italic}{(\string\em)} |
1461 |
\optdef{q}{tit-q}{Title in single quotes}{(`Title')} |
1462 |
\optdef{d}{tit-qq}{Title in double quotes}{(``Title'')} |
1463 |
\getans |
1464 |
|
1465 |
\mes{^^JCAPITALIZATION OF ARTICLE TITLE:} |
1466 |
\optdef{*}{}{Sentence style}{(first word and those in braces)} |
1467 |
\optdef{t}{atit-u}{Title style}{(just as in bib entry)} |
1468 |
\getans |
1469 |
|
1470 |
\mes{^^JARTICLE TITLE PRESENT:} |
1471 |
\optdef{*}{}{Article title present}{in journals and proceedings} |
1472 |
\optdef{x}{jtit-x}{No article title}{} |
1473 |
\getans |
1474 |
|
1475 |
% \end{macrocode} |
1476 |
% |
1477 |
% \subsection*{Journal names} |
1478 |
% Abbreviated journal names normally contain periods; the periods may be |
1479 |
% removed with this option. In fact, only letters, numbers, and spacing are |
1480 |
% retained. |
1481 |
% \begin{macrocode} |
1482 |
\mes{^^JJOURNAL NAMES:} |
1483 |
\optdef{*}{}{Periods in journal names}{are retained, as `Phys. Rev.'} |
1484 |
\optdef{x}{jxper}{Dotless journal names}{as `Phys Rev'} |
1485 |
\getans |
1486 |
|
1487 |
% \end{macrocode} |
1488 |
% Journal title is normally printed in italics; can be left in normal font. |
1489 |
% \begin{macrocode} |
1490 |
\mes{^^JJOURNAL TITLE FONT:} |
1491 |
\optdef{*}{}{Journal title italics}{} |
1492 |
\optdef{r}{jttl-rm}{Journal title normal}{font} |
1493 |
\getans |
1494 |
|
1495 |
% \end{macrocode} |
1496 |
% |
1497 |
% \subsection*{Title of Theses and Technical Reports} |
1498 |
% The title of a these (PhD or Master's) is normally treated the same |
1499 |
% as that of a book. Optionally, it may be formatted like that of |
1500 |
% an article. |
1501 |
% |
1502 |
% The title of a technical report is normally treated the same as that |
1503 |
% of an article. Optionally, it may be formatted like that of a book. |
1504 |
% |
1505 |
% \begin{macrocode} |
1506 |
\mes{^^JTHESIS TITLE:} |
1507 |
\optdef{*}{}{Thesis titles like books}{} |
1508 |
\optdef{a}{thtit-a}{Thesis title like article}{} |
1509 |
\getans |
1510 |
|
1511 |
\mes{^^JTECHNICAL REPORT TITLE:} |
1512 |
\optdef{*}{}{Tech. report title like articles}{} |
1513 |
\optdef{b}{trtit-b}{Tech. report title like books}{} |
1514 |
\getans |
1515 |
|
1516 |
% \end{macrocode} |
1517 |
% |
1518 |
% \subsection*{Journal reference} |
1519 |
% Great diversity of opinion exists as to how a journal reference is to be |
1520 |
% formatted. It consists of a volume, possibly a number, and page limits. |
1521 |
% The number is really only necessary if the page numbers within one volume |
1522 |
% start at 1 for each physical `number'. Since journals are often bound |
1523 |
% together in one volume later, it makes more sense to number the pages |
1524 |
% continuously through the whole volume. However, this is not always so, |
1525 |
% and then the `number' is necessary for the full specification. |
1526 |
% |
1527 |
% A number of styles for journal specifications are |
1528 |
% \begin{quote} |
1529 |
% \begin{tabular}{l@{\qquad}l} |
1530 |
% 21(2):33--55 & 21, no.\ 2: 33--55\\ |
1531 |
% \textbf{21}(2):33--55 & \textbf{21}, \#2, 33--55\\ |
1532 |
% \textit{21}(2), 33--55 & \textit{21} (2); 33--55 \\ |
1533 |
% 21(2) (1995) 33--55 & 21, (2)33--(2)55\\ |
1534 |
% 21(2) 33--55 & vol.~21 (2), pp.~33--55 |
1535 |
% \end{tabular} |
1536 |
% \end{quote} |
1537 |
% |
1538 |
% Here both start and stop page numbers have been given; often only the |
1539 |
% start page is wanted. |
1540 |
% |
1541 |
% \begin{macrocode} |
1542 |
\mes{^^JJOURNAL VOLUME NUMBER:} |
1543 |
\optdef{*}{}{Volume plain}{as vol(num)} |
1544 |
\optdef{i}{vol-it}{Volume italic}{as {\string\em\space vol}(num)} |
1545 |
\optdef{b}{vol-bf}{Volume bold}{as {\string\bf\space vol}(num)} |
1546 |
\optdef{d}{vol-2bf}{Volume and number bold}{as {\string\bf\space vol(num)}} |
1547 |
\getans |
1548 |
|
1549 |
% \end{macrocode} |
1550 |
% |
1551 |
% The form of the `number' is also given: in parentheses, with `no.', |
1552 |
% with \#, or omitted. |
1553 |
% \begin{macrocode} |
1554 |
\mes{^^JJOURNAL VOL AND NUMBER:} |
1555 |
\optdef{*}{}{Journal vol(num)}{as 34(2)} |
1556 |
\optdef{s}{vnum-sp}{Journal vol (num)}{as 34 (2)} |
1557 |
\optdef{c}{vnum-cm}{Journal vol, num}{as 34, 2} |
1558 |
\optdef{n}{vnum-nr}{Journal vol, no. num}{as 34, no. 2} |
1559 |
\optdef{h}{vnum-h}{Journal vol, \string\# number}{as 34, \string\#2} |
1560 |
\optdef{p}{vnum-pg}{Journal vol, number(page)}{as 34, (2)33} |
1561 |
\optdef{d}{vnum-dt}{Journal vol (year) num}{as 34 (1994) 2} |
1562 |
\optdef{x}{vnum-x}{Journal vol, no number}{as 34} |
1563 |
\getans |
1564 |
|
1565 |
\mes{^^JVOLUME PUNCTUATION:} |
1566 |
\optdef{*}{}{Volume with colon}{as vol(num):ppp} |
1567 |
\optdef{s}{volp-sp}{Volume with colon and space}{as vol(num): ppp} |
1568 |
\optdef{h}{volp-semi}{Volume with semi-colon}{as vol(num); ppp} |
1569 |
\optdef{c}{volp-com}{Volume with comma}{as vol(num), ppp} |
1570 |
\optdef{b}{volp-blk}{Volume with blank}{as vol(num) ppp} |
1571 |
\optdef{d}{volp-dt}{Volume with date}{as vol(num), date ppp} |
1572 |
\getans |
1573 |
|
1574 |
\mes{^^JPAGE NUMBERS:} |
1575 |
\optdef{*}{}{Start and stop page numbers}{given} |
1576 |
\optdef{f}{jpg-1}{Only start page number}{} |
1577 |
\getans |
1578 |
|
1579 |
\mes{^^JWORD `PAGE' IN ARTICLES:} |
1580 |
\optdef{*}{}{Article pages numbers only}{as 234-256} |
1581 |
\optdef{p}{jwdpg}{Include `page' in articles}{as pp. 234--256} |
1582 |
\getans |
1583 |
|
1584 |
% \end{macrocode} |
1585 |
% |
1586 |
% Some journals want page numbers at the end, even for books, proceedings, as |
1587 |
% well as for journals. |
1588 |
% \begin{macrocode} |
1589 |
\mes{^^JPOSITION OF PAGES:} |
1590 |
\optdef{*}{}{Pages given mid text}{as is normal} |
1591 |
\optdef{e}{pp-last}{Pages at end}{but before any notes} |
1592 |
\getans |
1593 |
|
1594 |
\mes{^^JWORD `VOLUME' IN ARTICLES:} |
1595 |
\optdef{*}{}{Article volume as number only}{as 21} |
1596 |
\optdef{p}{jwdvol}{Include `volume' in articles}{as vol. 21} |
1597 |
\getans |
1598 |
|
1599 |
% \end{macrocode} |
1600 |
% |
1601 |
% It is possible to decide whether the journal name should be |
1602 |
% separated from the following specifications with a blank or comma. |
1603 |
% \begin{macrocode} |
1604 |
\mes{^^JJOURNAL NAME PUNCTUATION:} |
1605 |
\optdef{*}{}{Comma after journal}{name} |
1606 |
\optdef{x}{jnm-x}{Space after journal}{name} |
1607 |
\getans |
1608 |
|
1609 |
% \end{macrocode} |
1610 |
% |
1611 |
% \subsection*{Books} |
1612 |
% The title of a book (as opposed to an article in a book or journal) is |
1613 |
% normally italicized. This may be set to the regular font. |
1614 |
% |
1615 |
% The page numbers in books may be set in parentheses, as (pp.\ 345--350). |
1616 |
% \begin{macrocode} |
1617 |
\mes{^^JBOOK TITLE:} |
1618 |
\optdef{*}{}{Book title italic}{(\string\em)} |
1619 |
\optdef{p}{btit-rm}{Book title plain}{(no font command)} |
1620 |
\getans |
1621 |
|
1622 |
\mes{^^JPAGES IN BOOKS:} |
1623 |
\optdef{*}{}{Book pages normal}{as pp. 50-55} |
1624 |
\optdef{p}{bkpg-par}{Book pages in parentheses}{as (pp. 50-55)} |
1625 |
\getans |
1626 |
|
1627 |
% \end{macrocode} |
1628 |
% Some psychology journals wish to have the publisher's address preceding |
1629 |
% the name, separated by colon, as |
1630 |
% \begin{quote}New York: Wiley and Sons\end{quote} |
1631 |
% |
1632 |
% Some journals (e.g.\ Nature) put publisher in parentheses with date, |
1633 |
% as (Wiley and Sons, New York, 1983). These normally put the date in |
1634 |
% parentheses at the end anyway, so this is a merging of the two sets of |
1635 |
% parentheses. |
1636 |
% \begin{macrocode} |
1637 |
\mes{^^JPUBLISHER ADDRESS:} |
1638 |
\optdef{*}{}{Publisher, address}{as Harcourt, New York} |
1639 |
\optdef{a}{add-pub}{Address: Publisher}{as New York: Harcourt} |
1640 |
\getans |
1641 |
|
1642 |
\mes{^^JPUBLISHER IN PARENTHESES:} |
1643 |
\optdef{*}{}{Publisher as normal block}{without parentheses} |
1644 |
\optdef{p}{pub-par}{Publisher in parentheses}{} |
1645 |
\optdef{d}{pub-date}{Publisher and date in parentheses}{(Oxford, 1994)} |
1646 |
\getans |
1647 |
|
1648 |
\mes{^^JPUBLISHER POSITION:} |
1649 |
\optdef{*}{}{Publisher after chapter, pages}{} |
1650 |
\optdef{p}{pre-pub}{Publisher before chapter, pages}{} |
1651 |
\optdef{e}{pre-edn}{Publisher after edition}{} |
1652 |
\getans |
1653 |
|
1654 |
% \end{macrocode} |
1655 |
% \subsection*{ISBN number} |
1656 |
% Books normally possess an ISBN number. This may be included as an |
1657 |
% optional entry for \texttt{book}, \texttt{inbook}, \texttt{booklet}, |
1658 |
% \texttt{incollection}, \texttt{proceedings}, \texttt{inproceedings}. |
1659 |
% \begin{macrocode} |
1660 |
\mes{^^JISBN NUMBER:} |
1661 |
\optdef{*}{isbn}{Include ISBN}{for books, booklets, etc.} |
1662 |
\optdef{x}{}{No ISBN}{} |
1663 |
\getans |
1664 |
|
1665 |
% \end{macrocode} |
1666 |
% |
1667 |
% \subsection*{Edited by} |
1668 |
% For an article within an edited collection, the normal form is |
1669 |
% \begin{quote} |
1670 |
% In J. K. James, editor, \emph{Title of Collection} \dots |
1671 |
% \end{quote} |
1672 |
% Alternative forms are |
1673 |
% \begin{quote} |
1674 |
% In J. K. James (editor), \emph{Title} \dots\\ |
1675 |
% In \emph{Title}, edited by J. K. James \dots\\ |
1676 |
% In \emph{Title} (Edited by J. K. James) \dots |
1677 |
% \end{quote} |
1678 |
% \begin{macrocode} |
1679 |
\mes{^^JEDITOR IN WHOLE BOOK:} |
1680 |
\optdef{*}{}{Word `editor' after name}{of book editor without author} |
1681 |
\optdef{a}{edpar}{`(editor)'}{in parentheses, after name} |
1682 |
\getans |
1683 |
|
1684 |
\mes{^^JEDITOR IN COLLECTIONS:} |
1685 |
\optdef{*}{}{.., editor, booktitle}{of collection} |
1686 |
\optdef{b}{edby}{Booktitle, edited by .. }{} |
1687 |
\optdef{p}{edby-par}{Booktitle (edited by ..)}{} |
1688 |
\optdef{e}{edby}{Booktitle, editor ..}{} |
1689 |
\optdef{k}{edby-par}{Booktitle (editor..)}{} |
1690 |
\optdef{j}{edby}{Booktitle, .., editor}{} |
1691 |
\optdef{m}{edby-par}{Booktitle (.., editor)}{} |
1692 |
\getans |
1693 |
|
1694 |
\mytempfalse |
1695 |
\if\ans e\mytemptrue\fi |
1696 |
\if\ans k\mytemptrue\fi |
1697 |
\ifmytemp |
1698 |
\wr{\spsp\sep edbyx\pc: Replace `edited by' by `editor(s)'} |
1699 |
\fi |
1700 |
|
1701 |
\mytempfalse |
1702 |
\if\ans j\mytemptrue\fi |
1703 |
\if\ans m\mytemptrue\fi |
1704 |
\ifmytemp |
1705 |
\wr{\spsp\sep edbyy\pc: Replace `edited by..' by `.., editor(s)'} |
1706 |
\fi |
1707 |
|
1708 |
\mytempfalse |
1709 |
\if\ans p\mytemptrue\fi |
1710 |
\if\ans k\mytemptrue\fi |
1711 |
\ifmytemp |
1712 |
\mes{^^JCAPITALIZE `EDITOR' OR `EDITED BY':} |
1713 |
\optdef{*}{}{`(editor,..)' or `(edited by..)'}{in lowercase} |
1714 |
\optdef{c}{edcap}{`(Editor,..)' or `(Edited by..)'}{in uppercase} |
1715 |
\getans |
1716 |
\fi |
1717 |
|
1718 |
% \end{macrocode} |
1719 |
% |
1720 |
% \subsection*{Block punctuation} |
1721 |
% Blocks are logical sections of the reference specification, such as the |
1722 |
% author block, the journal block, editor block, etc. These are normally |
1723 |
% separated by periods, but alternatively a comma may be used. Another |
1724 |
% choice is to use commas except after titles where a period is given. |
1725 |
% |
1726 |
% \LaTeX\ offers an \texttt{openbib} option, which means that the blocks |
1727 |
% are not only new sentences, but new lines as well. This can only |
1728 |
% function when the default option here is taken, for then the command |
1729 |
% |\newblock| is placed between the blocks. This command is normally |
1730 |
% defined to do nothing, but \LaTeX\ redefines it to issue a new line |
1731 |
% when open bibliographies are wanted. |
1732 |
% \begin{macrocode} |
1733 |
\mes{^^JPUNCTUATION BETWEEN SECTIONS (BLOCKS):} |
1734 |
\optdef{*}{}{\string\newblock\space after blocks} |
1735 |
{(periods or new lines with openbib option)} |
1736 |
\optdef{c}{blk-com}{Comma between blocks}{} |
1737 |
\optdef{s}{blk-com}{Semi-colon between blocks}{} |
1738 |
\optdef{b}{blk-com}{Blanks between blocks}{} |
1739 |
\optdef{t}{blk-tit}{Period after titles of articles, books, etc}{else commas} |
1740 |
\optdef{a}{blk-tita}{Period after titles of articles}{else commas} |
1741 |
\getans |
1742 |
|
1743 |
\if\ans s |
1744 |
\wr{\spsp\spsp\sep com-semi\pc: Semi-colon replaces comma between blocks} |
1745 |
\fi |
1746 |
\if\ans b |
1747 |
\wr{\spsp\spsp\sep com-blank\pc: Blank replaces comma between blocks} |
1748 |
\fi |
1749 |
|
1750 |
\mes{^^JPUNCTUATION AFTER AUTHORS:} |
1751 |
\optdef{*}{}{Author block normal}{with regular block punctuation} |
1752 |
\optdef{c}{au-col}{Author block with colon}{} |
1753 |
\getans |
1754 |
|
1755 |
% \end{macrocode} |
1756 |
% |
1757 |
% \subsection*{\textsl{In} with colon} |
1758 |
% When referring to works in a collection, one begins the block describing |
1759 |
% that collection with \textsl{In}. Optionally, one may add a colon. |
1760 |
% \begin{macrocode} |
1761 |
\mes{^^JPUNCTUATION AFTER `IN':} |
1762 |
\optdef{*}{}{Space after `in'}{for edited works or proceedings} |
1763 |
\optdef{c}{in-col}{Colon after `in'}{(as `In: ...')} |
1764 |
\optdef{x}{in-x}{No word `in'}{for edited works} |
1765 |
\getans |
1766 |
|
1767 |
% \end{macrocode} |
1768 |
% |
1769 |
% \subsection*{Final punctuation} |
1770 |
% The punctuation at the end of the reference is normally a period. This |
1771 |
% may be suppressed. |
1772 |
% \begin{macrocode} |
1773 |
\mes{^^JFINAL PUNCTUATION:} |
1774 |
\optdef{*}{}{Period at very end}{of the listed reference} |
1775 |
\optdef{x}{fin-bare}{No period at end}{} |
1776 |
\getans |
1777 |
|
1778 |
% \end{macrocode} |
1779 |
% |
1780 |
% \subsection*{Abbreviations} |
1781 |
% A number of words may be abbreviated: pages, editors, volume, chapter, |
1782 |
% and so on. The first two may be independently set to abbreviation, the |
1783 |
% rest with a single option. |
1784 |
% |
1785 |
% Additionally, the edition numbers may be |
1786 |
% output as words (first, second, etc.) or as numbers (1st, 2nd, etc.). |
1787 |
% (Recall that the input in the \texttt{.bib} file is always as English |
1788 |
% words.) |
1789 |
% \begin{macrocode} |
1790 |
|
1791 |
\if!\cfile! |
1792 |
\mes{^^JABBREVIATE WORD `PAGES':} |
1793 |
\optdef{*}{}{`Page(s)'}{(no abbreviation)} |
1794 |
\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.} |
1795 |
\optdef{x}{ppx}{`Page' omitted}{} |
1796 |
\getans |
1797 |
|
1798 |
\mes{^^JABBREVIATE WORD `EDITORS':} |
1799 |
\optdef{*}{}{`Editor(s)'}{(no abbreviation)} |
1800 |
\optdef{a}{ed}{`Editor' abbreviated}{as ed. or eds.} |
1801 |
\getans |
1802 |
|
1803 |
\mes{^^JOTHER ABBREVIATIONS:} |
1804 |
\optdef{*}{}{No abbreviations}{of volume, edition, chapter, etc} |
1805 |
\optdef{a}{abr}{Abbreviations}{of such words} |
1806 |
\getans |
1807 |
|
1808 |
\if\ans a |
1809 |
\mes{^^JMONTHS WITH DOTS:} |
1810 |
\optdef{*}{}{Months with dots}{as Jan.} |
1811 |
\optdef{x}{mth-bare}{Months without dots}{as Feb Mar} |
1812 |
\getans |
1813 |
\fi |
1814 |
|
1815 |
\mes{^^JEDITION NUMBERS:} |
1816 |
\optdef{*}{}{Write out editions}{as first, second, third, etc} |
1817 |
\optdef{n}{ord}{Numerical editions}{as 1st, 2nd, 3rd, etc} |
1818 |
\getans |
1819 |
% \end{macrocode} |
1820 |
% |
1821 |
% The above choices about abbreviations are made only if the internal |
1822 |
% languages are taken (English or \texttt{babel}). For an external language |
1823 |
% definition file, these choices, along with possible other ones, are made |
1824 |
% in the external file, which is read in at this point. |
1825 |
% \begin{macrocode} |
1826 |
\else |
1827 |
\input\cfile |
1828 |
\fi |
1829 |
|
1830 |
% \end{macrocode} |
1831 |
% |
1832 |
% This file contains the standard set of stored journal names present in |
1833 |
% the basic bibliography style files. If other files containing journal |
1834 |
% names are to be included, they may only contain the option \texttt{jabr} |
1835 |
% since that option is selected here. No option menus from the journal-name |
1836 |
% files will be read in. |
1837 |
% \begin{macrocode} |
1838 |
\mes{^^JSTORED JOURNAL NAMES:} |
1839 |
\optdef{*}{}{Full journal names}{for prestored journals} |
1840 |
\optdef{a}{jabr}{Abbreviated journal names}{} |
1841 |
\getans |
1842 |
|
1843 |
% \end{macrocode} |
1844 |
% \subsection*{Citation label} |
1845 |
% This applies to author--year style only. The label is the text written |
1846 |
% by the |\cite| command, and for author--year style, this is something like |
1847 |
% `Daly et al.\ (1990b)'. One may select italics for the authors and for the |
1848 |
% extra label attached to the year. The year always remains plain. |
1849 |
% |
1850 |
% If a font is selected for the cited authors, then the word `and' may be |
1851 |
% optionally put in the normal font. |
1852 |
% |
1853 |
% It is not possible to select the type of brackets for the year, since |
1854 |
% this is determined by the \LaTeX{} style option that manages the |
1855 |
% author--year citations. This is not standard \LaTeX, so that there are a |
1856 |
% number of private style files for achieving this. |
1857 |
% \begin{macrocode} |
1858 |
\ifnumerical\else |
1859 |
\mes{^^JFONT OF CITATION LABELS IN TEXT:} |
1860 |
\optdef{*}{}{Cited authors plain}{as result of \string\cite\space command} |
1861 |
\optdef{i}{lab-it}{Cited authors italic}{} |
1862 |
\optdef{s}{lab-sc}{Cited authors small caps}{} |
1863 |
\optdef{b}{lab-bf}{Cited authors bold}{} |
1864 |
\getans |
1865 |
|
1866 |
\mytempfalse |
1867 |
\if\ans i\mytemptrue\fi |
1868 |
\if\ans s\mytemptrue\fi |
1869 |
\if\ans b\mytemptrue\fi |
1870 |
\ifmytemp |
1871 |
\mes{^^JFONT FOR `AND' IN CITATIONS:} |
1872 |
\optdef{*}{}{Cited `and' in author font}{} |
1873 |
\optdef{r}{and-rm}{Cited `and' in normal font}{} |
1874 |
\getans |
1875 |
\fi |
1876 |
|
1877 |
\mes{^^JFONT OF EXTRA LABEL:^^J(The extra letter on the year)} |
1878 |
\optdef{*}{}{Extra label plain}{} |
1879 |
\optdef{i}{xlab-it}{Extra label italic}{} |
1880 |
\getans |
1881 |
\fi |
1882 |
|
1883 |
% \end{macrocode} |
1884 |
% |
1885 |
% \subsection*{Variations on \textsl{and}} |
1886 |
% It is possible to replace the word \textsl{and} with an ampersand \&, and to |
1887 |
% specify whether a comma is to precede \textsl{and} in a list of more than two |
1888 |
% names. |
1889 |
% |
1890 |
% A variable \textsl{and} may be provided for with the command |\BIBand| |
1891 |
% in place of the word. In this case, the command must be defined in the |
1892 |
% document file or some other package called. (This is intended for situations |
1893 |
% where an ampersand is wanted in parenthetical citations, but the word in |
1894 |
% textual ones.) |
1895 |
% |
1896 |
% \begin{macrocode} |
1897 |
\mes{^^JAMPERSAND:} |
1898 |
\optdef{*}{}{Use word `and'}{in author lists} |
1899 |
\optdef{a}{amper}{Use ampersand}{in place of `and'} |
1900 |
\optdef{v}{varand}{Use \string\BIBand}{in place of `and'} |
1901 |
\getans |
1902 |
|
1903 |
\mes{^^JCOMMA BEFORE `AND':} |
1904 |
\optdef{*}{}{Comma before `and'}{as `Tom, Dick, and Harry'} |
1905 |
\optdef{n}{and-xcom}{No comma before `and'}{as `Tom, Dick and Harry'} |
1906 |
\optdef{c}{and-com}{Comma with 2 authors}{as `Tom, and Harry'} |
1907 |
\getans |
1908 |
|
1909 |
\mes{^^JNO `AND' IN REFERENCE LIST:} |
1910 |
\optdef{*}{}{With `and'}{before last author in reference list} |
1911 |
\optdef{x}{xand}{No `and'}{as `Tom, Dick, Harry'} |
1912 |
\getans |
1913 |
|
1914 |
% \end{macrocode} |
1915 |
% |
1916 |
% \subsection*{Font of \textsl{et al}} |
1917 |
% One can chose that \textsl{et~al.}\ be put into italics. |
1918 |
% Or, if the authors are in a different font from the regular one, the |
1919 |
% \textsl{et~al.}\ can still be Roman. |
1920 |
% \begin{macrocode} |
1921 |
\mes{^^JFONT OF `ET AL':} |
1922 |
\optdef{*}{}{Plain et al}{} |
1923 |
\optdef{i}{etal-it}{Italic et al}{} |
1924 |
\optdef{r}{etal-rm}{Roman et al}{even when authors something else} |
1925 |
\getans |
1926 |
|
1927 |
% \end{macrocode} |
1928 |
% |
1929 |
% \subsection*{Define emphasis} |
1930 |
% In everything that been mentioned so far, italicization should be |
1931 |
% understood to mean `emphasize' in the \LaTeX{} sense. This means that the |
1932 |
% command |\em| is used. This is not the same as |\it|, which is always |
1933 |
% italics. Rather, with |\em|, the font style switches between |\rm| and |
1934 |
% |\it| depending on the context. Here one may choose to true italics, or |
1935 |
% to switch off italics altogether. |
1936 |
% \begin{macrocode} |
1937 |
\mes{^^JEMPHASIS:^^J(affects all so-called italics)} |
1938 |
\optdef{*}{}{Use emphasis}{ie, \string\em, allows font switching} |
1939 |
\optdef{i}{em-it}{Use true italics}{ie, \string\it, absolute italics} |
1940 |
\optdef{x}{em-x}{No italics}{at all} |
1941 |
\getans |
1942 |
|
1943 |
% \end{macrocode} |
1944 |
% \subsection*{New Font Selection Scheme} |
1945 |
% Bold face, italics, and emphasis are made with the \LaTeX~2.09 commands. |
1946 |
% This makes them compatible with \LaTeXe{} as well, but it is possible that |
1947 |
% in future they might die out. Also, they might not be provided with |
1948 |
% future classes. Allow an option to use the New Font Selection Scheme (NFSS) |
1949 |
% font commands in \LaTeXe. If this option is taken, then the \texttt{.bst} |
1950 |
% file may only be used with \LaTeXe. |
1951 |
% \begin{macrocode} |
1952 |
\mes{^^JNEW FONT SELECTION SCHEME:} |
1953 |
\optdef{*}{}{No NFSS}{use 2.09 font commands} |
1954 |
\optdef{n}{nfss}{NFSS}{use \string\textbf, \string\emph, not \string\bf, |
1955 |
\string\em} |
1956 |
\getans |
1957 |
|
1958 |
% \end{macrocode} |
1959 |
% |
1960 |
% Terminate the options list. If a language definition file has been called, |
1961 |
% then we have a closing brace too many, so add another dummy opening brace. |
1962 |
% \begin{macrocode} |
1963 |
\if!\cfile\jfile!\else |
1964 |
\begingroup\MBswitch |
1965 |
\wr(,{\pc) |
1966 |
\endgroup |
1967 |
\fi |
1968 |
|
1969 |
\endoptions |
1970 |
%</options> |
1971 |
% \end{macrocode} |
1972 |
% \StopEventually{\PrintChanges} |
1973 |
% |
1974 |
% \section{The Bibliographic Coding} |
1975 |
% |
1976 |
% \begin{macrocode} |
1977 |
%<*!options&!driver&!bblbst> |
1978 |
%<*!tail> |
1979 |
% For use with BibTeX version 0.99a or later |
1980 |
%------------------------------------------------------------------- |
1981 |
%<*!exlang> |
1982 |
%<!babel> % This bibliography style file is intended for texts in ENGLISH |
1983 |
%<*babel> |
1984 |
% This bibliography style file requires a file named babelbst.tex |
1985 |
% containing the definitions of word commands like \bbleditor, etc. |
1986 |
%</babel> |
1987 |
%</!exlang> |
1988 |
%<*exlang> |
1989 |
% This bibliography style file is intended for texts in |
1990 |
%<bahasa> % BAHASA |
1991 |
%<brazilian> % BRAZILIAN |
1992 |
%<catalan> % CATALAN |
1993 |
%<croatian> % CROATIAN |
1994 |
%<czech> % CZECH |
1995 |
%<danish> % DANISH |
1996 |
%<dutch> % DUTCH |
1997 |
%<english> % ENGLISH |
1998 |
%<esperanto> % ESPERANTO |
1999 |
%<finnish> % FINNISH |
2000 |
%<french> % FRENCH |
2001 |
%<galacian> % GALACIAN |
2002 |
%<german> % GERMAN |
2003 |
%<hungarian> % HUNGARIAN |
2004 |
%<italian> % ITALIAN |
2005 |
%<norwegian> % NORWEGIAN |
2006 |
%<norsk> % NORWEGIAN |
2007 |
%<polish> % POLISH |
2008 |
%<portuguese> % PORTUGUESE |
2009 |
%<romanian> % ROMANIAN |
2010 |
%<russian> % RUSSIAN |
2011 |
%<slovak> % SLOVAK |
2012 |
%<slovenian> % SLOVENIAN |
2013 |
%<spanish> % SPANISH |
2014 |
%<swedish> % SWEDISH |
2015 |
%<turkish> % TURKISH |
2016 |
%</exlang> |
2017 |
%<*ay> |
2018 |
% This is an author-year citation style bibliography. As such, it is |
2019 |
% non-standard LaTeX, and requires a special package file to function properly. |
2020 |
% Such a package is natbib.sty by Patrick W. Daly |
2021 |
%<*alk> |
2022 |
% or: apalike.sty by Oren Patashnik |
2023 |
% The form of the \bibitem entries is |
2024 |
% \bibitem[Jones et al., 1990]{key}... |
2025 |
%</alk> |
2026 |
%<*!(har|ast|alk|cay|nmd|cn)> |
2027 |
% The form of the \bibitem entries is |
2028 |
% \bibitem[Jones et al.(1990)]{key}... |
2029 |
%<nat> % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... |
2030 |
% The essential feature is that the label (the part in brackets) consists |
2031 |
% of the author names, as they should appear in the citation, with the year |
2032 |
% in parentheses following. There must be no space before the opening |
2033 |
% parenthesis! |
2034 |
%<nat> % With natbib v5.3, a full list of authors may also follow the year. |
2035 |
% In natbib.sty, it is possible to define the type of enclosures that is |
2036 |
% really wanted (brackets or parentheses), but in either case, there must |
2037 |
% be parentheses in the label. |
2038 |
% The \cite command functions as follows: |
2039 |
% \cite{key} ==>> Jones et al. (1990) |
2040 |
% \cite[]{key} ==>> (Jones et al., 1990) |
2041 |
% \cite[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) |
2042 |
% \cite[e.g.][]{key} ==>> (e.g. Jones et al., 1990) |
2043 |
% \cite[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) |
2044 |
% \citeauthor{key} Jones et al. |
2045 |
%<nat> % \citefullauthor{key} Jones, Baker, and Smith |
2046 |
% \citeyear{key} 1990 |
2047 |
%</!(har|ast|alk|cay|nmd|cn)> |
2048 |
%<*har> |
2049 |
% or: harvard.sty by Peter Williams and Thorsten Schnier |
2050 |
%<harnm> % (needs natbib v5.3 or harvard v2.0.3) |
2051 |
% The form of the bibitem entries is |
2052 |
% \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}... |
2053 |
%</har> |
2054 |
%<*cay> |
2055 |
% or: chicago.sty |
2056 |
% The form of the bibitem entries is |
2057 |
% \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith} |
2058 |
% {Jones et al.}{1990}{key}... |
2059 |
%</cay> |
2060 |
%<*nmd> |
2061 |
% or: named.sty |
2062 |
% The form of the bibitem entries is |
2063 |
% \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}... |
2064 |
%</nmd> |
2065 |
%<*ast> |
2066 |
% or: astron.sty |
2067 |
% The form of the bibitem entries is |
2068 |
% \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}... |
2069 |
%</ast> |
2070 |
%<*cn> |
2071 |
% or: authordate1-4.sty |
2072 |
% The form of the bibitem entries is |
2073 |
% \bibitem[\protect\citename{Jones et al.}1990]{key}... |
2074 |
%</cn> |
2075 |
%</ay> |
2076 |
%<*!ay> |
2077 |
%<*!alph&!cite> |
2078 |
% This is a numerical citation style, and as such is standard LaTeX. |
2079 |
%</!alph&!cite> |
2080 |
%<*alph> |
2081 |
% This is a labelled citation style similar to the standard alpha.bst, |
2082 |
% where labels are of the form Dal90 or DBK89. |
2083 |
%</alph> |
2084 |
%<*cite&!alph> |
2085 |
% This is a special pseudo-numerical bibliography style, intended to be |
2086 |
% used to list all the entries in a bib database |
2087 |
%</cite&!alph> |
2088 |
% It requires no extra package to interface to the main text. |
2089 |
% The form of the \bibitem entries is |
2090 |
%<!alph&!cite> % \bibitem{key}... |
2091 |
%<alph> % \bibitem[label]{key}... |
2092 |
%<!alph&cite> % \bibitem[key]{key}... |
2093 |
%<*!cite|alph> |
2094 |
% Usage of \cite is as follows: |
2095 |
%<*!alph&!cite> |
2096 |
% \cite{key} ==>> [#] |
2097 |
% \cite[chap. 2]{key} ==>> [#, chap. 2] |
2098 |
% where # is a number determined by the ordering in the reference list. |
2099 |
%</!alph&!cite> |
2100 |
%<*alph> |
2101 |
% \cite{key} ==>> [label] |
2102 |
% \cite[chap. 2]{key} ==>> [label, chap. 2] |
2103 |
% The order in the reference list is by label. |
2104 |
%</alph> |
2105 |
%<*seq-no&!alph> |
2106 |
% The order in the reference list is that by which the works were originally |
2107 |
% cited in the text, or that in the database. |
2108 |
%</seq-no&!alph> |
2109 |
%<*!seq-no&!alph> |
2110 |
% The order in the reference list is alphabetical by authors. |
2111 |
%</!seq-no&!alph> |
2112 |
%</!cite|alph> |
2113 |
%</!ay> |
2114 |
%--------------------------------------------------------------------- |
2115 |
|
2116 |
% \end{macrocode} |
2117 |
% \changes{1.5(2.3)}{1994 Sep 16}{Add URL entry type for \texttt{harnm} option} |
2118 |
% The new \texttt{harvard.sty} of \LaTeXe{} includes an entry URL, or |
2119 |
% rather it is included in the new \texttt{.bst} files for it. Add it |
2120 |
% here too, but only for option \texttt{harnm}. |
2121 |
% |
2122 |
% \changes{3.0}{1995 Mar 1}{Add optional entries \texttt{isbn}} |
2123 |
% Books normally have an ISBN number. |
2124 |
% This entry is (optionally) included, modelled after that in |
2125 |
% \texttt{xbtxbst.doc}. |
2126 |
% \begin{macrocode} |
2127 |
ENTRY |
2128 |
{ address |
2129 |
author |
2130 |
booktitle |
2131 |
chapter |
2132 |
edition |
2133 |
editor |
2134 |
howpublished |
2135 |
institution |
2136 |
%<isbn> isbn |
2137 |
journal |
2138 |
key |
2139 |
month |
2140 |
note |
2141 |
number |
2142 |
organization |
2143 |
pages |
2144 |
publisher |
2145 |
school |
2146 |
series |
2147 |
title |
2148 |
type |
2149 |
%<harnm> URL |
2150 |
volume |
2151 |
year |
2152 |
} |
2153 |
{} |
2154 |
%<!ay&!alph> { label } |
2155 |
%<!ay&alph> { label extra.label sort.label } |
2156 |
%<ay> { label extra.label sort.label short.list } |
2157 |
|
2158 |
INTEGERS { output.state before.all mid.sentence after.sentence after.block } |
2159 |
|
2160 |
FUNCTION {init.state.consts} |
2161 |
{ #0 'before.all := |
2162 |
#1 'mid.sentence := |
2163 |
#2 'after.sentence := |
2164 |
#3 'after.block := |
2165 |
} |
2166 |
|
2167 |
STRINGS { s t } |
2168 |
|
2169 |
FUNCTION {output.nonnull} |
2170 |
{ 's := |
2171 |
output.state mid.sentence = |
2172 |
%<!blk-com|(!com-semi&!com-blank)> { ", " * write$ } |
2173 |
%<blk-com&com-semi> { "; " * write$ } |
2174 |
%<blk-com&!com-semi&com-blank> { " " * write$ } |
2175 |
{ output.state after.block = |
2176 |
{ add.period$ write$ |
2177 |
newline$ |
2178 |
"\newblock " write$ |
2179 |
} |
2180 |
{ output.state before.all = |
2181 |
'write$ |
2182 |
{ add.period$ " " * write$ } |
2183 |
if$ |
2184 |
} |
2185 |
if$ |
2186 |
mid.sentence 'output.state := |
2187 |
} |
2188 |
if$ |
2189 |
s |
2190 |
} |
2191 |
|
2192 |
FUNCTION {output} |
2193 |
{ duplicate$ empty$ |
2194 |
'pop$ |
2195 |
'output.nonnull |
2196 |
if$ |
2197 |
} |
2198 |
|
2199 |
FUNCTION {output.check} |
2200 |
{ 't := |
2201 |
duplicate$ empty$ |
2202 |
{ pop$ "empty " t * " in " * cite$ * warning$ } |
2203 |
'output.nonnull |
2204 |
if$ |
2205 |
} |
2206 |
|
2207 |
FUNCTION {fin.entry} |
2208 |
%<*!fin-bare> |
2209 |
{ add.period$ |
2210 |
write$ |
2211 |
%</!fin-bare> |
2212 |
%<*fin-bare> |
2213 |
{ duplicate$ empty$ |
2214 |
'pop$ |
2215 |
'write$ |
2216 |
if$ |
2217 |
%</fin-bare> |
2218 |
newline$ |
2219 |
} |
2220 |
|
2221 |
FUNCTION {new.block} |
2222 |
{ output.state before.all = |
2223 |
'skip$ |
2224 |
{ after.block 'output.state := } |
2225 |
if$ |
2226 |
} |
2227 |
|
2228 |
FUNCTION {new.sentence} |
2229 |
{ output.state after.block = |
2230 |
'skip$ |
2231 |
{ output.state before.all = |
2232 |
'skip$ |
2233 |
{ after.sentence 'output.state := } |
2234 |
if$ |
2235 |
} |
2236 |
if$ |
2237 |
} |
2238 |
|
2239 |
% \end{macrocode} |
2240 |
% |
2241 |
% \begin{macro}{`add.blank'} |
2242 |
% \changes{1.5(2.3)b}{1995 Jan 10}{Add function} |
2243 |
% When text is printed with \texttt{output} or |
2244 |
% \texttt{output.check}, the \texttt{output.state} is set such that |
2245 |
% a comma will precede the next output text. For special effects, we want to |
2246 |
% suppress this comma, inserting a blank instead. Hence the |
2247 |
% \texttt{output.state} is changed to \texttt{before.all}, meaning no |
2248 |
% punctuation is to be inserted. |
2249 |
% \begin{macrocode} |
2250 |
FUNCTION {add.blank} |
2251 |
{ " " * before.all 'output.state := |
2252 |
} |
2253 |
|
2254 |
% \end{macrocode} |
2255 |
% \end{macro} |
2256 |
% \begin{macro}{`add.colon'} |
2257 |
% \changes{3.4}{1995 Sep 28}{Add macro} |
2258 |
% \begin{macrocode} |
2259 |
%<*au-col> |
2260 |
FUNCTION {add.colon} |
2261 |
{ empty$ |
2262 |
'skip$ |
2263 |
{ before.all 'output.state := ":" output add.blank } |
2264 |
if$ |
2265 |
} |
2266 |
|
2267 |
%</au-col> |
2268 |
% \end{macrocode} |
2269 |
% \end{macro} |
2270 |
% |
2271 |
% \begin{macro}{`no.blank.or.punct'} |
2272 |
% \changes{3.2}{1995 May 19}{Add function} |
2273 |
% \changes{3.2}{1995 May 30}{Present only for option \texttt{yrpp-xsp}} |
2274 |
% Another frill is to suppresss both blanks and punctuation. The |\hspace| |
2275 |
% permits a line break at this point. |
2276 |
% \begin{macrocode} |
2277 |
%<*yrpp-xsp> |
2278 |
FUNCTION {no.blank.or.punct} |
2279 |
{ "\hspace{0pt}" * before.all 'output.state := |
2280 |
} |
2281 |
|
2282 |
%</yrpp-xsp> |
2283 |
% \end{macrocode} |
2284 |
% \end{macro} |
2285 |
% |
2286 |
% \begin{macro}{`date.block'} |
2287 |
% \changes{3.0}{1995 Mar 9}{Add function} |
2288 |
% \changes{3.81}{1996 Jun 25}{Add option \texttt{yrp-per}} |
2289 |
% The \texttt{date.block} function is used for special punctuating effects |
2290 |
% after the date. |
2291 |
% \begin{macrocode} |
2292 |
FUNCTION {date.block} |
2293 |
{ |
2294 |
%<*!yrp-x> |
2295 |
%<yrp-col> ":" * |
2296 |
%<*!yrp-col> |
2297 |
%<yrp-semi> ";" * |
2298 |
%<*!yrp-semi> |
2299 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
2300 |
%<(blk-com|blk-tit|blk-tita)&!yrp-per> skip$ |
2301 |
%<(blk-com|blk-tit|blk-tita)&yrp-per> new.sentence |
2302 |
%</!yrp-semi> |
2303 |
%</!yrp-col> |
2304 |
%</!yrp-x> |
2305 |
%<*yrp-x|yrp-col|yrp-semi> |
2306 |
%<!yrpp-xsp> add.blank |
2307 |
%<yrpp-xsp> no.blank.or.punct |
2308 |
%</yrp-x|yrp-col|yrp-semi> |
2309 |
} |
2310 |
|
2311 |
% \end{macrocode} |
2312 |
% \end{macro} |
2313 |
% |
2314 |
% \begin{macrocode} |
2315 |
FUNCTION {not} |
2316 |
{ { #0 } |
2317 |
{ #1 } |
2318 |
if$ |
2319 |
} |
2320 |
|
2321 |
FUNCTION {and} |
2322 |
{ 'skip$ |
2323 |
{ pop$ #0 } |
2324 |
if$ |
2325 |
} |
2326 |
|
2327 |
FUNCTION {or} |
2328 |
{ { pop$ #1 } |
2329 |
'skip$ |
2330 |
if$ |
2331 |
} |
2332 |
|
2333 |
% \end{macrocode} |
2334 |
% \begin{macro}{`non.stop'} |
2335 |
% \changes{1.4(2.2)a}{1994 Sep 8}{Add to test if last character |
2336 |
% is punctuation: . ! ?} |
2337 |
% This function (my invention) tests if the last character in the string |
2338 |
% on the stack is \texttt{. ! ?} by using \texttt{add.period\$}. It is to |
2339 |
% be used for conditional italic correction or adding commas. |
2340 |
% \begin{macrocode} |
2341 |
FUNCTION {non.stop} |
2342 |
{ duplicate$ |
2343 |
"}" * add.period$ |
2344 |
#-1 #1 substring$ "." = |
2345 |
} |
2346 |
|
2347 |
% \end{macrocode} |
2348 |
% \end{macro} |
2349 |
% \begin{macrocode} |
2350 |
%<*!ay> |
2351 |
FUNCTION {new.block.checka} |
2352 |
{ empty$ |
2353 |
'skip$ |
2354 |
'new.block |
2355 |
if$ |
2356 |
} |
2357 |
|
2358 |
%</!ay> |
2359 |
FUNCTION {new.block.checkb} |
2360 |
{ empty$ |
2361 |
swap$ empty$ |
2362 |
and |
2363 |
'skip$ |
2364 |
'new.block |
2365 |
if$ |
2366 |
} |
2367 |
|
2368 |
%<*!ay> |
2369 |
FUNCTION {new.sentence.checka} |
2370 |
{ empty$ |
2371 |
'skip$ |
2372 |
'new.sentence |
2373 |
if$ |
2374 |
} |
2375 |
|
2376 |
FUNCTION {new.sentence.checkb} |
2377 |
{ empty$ |
2378 |
swap$ empty$ |
2379 |
and |
2380 |
'skip$ |
2381 |
'new.sentence |
2382 |
if$ |
2383 |
} |
2384 |
|
2385 |
%</!ay> |
2386 |
FUNCTION {field.or.null} |
2387 |
{ duplicate$ empty$ |
2388 |
{ pop$ "" } |
2389 |
'skip$ |
2390 |
if$ |
2391 |
} |
2392 |
|
2393 |
% \end{macrocode} |
2394 |
% \begin{macro}{`emphasize'} |
2395 |
% Emphasis can be either italic or the alternating font. The font command |
2396 |
% may be NFSS or regular \LaTeX~2.09 declarations. |
2397 |
%\changes{1.3(2.1)}{1994 Jul 1}{Add \texttt{nfss} option} |
2398 |
% \begin{macrocode} |
2399 |
FUNCTION {emphasize} |
2400 |
%<*!em-x> |
2401 |
{ duplicate$ empty$ |
2402 |
{ pop$ "" } |
2403 |
%<*!nfss> |
2404 |
%<!em-it> { "{\em " swap$ * "\/}" * } |
2405 |
%<em-it> { "{\it " swap$ * "\/}" * } |
2406 |
%</!nfss> |
2407 |
%<*nfss> |
2408 |
%<!em-it> { "\emph{" swap$ * "}" * } |
2409 |
%<em-it> { "\textit{" swap$ * "}" * } |
2410 |
%</nfss> |
2411 |
if$ |
2412 |
} |
2413 |
%</!em-x> |
2414 |
%<em-x>{ skip$ } |
2415 |
|
2416 |
%<*nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf> |
2417 |
% \end{macrocode} |
2418 |
% \end{macro} |
2419 |
% \begin{macro}{`bolden'} |
2420 |
% The bold font command may be NFSS or the regular \LaTeX~2.09 declaration. |
2421 |
%\changes{1.3(2.1)}{1994 Jul 1}{Add \texttt{nfss} option} |
2422 |
% \begin{macrocode} |
2423 |
FUNCTION {bolden} |
2424 |
{ duplicate$ empty$ |
2425 |
{ pop$ "" } |
2426 |
%<!nfss> { "{\bf " swap$ * "}" * } |
2427 |
%<nfss> { "\textbf{" swap$ * "}" * } |
2428 |
if$ |
2429 |
} |
2430 |
|
2431 |
%</nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf> |
2432 |
%<*lab-sc|nmft-sc> |
2433 |
% \end{macrocode} |
2434 |
% \end{macro} |
2435 |
% \begin{macro}{`scaps'} |
2436 |
% To put text into small caps. |
2437 |
%\changes{3.0}{1995 Mar 3}{Add function} |
2438 |
% \begin{macrocode} |
2439 |
FUNCTION {scaps} |
2440 |
{ duplicate$ empty$ |
2441 |
{ pop$ "" } |
2442 |
%<!nfss> { "{\sc " swap$ * "}" * } |
2443 |
%<nfss> { "\textsc{" swap$ * "}" * } |
2444 |
if$ |
2445 |
} |
2446 |
|
2447 |
%</lab-sc|nmft-sc> |
2448 |
%<*and-rm|nmand-rm|etal-rm> |
2449 |
% \end{macrocode} |
2450 |
% \end{macro} |
2451 |
% \begin{macro}{`roman.list'} |
2452 |
% \changes{3.4}{1995 Sep 28}{Add function} |
2453 |
% \begin{macro}{`roman.cite'} |
2454 |
% \changes{3.8}{1996 Mar 16}{Add function} |
2455 |
% These functions are use to print the words `and' and `et al.' in the |
2456 |
% authors' names in the regular font. Since the list of references and the |
2457 |
% citations can in principle have different author fonts, we need two such |
2458 |
% commands. For non-NFSS, these just select |\rm|, but for NFSS, the one |
2459 |
% attribute specifying the authors' fonts is reset. |
2460 |
% |
2461 |
% \begin{macrocode} |
2462 |
FUNCTION {roman.list} |
2463 |
{ duplicate$ empty$ |
2464 |
{ pop$ "" } |
2465 |
%<!nfss> { "{\rm " swap$ * "}" * } |
2466 |
%<*nfss> |
2467 |
%<nmft-bf> { "{\mdseries " swap$ * "}" * } |
2468 |
%<(nmft-it|nmft-sc)&!nmft-bf> { "{\upshape " swap$ * "}" * } |
2469 |
%<!nmft-it&!nmft-sc&!nmft-bf> { "{\normalfont " swap$ * "}" * } |
2470 |
%</nfss> |
2471 |
if$ |
2472 |
} |
2473 |
|
2474 |
FUNCTION {roman.cite} |
2475 |
%<!nfss>{ roman.list } |
2476 |
%<*nfss> |
2477 |
{ duplicate$ empty$ |
2478 |
{ pop$ "" } |
2479 |
%<lab-bf> { "{\mdseries " swap$ * "}" * } |
2480 |
%<(lab-it|lab-sc)&!lab-bf> { "{\upshape " swap$ * "}" * } |
2481 |
%<!lab-it&!lab-sc&!lab-bf> { "{\normalfont " swap$ * "}" * } |
2482 |
if$ |
2483 |
} |
2484 |
%</nfss> |
2485 |
|
2486 |
%</and-rm|nmand-rm|etal-rm> |
2487 |
% \end{macrocode} |
2488 |
% \end{macro}\end{macro} |
2489 |
% |
2490 |
% \begin{macro}{`capitalize'} |
2491 |
% \changes{3.0}{1995 Mar 7}{Add capitalizing function} |
2492 |
% Capitalizing is easy for regular languages, but for \texttt{babel}, |
2493 |
% some trickery stuff is needed; definitions of |\capitalize| and |
2494 |
% |\Capitalize| are written to the \texttt{.bbl} file. |
2495 |
% \begin{macrocode} |
2496 |
FUNCTION {capitalize} |
2497 |
%<!babel>{ "u" change.case$ "t" change.case$ } |
2498 |
%<babel>{ "\capitalize" swap$ * } |
2499 |
|
2500 |
% \end{macrocode} |
2501 |
% \end{macro} |
2502 |
% |
2503 |
% \begin{macro}{`space.word'} |
2504 |
% \changes{2.0}{1994 Jan 31}{Add function to space out words; necessary |
2505 |
% for the multilingual functions.} |
2506 |
% The function \texttt{space.word} adds a space before and after the word or |
2507 |
% words currently on the stack. This was added for the \texttt{bbl.}$nnn$ |
2508 |
% functions, that contain only a word without spacing, but replace explicit |
2509 |
% text in the originals that were spaced out. Its seems more flexible to |
2510 |
% define the word functions to be without spacing. |
2511 |
% \begin{macrocode} |
2512 |
FUNCTION {space.word} |
2513 |
{ " " swap$ * " " * } |
2514 |
|
2515 |
% Here are the language-specific definitions for explicit words. |
2516 |
% Each function has a name bbl.xxx where xxx is the English word. |
2517 |
%<*!exlang> |
2518 |
% \end{macrocode} |
2519 |
% \end{macro} |
2520 |
% \begin{macro}{`bbl.xxx'} |
2521 |
% \changes{2.0}{1994 Jan 31}{Replace all explicit words with functions |
2522 |
% of the form \texttt{bbl.xxx}.} |
2523 |
% \changes{3.6}{1996 Jan 15}{Add option \texttt{varand}} |
2524 |
% These are the default English words. There is no default language |
2525 |
% option: one of \texttt{english} or \texttt{babel} must be given. |
2526 |
% \begin{macrocode} |
2527 |
%<*!babel> |
2528 |
% The language selected here is ENGLISH |
2529 |
FUNCTION {bbl.and} |
2530 |
%<!varand>{ "and"} |
2531 |
%<varand>{ "\BIBand{}"} |
2532 |
|
2533 |
FUNCTION {bbl.editors} |
2534 |
%<!ed>{ "editors" } |
2535 |
%<ed>{ "eds." } |
2536 |
|
2537 |
FUNCTION {bbl.editor} |
2538 |
%<!ed>{ "editor" } |
2539 |
%<ed>{ "ed." } |
2540 |
|
2541 |
FUNCTION {bbl.edby} |
2542 |
{ "edited by" } |
2543 |
|
2544 |
FUNCTION {bbl.edition} |
2545 |
%<!abr>{ "edition" } |
2546 |
%<abr>{ "edn." } |
2547 |
|
2548 |
FUNCTION {bbl.volume} |
2549 |
%<!abr>{ "volume" } |
2550 |
%<abr>{ "vol." } |
2551 |
|
2552 |
FUNCTION {bbl.of} |
2553 |
{ "of" } |
2554 |
|
2555 |
FUNCTION {bbl.number} |
2556 |
%<!abr>{ "number" } |
2557 |
%<abr>{ "no." } |
2558 |
|
2559 |
FUNCTION {bbl.nr} |
2560 |
{ "no." } |
2561 |
|
2562 |
FUNCTION {bbl.in} |
2563 |
{ "in" } |
2564 |
|
2565 |
FUNCTION {bbl.pages} |
2566 |
%<!pp&!ppx>{ "pages" } |
2567 |
%<pp>{ "pp." } |
2568 |
%<!pp&ppx>{ "" } |
2569 |
|
2570 |
FUNCTION {bbl.page} |
2571 |
%<!pp&!ppx>{ "page" } |
2572 |
%<pp>{ "p." } |
2573 |
%<!pp&ppx>{ "" } |
2574 |
|
2575 |
FUNCTION {bbl.chapter} |
2576 |
%<!abr>{ "chapter" } |
2577 |
%<abr>{ "chap." } |
2578 |
|
2579 |
FUNCTION {bbl.techrep} |
2580 |
%<!abr>{ "Technical Report" } |
2581 |
%<abr>{ "Tech. Rep." } |
2582 |
|
2583 |
FUNCTION {bbl.mthesis} |
2584 |
{ "Master's thesis" } |
2585 |
|
2586 |
FUNCTION {bbl.phdthesis} |
2587 |
{ "Ph.D. thesis" } |
2588 |
|
2589 |
FUNCTION {bbl.first} |
2590 |
%<!ord>{ "First" } |
2591 |
%<ord>{ "1st" } |
2592 |
|
2593 |
FUNCTION {bbl.second} |
2594 |
%<!ord>{ "Second" } |
2595 |
%<ord>{ "2nd" } |
2596 |
|
2597 |
FUNCTION {bbl.third} |
2598 |
%<!ord>{ "Third" } |
2599 |
%<ord>{ "3rd" } |
2600 |
|
2601 |
FUNCTION {bbl.fourth} |
2602 |
%<!ord>{ "Fourth" } |
2603 |
%<ord>{ "4th" } |
2604 |
|
2605 |
FUNCTION {bbl.fifth} |
2606 |
%<!ord>{ "Fifth" } |
2607 |
%<ord>{ "5th" } |
2608 |
|
2609 |
FUNCTION {bbl.st} |
2610 |
{ "st" } |
2611 |
|
2612 |
FUNCTION {bbl.nd} |
2613 |
{ "nd" } |
2614 |
|
2615 |
FUNCTION {bbl.rd} |
2616 |
{ "rd" } |
2617 |
|
2618 |
FUNCTION {bbl.th} |
2619 |
{ "th" } |
2620 |
|
2621 |
%<*!abr> |
2622 |
MACRO {jan} {"January"} |
2623 |
|
2624 |
MACRO {feb} {"February"} |
2625 |
|
2626 |
MACRO {mar} {"March"} |
2627 |
|
2628 |
MACRO {apr} {"April"} |
2629 |
|
2630 |
MACRO {may} {"May"} |
2631 |
|
2632 |
MACRO {jun} {"June"} |
2633 |
|
2634 |
MACRO {jul} {"July"} |
2635 |
|
2636 |
MACRO {aug} {"August"} |
2637 |
|
2638 |
MACRO {sep} {"September"} |
2639 |
|
2640 |
MACRO {oct} {"October"} |
2641 |
|
2642 |
MACRO {nov} {"November"} |
2643 |
|
2644 |
MACRO {dec} {"December"} |
2645 |
|
2646 |
%</!abr> |
2647 |
%<*abr> |
2648 |
MACRO {jan} {"Jan."} |
2649 |
|
2650 |
MACRO {feb} {"Feb."} |
2651 |
|
2652 |
MACRO {mar} {"Mar."} |
2653 |
|
2654 |
MACRO {apr} {"Apr."} |
2655 |
|
2656 |
MACRO {may} {"May"} |
2657 |
|
2658 |
MACRO {jun} {"Jun."} |
2659 |
|
2660 |
MACRO {jul} {"Jul."} |
2661 |
|
2662 |
MACRO {aug} {"Aug."} |
2663 |
|
2664 |
MACRO {sep} {"Sep."} |
2665 |
|
2666 |
MACRO {oct} {"Oct."} |
2667 |
|
2668 |
MACRO {nov} {"Nov."} |
2669 |
|
2670 |
MACRO {dec} {"Dec."} |
2671 |
|
2672 |
%</abr> |
2673 |
%</!babel> |
2674 |
% \end{macrocode} |
2675 |
% |
2676 |
% Here are the definitions for \texttt{babel} option, i.e., explicit |
2677 |
% translations are not used, but rather only \LaTeX{} macros that must be |
2678 |
% defined in the file \texttt{babelbst.tex}. This could allow automatic |
2679 |
% language selection. |
2680 |
% \begin{macrocode} |
2681 |
%<*babel> |
2682 |
% The BABEL language selection is made here; definitions in babelbst.tex. |
2683 |
FUNCTION {bbl.and} |
2684 |
{ "\bbland{}"} |
2685 |
|
2686 |
FUNCTION {bbl.editors} |
2687 |
%<!ed>{ "\bbleditors{}" } |
2688 |
%<ed>{ "\bbleds{}" } |
2689 |
|
2690 |
FUNCTION {bbl.editor} |
2691 |
%<!ed>{ "\bbleditor{}" } |
2692 |
%<ed>{ "\bbled{}" } |
2693 |
|
2694 |
FUNCTION {bbl.edby} |
2695 |
{ "\bbledby{}" } |
2696 |
|
2697 |
FUNCTION {bbl.edition} |
2698 |
%<!abr>{ "\bbledition{}" } |
2699 |
%<abr>{ "\bbledn{}" } |
2700 |
|
2701 |
FUNCTION {bbl.volume} |
2702 |
%<!abr>{ "\bblvolume{}" } |
2703 |
%<abr>{ "\bblvol{}" } |
2704 |
|
2705 |
FUNCTION {bbl.of} |
2706 |
{ "\bblof{}" } |
2707 |
|
2708 |
FUNCTION {bbl.number} |
2709 |
%<!abr>{ "\bblnumber{}" } |
2710 |
%<abr>{ "\bblno{}" } |
2711 |
|
2712 |
FUNCTION {bbl.nr} |
2713 |
{ "\bblno{}" } |
2714 |
|
2715 |
FUNCTION {bbl.in} |
2716 |
{ "\bblin{}" } |
2717 |
|
2718 |
FUNCTION {bbl.pages} |
2719 |
%<!pp&!ppx>{ "\bblpages{}" } |
2720 |
%<pp>{ "\bblpp{}" } |
2721 |
%<!pp&ppx>{ "" } |
2722 |
|
2723 |
FUNCTION {bbl.page} |
2724 |
%<!pp&!ppx>{ "\bblpage{}" } |
2725 |
%<pp>{ "\bblp{}" } |
2726 |
%<!pp&ppx>{ "" } |
2727 |
|
2728 |
FUNCTION {bbl.chapter} |
2729 |
%<!abr>{ "\bblchapter{}" } |
2730 |
%<abr>{ "\bblchap{}" } |
2731 |
|
2732 |
FUNCTION {bbl.techrep} |
2733 |
%<!abr>{ "\bbltechreport{}" } |
2734 |
%<abr>{ "\bbltechrep{}" } |
2735 |
|
2736 |
FUNCTION {bbl.mthesis} |
2737 |
{ "\bblmthesis{}" } |
2738 |
|
2739 |
FUNCTION {bbl.phdthesis} |
2740 |
{ "\bblphdthesis{}" } |
2741 |
|
2742 |
FUNCTION {bbl.first} |
2743 |
%<!ord>{ "\bblfirst{}" } |
2744 |
%<ord>{ "\bblfirsto{}" } |
2745 |
|
2746 |
FUNCTION {bbl.second} |
2747 |
%<!ord>{ "\bblsecond{}" } |
2748 |
%<ord>{ "\bblsecondo{}" } |
2749 |
|
2750 |
FUNCTION {bbl.third} |
2751 |
%<!ord>{ "\bblthird{}" } |
2752 |
%<ord>{ "\bblthirdo{}" } |
2753 |
|
2754 |
FUNCTION {bbl.fourth} |
2755 |
%<!ord>{ "\bblfourth{}" } |
2756 |
%<ord>{ "\bblfourtho{}" } |
2757 |
|
2758 |
FUNCTION {bbl.fifth} |
2759 |
%<!ord>{ "\bblfifth{}" } |
2760 |
%<ord>{ "\bblfiftho{}" } |
2761 |
|
2762 |
FUNCTION {bbl.st} |
2763 |
{ "\bblst{}" } |
2764 |
|
2765 |
FUNCTION {bbl.nd} |
2766 |
{ "\bblnd{}" } |
2767 |
|
2768 |
FUNCTION {bbl.rd} |
2769 |
{ "\bblrd{}" } |
2770 |
|
2771 |
FUNCTION {bbl.th} |
2772 |
{ "\bblth{}" } |
2773 |
|
2774 |
MACRO {jan} {"\bbljan{}"} |
2775 |
|
2776 |
MACRO {feb} {"\bblfeb{}"} |
2777 |
|
2778 |
MACRO {mar} {"\bblmar{}"} |
2779 |
|
2780 |
MACRO {apr} {"\bblapr{}"} |
2781 |
|
2782 |
MACRO {may} {"\bblmay{}"} |
2783 |
|
2784 |
MACRO {jun} {"\bbljun{}"} |
2785 |
|
2786 |
MACRO {jul} {"\bbljul{}"} |
2787 |
|
2788 |
MACRO {aug} {"\bblaug{}"} |
2789 |
|
2790 |
MACRO {sep} {"\bblsep{}"} |
2791 |
|
2792 |
MACRO {oct} {"\bbloct{}"} |
2793 |
|
2794 |
MACRO {nov} {"\bblnov{}"} |
2795 |
|
2796 |
MACRO {dec} {"\bbldec{}"} |
2797 |
|
2798 |
%</babel> |
2799 |
% \end{macrocode} |
2800 |
% |
2801 |
% \begin{macro}{`eng.ord'} |
2802 |
% \changes{2.0}{1994 Jan 31}{Add function to format English ordinals.} |
2803 |
% This function adds English endings for ordinals 1, 2, 3. However, if |
2804 |
% the second last digit is 1, then the ending is `th' for all last digits. |
2805 |
% So far, all other languages included do not have this problem, and it is |
2806 |
% sufficient to add the \textsl{th} equivalent. This might change with further |
2807 |
% languages. |
2808 |
% |
2809 |
% This function must be included with \texttt{babel} too, since that includes |
2810 |
% English. This means that the language definition files must also provide |
2811 |
% for |\bblst|, |\bblnd|, and |\bblrd|, setting them all equal to |\bblth|. |
2812 |
% |
2813 |
% \begin{macrocode} |
2814 |
%<*english|!exlang> |
2815 |
FUNCTION {eng.ord} |
2816 |
{ duplicate$ "1" swap$ * |
2817 |
#-2 #1 substring$ "1" = |
2818 |
{ bbl.th * } |
2819 |
{ duplicate$ #-1 #1 substring$ |
2820 |
duplicate$ "1" = |
2821 |
{ pop$ bbl.st * } |
2822 |
{ duplicate$ "2" = |
2823 |
{ pop$ bbl.nd * } |
2824 |
{ "3" = |
2825 |
{ bbl.rd * } |
2826 |
{ bbl.th * } |
2827 |
if$ |
2828 |
} |
2829 |
if$ |
2830 |
} |
2831 |
if$ |
2832 |
} |
2833 |
if$ |
2834 |
} |
2835 |
|
2836 |
%</english|!exlang> |
2837 |
% \end{macrocode} |
2838 |
% \end{macro} |
2839 |
% |
2840 |
% \begin{macrocode} |
2841 |
%</!exlang> |
2842 |
%</!tail> |
2843 |
%<*!head> |
2844 |
% \end{macrocode} |
2845 |
% \end{macro} |
2846 |
% |
2847 |
% \begin{macrocode} |
2848 |
%<*!jabr> |
2849 |
MACRO {acmcs} {"ACM Computing Surveys"} |
2850 |
|
2851 |
MACRO {acta} {"Acta Informatica"} |
2852 |
|
2853 |
MACRO {cacm} {"Communications of the ACM"} |
2854 |
|
2855 |
MACRO {ibmjrd} {"IBM Journal of Research and Development"} |
2856 |
|
2857 |
MACRO {ibmsj} {"IBM Systems Journal"} |
2858 |
|
2859 |
MACRO {ieeese} {"IEEE Transactions on Software Engineering"} |
2860 |
|
2861 |
MACRO {ieeetc} {"IEEE Transactions on Computers"} |
2862 |
|
2863 |
MACRO {ieeetcad} |
2864 |
{"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} |
2865 |
|
2866 |
MACRO {ipl} {"Information Processing Letters"} |
2867 |
|
2868 |
MACRO {jacm} {"Journal of the ACM"} |
2869 |
|
2870 |
MACRO {jcss} {"Journal of Computer and System Sciences"} |
2871 |
|
2872 |
MACRO {scp} {"Science of Computer Programming"} |
2873 |
|
2874 |
MACRO {sicomp} {"SIAM Journal on Computing"} |
2875 |
|
2876 |
MACRO {tocs} {"ACM Transactions on Computer Systems"} |
2877 |
|
2878 |
MACRO {tods} {"ACM Transactions on Database Systems"} |
2879 |
|
2880 |
MACRO {tog} {"ACM Transactions on Graphics"} |
2881 |
|
2882 |
MACRO {toms} {"ACM Transactions on Mathematical Software"} |
2883 |
|
2884 |
MACRO {toois} {"ACM Transactions on Office Information Systems"} |
2885 |
|
2886 |
MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} |
2887 |
|
2888 |
MACRO {tcs} {"Theoretical Computer Science"} |
2889 |
|
2890 |
%</!jabr> |
2891 |
%<*jabr> |
2892 |
MACRO {acmcs} {"ACM Comput. Surv."} |
2893 |
|
2894 |
MACRO {acta} {"Acta Inf."} |
2895 |
|
2896 |
MACRO {cacm} {"Commun. ACM"} |
2897 |
|
2898 |
MACRO {ibmjrd} {"IBM J. Res. Dev."} |
2899 |
|
2900 |
MACRO {ibmsj} {"IBM Syst.~J."} |
2901 |
|
2902 |
MACRO {ieeese} {"IEEE Trans. Softw. Eng."} |
2903 |
|
2904 |
MACRO {ieeetc} {"IEEE Trans. Comput."} |
2905 |
|
2906 |
MACRO {ieeetcad} |
2907 |
{"IEEE Trans. Comput.-Aided Design Integrated Circuits"} |
2908 |
|
2909 |
MACRO {ipl} {"Inf. Process. Lett."} |
2910 |
|
2911 |
MACRO {jacm} {"J.~ACM"} |
2912 |
|
2913 |
MACRO {jcss} {"J.~Comput. Syst. Sci."} |
2914 |
|
2915 |
MACRO {scp} {"Sci. Comput. Programming"} |
2916 |
|
2917 |
MACRO {sicomp} {"SIAM J. Comput."} |
2918 |
|
2919 |
MACRO {tocs} {"ACM Trans. Comput. Syst."} |
2920 |
|
2921 |
MACRO {tods} {"ACM Trans. Database Syst."} |
2922 |
|
2923 |
MACRO {tog} {"ACM Trans. Gr."} |
2924 |
|
2925 |
MACRO {toms} {"ACM Trans. Math. Softw."} |
2926 |
|
2927 |
MACRO {toois} {"ACM Trans. Office Inf. Syst."} |
2928 |
|
2929 |
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."} |
2930 |
|
2931 |
MACRO {tcs} {"Theoretical Comput. Sci."} |
2932 |
|
2933 |
%</jabr> |
2934 |
% \end{macrocode} |
2935 |
% |
2936 |
% \begin{macro}{`write.url'} |
2937 |
% \changes{1.5(2.3)}{1994 Sep 16}{Add \texttt{write.url} for option |
2938 |
% \texttt{harnm}} |
2939 |
% This function taken over from \texttt{agsm.sty}, the main \texttt{harvard} |
2940 |
% bib style. |
2941 |
% \begin{macrocode} |
2942 |
%<*harnm> |
2943 |
FUNCTION {write.url} |
2944 |
{ URL empty$ |
2945 |
{ skip$ } |
2946 |
{ "\newline\harvardurl{" URL * "}" * write$ newline$ } |
2947 |
if$ |
2948 |
} |
2949 |
|
2950 |
%</harnm> |
2951 |
% \end{macrocode} |
2952 |
% \end{macro} |
2953 |
% |
2954 |
% \begin{macro}{`format.names'} |
2955 |
% \changes{1.5(2.3)}{1994 Sep 16}{Add \texttt{harvard} command for `and' with |
2956 |
% new option \texttt{harnm}} |
2957 |
% \changes{3.0}{1995 Feb 27}{Add option \texttt{nm-revf}} |
2958 |
% \changes{3.0}{1995 Mar 15}{Add option \texttt{nm-rvx}} |
2959 |
% \changes{3.2}{1995 Jun 7}{Add option \texttt{nm-rvv}} |
2960 |
% \changes{3.6}{1995 Dec 7}{Jr to go at end with \texttt{nm-rev1} (AGU style)} |
2961 |
% \changes{3.6}{1995 Dec 8}{Add option \texttt{nmand-rm}} |
2962 |
% \changes{3.6}{1996 Jan 30}{Add option \texttt{etal-rm}} |
2963 |
% \changes{3.7}{1996 Feb 5}{Add option \texttt{aunm-semi}} |
2964 |
% \changes{3.82}{1996 Dec 16}{Add option \texttt{nm-revv1} (AGU style with full |
2965 |
% names)} |
2966 |
% The \texttt{harvard} package now (version 2.0.3, for \LaTeXe) uses |
2967 |
% |\harvardand| in place of the word \textsl{and} so that it can be changed |
2968 |
% at run time. This is allowed for with the option \texttt{harnm}, which |
2969 |
% need not be used only with the \texttt{har} option. |
2970 |
% This seems like a useless feature for \texttt{.bst} files made from |
2971 |
% this multilanguage source. However, it is included anyway, which means |
2972 |
% if \texttt{harnm} option selected, one must redefine |\harvardand| |
2973 |
% in the document for the language being used. |
2974 |
% \begin{macrocode} |
2975 |
INTEGERS { nameptr namesleft numnames } |
2976 |
|
2977 |
FUNCTION {format.names} |
2978 |
{ 's := |
2979 |
#1 'nameptr := |
2980 |
s num.names$ 'numnames := |
2981 |
numnames 'namesleft := |
2982 |
{ namesleft #0 > } |
2983 |
%<*!nm-rev1&!nm-revv1> |
2984 |
{ s nameptr |
2985 |
%<nm-init> "{f.~}{vv~}{ll}{, jj}" format.name$ 't := |
2986 |
%<*!nm-init> |
2987 |
%<nm-rev> "{vv~}{ll}{, jj}{, f.}" format.name$ 't := |
2988 |
%<*!nm-rev> |
2989 |
%<nm-rv> "{vv~}{ll}{ jj}{ f{~}}" format.name$ 't := |
2990 |
%<*!nm-rv> |
2991 |
%<nm-rvx> "{vv~}{ll}{ jj}{ f{}}" format.name$ 't := |
2992 |
%<*!nm-rvx> |
2993 |
%<nm-rvv> "{vv~}{ll}{ jj}{ f{.}.}" format.name$ 't := |
2994 |
%<*!nm-rvv> |
2995 |
%<nm-revf> "{vv~}{ll}{, jj}{, ff}" format.name$ 't := |
2996 |
%<*!nm-revf> |
2997 |
"{ff~}{vv~}{ll}{, jj}" format.name$ 't := |
2998 |
%</!nm-revf> |
2999 |
%</!nm-rvv> |
3000 |
%</!nm-rvx> |
3001 |
%</!nm-rv> |
3002 |
%</!nm-rev> |
3003 |
%</!nm-init> |
3004 |
%</!nm-rev1&!nm-revv1> |
3005 |
%<*nm-rev1> |
3006 |
{ nameptr #1 > |
3007 |
{ s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := } |
3008 |
{ s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ 't := } |
3009 |
if$ |
3010 |
%</nm-rev1> |
3011 |
%<*!nm-rev1&nm-revv1> |
3012 |
{ nameptr #1 > |
3013 |
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := } |
3014 |
{ s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$ 't := } |
3015 |
if$ |
3016 |
%</!nm-rev1&nm-revv1> |
3017 |
nameptr #1 > |
3018 |
{ |
3019 |
%<*nmlm> |
3020 |
%<m1> nameptr #2 = |
3021 |
%<m2> nameptr #3 = |
3022 |
%<m3> nameptr #4 = |
3023 |
%<m4> nameptr #5 = |
3024 |
%<m5> nameptr #6 = |
3025 |
%<m6> nameptr #7 = |
3026 |
%<x1> numnames #1 > and |
3027 |
%<x2> numnames #2 > and |
3028 |
%<x3> numnames #3 > and |
3029 |
%<x4> numnames #4 > and |
3030 |
%<x5> numnames #5 > and |
3031 |
%<x6> numnames #6 > and |
3032 |
%<x7> numnames #7 > and |
3033 |
%<x8> numnames #8 > and |
3034 |
%<x9> numnames #9 > and |
3035 |
{ "others" 't := |
3036 |
#1 'namesleft := } |
3037 |
'skip$ |
3038 |
if$ |
3039 |
%</nmlm> |
3040 |
namesleft #1 > |
3041 |
%<!aunm-semi> { ", " * t * } |
3042 |
%<aunm-semi> { "; " * t * } |
3043 |
{ |
3044 |
%<(and-com|xand)&!aunm-semi> "," * |
3045 |
%<(and-com|xand)&aunm-semi> ";" * |
3046 |
%<*!and-xcom&!and-com&!xand> |
3047 |
numnames #2 > |
3048 |
%<!aunm-semi> { "," * } |
3049 |
%<aunm-semi> { ";" * } |
3050 |
'skip$ |
3051 |
if$ |
3052 |
%</!and-xcom&!and-com&!xand> |
3053 |
t "others" = |
3054 |
%<!etal-it&!etal-rm> { " et~al." * } |
3055 |
%<!etal-it&etal-rm> { " " * "et~al." roman.list * } |
3056 |
%<etal-it> { " " * "et~al." emphasize * } |
3057 |
%<*!harnm> |
3058 |
%<!amper&!xand&!nmand-rm> { bbl.and space.word * t * } |
3059 |
%<!amper&!xand&nmand-rm> { bbl.and roman.list space.word * t * } |
3060 |
%<amper&!xand> { " \& " * t * } |
3061 |
%</!harnm> |
3062 |
%<harnm&!xand> { " \harvardand\ " * t * } |
3063 |
%<xand> { " " * t * } |
3064 |
if$ |
3065 |
} |
3066 |
if$ |
3067 |
} |
3068 |
't |
3069 |
if$ |
3070 |
nameptr #1 + 'nameptr := |
3071 |
namesleft #1 - 'namesleft := |
3072 |
} |
3073 |
while$ |
3074 |
} |
3075 |
|
3076 |
% \end{macrocode} |
3077 |
% \end{macro} |
3078 |
% |
3079 |
% \begin{macro}{`format.names.ed'} |
3080 |
% \changes{1.6(2.4)}{1995 Feb 2}{Add option \texttt{ed-rev} to allow editor |
3081 |
% to be formatted just like authors'} |
3082 |
% \changes{3.0}{1995 Feb 27}{Option \texttt{nm-revf} to act just as default} |
3083 |
% When editors are used in place of authors to identify the work, the |
3084 |
% names are always formatted just like authors'. However, in collections, |
3085 |
% where ``edited by'' or ``\emph{names} (editors)'' are given, it is |
3086 |
% normal not the reverse the names, even if the authors' are. The option |
3087 |
% \texttt{ed-rev} sees to it that editor names are always formatted exactly |
3088 |
% like those of authors, being reversed if necessary. |
3089 |
% |
3090 |
% The option \texttt{nm-revf} in this case acts the same as the default |
3091 |
% when no \texttt{nm-} option given: full names with surname last. Therefore |
3092 |
% it is not necessary to test for it at all, since it, like the default, |
3093 |
% has the lowest priority: any other \texttt{nm-} option clobbers it. |
3094 |
% |
3095 |
% The option \texttt{aunm-semi} will put a semi-colon between editor names, just |
3096 |
% as for authors, when \texttt{ed-rev} selected, in keeping with the idea |
3097 |
% that in this case both authors and editors are to be formatted the same. |
3098 |
% \begin{macrocode} |
3099 |
FUNCTION {format.names.ed} |
3100 |
%<ed-rev>{ format.names } |
3101 |
%<*!ed-rev> |
3102 |
{ 's := |
3103 |
#1 'nameptr := |
3104 |
s num.names$ 'numnames := |
3105 |
numnames 'namesleft := |
3106 |
{ namesleft #0 > } |
3107 |
{ s nameptr |
3108 |
%<nm-init|nm-rev|nm-rev1> "{f.~}{vv~}{ll}{, jj}" |
3109 |
%<*!nm-init&!nm-rev&!nm-rev1> |
3110 |
%<nm-revv1> "{ff~}{vv~}{ll}{, jj}" |
3111 |
%<*!nm-revv1> |
3112 |
%<nm-rv> "{f{~}~}{vv~}{ll}{ jj}" |
3113 |
%<*!nm-rv> |
3114 |
%<nm-rvx> "{f{}~}{vv~}{ll}{ jj}" |
3115 |
%<*!nm-rvx> |
3116 |
%<nm-rvv> "{f{.}.~}{vv~}{ll}{ jj}" |
3117 |
%<*!nm-rvv> |
3118 |
"{ff~}{vv~}{ll}{, jj}" |
3119 |
%</!nm-rvv> |
3120 |
%</!nm-rvx> |
3121 |
%</!nm-rv> |
3122 |
%</!nm-revv1> |
3123 |
%</!nm-init&!nm-rev&!nm-rev1> |
3124 |
format.name$ 't := |
3125 |
nameptr #1 > |
3126 |
{ |
3127 |
namesleft #1 > |
3128 |
%<!aunm-semi> { ", " * t * } |
3129 |
%<aunm-semi> { "; " * t * } |
3130 |
{ |
3131 |
%<(and-com|xand)&!aunm-semi> "," * |
3132 |
%<(and-com|xand)&aunm-semi> ";" * |
3133 |
%<*!and-xcom&!and-com&!xand> |
3134 |
numnames #2 > |
3135 |
%<!aunm-semi> { "," * } |
3136 |
%<aunm-semi> { ";" * } |
3137 |
'skip$ |
3138 |
if$ |
3139 |
%</!and-xcom&!and-com&!xand> |
3140 |
t "others" = |
3141 |
%<!etal-it&!etal-rm> { " et~al." * } |
3142 |
%<!etal-it&etal-rm> { " " * "et~al." roman.list * } |
3143 |
%<etal-it> { " " * "et~al." emphasize * } |
3144 |
%<*!harnm> |
3145 |
%<!amper&!xand&!nmand-rm> { bbl.and space.word * t * } |
3146 |
%<!amper&!xand&nmand-rm> { bbl.and roman.list space.word * t * } |
3147 |
%<amper&!xand> { " \& " * t * } |
3148 |
%</!harnm> |
3149 |
%<harnm&!xand> { " \harvardand\ " * t * } |
3150 |
%<xand> { " " * t * } |
3151 |
if$ |
3152 |
} |
3153 |
if$ |
3154 |
} |
3155 |
't |
3156 |
if$ |
3157 |
nameptr #1 + 'nameptr := |
3158 |
namesleft #1 - 'namesleft := |
3159 |
} |
3160 |
while$ |
3161 |
} |
3162 |
|
3163 |
%</!ed-rev> |
3164 |
% \end{macrocode} |
3165 |
% \end{macro} |
3166 |
% \begin{macrocode} |
3167 |
%<*ay> |
3168 |
FUNCTION {format.key} |
3169 |
{ empty$ |
3170 |
{ key field.or.null } |
3171 |
{ "" } |
3172 |
if$ |
3173 |
} |
3174 |
|
3175 |
%</ay> |
3176 |
% \end{macrocode} |
3177 |
% \begin{macro}{`format.authors'} |
3178 |
% \begin{macrocode} |
3179 |
FUNCTION {format.authors} |
3180 |
{ author empty$ |
3181 |
{ "" } |
3182 |
{ |
3183 |
%<nmft-sc> author format.names scaps |
3184 |
%<*!nmft-sc> |
3185 |
%<nmft-bf> author format.names bolden |
3186 |
%<*!nmft-bf> |
3187 |
%<nmft-it> author format.names emphasize |
3188 |
%<*!nmft-it> |
3189 |
author format.names |
3190 |
%</!nmft-it> |
3191 |
%</!nmft-bf> |
3192 |
%</!nmft-sc> |
3193 |
} |
3194 |
if$ |
3195 |
} |
3196 |
|
3197 |
% \end{macrocode} |
3198 |
% \end{macro} |
3199 |
% |
3200 |
% \begin{macro}{`format.editors'} |
3201 |
% \changes{3.0}{1995 Mar 20}{Add option \texttt{edpar}} |
3202 |
% The option \texttt{edpar} puts the word `editor' in parentheses. |
3203 |
% In \texttt{genbst.mbs}, this occurred automatically with the option |
3204 |
% \texttt{ed}, to abbreviate `editor' to `ed'. In \texttt{babel.mbs}, |
3205 |
% this was not the case, because of complications with the word functions. |
3206 |
% Now this possibility is added as a special option, which means there is |
3207 |
% some inconsistency with older \texttt{.dbj} files that called \texttt{ed}: |
3208 |
% the abbreviated `ed' is not put in parentheses unless \texttt{edpar} is |
3209 |
% also called. |
3210 |
% \begin{macrocode} |
3211 |
FUNCTION {format.editors} |
3212 |
{ editor empty$ |
3213 |
{ "" } |
3214 |
{ |
3215 |
%<nmft-sc> editor format.names scaps |
3216 |
%<*!nmft-sc> |
3217 |
%<nmft-bf> editor format.names bolden |
3218 |
%<*!nmft-bf> |
3219 |
%<nmft-it> editor format.names emphasize |
3220 |
%<*!nmft-it> |
3221 |
editor format.names |
3222 |
%</!nmft-it> |
3223 |
%</!nmft-bf> |
3224 |
%</!nmft-sc> |
3225 |
editor num.names$ #1 > |
3226 |
%<*!edpar> |
3227 |
{ ", " * bbl.editors * } |
3228 |
{ ", " * bbl.editor * } |
3229 |
%</!edpar> |
3230 |
%<*edpar> |
3231 |
{ " (" * bbl.editors * ")" * } |
3232 |
{ " (" * bbl.editor * ")" * } |
3233 |
%</edpar> |
3234 |
if$ |
3235 |
} |
3236 |
if$ |
3237 |
} |
3238 |
|
3239 |
% \end{macrocode} |
3240 |
% \end{macro} |
3241 |
% |
3242 |
% \begin{macro}{`format.in.editors'} |
3243 |
% \changes{3.0}{1995 Mar 20}{Add option \texttt{edpar}} |
3244 |
% See the note about the option \texttt{edpar} above. |
3245 |
% \begin{macrocode} |
3246 |
FUNCTION {format.in.editors} |
3247 |
{ editor empty$ |
3248 |
{ "" } |
3249 |
{ editor format.names.ed |
3250 |
%<*!edby&!edby-par> |
3251 |
editor num.names$ #1 > |
3252 |
%<*!edpar> |
3253 |
{ ", " * bbl.editors * } |
3254 |
{ ", " * bbl.editor * } |
3255 |
%</!edpar> |
3256 |
%<*edpar> |
3257 |
{ " (" * bbl.editors * ")" * } |
3258 |
{ " (" * bbl.editor * ")" * } |
3259 |
%</edpar> |
3260 |
if$ |
3261 |
%</!edby&!edby-par> |
3262 |
} |
3263 |
if$ |
3264 |
} |
3265 |
|
3266 |
% \end{macrocode} |
3267 |
% \end{macro} |
3268 |
% |
3269 |
% \begin{macro}{`format.isbn'} |
3270 |
% \changes{3.0}{1995 Mar 1}{Add function} |
3271 |
% \begin{macrocode} |
3272 |
%<*isbn> |
3273 |
FUNCTION {format.isbn} |
3274 |
{ isbn empty$ |
3275 |
{ "" } |
3276 |
{ |
3277 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
3278 |
"ISBN " isbn * } |
3279 |
if$ |
3280 |
} |
3281 |
|
3282 |
%</isbn> |
3283 |
% \end{macrocode} |
3284 |
% \end{macro} |
3285 |
% |
3286 |
% \begin{macro}{`format.title'} |
3287 |
% \changes{1.4(2.2)a}{1994 Sep 7}{Add enquote function to put titles in quotes, |
3288 |
% such that punctuation is inside quotes.} |
3289 |
% \changes{3.8}{1996 Apr 17}{Fix bug in quoted title and \texttt{blk-com}} |
3290 |
% \begin{macrocode} |
3291 |
FUNCTION {format.title} |
3292 |
{ title empty$ |
3293 |
{ "" } |
3294 |
%<!atit-u> { title "t" change.case$ |
3295 |
%<atit-u> { title |
3296 |
%<tit-it> emphasize |
3297 |
%<*!tit-it&(tit-q|tit-qq)> |
3298 |
"\enquote{" swap$ * |
3299 |
%<*blk-com> |
3300 |
non.stop |
3301 |
%<!com-semi&!com-blank> { ",} " * } |
3302 |
%<com-semi> { ";} " * } |
3303 |
%<!com-semi&com-blank> { "} " * } |
3304 |
{ "} " * } |
3305 |
if$ |
3306 |
%</blk-com> |
3307 |
%<!blk-com> add.period$ "}" * |
3308 |
%</!tit-it&(tit-q|tit-qq)> |
3309 |
} |
3310 |
if$ |
3311 |
} |
3312 |
|
3313 |
% \end{macrocode} |
3314 |
% \end{macro} |
3315 |
% |
3316 |
% \begin{macro}{`end.quote.title'} |
3317 |
% \changes{3.82}{1996 Nov 15}{Add macro to finish off quoted titles} |
3318 |
% For a quoted title, the punctuation appears in the quotes. For commas |
3319 |
% between block, this means the inter-block punctuation is already present, |
3320 |
% so it must be suppressed after every \texttt{format.title output}. This |
3321 |
% is done by setting the \texttt{output.state} to \texttt{before.all}, but |
3322 |
% only if there really was a title. Call this macro every time after |
3323 |
% titles are output. |
3324 |
% \begin{macrocode} |
3325 |
%<*blk-com&(tit-q|tit-qq)> |
3326 |
FUNCTION {end.quote.title} |
3327 |
{ title empty$ |
3328 |
'skip$ |
3329 |
{ before.all 'output.state := } |
3330 |
if$ |
3331 |
} |
3332 |
|
3333 |
%</blk-com&(tit-q|tit-qq)> |
3334 |
% \end{macrocode} |
3335 |
% \end{macro} |
3336 |
% |
3337 |
% \begin{macro}{`make.full.names'} |
3338 |
% \changes{1.1}{1993 Nov 12}{Add key labels to \texttt{calc.long.label} and |
3339 |
% get {\tt'author} and {\tt'editor} in right order when author |
3340 |
% missing.} |
3341 |
% \changes{1.4(2.2)}{1994 Sep 5}{Remove \texttt{calc.long.label} and |
3342 |
% \texttt{format.long.lab.names}, replacing them with |
3343 |
% \texttt{format.full.names}, \texttt{make.full.names}, and adding |
3344 |
% \texttt{author.editor.key}, \texttt{author.key}, and \texttt{editor.key}} |
3345 |
% \changes{1.4(2.2)a}{1994 Sep 7}{Remove option \texttt{and-com} from |
3346 |
% \texttt{make.full.names}} |
3347 |
% \changes{1.5(2.3)}{1994 Sep 15}{Add full names for \texttt{natbib} v5.3} |
3348 |
% \changes{3.6}{1995 Dec 8}{Suppress `and' in full list if suppressed in short} |
3349 |
% \changes{3.6}{1995 Dec 8}{Font of `and' in lists same as in citations} |
3350 |
% In versions before 2.2, there were two functions \texttt{calc.long.label} |
3351 |
% and \texttt{format.long.lab.names} that made up the string |
3352 |
% \texttt{long.label} for each entry. This contains the full author list. |
3353 |
% However, there was a bug in the one routine, entered by mistake when an |
3354 |
% earlier bug was removed, and more seriously, the string |
3355 |
% \texttt{long.label} was limited to \texttt{entry.max\$} characters, 100 on |
3356 |
% my system. Author lists were truncated. Thus, \texttt{make.full.names} |
3357 |
% is used instead to enter the full list of names directly in the |
3358 |
% \texttt{output.bibitem} function, without an intermediate string. This |
3359 |
% involves changing the order of some function definitions, especially |
3360 |
% \texttt{output.bibitem} must come later. |
3361 |
% \begin{macrocode} |
3362 |
%<*har|cay|nat> |
3363 |
FUNCTION {format.full.names} |
3364 |
{'s := |
3365 |
#1 'nameptr := |
3366 |
s num.names$ 'numnames := |
3367 |
numnames 'namesleft := |
3368 |
{ namesleft #0 > } |
3369 |
{ s nameptr |
3370 |
"{vv~}{ll}" format.name$ 't := |
3371 |
nameptr #1 > |
3372 |
{ |
3373 |
%<*nmlm> |
3374 |
%<m1> nameptr #2 = |
3375 |
%<m2> nameptr #3 = |
3376 |
%<m3> nameptr #4 = |
3377 |
%<m4> nameptr #5 = |
3378 |
%<m5> nameptr #6 = |
3379 |
%<x1> numnames #1 > and |
3380 |
%<x2> numnames #2 > and |
3381 |
%<x3> numnames #3 > and |
3382 |
%<x4> numnames #4 > and |
3383 |
%<x5> numnames #5 > and |
3384 |
%<x6> numnames #6 > and |
3385 |
%<x7> numnames #7 > and |
3386 |
%<x8> numnames #8 > and |
3387 |
%<x9> numnames #9 > and |
3388 |
{ "others" 't := |
3389 |
#1 'namesleft := } |
3390 |
'skip$ |
3391 |
if$ |
3392 |
%</nmlm> |
3393 |
namesleft #1 > |
3394 |
{ ", " * t * } |
3395 |
{ |
3396 |
%<*!and-xcom> |
3397 |
numnames #2 > |
3398 |
{ "," * } |
3399 |
'skip$ |
3400 |
if$ |
3401 |
%</!and-xcom> |
3402 |
t "others" = |
3403 |
%<!etal-it&!etal-rm> { " et~al." * } |
3404 |
%<!etal-it&etal-rm> { " " * "et~al." roman.cite * } |
3405 |
%<etal-it> { " " * "et~al." emphasize * } |
3406 |
%<*!harnm> |
3407 |
%<!amper&!and-rm> { bbl.and space.word * t * } |
3408 |
%<!amper&and-rm> { bbl.and roman.cite space.word * t * } |
3409 |
%<amper> { " \& " * t * } |
3410 |
%</!harnm> |
3411 |
%<harnm> { " \harvardand\ " * t * } |
3412 |
if$ |
3413 |
} |
3414 |
if$ |
3415 |
} |
3416 |
't |
3417 |
if$ |
3418 |
nameptr #1 + 'nameptr := |
3419 |
namesleft #1 - 'namesleft := |
3420 |
} |
3421 |
while$ |
3422 |
} |
3423 |
|
3424 |
FUNCTION {author.editor.key.full} |
3425 |
{ author empty$ |
3426 |
{ editor empty$ |
3427 |
{ key empty$ |
3428 |
{ cite$ #1 #3 substring$ } |
3429 |
'key |
3430 |
if$ |
3431 |
} |
3432 |
{ editor format.full.names } |
3433 |
if$ |
3434 |
} |
3435 |
{ author format.full.names } |
3436 |
if$ |
3437 |
} |
3438 |
|
3439 |
FUNCTION {author.key.full} |
3440 |
{ author empty$ |
3441 |
{ key empty$ |
3442 |
{ cite$ #1 #3 substring$ } |
3443 |
'key |
3444 |
if$ |
3445 |
} |
3446 |
{ author format.full.names } |
3447 |
if$ |
3448 |
} |
3449 |
|
3450 |
FUNCTION {editor.key.full} |
3451 |
{ editor empty$ |
3452 |
{ key empty$ |
3453 |
{ cite$ #1 #3 substring$ } |
3454 |
'key |
3455 |
if$ |
3456 |
} |
3457 |
{ editor format.full.names } |
3458 |
if$ |
3459 |
} |
3460 |
|
3461 |
FUNCTION {make.full.names} |
3462 |
{ type$ "book" = |
3463 |
type$ "inbook" = |
3464 |
or |
3465 |
'author.editor.key.full |
3466 |
{ type$ "proceedings" = |
3467 |
'editor.key.full |
3468 |
'author.key.full |
3469 |
if$ |
3470 |
} |
3471 |
if$ |
3472 |
%<lab-it> emphasize |
3473 |
%<lab-bf&!lab-it> bolden |
3474 |
%<lab-sc&!lab-it&!lab-bf> scaps |
3475 |
} |
3476 |
|
3477 |
%</har|cay|nat> |
3478 |
% \end{macrocode} |
3479 |
% \end{macro} |
3480 |
% |
3481 |
% \begin{macro}{`output.bibitem'} |
3482 |
%\changes{1.1}{1993 Nov 12}{Test for missing year, set to {\tt????}.} |
3483 |
% The \texttt{output.bibitem} function formats the |\bibitem| entries. |
3484 |
%\changes{1.4(2.2)}{1994 Sep 5}{Move to later location, add |
3485 |
% \texttt{make.full.names} instead of inserting string \texttt{long.label}} |
3486 |
%\changes{1.5(2.3)}{1994 Sep 16}{Add option \texttt{nat} for full author list |
3487 |
% for \texttt{natbib.sty} version~5.3} |
3488 |
% \begin{macrocode} |
3489 |
FUNCTION {output.bibitem} |
3490 |
{ newline$ |
3491 |
%<*ay> |
3492 |
%<!har> "\bibitem[" write$ |
3493 |
%<har> "\harvarditem" write$ |
3494 |
%<nmd> "\protect\citeauthoryear{" write$ |
3495 |
%<ast> "\protect\astroncite{" write$ |
3496 |
%<cay> "\protect\citeauthoryear{" make.full.names * "}{" * write$ |
3497 |
%<cn> "\protect\citename{" write$ |
3498 |
%<!har> label write$ |
3499 |
%<har> make.full.names duplicate$ label = |
3500 |
%<har> 'skip$ |
3501 |
%<har> { "[" label * "]" * write$ } |
3502 |
%<har> if$ |
3503 |
%<har> "{" swap$ * "}{" * write$ |
3504 |
%<har> year duplicate$ empty$ |
3505 |
%<cn> ", }" year duplicate$ empty$ |
3506 |
%<cay|nmd|ast> "}{" year duplicate$ empty$ |
3507 |
%<har|cn|cay|nmd|ast> { pop$ "????" } |
3508 |
%<har|cn|cay|nmd|ast> 'skip$ |
3509 |
%<har|cn|cay|nmd|ast> if$ |
3510 |
%<har> extra.label * "}{" * write$ |
3511 |
%<cn> * extra.label * "]{" * write$ |
3512 |
%<cay|nmd|ast> * extra.label * "}]{" * write$ |
3513 |
%<alk> "]{" write$ |
3514 |
%<!(har|cay|nmd|ast|alk|cn|nat)> ")]{" write$ |
3515 |
%<nat> ")" make.full.names duplicate$ short.list = |
3516 |
%<nat> { pop$ } |
3517 |
%<nat> { * } |
3518 |
%<nat> if$ |
3519 |
%<nat> "]{" * write$ |
3520 |
%</ay> |
3521 |
%<!ay&!(cite|alph)> "\bibitem{" write$ |
3522 |
%<!ay&(cite|alph)> "\bibitem[" label * "]{" * write$ |
3523 |
cite$ write$ |
3524 |
"}" write$ |
3525 |
newline$ |
3526 |
"" |
3527 |
before.all 'output.state := |
3528 |
} |
3529 |
|
3530 |
% \end{macrocode} |
3531 |
% \end{macro} |
3532 |
% |
3533 |
% \begin{macro}{`bracket.number'} |
3534 |
% \changes{3.6}{1995 Nov 23}{Add function to put `number' on pages} |
3535 |
% For the scheme in which the `number' is added to the pages, provide this |
3536 |
% function which is called in \texttt{num.pages}. This adds number at |
3537 |
% the start and after any hyphens. |
3538 |
% \begin{macrocode} |
3539 |
%<*vnum-pg> |
3540 |
FUNCTION {bracket.number} |
3541 |
{ number empty$ |
3542 |
'skip$ |
3543 |
{ "(" number * ")" * * } |
3544 |
if$ |
3545 |
} |
3546 |
|
3547 |
FUNCTION {num.pages} |
3548 |
{ 't := |
3549 |
"0" 's := |
3550 |
"" |
3551 |
bracket.number |
3552 |
{ t empty$ not } |
3553 |
{ t #1 #1 substring$ "-" = |
3554 |
{ "1" 's := } |
3555 |
{ "1" s = |
3556 |
'bracket.number |
3557 |
'skip$ |
3558 |
if$ |
3559 |
"0" 's := |
3560 |
} |
3561 |
if$ |
3562 |
t #1 #1 substring$ * |
3563 |
t #2 global.max$ substring$ 't := |
3564 |
} |
3565 |
while$ |
3566 |
} |
3567 |
|
3568 |
%</vnum-pg> |
3569 |
% \end{macrocode} |
3570 |
% \end{macro} |
3571 |
% \begin{macrocode} |
3572 |
FUNCTION {n.dashify} |
3573 |
{ 't := |
3574 |
"" |
3575 |
{ t empty$ not } |
3576 |
{ t #1 #1 substring$ "-" = |
3577 |
{ t #1 #2 substring$ "--" = not |
3578 |
{ "--" * |
3579 |
t #2 global.max$ substring$ 't := |
3580 |
} |
3581 |
{ { t #1 #1 substring$ "-" = } |
3582 |
{ "-" * |
3583 |
t #2 global.max$ substring$ 't := |
3584 |
} |
3585 |
while$ |
3586 |
} |
3587 |
if$ |
3588 |
} |
3589 |
{ t #1 #1 substring$ * |
3590 |
t #2 global.max$ substring$ 't := |
3591 |
} |
3592 |
if$ |
3593 |
} |
3594 |
while$ |
3595 |
} |
3596 |
|
3597 |
% \end{macrocode} |
3598 |
% |
3599 |
% \begin{macro}{`word.in'} |
3600 |
% \changes{2.0}{1994 Jan 31}{Function \texttt{word.in} constructed out of |
3601 |
% \texttt{bbl.in} or \texttt{bbl.iin}.} |
3602 |
% \changes{3.0}{1995 Feb 16}{Use only \texttt{bbl.in} and capitalize it |
3603 |
% as necessary; remove \texttt{bbl.iin}} |
3604 |
% \changes{3.81}{1996 Jun 19}{Add option \texttt{in-x} to suppress `in'} |
3605 |
% The function \texttt{word.in} prints the word \textsl{in} for references |
3606 |
% that are |
3607 |
% contained in a larger work, or in conference proceedings. One may have a |
3608 |
% colon after the word with the option \texttt{in-col}. If blocks of text are |
3609 |
% to be separated with commas (option \texttt{blk-com}) then the word remains |
3610 |
% in lower case, as it is defined in \texttt{bbl.in}; but if blocks act as |
3611 |
% sentences, then it must be capitalized.^^A by using \texttt{bbl.iin}. |
3612 |
% \begin{macrocode} |
3613 |
FUNCTION {word.in} |
3614 |
%<in-x>{ "" } |
3615 |
%<*!in-x> |
3616 |
%<blk-com|blk-tita>{ bbl.in |
3617 |
%<!blk-com&!blk-tita>{ bbl.in capitalize |
3618 |
%<in-col> ":" * |
3619 |
" " * } |
3620 |
%</!in-x> |
3621 |
|
3622 |
% \end{macrocode} |
3623 |
% \end{macro} |
3624 |
% \begin{macro}{`format.date'} |
3625 |
% \changes{1.4(2.2)}{1994 Sep 6}{Add option \texttt{yr-per} to put period |
3626 |
% before date} |
3627 |
% \changes{1.5(2.3)}{1994 Sep 16}{Add \texttt{harvard} bracket names to year |
3628 |
% with new option \texttt{harnm}} |
3629 |
% \changes{1.6(2.4)}{1995 Feb 2}{Add \texttt{yr-blk} for no punctuation before |
3630 |
% the date} |
3631 |
% \changes{3.2}{1995 May 19}{Add \texttt{dtrev} option for year month} |
3632 |
% \changes{3.2}{1995 May 19}{Add \texttt{mth-bare} for dotless abbreviation |
3633 |
% of months} |
3634 |
% \changes{3.4}{1995 Sep 28}{Add \texttt{volp-dt} for date after volume} |
3635 |
% \changes{3.5}{1995 Oct 9}{Add brace pair after |
3636 |
% \texttt{\char`\\harvardyearright}} |
3637 |
% \changes{3.5}{1995 Oct 16}{Add \texttt{aymth} option for months in dates} |
3638 |
% \changes{3.8}{1996 Mar 19}{Add \texttt{vnum-dt} option} |
3639 |
% \changes{3.81}{1996 Sep 12}{Add \texttt{yr-com} option} |
3640 |
% \changes{3.82}{1996 Dec 12}{Fix bug that left off extra label for plain year} |
3641 |
% The new \texttt{harvard.sty} allows variable brackets around the date |
3642 |
% in the reference list. It uses |\harvardyearleft| and |\harvardyearright| |
3643 |
% in the \texttt{.bst} files. Allow this with the option \texttt{harnm}, |
3644 |
% which could actually be used without the \texttt{har} option. Note that |
3645 |
% this overrides the other year formatting options. |
3646 |
% \begin{macrocode} |
3647 |
%<*ay> |
3648 |
FUNCTION {format.date} |
3649 |
{ year duplicate$ empty$ |
3650 |
{ "empty year in " cite$ * "; set to ????" * warning$ |
3651 |
pop$ "????" } |
3652 |
'skip$ |
3653 |
if$ |
3654 |
%<*aymth> |
3655 |
month empty$ |
3656 |
'skip$ |
3657 |
{ month |
3658 |
%<dtrev> swap$ |
3659 |
" " * swap$ * |
3660 |
} |
3661 |
if$ |
3662 |
%<mth-bare> purify$ |
3663 |
%</aymth> |
3664 |
%<dtbf> bolden |
3665 |
extra.label * |
3666 |
%<*!harnm> |
3667 |
%<*yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per> |
3668 |
%<!volp-dt&!vnum-dt> before.all 'output.state := |
3669 |
%<yr-par> " (" swap$ * ")" * |
3670 |
%<!yr-par&yr-brk> " [" swap$ * "]" * |
3671 |
%<!yr-par&!yr-brk&yr-col> ": " swap$ * |
3672 |
%<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ * |
3673 |
%<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state := |
3674 |
%<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ * |
3675 |
%</yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per> |
3676 |
%</!harnm> |
3677 |
%<harnm> " \harvardyearleft " swap$ * "\harvardyearright{}" * |
3678 |
} |
3679 |
|
3680 |
%</ay> |
3681 |
%<*!ay> |
3682 |
FUNCTION {format.date} |
3683 |
{ year empty$ |
3684 |
{ month empty$ |
3685 |
{ "" } |
3686 |
{ "there's a month but no year in " cite$ * warning$ |
3687 |
month |
3688 |
} |
3689 |
if$ |
3690 |
} |
3691 |
{ month empty$ |
3692 |
'year |
3693 |
%<!dtrev> { month " " * year * } |
3694 |
%<dtrev> { year " " * month * } |
3695 |
if$ |
3696 |
%<mth-bare> purify$ |
3697 |
} |
3698 |
if$ |
3699 |
%<dtbf> bolden |
3700 |
%<*yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk> |
3701 |
duplicate$ empty$ |
3702 |
'skip$ |
3703 |
{ |
3704 |
%<!volp-dt&!vnum-dt> before.all 'output.state := |
3705 |
%<yr-par> " (" swap$ * ")" * |
3706 |
%<!yr-par&yr-brk> " [" swap$ * "]" * |
3707 |
%<!yr-par&!yr-brk&yr-col> ": " swap$ * |
3708 |
%<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ * |
3709 |
%<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state := |
3710 |
%<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ * |
3711 |
} |
3712 |
if$ |
3713 |
%</yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk> |
3714 |
} |
3715 |
|
3716 |
%</!ay> |
3717 |
% \end{macrocode} |
3718 |
% \end{macro} |
3719 |
% \begin{macrocode} |
3720 |
FUNCTION {format.btitle} |
3721 |
%<!btit-rm>{ title emphasize |
3722 |
%<btit-rm>{ title |
3723 |
} |
3724 |
|
3725 |
FUNCTION {tie.or.space.connect} |
3726 |
{ duplicate$ text.length$ #3 < |
3727 |
{ "~" } |
3728 |
{ " " } |
3729 |
if$ |
3730 |
swap$ * * |
3731 |
} |
3732 |
|
3733 |
FUNCTION {either.or.check} |
3734 |
{ empty$ |
3735 |
'pop$ |
3736 |
{ "can't use both " swap$ * " fields in " * cite$ * warning$ } |
3737 |
if$ |
3738 |
} |
3739 |
|
3740 |
FUNCTION {format.bvolume} |
3741 |
{ volume empty$ |
3742 |
{ "" } |
3743 |
{ bbl.volume volume tie.or.space.connect |
3744 |
series empty$ |
3745 |
'skip$ |
3746 |
{ bbl.of space.word * series emphasize * } |
3747 |
if$ |
3748 |
"volume and number" number either.or.check |
3749 |
} |
3750 |
if$ |
3751 |
} |
3752 |
|
3753 |
FUNCTION {format.number.series} |
3754 |
{ volume empty$ |
3755 |
{ number empty$ |
3756 |
{ series field.or.null } |
3757 |
{ output.state mid.sentence = |
3758 |
{ bbl.number } |
3759 |
{ bbl.number capitalize } |
3760 |
if$ |
3761 |
number tie.or.space.connect |
3762 |
series empty$ |
3763 |
{ "there's a number but no series in " cite$ * warning$ } |
3764 |
{ bbl.in space.word * series * } |
3765 |
if$ |
3766 |
} |
3767 |
if$ |
3768 |
} |
3769 |
{ "" } |
3770 |
if$ |
3771 |
} |
3772 |
|
3773 |
% \end{macrocode} |
3774 |
% |
3775 |
% \begin{macro}{`is.num'} |
3776 |
% \changes{2.0}{1994 Jan 31}{Add function to test for digit.} |
3777 |
% This function takes the single-character string on the stack and returns |
3778 |
% 1 if it is a digit, else 0. |
3779 |
% \begin{macrocode} |
3780 |
FUNCTION {is.num} |
3781 |
{ chr.to.int$ |
3782 |
duplicate$ "0" chr.to.int$ < not |
3783 |
swap$ "9" chr.to.int$ > not and |
3784 |
} |
3785 |
|
3786 |
% \end{macrocode} |
3787 |
% \end{macro} |
3788 |
% |
3789 |
% \begin{macro}{`extract.num'} |
3790 |
% \changes{2.0}{1994 Jan 31}{Add function to extract leading number from |
3791 |
% a literal string.} |
3792 |
% This function tests the string on the stack to see if it begins with a |
3793 |
% number. If so, that number is left on the stack; if the string contains |
3794 |
% no numbers at the start, it is left unchanged. The idea is to convert |
3795 |
% \textsl{1st} to \textsl{1} and leave \textsl{first} as is. |
3796 |
% This is used by {\tt convert.edition}. |
3797 |
% \begin{macrocode} |
3798 |
FUNCTION {extract.num} |
3799 |
{ duplicate$ 't := |
3800 |
"" 's := |
3801 |
{ t empty$ not } |
3802 |
{ t #1 #1 substring$ |
3803 |
t #2 global.max$ substring$ 't := |
3804 |
duplicate$ is.num |
3805 |
{ s swap$ * 's := } |
3806 |
{ pop$ "" 't := } |
3807 |
if$ |
3808 |
} |
3809 |
while$ |
3810 |
s empty$ |
3811 |
'skip$ |
3812 |
{ pop$ s } |
3813 |
if$ |
3814 |
} |
3815 |
|
3816 |
% \end{macrocode} |
3817 |
% \end{macro} |
3818 |
% |
3819 |
% \begin{macro}{`convert.edition'} |
3820 |
% \changes{2.0}{1994 Jan 31}{Add function to convert \texttt{edition} entry |
3821 |
% text from word to a function} |
3822 |
% The function \texttt{convert.edition} takes the text in the field |
3823 |
% \texttt{edition} and changes it to the language-specific equivalent. As |
3824 |
% originally planned for \btx, this field should contain the words |
3825 |
% \textsl{First}, \textsl{Second}, etc. Being so explicit, |
3826 |
% it is not so easy to translate, nor to |
3827 |
% convert to \textsl{1st}, \textsl{2nd}, etc., if one wanted. |
3828 |
% This function carries out the translation, by changing |
3829 |
% \textsl{first} or \textsl{1} to \texttt{bbl.first}, and so |
3830 |
% on. The field is reduced to lower case to make it case insensitive. If no |
3831 |
% translation is found, then the original text in \texttt{edition} is used |
3832 |
% instead, as it stands. However, if the original is a number greater than |
3833 |
% the maximum for which text is provided, then \texttt{bbl.th} is added to |
3834 |
% it. |
3835 |
% \begin{macrocode} |
3836 |
FUNCTION {convert.edition} |
3837 |
{ edition extract.num "l" change.case$ 's := |
3838 |
s "first" = s "1" = or |
3839 |
{ bbl.first 't := } |
3840 |
{ s "second" = s "2" = or |
3841 |
{ bbl.second 't := } |
3842 |
{ s "third" = s "3" = or |
3843 |
{ bbl.third 't := } |
3844 |
{ s "fourth" = s "4" = or |
3845 |
{ bbl.fourth 't := } |
3846 |
{ s "fifth" = s "5" = or |
3847 |
{ bbl.fifth 't := } |
3848 |
{ s #1 #1 substring$ is.num |
3849 |
%<!english&exlang> { s bbl.th * 't := } |
3850 |
%<english|!exlang> { s eng.ord 't := } |
3851 |
{ edition 't := } |
3852 |
if$ |
3853 |
} |
3854 |
if$ |
3855 |
} |
3856 |
if$ |
3857 |
} |
3858 |
if$ |
3859 |
} |
3860 |
if$ |
3861 |
} |
3862 |
if$ |
3863 |
t |
3864 |
} |
3865 |
|
3866 |
% \end{macrocode} |
3867 |
% \end{macro} |
3868 |
% |
3869 |
% \begin{macro}{`format.edition'} |
3870 |
% \changes{2.0}{1994 Jan 31}{Add call to \texttt{convert.edition}} |
3871 |
% This function formats the text for the edition specification, such as |
3872 |
% ``Second edition''. It combines the edition number with the word |
3873 |
% \textsl{edition}. |
3874 |
% \begin{macrocode} |
3875 |
FUNCTION {format.edition} |
3876 |
{ edition empty$ |
3877 |
{ "" } |
3878 |
{ output.state mid.sentence = |
3879 |
{ convert.edition "l" change.case$ " " * bbl.edition * } |
3880 |
{ convert.edition "t" change.case$ " " * bbl.edition * } |
3881 |
if$ |
3882 |
} |
3883 |
if$ |
3884 |
} |
3885 |
|
3886 |
% \end{macrocode} |
3887 |
% \end{macro} |
3888 |
% \begin{macrocode} |
3889 |
INTEGERS { multiresult } |
3890 |
|
3891 |
FUNCTION {multi.page.check} |
3892 |
{ 't := |
3893 |
#0 'multiresult := |
3894 |
{ multiresult not |
3895 |
t empty$ not |
3896 |
and |
3897 |
} |
3898 |
{ t #1 #1 substring$ |
3899 |
duplicate$ "-" = |
3900 |
swap$ duplicate$ "," = |
3901 |
swap$ "+" = |
3902 |
or or |
3903 |
{ #1 'multiresult := } |
3904 |
{ t #2 global.max$ substring$ 't := } |
3905 |
if$ |
3906 |
} |
3907 |
while$ |
3908 |
multiresult |
3909 |
} |
3910 |
|
3911 |
% \end{macrocode} |
3912 |
% \begin{macro}{`format.pages'} |
3913 |
% \changes{3.6}{1995 Nov 24}{Add option \texttt{bkpg-par}} |
3914 |
% \begin{macrocode} |
3915 |
FUNCTION {format.pages} |
3916 |
{ pages empty$ |
3917 |
{ "" } |
3918 |
{ pages multi.page.check |
3919 |
%<*!bkpg-par> |
3920 |
{ bbl.pages pages n.dashify tie.or.space.connect } |
3921 |
{ bbl.page pages tie.or.space.connect } |
3922 |
%</!bkpg-par> |
3923 |
%<*bkpg-par> |
3924 |
{ "(" bbl.pages pages n.dashify tie.or.space.connect ")" * * } |
3925 |
{ "(" bbl.page pages tie.or.space.connect ")" * * } |
3926 |
%</bkpg-par> |
3927 |
if$ |
3928 |
} |
3929 |
if$ |
3930 |
} |
3931 |
|
3932 |
% \end{macrocode} |
3933 |
% \end{macro} |
3934 |
% \begin{macrocode} |
3935 |
%<*jpg-1> |
3936 |
FUNCTION {first.page} |
3937 |
{ 't := |
3938 |
"" |
3939 |
{ t empty$ not t #1 #1 substring$ "-" = not and } |
3940 |
{ t #1 #1 substring$ * |
3941 |
t #2 global.max$ substring$ 't := |
3942 |
} |
3943 |
while$ |
3944 |
} |
3945 |
|
3946 |
%</jpg-1> |
3947 |
% \end{macrocode} |
3948 |
% |
3949 |
% \begin{macro}{`format.journal.pages'} |
3950 |
% \changes{3.82}{1996 Nov 15}{Remove from \texttt{format.vol.num.pages} to |
3951 |
% be a separate function} |
3952 |
% \begin{macrocode} |
3953 |
FUNCTION {format.journal.pages} |
3954 |
{ |
3955 |
pages empty$ |
3956 |
'skip$ |
3957 |
{ duplicate$ empty$ |
3958 |
{ pop$ format.pages } |
3959 |
%<*!jpg-1> |
3960 |
%<volp-dt&!vnum-pg&!jwdpg> { " " * pages n.dashify * } |
3961 |
%<volp-dt&vnum-pg> { " " * pages num.pages n.dashify * } |
3962 |
%<volp-dt&!vnum-pg&jwdpg> { " " * bbl.pages "~" * * pages n.dashify * } |
3963 |
%<*!volp-dt> |
3964 |
%<volp-sp&!vnum-pg&!jwdpg> { ": " * pages n.dashify * } |
3965 |
%<volp-sp&vnum-pg> { ": " * pages num.pages n.dashify * } |
3966 |
%<volp-sp&!vnum-pg&jwdpg> { ": " * bbl.pages "~" * * pages n.dashify * } |
3967 |
%<*!volp-sp> |
3968 |
%<volp-blk&!vnum-pg&!jwdpg> { " " * pages n.dashify * } |
3969 |
%<volp-blk&vnum-pg> { " " * pages num.pages n.dashify * } |
3970 |
%<volp-blk&!vnum-pg&jwdpg> { " " * bbl.pages "~" * * pages n.dashify * } |
3971 |
%<*!volp-blk> |
3972 |
%<volp-com&!vnum-pg&!jwdpg> { ", " * pages n.dashify * } |
3973 |
%<volp-com&vnum-pg> { ", " * pages num.pages n.dashify * } |
3974 |
%<volp-com&!vnum-pg&jwdpg> { ", " * bbl.pages "~" * * pages n.dashify * } |
3975 |
%<*!volp-com> |
3976 |
%<volp-semi&!vnum-pg&!jwdpg> { "; " * pages n.dashify * } |
3977 |
%<volp-semi&vnum-pg> { "; " * pages num.pages n.dashify * } |
3978 |
%<volp-semi&!vnum-pg&jwdpg> { "; " * bbl.pages "~" * * pages n.dashify * } |
3979 |
%<*!volp-semi> |
3980 |
%<!vnum-pg&!jwdpg> { ":" * pages n.dashify * } |
3981 |
%<vnum-pg> { ":" * pages num.pages n.dashify * } |
3982 |
%<!vnum-pg&jwdpg> { ":" * bbl.pages "~" * * pages n.dashify * } |
3983 |
%</!volp-semi> |
3984 |
%</!volp-com> |
3985 |
%</!volp-blk> |
3986 |
%</!volp-sp> |
3987 |
%</!volp-dt> |
3988 |
%</!jpg-1> |
3989 |
%<*jpg-1> |
3990 |
%<volp-dt&!vnum-pg&!jwdpg> { " " * pages first.page * } |
3991 |
%<volp-dt&vnum-pg> { " " * pages first.page num.pages * } |
3992 |
%<volp-dt&!vnum-pg&jwdpg> { " " * bbl.page "~" * * pages first.page * } |
3993 |
%<*!volp-dt> |
3994 |
%<volp-sp&!vnum-pg&!jwdpg> { ": " * pages first.page * } |
3995 |
%<volp-sp&vnum-pg> { ": " * pages first.page num.pages * } |
3996 |
%<volp-sp&!vnum-pg&jwdpg> { ": " * bbl.page "~" * * pages first.page * } |
3997 |
%<*!volp-sp> |
3998 |
%<volp-blk&!vnum-pg&!jwdpg> { " " * pages first.page * } |
3999 |
%<volp-blk&vnum-pg> { " " * pages first.page num.pages * } |
4000 |
%<volp-blk&!vnum-pg&jwdpg> { " " * bbl.page "~" * * pages first.page * } |
4001 |
%<*!volp-blk> |
4002 |
%<volp-com&!vnum-pg&!jwdpg> { ", " * pages first.page * } |
4003 |
%<volp-com&vnum-pg> { ", " * pages first.page num.pages * } |
4004 |
%<volp-com&!vnum-pg&jwdpg> { ", " * bbl.page "~" * * pages first.page * } |
4005 |
%<*!volp-com> |
4006 |
%<volp-semi&!vnum-pg&!jwdpg> { "; " * pages first.page * } |
4007 |
%<volp-semi&vnum-pg> { "; " * pages first.page num.pages * } |
4008 |
%<volp-semi&!vnum-pg&jwdpg> { "; " * bbl.page "~" * * pages first.page * } |
4009 |
%<*!volp-semi> |
4010 |
%<!vnum-pg&!jwdpg> { ":" * pages first.page * } |
4011 |
%<vnum-pg> { ":" * pages first.page num.pages * } |
4012 |
%<!vnum-pg&jwdpg> { ":" * bbl.page "~" * * pages first.page * } |
4013 |
%</!volp-semi> |
4014 |
%</!volp-com> |
4015 |
%</!volp-blk> |
4016 |
%</!volp-sp> |
4017 |
%</!volp-dt> |
4018 |
%</jpg-1> |
4019 |
if$ |
4020 |
} |
4021 |
if$ |
4022 |
} |
4023 |
|
4024 |
% \end{macrocode} |
4025 |
% \end{macro} |
4026 |
% \begin{macro}{`format.vol.num.pages'} |
4027 |
% \changes{1.4(2.2)}{1994 Sep 6}{Add option \texttt{volp-sp} to put space |
4028 |
% after colon in vol:~page.} |
4029 |
% \changes{1.5(2.3)c}{1995 Jan 20}{Add options \texttt{vnum-h}, |
4030 |
% \texttt{vnum-nr} and \texttt{vnum-x} for various formats of |
4031 |
% journal vol number} |
4032 |
% \changes{1.7(2.5)}{1995 Feb 9}{Add options \texttt{vnum-sp} and |
4033 |
% \texttt{vnum-cm}} |
4034 |
% \changes{3.0}{1995 Mar 17}{Add option \texttt{volp-semi}} |
4035 |
% \changes{3.4}{1995 Sep 28}{Put \texttt{bolden} in right place for |
4036 |
% \texttt{vol-2bf} option} |
4037 |
% \changes{3.8}{1996 Mar 19}{Put date between volume and number} |
4038 |
% \changes{3.8}{1996 Mar 19}{Add possibilitity of `page' word} |
4039 |
% \changes{3.81}{1996 Jun 19}{Activate \texttt{jwdpg} option properly} |
4040 |
% \changes{3.81}{1996 Jun 19}{Add possibilitity of `volume' word} |
4041 |
% \changes{3.82}{1996 Nov 15}{Add option \texttt{pp-last}} |
4042 |
% The option \texttt{vnum-dt} is most unpleasing. There should be more choice |
4043 |
% about how the number is formatted. It should be a separate option from |
4044 |
% the \texttt{vnum-} series, but it was a special wish. Option \texttt{jwdpg} |
4045 |
% is also part of this special wish. (Was not properly programmed until 3.81). |
4046 |
% |
4047 |
% The option \texttt{pp-last} is similar to \texttt{vnum-dt}, and might |
4048 |
% actually be able to replace it if used correctly with other options. But |
4049 |
% that is speculation on my part. What it does is to suppress the pages |
4050 |
% in the formatting macros, and sees to it that the pages are added just |
4051 |
% before any notes in those entries that take pages. This applies to more than |
4052 |
% just \texttt{article}, but to \texttt{inbook}, \texttt{incollection} as well. |
4053 |
% \begin{macrocode} |
4054 |
FUNCTION {format.vol.num.pages} |
4055 |
{ volume field.or.null |
4056 |
%<*jwdvol> |
4057 |
volume empty$ |
4058 |
'skip$ |
4059 |
{ bbl.volume "~" * swap$ * } |
4060 |
if$ |
4061 |
%</jwdvol> |
4062 |
%<vol-bf&!vol-2bf> bolden |
4063 |
%<!vol-bf&!vol-2bf&vol-it> emphasize |
4064 |
%<vnum-dt> format.date * |
4065 |
%<*!vnum-x&!vnum-pg> |
4066 |
number empty$ |
4067 |
'skip$ |
4068 |
{ |
4069 |
%<vnum-sp> "~(" number * ")" * * |
4070 |
%<!vnum-sp&vnum-cm> ", " number * * |
4071 |
%<!vnum-sp&!vnum-cm&vnum-nr> ", " bbl.nr * number tie.or.space.connect * |
4072 |
%<!vnum-sp&!vnum-cm&!vnum-nr&vnum-h> ", \#" number * * |
4073 |
%<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&vnum-dt> " " number * * |
4074 |
%<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&!vnum-dt> "(" number * ")" * * |
4075 |
volume empty$ |
4076 |
{ "there's a number but no volume in " cite$ * warning$ } |
4077 |
'skip$ |
4078 |
if$ |
4079 |
} |
4080 |
if$ |
4081 |
%</!vnum-x&!vnum-pg> |
4082 |
%<!vol-bf&vol-2bf> bolden |
4083 |
%<volp-dt> format.date * |
4084 |
%<!pp-last> format.journal.pages |
4085 |
} |
4086 |
|
4087 |
% \end{macrocode} |
4088 |
% \end{macro} |
4089 |
% \begin{macrocode} |
4090 |
FUNCTION {format.chapter.pages} |
4091 |
{ chapter empty$ |
4092 |
%<!pp-last> 'format.pages |
4093 |
%<pp-last> { "" } |
4094 |
{ type empty$ |
4095 |
{ bbl.chapter } |
4096 |
{ type "l" change.case$ } |
4097 |
if$ |
4098 |
chapter tie.or.space.connect |
4099 |
%<*!pp-last> |
4100 |
pages empty$ |
4101 |
'skip$ |
4102 |
{ ", " * format.pages * } |
4103 |
if$ |
4104 |
%</!pp-last> |
4105 |
} |
4106 |
if$ |
4107 |
} |
4108 |
|
4109 |
% \end{macrocode} |
4110 |
% \begin{macro}{`format.in.ed.booktitle'} |
4111 |
% \changes{1.5(2.3)b}{1995 Jan 18}{Add option \texttt{edby-par} to put editors |
4112 |
% in parentheses} |
4113 |
% \changes{1.6(2.4)}{1995 Feb 2}{If \texttt{ed} and \texttt{edby} given |
4114 |
% together, abbreviate `edited by' to `ed(s).'} |
4115 |
% \changes{3.1}{1995 May 2}{Add option \texttt{edbyx} to replace `edited by' |
4116 |
% by `ed(s).'} |
4117 |
% \changes{3.81}{1996 Jun 26}{Add option \texttt{edcap}} |
4118 |
% Prior to version 3.81, the \textsl{Editor} or \textsl{Edited by} in |
4119 |
% parentheses was meant to be capitalized, but this did not work properly. |
4120 |
% Now the option \texttt{edcap} produces this, and default is not capitalized. |
4121 |
% \begin{macrocode} |
4122 |
FUNCTION {format.in.ed.booktitle} |
4123 |
{ booktitle empty$ |
4124 |
{ "" } |
4125 |
{ editor empty$ |
4126 |
{ word.in booktitle emphasize * } |
4127 |
%<!edby&!edby-par> { word.in format.in.editors * ", " * |
4128 |
%<!edby&!edby-par> booktitle emphasize * } |
4129 |
%<*edby|edby-par> |
4130 |
{ word.in booktitle emphasize * |
4131 |
%<edby> ", " * |
4132 |
%<edby-par> " (" * |
4133 |
%<!edbyx&!edbyy> bbl.edby |
4134 |
%<*edbyx> |
4135 |
editor num.names$ #1 > |
4136 |
{ bbl.editors } |
4137 |
{ bbl.editor } |
4138 |
if$ |
4139 |
%</edbyx> |
4140 |
%<edby-par&edcap> capitalize |
4141 |
%<edbyx|!edbyy> * |
4142 |
" " * |
4143 |
format.in.editors * |
4144 |
%<*edbyy> |
4145 |
", " * |
4146 |
editor num.names$ #1 > |
4147 |
{ bbl.editors } |
4148 |
{ bbl.editor } |
4149 |
if$ |
4150 |
* |
4151 |
%</edbyy> |
4152 |
%<edby-par> ")" * |
4153 |
} |
4154 |
%</edby|edby-par> |
4155 |
if$ |
4156 |
} |
4157 |
if$ |
4158 |
} |
4159 |
|
4160 |
% \end{macrocode} |
4161 |
% \end{macro} |
4162 |
% \begin{macrocode} |
4163 |
%<*!ay> |
4164 |
FUNCTION {empty.misc.check} |
4165 |
{ author empty$ title empty$ howpublished empty$ |
4166 |
month empty$ year empty$ note empty$ |
4167 |
and and and and and |
4168 |
%<!seq-no|alph> key empty$ not and |
4169 |
{ "all relevant fields are empty in " cite$ * warning$ } |
4170 |
'skip$ |
4171 |
if$ |
4172 |
} |
4173 |
|
4174 |
%</!ay> |
4175 |
FUNCTION {format.thesis.type} |
4176 |
{ type empty$ |
4177 |
'skip$ |
4178 |
{ pop$ |
4179 |
type "t" change.case$ |
4180 |
} |
4181 |
if$ |
4182 |
} |
4183 |
|
4184 |
FUNCTION {format.tr.number} |
4185 |
{ type empty$ |
4186 |
{ bbl.techrep } |
4187 |
'type |
4188 |
if$ |
4189 |
number empty$ |
4190 |
{ "t" change.case$ } |
4191 |
{ number tie.or.space.connect } |
4192 |
if$ |
4193 |
} |
4194 |
|
4195 |
% \end{macrocode} |
4196 |
% |
4197 |
% \begin{macro}{`format.article.crossref'} |
4198 |
%\changes{1.3(2.1)}{1994 Jul 1}{Emphasize \texttt{journal} with |
4199 |
% \texttt{emphasize}, not explicitly} |
4200 |
% The \texttt{journal} field was emphasized emplicitly, but it should be |
4201 |
% done by command. |
4202 |
% \begin{macrocode} |
4203 |
FUNCTION {format.article.crossref} |
4204 |
{ |
4205 |
%<*!ay> |
4206 |
key empty$ |
4207 |
{ journal empty$ |
4208 |
{ "need key or journal for " cite$ * " to crossref " * crossref * |
4209 |
warning$ |
4210 |
"" |
4211 |
} |
4212 |
{ word.in journal emphasize * } |
4213 |
if$ |
4214 |
} |
4215 |
{ word.in key * " " *} |
4216 |
if$ |
4217 |
%</!ay> |
4218 |
%<ay> word.in |
4219 |
" \cite{" * crossref * "}" * |
4220 |
} |
4221 |
|
4222 |
% \end{macrocode} |
4223 |
% \end{macro} |
4224 |
% \begin{macrocode} |
4225 |
%<*!ay> |
4226 |
FUNCTION {format.crossref.editor} |
4227 |
{ editor #1 "{vv~}{ll}" format.name$ |
4228 |
editor num.names$ duplicate$ |
4229 |
#2 > |
4230 |
%<!etal-it&!etal-rm> { pop$ " et~al." * } |
4231 |
%<!etal-it&etal-rm> { pop$ " " * "et~al." roman.list * } |
4232 |
%<etal-it> { pop$ " " * "et~al." emphasize * } |
4233 |
{ #2 < |
4234 |
'skip$ |
4235 |
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = |
4236 |
%<!etal-it&!etal-rm> { " et~al." * } |
4237 |
%<!etal-it&etal-rm> { " " * "et~al." roman.list * } |
4238 |
%<etal-it> { " " * "et~al." emphasize * } |
4239 |
%<*!harnm> |
4240 |
%<!amper> { bbl.and space.word * editor #2 "{vv~}{ll}" format.name$ * } |
4241 |
%<amper> { " \& " * editor #2 "{vv~}{ll}" format.name$ * } |
4242 |
%</!harnm> |
4243 |
%<harnm> { " \harvardand\ " * editor #2 "{vv~}{ll}" format.name$ * } |
4244 |
if$ |
4245 |
} |
4246 |
if$ |
4247 |
} |
4248 |
if$ |
4249 |
} |
4250 |
|
4251 |
%</!ay> |
4252 |
% \end{macrocode} |
4253 |
% |
4254 |
% \begin{macro}{`format.book.crossref'} |
4255 |
%\changes{1.3(2.1)}{1994 Jul 1}{Emphasize \texttt{series} with |
4256 |
% \texttt{emphasize}, not explicitly} |
4257 |
% The \texttt{series} field was emphasized emplicitly, but it should be |
4258 |
% done by command. |
4259 |
% \begin{macrocode} |
4260 |
FUNCTION {format.book.crossref} |
4261 |
{ volume empty$ |
4262 |
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$ |
4263 |
word.in |
4264 |
} |
4265 |
%<(blk-com|blk-tita)> { bbl.volume volume tie.or.space.connect |
4266 |
%<!(blk-com|blk-tita)> { bbl.volume capitalize |
4267 |
%<!(blk-com|blk-tita)> volume tie.or.space.connect |
4268 |
bbl.of space.word * |
4269 |
} |
4270 |
if$ |
4271 |
%<*!ay> |
4272 |
editor empty$ |
4273 |
editor field.or.null author field.or.null = |
4274 |
or |
4275 |
{ key empty$ |
4276 |
{ series empty$ |
4277 |
{ "need editor, key, or series for " cite$ * " to crossref " * |
4278 |
crossref * warning$ |
4279 |
"" * |
4280 |
} |
4281 |
{ series emphasize * } |
4282 |
if$ |
4283 |
} |
4284 |
{ key * } |
4285 |
if$ |
4286 |
} |
4287 |
{ format.crossref.editor * } |
4288 |
if$ |
4289 |
%</!ay> |
4290 |
" \cite{" * crossref * "}" * |
4291 |
} |
4292 |
|
4293 |
% \end{macrocode} |
4294 |
% \end{macro} |
4295 |
% |
4296 |
% \begin{macro}{`format.incoll.inproc.crossref'} |
4297 |
%\changes{1.3(2.1)}{1994 Jul 1}{Emphasize \texttt{booktitle} with |
4298 |
% \texttt{emphasize}, not explicitly} |
4299 |
% The \texttt{booktitle} field was emphasized emplicitly, but it should be |
4300 |
% done by command. |
4301 |
% \begin{macrocode} |
4302 |
FUNCTION {format.incoll.inproc.crossref} |
4303 |
{ |
4304 |
%<*!ay> |
4305 |
editor empty$ |
4306 |
editor field.or.null author field.or.null = |
4307 |
or |
4308 |
{ key empty$ |
4309 |
{ booktitle empty$ |
4310 |
{ "need editor, key, or booktitle for " cite$ * " to crossref " * |
4311 |
crossref * warning$ |
4312 |
"" |
4313 |
} |
4314 |
{ word.in booktitle emphasize * } |
4315 |
if$ |
4316 |
} |
4317 |
{ word.in key * " " *} |
4318 |
if$ |
4319 |
} |
4320 |
{ word.in format.crossref.editor * " " *} |
4321 |
if$ |
4322 |
%</!ay> |
4323 |
%<ay> word.in |
4324 |
" \cite{" * crossref * "}" * |
4325 |
} |
4326 |
|
4327 |
% \end{macrocode} |
4328 |
% \end{macro} |
4329 |
% |
4330 |
% \begin{macro}{`format.publisher'} |
4331 |
% \changes{3.3}{1995 Aug 7}{Add option \texttt{add-pub} which makes use |
4332 |
% of this function} |
4333 |
% \changes{3.8}{1996 Mar 12}{Add option \texttt{pub-par} to put publisher |
4334 |
% in parentheses} |
4335 |
% \changes{3.81}{1996 Sep 16}{Add option \texttt{pub-date} to put publisher |
4336 |
% and date in parentheses together} |
4337 |
% \changes{3.82}{1996 Dec 16}{Add \texttt{add.blank} for \texttt{pub-par}} |
4338 |
% Psychology journals often want \textit{address}: \textit{publisher}. |
4339 |
% |
4340 |
% \textsl{Nature} wants publisher and date in parentheses, and when both |
4341 |
% are there, they are merged into one set. |
4342 |
% Call function \texttt{add.blank} before parentheses so suppress preceding |
4343 |
% punctuation, which looks strange when publisher in parentheses. |
4344 |
% \begin{macrocode} |
4345 |
FUNCTION {format.publisher} |
4346 |
{ publisher empty$ |
4347 |
{ "empty publisher in " cite$ * warning$ } |
4348 |
'skip$ |
4349 |
if$ |
4350 |
"" |
4351 |
%<*pub-date&!ay> |
4352 |
year empty$ |
4353 |
{ "empty year in " cite$ * warning$ } |
4354 |
'skip$ |
4355 |
if$ |
4356 |
%</pub-date&!ay> |
4357 |
%<*!(pub-date&ay)> |
4358 |
address empty$ publisher empty$ and |
4359 |
%<pub-date> year empty$ and |
4360 |
'skip$ |
4361 |
{ |
4362 |
%</!(pub-date&ay)> |
4363 |
%<pub-par|pub-date> add.blank "(" * |
4364 |
%<*add-pub> |
4365 |
address empty$ |
4366 |
'skip$ |
4367 |
{ address * } |
4368 |
if$ |
4369 |
publisher empty$ |
4370 |
'skip$ |
4371 |
%</add-pub> |
4372 |
%<*!add-pub> |
4373 |
publisher empty$ |
4374 |
{ address empty$ |
4375 |
'skip$ |
4376 |
{ address * } |
4377 |
if$ |
4378 |
} |
4379 |
{ publisher * |
4380 |
address empty$ |
4381 |
'skip$ |
4382 |
{ ", " * address * } |
4383 |
if$ |
4384 |
} |
4385 |
%</!add-pub> |
4386 |
%<*add-pub> |
4387 |
{ address empty$ |
4388 |
'skip$ |
4389 |
{ ": " * } |
4390 |
if$ |
4391 |
publisher * |
4392 |
} |
4393 |
%</add-pub> |
4394 |
if$ |
4395 |
%<*pub-date&!ay> |
4396 |
year empty$ |
4397 |
'skip$ |
4398 |
{ publisher empty$ address empty$ and |
4399 |
'skip$ |
4400 |
{ ", " * } |
4401 |
if$ |
4402 |
year * |
4403 |
} |
4404 |
if$ |
4405 |
%</pub-date&!ay> |
4406 |
%<*pub-date&ay> |
4407 |
year duplicate$ empty$ |
4408 |
{ "empty year in " cite$ * "; set to ????" * warning$ |
4409 |
pop$ "????" } |
4410 |
'skip$ |
4411 |
if$ |
4412 |
publisher empty$ address empty$ and |
4413 |
{ * } |
4414 |
{ ", " swap$ * * } |
4415 |
if$ |
4416 |
%</pub-date&ay> |
4417 |
%<pub-par|pub-date> ")" * |
4418 |
%<*!(pub-date&ay)> |
4419 |
} |
4420 |
if$ |
4421 |
%</!(pub-date&ay)> |
4422 |
output |
4423 |
} |
4424 |
|
4425 |
% \end{macrocode} |
4426 |
% \end{macro} |
4427 |
% \changes{1.5(2.3)b}{1995 Jan 18}{Add option \texttt{yrp-x} to suppress |
4428 |
% punctuation following date at beginning} |
4429 |
% \changes{3.0}{1995 Mar 8}{Add option \texttt{yrp-col} to add colon after |
4430 |
% date at beginning} |
4431 |
% \changes{3.0}{1995 Mar 20}{Add option \texttt{jxper} to remove periods |
4432 |
% from journal name} |
4433 |
% \changes{3.2}{1995 May 19}{Add option \texttt{dt-jnl} to make date part of |
4434 |
% the journal specification, follows journal name.} |
4435 |
% \changes{3.4}{1995 Sep 28}{Add option \texttt{au-col}} |
4436 |
% \changes{3.6}{1995 Nov 23}{Add option \texttt{jttl-rm}} |
4437 |
% \changes{3.7}{1996 Feb 5}{Put \texttt{purify\$} before \texttt{emphasize}} |
4438 |
% \changes{3.81}{1996 Jun 26}{Add option \texttt{blk-tita} for article only} |
4439 |
% \begin{macrocode} |
4440 |
FUNCTION {article} |
4441 |
{ output.bibitem |
4442 |
format.authors "author" output.check |
4443 |
%<ay> author format.key output |
4444 |
%<au-col> author add.colon |
4445 |
%<dt-beg> format.date "year" output.check |
4446 |
%<dt-beg> date.block |
4447 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4448 |
%<*!jtit-x> |
4449 |
format.title "title" output.check |
4450 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4451 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4452 |
%<blk-tit|blk-tita> new.sentence |
4453 |
%</!jtit-x> |
4454 |
crossref missing$ |
4455 |
{ journal |
4456 |
%<jxper> purify$ |
4457 |
%<!jttl-rm> emphasize |
4458 |
"journal" output.check |
4459 |
%<jnm-x> add.blank |
4460 |
%<*!dt-beg&!dt-end&dt-jnl&!volp-dt&!vnum-dt> |
4461 |
format.date "year" output.check |
4462 |
date.block |
4463 |
%</!dt-beg&!dt-end&dt-jnl&!volp-dt&!vnum-dt> |
4464 |
format.vol.num.pages output |
4465 |
%<!dt-beg&!dt-end&!dt-jnl&!volp-dt&!vnum-dt> format.date "year" output.check |
4466 |
} |
4467 |
{ format.article.crossref output.nonnull |
4468 |
format.pages output |
4469 |
} |
4470 |
if$ |
4471 |
%<pp-last> format.journal.pages |
4472 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4473 |
note output |
4474 |
%<*!dt-beg&dt-end> |
4475 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4476 |
format.date "year" output.check |
4477 |
%</!dt-beg&dt-end> |
4478 |
fin.entry |
4479 |
%<harnm> write.url |
4480 |
} |
4481 |
|
4482 |
% \end{macrocode} |
4483 |
%\changes{2.0a}{1994 Aug 30}{Fix up \texttt{new.sentence} so not added with |
4484 |
% \texttt{blk-com}} |
4485 |
% \begin{macrocode} |
4486 |
FUNCTION {book} |
4487 |
{ output.bibitem |
4488 |
author empty$ |
4489 |
{ format.editors "author and editor" output.check |
4490 |
%<ay> editor format.key output |
4491 |
%<au-col> editor add.colon |
4492 |
} |
4493 |
{ format.authors output.nonnull |
4494 |
%<au-col> author add.colon |
4495 |
crossref missing$ |
4496 |
{ "author and editor" editor either.or.check } |
4497 |
'skip$ |
4498 |
if$ |
4499 |
} |
4500 |
if$ |
4501 |
%<dt-beg&!pub-date> format.date "year" output.check |
4502 |
%<dt-beg&!pub-date> date.block |
4503 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4504 |
format.btitle "title" output.check |
4505 |
crossref missing$ |
4506 |
{ format.bvolume output |
4507 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4508 |
%<blk-tit> new.sentence |
4509 |
format.number.series output |
4510 |
%<pre-edn> format.edition output |
4511 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
4512 |
format.publisher |
4513 |
} |
4514 |
{ |
4515 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4516 |
%<blk-tit> new.sentence |
4517 |
format.book.crossref output.nonnull |
4518 |
%<!dt-beg&!dt-end&pub-date> format.date "year" output.check |
4519 |
} |
4520 |
if$ |
4521 |
%<!pre-edn> format.edition output |
4522 |
%<!dt-beg&!dt-end&!pub-date> format.date "year" output.check |
4523 |
%<isbn> format.isbn output |
4524 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4525 |
note output |
4526 |
%<*!dt-beg&dt-end&!pub-date> |
4527 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4528 |
format.date "year" output.check |
4529 |
%</!dt-beg&dt-end&!pub-date> |
4530 |
fin.entry |
4531 |
%<harnm> write.url |
4532 |
} |
4533 |
|
4534 |
FUNCTION {booklet} |
4535 |
{ output.bibitem |
4536 |
format.authors output |
4537 |
%<ay> author format.key output |
4538 |
%<au-col> author add.colon |
4539 |
%<ay&dt-beg> format.date "year" output.check |
4540 |
%<!ay&dt-beg> format.date output |
4541 |
%<dt-beg> date.block |
4542 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4543 |
format.title "title" output.check |
4544 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4545 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4546 |
%<blk-tit> new.sentence |
4547 |
howpublished output |
4548 |
address output |
4549 |
%<ay&!dt-beg&!dt-end> format.date "year" output.check |
4550 |
%<!ay&!dt-beg&!dt-end> format.date output |
4551 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4552 |
note output |
4553 |
%<*ay&!dt-beg&dt-end> |
4554 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4555 |
format.date "year" output.check |
4556 |
%</ay&!dt-beg&dt-end> |
4557 |
%<*!ay&!dt-beg&dt-end> |
4558 |
%<isbn> format.isbn output |
4559 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4560 |
format.date output |
4561 |
%</!ay&!dt-beg&dt-end> |
4562 |
fin.entry |
4563 |
%<harnm> write.url |
4564 |
} |
4565 |
|
4566 |
% \end{macrocode} |
4567 |
% The medical journals, with option \texttt{dt-jnl}, have the date as part of |
4568 |
% the journal specification. For chapters in books, they want date and pages |
4569 |
% to appear at the end, with a space between them. (For journals, there is to be |
4570 |
% no space.) Suppress the chapter specification (for now). |
4571 |
% |
4572 |
% The \texttt{dt-jnl} option usually behaves as the default, except for some |
4573 |
% special entries, like this one. |
4574 |
% \begin{macrocode} |
4575 |
FUNCTION {inbook} |
4576 |
{ output.bibitem |
4577 |
author empty$ |
4578 |
{ format.editors "author and editor" output.check |
4579 |
%<ay> editor format.key output |
4580 |
%<au-col> editor add.colon |
4581 |
} |
4582 |
{ format.authors output.nonnull |
4583 |
%<au-col> author add.colon |
4584 |
crossref missing$ |
4585 |
{ "author and editor" editor either.or.check } |
4586 |
'skip$ |
4587 |
if$ |
4588 |
} |
4589 |
if$ |
4590 |
%<dt-beg&!pub-date> format.date "year" output.check |
4591 |
%<dt-beg&!pub-date> date.block |
4592 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4593 |
format.btitle "title" output.check |
4594 |
crossref missing$ |
4595 |
{ |
4596 |
%<pre-pub> format.publisher |
4597 |
format.bvolume output |
4598 |
%<*dt-beg|dt-end|!dt-jnl> |
4599 |
format.chapter.pages "chapter and pages" output.check |
4600 |
%</dt-beg|dt-end|!dt-jnl> |
4601 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4602 |
%<blk-tit> new.sentence |
4603 |
format.number.series output |
4604 |
%<pre-edn> format.edition output |
4605 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
4606 |
%<!pre-pub> format.publisher |
4607 |
} |
4608 |
{ |
4609 |
%<*dt-beg|dt-end|!dt-jnl> |
4610 |
format.chapter.pages "chapter and pages" output.check |
4611 |
%</dt-beg|dt-end|!dt-jnl> |
4612 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4613 |
%<blk-tit> new.sentence |
4614 |
format.book.crossref output.nonnull |
4615 |
%<!dt-beg&!dt-end&!dt-jnl&pub-date> format.date "year" output.check |
4616 |
} |
4617 |
if$ |
4618 |
%<!pre-edn> format.edition output |
4619 |
%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check |
4620 |
%<isbn> format.isbn output |
4621 |
%<*!dt-beg&!dt-end&dt-jnl> |
4622 |
%<!pub-date> year "year" output.check |
4623 |
%<!pub-date> date.block |
4624 |
add.blank |
4625 |
format.pages "pages" output.check |
4626 |
%</!dt-beg&!dt-end&dt-jnl> |
4627 |
%<pp-last> format.pages "pages" output.check |
4628 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4629 |
note output |
4630 |
%<*!dt-beg&dt-end&!pub-date> |
4631 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4632 |
format.date "year" output.check |
4633 |
%</!dt-beg&dt-end&!pub-date> |
4634 |
fin.entry |
4635 |
%<harnm> write.url |
4636 |
} |
4637 |
|
4638 |
FUNCTION {incollection} |
4639 |
{ output.bibitem |
4640 |
format.authors "author" output.check |
4641 |
%<ay> author format.key output |
4642 |
%<au-col> author add.colon |
4643 |
%<dt-beg&!pub-date> format.date "year" output.check |
4644 |
%<dt-beg&!pub-date> date.block |
4645 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4646 |
%<*!jtit-x> |
4647 |
format.title "title" output.check |
4648 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4649 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4650 |
%<blk-tit> new.sentence |
4651 |
%</!jtit-x> |
4652 |
crossref missing$ |
4653 |
{ format.in.ed.booktitle "booktitle" output.check |
4654 |
%<pre-pub> format.publisher |
4655 |
format.bvolume output |
4656 |
format.number.series output |
4657 |
%<pre-edn> format.edition output |
4658 |
%<dt-beg|dt-end|!dt-jnl> format.chapter.pages output |
4659 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
4660 |
%<!pre-pub> format.publisher |
4661 |
%<!pre-edn> format.edition output |
4662 |
%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check |
4663 |
} |
4664 |
{ format.incoll.inproc.crossref output.nonnull |
4665 |
%<dt-beg|dt-end|!dt-jnl> format.chapter.pages output |
4666 |
} |
4667 |
if$ |
4668 |
%<isbn> format.isbn output |
4669 |
%<*!dt-beg&!dt-end&dt-jnl> |
4670 |
%<!pub-date> year "year" output.check |
4671 |
%<!pub-date> date.block |
4672 |
add.blank |
4673 |
format.pages "pages" output.check |
4674 |
%</!dt-beg&!dt-end&dt-jnl> |
4675 |
%<pp-last> format.pages "pages" output.check |
4676 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4677 |
note output |
4678 |
%<*!dt-beg&dt-end&!pub-date> |
4679 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4680 |
format.date "year" output.check |
4681 |
%</!dt-beg&dt-end&!pub-date> |
4682 |
fin.entry |
4683 |
%<harnm> write.url |
4684 |
} |
4685 |
|
4686 |
% \end{macrocode} |
4687 |
% |
4688 |
% \begin{macro}{`inproceedings'} |
4689 |
% \changes{3.81}{1996 Sep 13}{Reorganize organization/publisher} |
4690 |
% \begin{macrocode} |
4691 |
FUNCTION {inproceedings} |
4692 |
{ output.bibitem |
4693 |
format.authors "author" output.check |
4694 |
%<ay> author format.key output |
4695 |
%<au-col> author add.colon |
4696 |
%<dt-beg&!pub-date> format.date "year" output.check |
4697 |
%<dt-beg&!pub-date> date.block |
4698 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4699 |
%<*!jtit-x> |
4700 |
format.title "title" output.check |
4701 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4702 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4703 |
%<blk-tit> new.sentence |
4704 |
%</!jtit-x> |
4705 |
crossref missing$ |
4706 |
{ format.in.ed.booktitle "booktitle" output.check |
4707 |
%<*!pre-pub> |
4708 |
format.bvolume output |
4709 |
format.number.series output |
4710 |
%<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output |
4711 |
%</!pre-pub> |
4712 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
4713 |
publisher empty$ |
4714 |
{ organization output |
4715 |
address output |
4716 |
%<pub-date> format.date "year" output.check |
4717 |
} |
4718 |
{ organization output |
4719 |
format.publisher |
4720 |
} |
4721 |
if$ |
4722 |
%<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check |
4723 |
%<*pre-pub> |
4724 |
format.bvolume output |
4725 |
format.number.series output |
4726 |
%<(dt-beg|dt-end|!dt-jnl)|!pp-last> format.pages output |
4727 |
%</pre-pub> |
4728 |
} |
4729 |
{ format.incoll.inproc.crossref output.nonnull |
4730 |
%<dt-beg|dt-end|!dt-jnl> format.pages output |
4731 |
} |
4732 |
if$ |
4733 |
%<isbn> format.isbn output |
4734 |
%<*!dt-beg&!dt-end&dt-jnl> |
4735 |
%<!pub-date> year "year" output.check |
4736 |
%<!pub-date> date.block |
4737 |
add.blank |
4738 |
format.pages "pages" output.check |
4739 |
%</!dt-beg&!dt-end&dt-jnl> |
4740 |
%<pp-last> format.pages "pages" output.check |
4741 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4742 |
note output |
4743 |
%<*!dt-beg&dt-end&!pub-date> |
4744 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4745 |
format.date "year" output.check |
4746 |
%</!dt-beg&dt-end&!pub-date> |
4747 |
fin.entry |
4748 |
%<harnm> write.url |
4749 |
} |
4750 |
|
4751 |
% \end{macrocode} |
4752 |
% \end{macro} |
4753 |
% |
4754 |
% \begin{macrocode} |
4755 |
FUNCTION {conference} { inproceedings } |
4756 |
|
4757 |
%<*ay> |
4758 |
FUNCTION {manual} |
4759 |
{ output.bibitem |
4760 |
format.authors output |
4761 |
author format.key output |
4762 |
%<au-col> author add.colon |
4763 |
%<dt-beg> format.date "year" output.check |
4764 |
%<dt-beg> date.block |
4765 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4766 |
format.btitle "title" output.check |
4767 |
%<blk-tit> new.sentence |
4768 |
%<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb |
4769 |
organization output |
4770 |
address output |
4771 |
format.edition output |
4772 |
%<!dt-beg&!dt-end> format.date "year" output.check |
4773 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4774 |
note output |
4775 |
%<*!dt-beg&dt-end> |
4776 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4777 |
format.date "year" output.check |
4778 |
%</!dt-beg&dt-end> |
4779 |
fin.entry |
4780 |
%<harnm> write.url |
4781 |
} |
4782 |
|
4783 |
%</ay> |
4784 |
%<*!ay> |
4785 |
FUNCTION {manual} |
4786 |
{ output.bibitem |
4787 |
author empty$ |
4788 |
{ organization empty$ |
4789 |
'skip$ |
4790 |
{ organization output.nonnull |
4791 |
address output |
4792 |
} |
4793 |
if$ |
4794 |
} |
4795 |
{ format.authors output.nonnull } |
4796 |
if$ |
4797 |
%<au-col> author add.colon |
4798 |
%<ay&dt-beg> format.date "year" output.check |
4799 |
%<!ay&dt-beg> format.date output |
4800 |
%<dt-beg> date.block |
4801 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4802 |
format.btitle "title" output.check |
4803 |
%<blk-tit> new.sentence |
4804 |
author empty$ |
4805 |
{ organization empty$ |
4806 |
{ |
4807 |
%<!blk-com&!blk-tit&!blk-tita> address new.block.checka |
4808 |
address output |
4809 |
} |
4810 |
'skip$ |
4811 |
if$ |
4812 |
} |
4813 |
{ |
4814 |
%<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb |
4815 |
organization output |
4816 |
address output |
4817 |
} |
4818 |
if$ |
4819 |
format.edition output |
4820 |
%<ay&!dt-beg&!dt-end> format.date "year" output.check |
4821 |
%<!ay&!dt-beg&!dt-end> format.date output |
4822 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4823 |
note output |
4824 |
%<*ay&!dt-beg&dt-end> |
4825 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4826 |
format.date "year" output.check |
4827 |
%</ay&!dt-beg&dt-end> |
4828 |
%<*!ay&!dt-beg&dt-end> |
4829 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4830 |
format.date output |
4831 |
%</!ay&!dt-beg&dt-end> |
4832 |
fin.entry |
4833 |
%<harnm> write.url |
4834 |
} |
4835 |
|
4836 |
%</!ay> |
4837 |
% \end{macrocode} |
4838 |
% \begin{macro}{`masterthesis'} |
4839 |
% \changes{2.0}{1994 Feb 7}{Add \texttt{thtit-a} to format thesis titles like |
4840 |
% articles instead of books.} |
4841 |
% To format a master's thesis. |
4842 |
% \begin{macrocode} |
4843 |
FUNCTION {mastersthesis} |
4844 |
{ output.bibitem |
4845 |
format.authors "author" output.check |
4846 |
%<ay> author format.key output |
4847 |
%<au-col> author add.colon |
4848 |
%<dt-beg> format.date "year" output.check |
4849 |
%<dt-beg> date.block |
4850 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4851 |
%<!thtit-a> format.btitle "title" output.check |
4852 |
%<thtit-a> format.title "title" output.check |
4853 |
%<thtit-a&blk-com&(tit-q|tit-qq)> end.quote.title |
4854 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4855 |
%<blk-tit> new.sentence |
4856 |
bbl.mthesis format.thesis.type output.nonnull |
4857 |
school "school" output.check |
4858 |
address output |
4859 |
%<!dt-beg&!dt-end> format.date "year" output.check |
4860 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4861 |
note output |
4862 |
%<*!dt-beg&dt-end> |
4863 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4864 |
format.date "year" output.check |
4865 |
%</!dt-beg&dt-end> |
4866 |
fin.entry |
4867 |
%<harnm> write.url |
4868 |
} |
4869 |
|
4870 |
% \end{macrocode} |
4871 |
% \end{macro} |
4872 |
% \begin{macrocode} |
4873 |
FUNCTION {misc} |
4874 |
{ output.bibitem |
4875 |
format.authors output |
4876 |
%<ay> author format.key output |
4877 |
%<au-col> author add.colon |
4878 |
%<ay&dt-beg> format.date "year" output.check |
4879 |
%<!ay&dt-beg> format.date output |
4880 |
%<*ay> |
4881 |
%<dt-beg> date.block |
4882 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4883 |
format.title output |
4884 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4885 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4886 |
%<blk-tit> new.sentence |
4887 |
%</ay> |
4888 |
%<*!ay> |
4889 |
%<!blk-com&!blk-tit&!blk-tita> title howpublished new.block.checkb |
4890 |
format.title output |
4891 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
4892 |
%<blk-tit> new.sentence |
4893 |
%<!blk-com&!blk-tit&!blk-tita> howpublished new.block.checka |
4894 |
%</!ay> |
4895 |
howpublished output |
4896 |
%<ay&!dt-beg&!dt-end> format.date "year" output.check |
4897 |
%<!ay&!dt-beg&!dt-end> format.date output |
4898 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4899 |
note output |
4900 |
%<*ay&!dt-beg&dt-end> |
4901 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4902 |
format.date "year" output.check |
4903 |
%</ay&!dt-beg&dt-end> |
4904 |
%<*!ay&!dt-beg&dt-end> |
4905 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4906 |
format.date output |
4907 |
%</!ay&!dt-beg&dt-end> |
4908 |
fin.entry |
4909 |
%<harnm> write.url |
4910 |
%<!ay> empty.misc.check |
4911 |
} |
4912 |
|
4913 |
% \end{macrocode} |
4914 |
% \begin{macro}{`phdthesis'} |
4915 |
% \changes{2.0}{1994 Feb 7}{Add \texttt{thtit-a} to format thesis titles like |
4916 |
% articles instead of books.} |
4917 |
% To format a doctoral thesis. |
4918 |
% \begin{macrocode} |
4919 |
FUNCTION {phdthesis} |
4920 |
{ output.bibitem |
4921 |
format.authors "author" output.check |
4922 |
%<ay> author format.key output |
4923 |
%<au-col> author add.colon |
4924 |
%<dt-beg> format.date "year" output.check |
4925 |
%<dt-beg> date.block |
4926 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4927 |
%<!thtit-a> format.btitle "title" output.check |
4928 |
%<thtit-a> format.title "title" output.check |
4929 |
%<thtit-a&blk-com&(tit-q|tit-qq)> end.quote.title |
4930 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4931 |
%<blk-tit> new.sentence |
4932 |
bbl.phdthesis format.thesis.type output.nonnull |
4933 |
school "school" output.check |
4934 |
address output |
4935 |
%<!dt-beg&!dt-end> format.date "year" output.check |
4936 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4937 |
note output |
4938 |
%<*!dt-beg&dt-end> |
4939 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4940 |
format.date "year" output.check |
4941 |
%</!dt-beg&dt-end> |
4942 |
fin.entry |
4943 |
%<harnm> write.url |
4944 |
} |
4945 |
|
4946 |
% \end{macrocode} |
4947 |
% \end{macro} |
4948 |
% \begin{macrocode} |
4949 |
%<*ay> |
4950 |
FUNCTION {proceedings} |
4951 |
{ output.bibitem |
4952 |
format.editors output |
4953 |
editor format.key output |
4954 |
%<au-col> editor add.colon |
4955 |
%<dt-beg> format.date "year" output.check |
4956 |
%<dt-beg> date.block |
4957 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4958 |
format.btitle "title" output.check |
4959 |
format.bvolume output |
4960 |
format.number.series output |
4961 |
address output |
4962 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
4963 |
organization output |
4964 |
publisher output |
4965 |
%<!dt-beg&!dt-end> format.date "year" output.check |
4966 |
%<isbn> format.isbn output |
4967 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4968 |
note output |
4969 |
%<*!dt-beg&dt-end> |
4970 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
4971 |
format.date "year" output.check |
4972 |
%</!dt-beg&dt-end> |
4973 |
fin.entry |
4974 |
%<harnm> write.url |
4975 |
} |
4976 |
|
4977 |
%</ay> |
4978 |
%<*!ay> |
4979 |
FUNCTION {proceedings} |
4980 |
{ output.bibitem |
4981 |
editor empty$ |
4982 |
{ organization output } |
4983 |
{ format.editors output.nonnull } |
4984 |
if$ |
4985 |
%<au-col> editor add.colon |
4986 |
%<dt-beg> format.date "year" output.check |
4987 |
%<dt-beg> date.block |
4988 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
4989 |
format.btitle "title" output.check |
4990 |
format.bvolume output |
4991 |
format.number.series output |
4992 |
address empty$ |
4993 |
{ editor empty$ |
4994 |
{ publisher new.sentence.checka } |
4995 |
{ organization publisher new.sentence.checkb |
4996 |
organization output |
4997 |
} |
4998 |
if$ |
4999 |
publisher output |
5000 |
%<!dt-beg&!dt-end> format.date "year" output.check |
5001 |
} |
5002 |
{ address output.nonnull |
5003 |
%<!dt-beg&!dt-end> format.date "year" output.check |
5004 |
%<!blk-com&!blk-tit&!blk-tita> new.sentence |
5005 |
editor empty$ |
5006 |
'skip$ |
5007 |
{ organization output } |
5008 |
if$ |
5009 |
publisher output |
5010 |
} |
5011 |
if$ |
5012 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5013 |
note output |
5014 |
%<*!dt-beg&dt-end> |
5015 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5016 |
format.date "year" output.check |
5017 |
%</!dt-beg&dt-end> |
5018 |
fin.entry |
5019 |
%<harnm> write.url |
5020 |
} |
5021 |
|
5022 |
%</!ay> |
5023 |
% \end{macrocode} |
5024 |
% |
5025 |
% \begin{macro}{`techreport'} |
5026 |
% \changes{3.5}{1995 Oct 4}{Add option \texttt{trtit-b}} |
5027 |
% \begin{macrocode} |
5028 |
FUNCTION {techreport} |
5029 |
{ output.bibitem |
5030 |
format.authors "author" output.check |
5031 |
%<ay> author format.key output |
5032 |
%<au-col> author add.colon |
5033 |
%<dt-beg> format.date "year" output.check |
5034 |
%<dt-beg> date.block |
5035 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
5036 |
%<trtit-b> format.btitle "title" output.check |
5037 |
%<!trtit-b> format.title "title" output.check |
5038 |
%<!trtit-b&blk-com&(tit-q|tit-qq)> end.quote.title |
5039 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5040 |
%<blk-tit> new.sentence |
5041 |
format.tr.number output.nonnull |
5042 |
institution "institution" output.check |
5043 |
address output |
5044 |
%<!dt-beg&!dt-end> format.date "year" output.check |
5045 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5046 |
note output |
5047 |
%<*!dt-beg&dt-end> |
5048 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5049 |
format.date "year" output.check |
5050 |
%</!dt-beg&dt-end> |
5051 |
fin.entry |
5052 |
%<harnm> write.url |
5053 |
} |
5054 |
|
5055 |
% \end{macrocode} |
5056 |
% \end{macro} |
5057 |
% |
5058 |
% \begin{macrocode} |
5059 |
FUNCTION {unpublished} |
5060 |
{ output.bibitem |
5061 |
format.authors "author" output.check |
5062 |
%<ay> author format.key output |
5063 |
%<au-col> author add.colon |
5064 |
%<ay&dt-beg> format.date "year" output.check |
5065 |
%<!ay&dt-beg> format.date output |
5066 |
%<dt-beg> date.block |
5067 |
%<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block |
5068 |
format.title "title" output.check |
5069 |
%<blk-com&(tit-q|tit-qq)> end.quote.title |
5070 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5071 |
%<blk-tit> new.sentence |
5072 |
note "note" output.check |
5073 |
%<*ay&!dt-beg&dt-end> |
5074 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5075 |
format.date "year" output.check |
5076 |
%</ay&!dt-beg&dt-end> |
5077 |
%<*!ay&!dt-beg&dt-end> |
5078 |
%<!blk-com&!blk-tit&!blk-tita> new.block |
5079 |
format.date output |
5080 |
%</!ay&!dt-beg&dt-end> |
5081 |
fin.entry |
5082 |
%<harnm> write.url |
5083 |
} |
5084 |
|
5085 |
FUNCTION {default.type} { misc } |
5086 |
|
5087 |
READ |
5088 |
|
5089 |
% \end{macrocode} |
5090 |
% |
5091 |
% \begin{macro}{`sortify'} |
5092 |
% \changes{3.8}{1996 Feb 29}{Do not allow unsorted alphas} |
5093 |
% In \texttt{btxbst.doc}/\texttt{.mbs}, the \texttt{sortify} function is |
5094 |
% left out for unsorted alpha-style citations. This leads to an error, |
5095 |
% because it is still used. So leave it in here too. \emph{In fact, do away |
5096 |
% with unsorted alpha style, since it is as useless as unsorted author--year |
5097 |
% listings.} |
5098 |
% \begin{macrocode} |
5099 |
%<*ay|alph|!seq-no> |
5100 |
FUNCTION {sortify} |
5101 |
{ purify$ |
5102 |
"l" change.case$ |
5103 |
} |
5104 |
|
5105 |
% \end{macrocode} |
5106 |
% \end{macro} |
5107 |
% |
5108 |
% \begin{macrocode} |
5109 |
INTEGERS { len } |
5110 |
|
5111 |
FUNCTION {chop.word} |
5112 |
{ 's := |
5113 |
'len := |
5114 |
s #1 len substring$ = |
5115 |
{ s len #1 + global.max$ substring$ } |
5116 |
's |
5117 |
if$ |
5118 |
} |
5119 |
|
5120 |
% \end{macrocode} |
5121 |
% |
5122 |
% \begin{macro}{`format.lab.names'} |
5123 |
% \changes{3.8}{1996 Feb 29}{Add option \texttt{alph} for \texttt{alpha.bst} |
5124 |
% style of labels} |
5125 |
% The function \texttt{format.lab.names} formats by author--year or the |
5126 |
% \texttt{alpha} style as in the original \texttt{alpha.bst}. |
5127 |
% Only major difference is that there should be no unsorted (\texttt{seq-no}) |
5128 |
% versions of this. Patashnik was clearly very unhappy about accommodating |
5129 |
% such an animal, and in fact, his unsorted alpha style crashes \btx. |
5130 |
% I also provide the \texttt{vonx} option here to ignore the \textsl{von} |
5131 |
% part of the name. |
5132 |
% \begin{macrocode} |
5133 |
%<*!ay&alph> |
5134 |
INTEGERS { et.al.char.used } |
5135 |
|
5136 |
FUNCTION {initialize.et.al.char.used} |
5137 |
{ #0 'et.al.char.used := |
5138 |
} |
5139 |
|
5140 |
EXECUTE {initialize.et.al.char.used} |
5141 |
|
5142 |
FUNCTION {format.lab.names} |
5143 |
{ 's := |
5144 |
s num.names$ 'numnames := |
5145 |
numnames #1 > |
5146 |
{ numnames #4 > |
5147 |
{ #3 'namesleft := } |
5148 |
{ numnames 'namesleft := } |
5149 |
if$ |
5150 |
#1 'nameptr := |
5151 |
"" |
5152 |
{ namesleft #0 > } |
5153 |
{ nameptr numnames = |
5154 |
{ s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = |
5155 |
{ "{\etalchar{+}}" * |
5156 |
#1 'et.al.char.used := |
5157 |
} |
5158 |
%<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * } |
5159 |
%<vonx> { s nameptr "{l{}}" format.name$ * } |
5160 |
if$ |
5161 |
} |
5162 |
%<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * } |
5163 |
%<vonx> { s nameptr "{l{}}" format.name$ * } |
5164 |
if$ |
5165 |
nameptr #1 + 'nameptr := |
5166 |
namesleft #1 - 'namesleft := |
5167 |
} |
5168 |
while$ |
5169 |
numnames #4 > |
5170 |
{ "{\etalchar{+}}" * |
5171 |
#1 'et.al.char.used := |
5172 |
} |
5173 |
'skip$ |
5174 |
if$ |
5175 |
} |
5176 |
%<!vonx> { s #1 "{v{}}{l{}}" format.name$ |
5177 |
%<vonx> { s #1 "{l{}}" format.name$ |
5178 |
duplicate$ text.length$ #2 < |
5179 |
{ pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } |
5180 |
'skip$ |
5181 |
if$ |
5182 |
} |
5183 |
if$ |
5184 |
} |
5185 |
|
5186 |
%</!ay&alph> |
5187 |
%<*ay> |
5188 |
FUNCTION {format.lab.names} |
5189 |
{ 's := |
5190 |
s #1 "{vv~}{ll}" format.name$ |
5191 |
s num.names$ duplicate$ |
5192 |
#2 > |
5193 |
%<!etal-it&!etal-rm> { pop$ " et~al." * } |
5194 |
%<!etal-it&etal-rm> { pop$ " " * "et~al." roman.cite * } |
5195 |
%<etal-it> { pop$ " " * "et~al." emphasize * } |
5196 |
{ #2 < |
5197 |
'skip$ |
5198 |
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = |
5199 |
%<!etal-it&!etal-rm> { " et~al." * } |
5200 |
%<!etal-it&etal-rm> { " " * "et~al." roman.cite * } |
5201 |
%<etal-it> { " " * "et~al." emphasize * } |
5202 |
%<*!harnm> |
5203 |
%<*!amper> |
5204 |
{ bbl.and |
5205 |
%<and-rm> roman.cite |
5206 |
space.word * s #2 "{vv~}{ll}" format.name$ * } |
5207 |
%</!amper> |
5208 |
%<amper> { " \& " * s #2 "{vv~}{ll}" format.name$ * } |
5209 |
%</!harnm> |
5210 |
%<harnm> { " \harvardand\ " * s #2 "{vv~}{ll}" format.name$ * } |
5211 |
if$ |
5212 |
} |
5213 |
if$ |
5214 |
} |
5215 |
if$ |
5216 |
} |
5217 |
|
5218 |
%</ay> |
5219 |
% \end{macrocode} |
5220 |
% \end{macro} |
5221 |
% |
5222 |
% Have to be very careful with the options \texttt{ay}, \texttt{alph}, and |
5223 |
% \texttt{seq-no} here. The first two are actually mutually exclusive, and |
5224 |
% \texttt{ay} should dominate. The \texttt{seq-no} option only applies for |
5225 |
% numerical (\texttt{!ay}) but not alphabetic (\texttt{alph}) selections. |
5226 |
% This whole block of coding dealing with labels is only included for |
5227 |
% author--year or alphabetic or ordered numerical. |
5228 |
% That is, \texttt{ay} or \texttt{alph} or \texttt{!seq-no} is true. |
5229 |
% \begin{macrocode} |
5230 |
%<*ay|alph> |
5231 |
FUNCTION {author.key.label} |
5232 |
{ author empty$ |
5233 |
{ key empty$ |
5234 |
{ cite$ #1 #3 substring$ } |
5235 |
%<ay> 'key |
5236 |
%<!ay> { key #3 text.prefix$ } |
5237 |
if$ |
5238 |
} |
5239 |
{ author format.lab.names } |
5240 |
if$ |
5241 |
} |
5242 |
|
5243 |
FUNCTION {author.editor.key.label} |
5244 |
{ author empty$ |
5245 |
{ editor empty$ |
5246 |
{ key empty$ |
5247 |
{ cite$ #1 #3 substring$ } |
5248 |
%<ay> 'key |
5249 |
%<!ay> { key #3 text.prefix$ } |
5250 |
if$ |
5251 |
} |
5252 |
{ editor format.lab.names } |
5253 |
if$ |
5254 |
} |
5255 |
{ author format.lab.names } |
5256 |
if$ |
5257 |
} |
5258 |
|
5259 |
%</ay|alph> |
5260 |
%<*!ay&alph> |
5261 |
FUNCTION {author.key.organization.label} |
5262 |
{ author empty$ |
5263 |
{ key empty$ |
5264 |
{ organization empty$ |
5265 |
{ cite$ #1 #3 substring$ } |
5266 |
{ "The " #4 organization chop.word #3 text.prefix$ } |
5267 |
if$ |
5268 |
} |
5269 |
{ key #3 text.prefix$ } |
5270 |
if$ |
5271 |
} |
5272 |
{ author format.lab.names } |
5273 |
if$ |
5274 |
} |
5275 |
|
5276 |
FUNCTION {editor.key.organization.label} |
5277 |
{ editor empty$ |
5278 |
{ key empty$ |
5279 |
{ organization empty$ |
5280 |
{ cite$ #1 #3 substring$ } |
5281 |
{ "The " #4 organization chop.word #3 text.prefix$ } |
5282 |
if$ |
5283 |
} |
5284 |
{ key #3 text.prefix$ } |
5285 |
if$ |
5286 |
} |
5287 |
{ editor format.lab.names } |
5288 |
if$ |
5289 |
} |
5290 |
|
5291 |
%</!ay&alph> |
5292 |
%<*ay> |
5293 |
FUNCTION {editor.key.label} |
5294 |
{ editor empty$ |
5295 |
{ key empty$ |
5296 |
{ cite$ #1 #3 substring$ } |
5297 |
'key |
5298 |
if$ |
5299 |
} |
5300 |
{ editor format.lab.names } |
5301 |
if$ |
5302 |
} |
5303 |
|
5304 |
% \end{macrocode} |
5305 |
% \begin{macro}{`calc.short.authors'} |
5306 |
% \changes{3.3}{1995 Sep 4}{Add function to store short list of authors |
5307 |
% for later test} |
5308 |
% \begin{macrocode} |
5309 |
FUNCTION {calc.short.authors} |
5310 |
{ type$ "book" = |
5311 |
type$ "inbook" = |
5312 |
or |
5313 |
'author.editor.key.label |
5314 |
{ type$ "proceedings" = |
5315 |
'editor.key.label |
5316 |
'author.key.label |
5317 |
if$ |
5318 |
} |
5319 |
if$ |
5320 |
%<lab-it> emphasize |
5321 |
%<lab-bf&!lab-it> bolden |
5322 |
%<lab-sc&!lab-it&!lab-bf> scaps |
5323 |
'short.list := |
5324 |
} |
5325 |
|
5326 |
% \end{macrocode} |
5327 |
% \end{macro} |
5328 |
% \begin{macro}{`calc.label'} |
5329 |
% \changes{1.5(2.3)a}{1994 Oct 11}{Add option \texttt{note-yr}} |
5330 |
% \changes{3.0}{1995 Mar 3}{Add options \texttt{lab-bf} and \texttt{lab-sc}} |
5331 |
% \changes{3.3}{1995 Sep 4}{Use \texttt{calc.short.authors}} |
5332 |
% \changes{3.8}{1996 Feb 29}{Add \texttt{calc.label} from \texttt{alpha.bst}} |
5333 |
% \begin{macrocode} |
5334 |
FUNCTION {calc.label} |
5335 |
{ calc.short.authors |
5336 |
short.list |
5337 |
%<!(har|ast|cay|nmd|alk|cn)> "(" |
5338 |
%<har|ast|cay|nmd|alk|cn> ", " |
5339 |
* |
5340 |
year duplicate$ empty$ |
5341 |
{ pop$ "????" } |
5342 |
%<!note-yr> { purify$ #-1 #4 substring$ } |
5343 |
%<note-yr> 'skip$ |
5344 |
if$ |
5345 |
* |
5346 |
'label := |
5347 |
} |
5348 |
|
5349 |
%</ay> |
5350 |
%<*!ay&alph> |
5351 |
FUNCTION {calc.label} |
5352 |
{ type$ "book" = |
5353 |
type$ "inbook" = |
5354 |
or |
5355 |
'author.editor.key.label |
5356 |
{ type$ "proceedings" = |
5357 |
'editor.key.organization.label |
5358 |
{ type$ "manual" = |
5359 |
'author.key.organization.label |
5360 |
'author.key.label |
5361 |
if$ |
5362 |
} |
5363 |
if$ |
5364 |
} |
5365 |
if$ |
5366 |
duplicate$ |
5367 |
year field.or.null purify$ #-1 #2 substring$ |
5368 |
* |
5369 |
'label := |
5370 |
year field.or.null purify$ #-1 #4 substring$ |
5371 |
* |
5372 |
sortify 'sort.label := |
5373 |
} |
5374 |
|
5375 |
%</!ay&alph> |
5376 |
%<*ay> |
5377 |
% \end{macrocode} |
5378 |
% \end{macro} |
5379 |
% \begin{macro}{`calc.short.label'} |
5380 |
% \changes{3.3}{1995 Sep 4}{Use \texttt{calc.short.authors}} |
5381 |
% \begin{macrocode} |
5382 |
%<*har|cay|nmd|ast|cn> |
5383 |
FUNCTION {calc.short.label} |
5384 |
{ calc.short.authors short.list |
5385 |
'label := |
5386 |
} |
5387 |
|
5388 |
%</har|cay|nmd|ast|cn> |
5389 |
%</ay> |
5390 |
% \end{macrocode} |
5391 |
% \end{macro} |
5392 |
% \begin{macro}{`sort.format.names'} |
5393 |
% \changes{1.7(2.5)}{1995 Feb 9}{Make ordering of `et al' works by year |
5394 |
% and authors and not just year} |
5395 |
% \changes{3.0}{1995 Feb 27}{Option \texttt{nm-revf} to act just as default} |
5396 |
% \changes{3.2}{1995 Jun 16}{Add option \texttt{vonx} so sorting ignores the |
5397 |
% \emph{von} part of the name} |
5398 |
% \changes{3.5}{1995 Oct 24}{For limited authors, sort only on those present} |
5399 |
% \changes{3.5}{1995 Oct 24}{`Et al' considered author before all others} |
5400 |
% \begin{macrocode} |
5401 |
FUNCTION {sort.format.names} |
5402 |
{ 's := |
5403 |
#1 'nameptr := |
5404 |
"" |
5405 |
s num.names$ 'numnames := |
5406 |
numnames 'namesleft := |
5407 |
{ namesleft #0 > } |
5408 |
{ s nameptr |
5409 |
%<*!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvv> |
5410 |
%<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" |
5411 |
%<vonx> "{ll{ }}{ ff{ }}{ jj{ }}" |
5412 |
%</!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvv> |
5413 |
%<*nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvv> |
5414 |
%<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" |
5415 |
%<vonx> "{ll{ }}{ f{ }}{ jj{ }}" |
5416 |
%</nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvv> |
5417 |
format.name$ 't := |
5418 |
nameptr #1 > |
5419 |
{ |
5420 |
%<*nmlm> |
5421 |
%<m1> nameptr #2 = |
5422 |
%<m2> nameptr #3 = |
5423 |
%<m3> nameptr #4 = |
5424 |
%<m4> nameptr #5 = |
5425 |
%<m5> nameptr #6 = |
5426 |
%<x1> numnames #1 > and |
5427 |
%<x2> numnames #2 > and |
5428 |
%<x3> numnames #3 > and |
5429 |
%<x4> numnames #4 > and |
5430 |
%<x5> numnames #5 > and |
5431 |
%<x6> numnames #6 > and |
5432 |
%<x7> numnames #7 > and |
5433 |
%<x8> numnames #8 > and |
5434 |
%<x9> numnames #9 > and |
5435 |
{ "others" 't := |
5436 |
#1 'namesleft := } |
5437 |
'skip$ |
5438 |
if$ |
5439 |
%</nmlm> |
5440 |
" " * |
5441 |
namesleft #1 = t "others" = and |
5442 |
{ "aaaaa" * } |
5443 |
%<*seq-lab|seq-key> |
5444 |
{ numnames #2 > nameptr #2 = and |
5445 |
{ "zz" * year field.or.null * " " * } |
5446 |
'skip$ |
5447 |
if$ |
5448 |
t sortify * |
5449 |
} |
5450 |
%</seq-lab|seq-key> |
5451 |
%<!seq-lab&!seq-key> { t sortify * } |
5452 |
if$ |
5453 |
} |
5454 |
{ t sortify * } |
5455 |
if$ |
5456 |
nameptr #1 + 'nameptr := |
5457 |
namesleft #1 - 'namesleft := |
5458 |
} |
5459 |
while$ |
5460 |
} |
5461 |
|
5462 |
% \end{macrocode} |
5463 |
% \end{macro} |
5464 |
% |
5465 |
% \begin{macrocode} |
5466 |
FUNCTION {sort.format.title} |
5467 |
{ 't := |
5468 |
"A " #2 |
5469 |
"An " #3 |
5470 |
"The " #4 t chop.word |
5471 |
chop.word |
5472 |
chop.word |
5473 |
sortify |
5474 |
#1 global.max$ substring$ |
5475 |
} |
5476 |
|
5477 |
FUNCTION {author.sort} |
5478 |
{ author empty$ |
5479 |
{ key empty$ |
5480 |
{ "to sort, need author or key in " cite$ * warning$ |
5481 |
"" |
5482 |
} |
5483 |
{ key sortify } |
5484 |
if$ |
5485 |
} |
5486 |
{ author sort.format.names } |
5487 |
if$ |
5488 |
} |
5489 |
|
5490 |
FUNCTION {author.editor.sort} |
5491 |
{ author empty$ |
5492 |
{ editor empty$ |
5493 |
{ key empty$ |
5494 |
{ "to sort, need author, editor, or key in " cite$ * warning$ |
5495 |
"" |
5496 |
} |
5497 |
{ key sortify } |
5498 |
if$ |
5499 |
} |
5500 |
{ editor sort.format.names } |
5501 |
if$ |
5502 |
} |
5503 |
{ author sort.format.names } |
5504 |
if$ |
5505 |
} |
5506 |
|
5507 |
%<*ay> |
5508 |
FUNCTION {editor.sort} |
5509 |
{ editor empty$ |
5510 |
{ key empty$ |
5511 |
{ "to sort, need editor or key in " cite$ * warning$ |
5512 |
"" |
5513 |
} |
5514 |
{ key sortify } |
5515 |
if$ |
5516 |
} |
5517 |
{ editor sort.format.names } |
5518 |
if$ |
5519 |
} |
5520 |
|
5521 |
%<*seq-no> |
5522 |
INTEGERS { seq.num } |
5523 |
|
5524 |
FUNCTION {init.seq} |
5525 |
{ #0 'seq.num :=} |
5526 |
|
5527 |
EXECUTE {init.seq} |
5528 |
|
5529 |
FUNCTION {int.to.fix} |
5530 |
{ "000000000" swap$ int.to.str$ * |
5531 |
#-1 #10 substring$ |
5532 |
} |
5533 |
|
5534 |
%</seq-no> |
5535 |
% \end{macrocode} |
5536 |
% \begin{macro}{`presort'} |
5537 |
% \changes{3.81}{1996 Sep 16}{Add option \texttt{seq-no} to author--year} |
5538 |
% For unsorted author--year, make up the final sorting order in |
5539 |
% \texttt{sort.label} with the original sequence number, for unsorting later. |
5540 |
% \begin{macrocode} |
5541 |
FUNCTION {presort} |
5542 |
{ calc.label |
5543 |
label sortify |
5544 |
" " |
5545 |
* |
5546 |
%<*!seq-no> |
5547 |
type$ "book" = |
5548 |
type$ "inbook" = |
5549 |
or |
5550 |
'author.editor.sort |
5551 |
{ type$ "proceedings" = |
5552 |
'editor.sort |
5553 |
'author.sort |
5554 |
if$ |
5555 |
} |
5556 |
if$ |
5557 |
#1 entry.max$ substring$ |
5558 |
%</!seq-no> |
5559 |
%<*seq-no> |
5560 |
seq.num #1 + 'seq.num := |
5561 |
seq.num int.to.fix |
5562 |
%</seq-no> |
5563 |
'sort.label := |
5564 |
sort.label |
5565 |
* |
5566 |
" " |
5567 |
* |
5568 |
%<seq-yr> " " * year field.or.null * |
5569 |
%<*!seq-key&!seq-yr> |
5570 |
title field.or.null |
5571 |
sort.format.title |
5572 |
%</!seq-key&!seq-yr> |
5573 |
%<seq-key|seq-yr> cite$ |
5574 |
* |
5575 |
#1 entry.max$ substring$ |
5576 |
'sort.key$ := |
5577 |
} |
5578 |
|
5579 |
% \end{macrocode} |
5580 |
% \end{macro} |
5581 |
% \begin{macrocode} |
5582 |
%</ay> |
5583 |
%<*!ay> |
5584 |
FUNCTION {author.organization.sort} |
5585 |
{ author empty$ |
5586 |
{ organization empty$ |
5587 |
{ key empty$ |
5588 |
{ "to sort, need author, organization, or key in " cite$ * warning$ |
5589 |
"" |
5590 |
} |
5591 |
{ key sortify } |
5592 |
if$ |
5593 |
} |
5594 |
{ "The " #4 organization chop.word sortify } |
5595 |
if$ |
5596 |
} |
5597 |
{ author sort.format.names } |
5598 |
if$ |
5599 |
} |
5600 |
|
5601 |
FUNCTION {editor.organization.sort} |
5602 |
{ editor empty$ |
5603 |
{ organization empty$ |
5604 |
{ key empty$ |
5605 |
{ "to sort, need editor, organization, or key in " cite$ * warning$ |
5606 |
"" |
5607 |
} |
5608 |
{ key sortify } |
5609 |
if$ |
5610 |
} |
5611 |
{ "The " #4 organization chop.word sortify } |
5612 |
if$ |
5613 |
} |
5614 |
{ editor sort.format.names } |
5615 |
if$ |
5616 |
} |
5617 |
|
5618 |
FUNCTION {presort} |
5619 |
%<*alph> |
5620 |
{ calc.label |
5621 |
sort.label |
5622 |
" " |
5623 |
* |
5624 |
type$ "book" = |
5625 |
%</alph> |
5626 |
%<!alph>{ type$ "book" = |
5627 |
type$ "inbook" = |
5628 |
or |
5629 |
'author.editor.sort |
5630 |
{ type$ "proceedings" = |
5631 |
'editor.organization.sort |
5632 |
{ type$ "manual" = |
5633 |
'author.organization.sort |
5634 |
'author.sort |
5635 |
if$ |
5636 |
} |
5637 |
if$ |
5638 |
} |
5639 |
if$ |
5640 |
%<alph> * |
5641 |
" " |
5642 |
* |
5643 |
year field.or.null sortify |
5644 |
%<!seq-yr|alph> * |
5645 |
" " |
5646 |
* |
5647 |
%<seq-yr&!alph> swap$ * |
5648 |
title field.or.null |
5649 |
sort.format.title |
5650 |
* |
5651 |
#1 entry.max$ substring$ |
5652 |
'sort.key$ := |
5653 |
} |
5654 |
|
5655 |
%</!ay> |
5656 |
ITERATE {presort} |
5657 |
|
5658 |
SORT |
5659 |
|
5660 |
%</ay|alph|!seq-no> |
5661 |
% \end{macrocode} |
5662 |
% \begin{macro}{`forward.pass'} |
5663 |
% \changes{3.4}{1995 Sep 5}{Include number of references in argument to |
5664 |
% \texttt{thebibliography} environment} |
5665 |
% With version~6.0 of \texttt{natbib}, the author-year styles can also be |
5666 |
% used for numerical citations; then the \texttt{thebibliography} environment |
5667 |
% must have an argument indicating the length of the longest label. |
5668 |
% Simply count the references and add this number as the argument. |
5669 |
% \begin{macrocode} |
5670 |
%<*ay> |
5671 |
STRINGS { last.label next.extra } |
5672 |
|
5673 |
INTEGERS { last.extra.num number.label } |
5674 |
|
5675 |
FUNCTION {initialize.extra.label.stuff} |
5676 |
{ #0 int.to.chr$ 'last.label := |
5677 |
"" 'next.extra := |
5678 |
#0 'last.extra.num := |
5679 |
#0 'number.label := |
5680 |
} |
5681 |
|
5682 |
FUNCTION {forward.pass} |
5683 |
{ last.label label = |
5684 |
{ last.extra.num #1 + 'last.extra.num := |
5685 |
last.extra.num int.to.chr$ 'extra.label := |
5686 |
} |
5687 |
{ "a" chr.to.int$ 'last.extra.num := |
5688 |
"" 'extra.label := |
5689 |
label 'last.label := |
5690 |
} |
5691 |
if$ |
5692 |
number.label #1 + 'number.label := |
5693 |
} |
5694 |
|
5695 |
%</ay> |
5696 |
%<*!ay&alph> |
5697 |
STRINGS { longest.label last.sort.label next.extra } |
5698 |
|
5699 |
INTEGERS { longest.label.width last.extra.num } |
5700 |
|
5701 |
FUNCTION {initialize.longest.label} |
5702 |
{ "" 'longest.label := |
5703 |
#0 int.to.chr$ 'last.sort.label := |
5704 |
"" 'next.extra := |
5705 |
#0 'longest.label.width := |
5706 |
#0 'last.extra.num := |
5707 |
} |
5708 |
|
5709 |
FUNCTION {forward.pass} |
5710 |
{ last.sort.label sort.label = |
5711 |
{ last.extra.num #1 + 'last.extra.num := |
5712 |
last.extra.num int.to.chr$ 'extra.label := |
5713 |
} |
5714 |
{ "a" chr.to.int$ 'last.extra.num := |
5715 |
"" 'extra.label := |
5716 |
sort.label 'last.sort.label := |
5717 |
} |
5718 |
if$ |
5719 |
} |
5720 |
|
5721 |
%</!ay&alph> |
5722 |
% \end{macrocode} |
5723 |
% \end{macro} |
5724 |
% \begin{macro}{`reverse.pass'} |
5725 |
% \changes{3.3}{1995 Aug 7}{Put extra label in braces} |
5726 |
% The extra label is added in braces so that natbib can treat it as one unit. |
5727 |
% This allows extra labels to be more than one letter long. For non-NFSS |
5728 |
% emphasizing, this is no problem, since labels go in |{\em a}|, but for |
5729 |
% non-emphasizing and for NFSS, it caused troubles without the braces. |
5730 |
% The trouble arises with multiple citations in one |\cite| in which |
5731 |
% authors and years are the same, and only the extra label is given for |
5732 |
% the next one. Note: |\emph{a}| is more than one letter long in this sense, |
5733 |
% so it is not just a problem for more than 26 papers with same authors and |
5734 |
% year. |
5735 |
% |
5736 |
% \changes{3.81}{1996 Jun 17}{Add \texttt{\char`\\natexlab}} |
5737 |
% The command |\natexlab| now encloses the extra label for \texttt{natbib} |
5738 |
% styles. This command normally just prints its argument, but for numerical |
5739 |
% citation mode, it swallows its argument. This allows the extra labels to |
5740 |
% be suppressed for numerical citations where they are superfluous. |
5741 |
% The enclosing braces mentioned above must be included here to make the |
5742 |
% entire extra label text a single token for \texttt{natbib}. |
5743 |
% \begin{macrocode} |
5744 |
%<*ay> |
5745 |
FUNCTION {reverse.pass} |
5746 |
{ next.extra "b" = |
5747 |
{ "a" 'extra.label := } |
5748 |
'skip$ |
5749 |
if$ |
5750 |
extra.label 'next.extra := |
5751 |
extra.label |
5752 |
%<xlab-it> emphasize |
5753 |
duplicate$ empty$ |
5754 |
'skip$ |
5755 |
{ "{\natexlab{" swap$ * "}}" * } |
5756 |
if$ |
5757 |
'extra.label := |
5758 |
%<!(har|ast|cay|nmd|cn)> label extra.label * 'label := |
5759 |
} |
5760 |
|
5761 |
%</ay> |
5762 |
%<*!ay&alph> |
5763 |
FUNCTION {reverse.pass} |
5764 |
{ next.extra "b" = |
5765 |
{ "a" 'extra.label := } |
5766 |
'skip$ |
5767 |
if$ |
5768 |
label extra.label * 'label := |
5769 |
label width$ longest.label.width > |
5770 |
{ label 'longest.label := |
5771 |
label width$ 'longest.label.width := |
5772 |
} |
5773 |
'skip$ |
5774 |
if$ |
5775 |
extra.label 'next.extra := |
5776 |
} |
5777 |
|
5778 |
%</!ay&alph> |
5779 |
% \end{macrocode} |
5780 |
% \end{macro} |
5781 |
% |
5782 |
% \begin{macrocode} |
5783 |
%<ay>EXECUTE {initialize.extra.label.stuff} |
5784 |
%<!ay&alph>EXECUTE {initialize.longest.label} |
5785 |
%<*ay|alph> |
5786 |
|
5787 |
ITERATE {forward.pass} |
5788 |
|
5789 |
REVERSE {reverse.pass} |
5790 |
|
5791 |
%</ay|alph> |
5792 |
%<*ay> |
5793 |
FUNCTION {bib.sort.order} |
5794 |
{ sort.label |
5795 |
" " |
5796 |
* |
5797 |
year field.or.null sortify |
5798 |
%<seq-yr&!(seq-lab|seq-key)> swap$ |
5799 |
* |
5800 |
" " |
5801 |
* |
5802 |
%<*!seq-key&!seq-yr> |
5803 |
title field.or.null |
5804 |
sort.format.title |
5805 |
%</!seq-key&!seq-yr> |
5806 |
%<seq-key|seq-yr> cite$ |
5807 |
* |
5808 |
#1 entry.max$ substring$ |
5809 |
'sort.key$ := |
5810 |
%<har|cay|nmd|cn|ast> calc.short.label |
5811 |
} |
5812 |
|
5813 |
ITERATE {bib.sort.order} |
5814 |
|
5815 |
SORT |
5816 |
|
5817 |
%</ay> |
5818 |
%<*!ay&!alph> |
5819 |
STRINGS { longest.label } |
5820 |
|
5821 |
INTEGERS { number.label longest.label.width } |
5822 |
|
5823 |
FUNCTION {initialize.longest.label} |
5824 |
{ "" 'longest.label := |
5825 |
#1 'number.label := |
5826 |
#0 'longest.label.width := |
5827 |
} |
5828 |
|
5829 |
FUNCTION {longest.label.pass} |
5830 |
%<*!cite> |
5831 |
{ number.label int.to.str$ 'label := |
5832 |
number.label #1 + 'number.label := |
5833 |
%</!cite> |
5834 |
%<cite>{ cite$ 'label := |
5835 |
label width$ longest.label.width > |
5836 |
{ label 'longest.label := |
5837 |
label width$ 'longest.label.width := |
5838 |
} |
5839 |
'skip$ |
5840 |
if$ |
5841 |
} |
5842 |
|
5843 |
EXECUTE {initialize.longest.label} |
5844 |
|
5845 |
ITERATE {longest.label.pass} |
5846 |
|
5847 |
%</!ay&!alph> |
5848 |
% \end{macrocode} |
5849 |
% |
5850 |
% \begin{macro}{`begin.bib'} |
5851 |
% \changes{2.0}{1994 Jan 31}{For \texttt{german}, add the definition of |
5852 |
% {\tt\protect\bslash qq} to replace double-quote character.} |
5853 |
% \changes{2.0}{1994 Jan 31}{For \texttt{babel}, read in file |
5854 |
% \texttt{babelbst.tex} in \texttt{thebibliography} to define the word |
5855 |
% commands.} |
5856 |
% \changes{3.4}{1995 Sep 5}{Add number of references as argument} |
5857 |
% The function \texttt{begin.bib} writes the initial text to the \texttt{.bbl} |
5858 |
% file. The most important matter here is that the \texttt{thebibliography} |
5859 |
% environment is invoked. |
5860 |
% \begin{macrocode} |
5861 |
FUNCTION {begin.bib} |
5862 |
%<*!ay&alph> |
5863 |
{ et.al.char.used |
5864 |
{ "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ } |
5865 |
'skip$ |
5866 |
if$ |
5867 |
preamble$ empty$ |
5868 |
%</!ay&alph> |
5869 |
%<ay|!alph>{ preamble$ empty$ |
5870 |
'skip$ |
5871 |
{ preamble$ write$ newline$ } |
5872 |
if$ |
5873 |
%<ay> "\begin{thebibliography}{" number.label int.to.str$ * "}" * |
5874 |
%<!ay> "\begin{thebibliography}{" longest.label * "}" * |
5875 |
write$ newline$ |
5876 |
%<!tit-it&tit-q> "\newcommand{\enquote}[1]{`#1'}" |
5877 |
%<!tit-it&!tit-q&tit-qq> "\newcommand{\enquote}[1]{``#1''}" |
5878 |
%<!tit-it&(tit-q|tit-qq)> write$ newline$ |
5879 |
%<umlaut> "\let\qq=\" quote$ * write$ newline$ |
5880 |
%<*ay> |
5881 |
"\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" |
5882 |
write$ newline$ |
5883 |
%</ay> |
5884 |
%<*babel> |
5885 |
"\input{babelbst.tex}" write$ newline$ |
5886 |
"\newcommand{\Capitalize}[1]{\uppercase{#1}}" write$ newline$ |
5887 |
"\newcommand{\capitalize}[1]{\expandafter\Capitalize#1}" write$ newline$ |
5888 |
%</babel> |
5889 |
} |
5890 |
|
5891 |
EXECUTE {begin.bib} |
5892 |
|
5893 |
% \end{macrocode} |
5894 |
% \end{macro} |
5895 |
% \begin{macrocode} |
5896 |
EXECUTE {init.state.consts} |
5897 |
|
5898 |
ITERATE {call.type$} |
5899 |
|
5900 |
FUNCTION {end.bib} |
5901 |
{ newline$ |
5902 |
"\end{thebibliography}" write$ newline$ |
5903 |
} |
5904 |
|
5905 |
EXECUTE {end.bib} |
5906 |
%</!head> |
5907 |
%</!options&!driver&!bblbst> |
5908 |
% \end{macrocode} |
5909 |
% |
5910 |
% \section{The File \texttt{babelbst.tex} for English} |
5911 |
% The following contains the definitions for the \texttt{babel} language |
5912 |
% selection as they apply to English. This file may be extracted with |
5913 |
% \dtx{} and the option \texttt{bblbst}. |
5914 |
% \begin{macrocode} |
5915 |
%<*bblbst> |
5916 |
% This is babelbst.tex for English. |
5917 |
% It should serve as a model for other languages. |
5918 |
% Alternatively, store it under a different name (e.g. englbst.tex) |
5919 |
% and then \input it with a command in babelbst.tex. |
5920 |
\def\bbland{and} |
5921 |
\def\bbleditors{editors} \def\bbleds{eds.} |
5922 |
\def\bbleditor{editor} \def\bbled{ed.} |
5923 |
\def\bbledby{edited by} |
5924 |
\def\bbledition{edition} \def\bbledn{edn.} |
5925 |
\def\bblvolume{volume} \def\bblvol{vol.} |
5926 |
\def\bblof{of} |
5927 |
\def\bblnumber{number} \def\bblno{no.} |
5928 |
\def\bblin{in} |
5929 |
\def\bblpages{pages} \def\bblpp{pp.} |
5930 |
\def\bblpage{page} \def\bblp{p.} |
5931 |
\def\bblchapter{chapter} \def\bblchap{chap.} |
5932 |
\def\bbltechreport{Technical Report} |
5933 |
\def\bbltechrep{Tech. Rep.} |
5934 |
\def\bblmthesis{Master's thesis} |
5935 |
\def\bblphdthesis{Ph.D. thesis} |
5936 |
\def\bblfirst{First} \def\bblfirsto{1st} |
5937 |
\def\bblsecond{Second} \def\bblsecondo{2nd} |
5938 |
\def\bblthird{Third} \def\bblthirdo{3rd} |
5939 |
\def\bblfourth{Fourth} \def\bblfourtho{4th} |
5940 |
\def\bblfifth{Fifth} \def\bblfiftho{5th} |
5941 |
\def\bblst{st} \def\bblnd{nd} \def\bblrd{rd} |
5942 |
\def\bblth{th} |
5943 |
\def\bbljan{January} \def\bblfeb{February} \def\bblmar{March} |
5944 |
\def\bblapr{April} \def\bblmay{May} \def\bbljun{June} |
5945 |
\def\bbljul{July} \def\bblaug{August} \def\bblsep{September} |
5946 |
\def\bbloct{October} \def\bblnov{November} \def\bbldec{December} |
5947 |
%</bblbst> |
5948 |
% \end{macrocode} |
5949 |
% |
5950 |
% \Finale |