Debian Codegraph @

texmf-dist/source/bibtex/francais-bst/francais-bst.mbs

raw
1 % \iffalse meta-comment -*- mode: doctex -*-
2 %
3 % Master bibliography style for francais.bst and francaissc.bst
4 %
5 % Copyright (C) 2012-2024 Vincent Goulet
6 %
7 % This file may be distributed and/or modified under the conditions
8 % of the LaTeX Project Public License, either version 1.3c of this
9 % license or (at your option) any later version. The latest version
10 % of this license is in:
11 %
12 % https://www.latex-project.org/lppl.txt
13 %
14 % This work has the LPPL maintenance status `maintained'.
15 %
16 % The Current Maintainer of this work is Vincent Goulet
17 % <[email protected]>.
18 %
19 % This work derives from merlin.mbs, part of the custom-bib
20 % collection, a contribution to the LaTeX2e system.
21 % Copyright 1994-2011 Patrick W Daly
22 % Max-Planck-Institut f\"ur Sonnensystemforschung
23 % Max-Planck-Str. 2
24 % D-37191 Katlenburg-Lindau
25 % Germany
26 % E-mail: [email protected]
27 %
28 %<*!tail>
29 % (The following notice appears in bst files generated from this file)
30 % -------------------------------------------------------------------
31 % Name and version information of the main mbs file:
32 %\fi
33 % \ProvidesFile{francais-bst.mbs}[2024/02/13 v2.0a (VG, PWD, AO, DPC)]
34 %\iffalse
35 %</!tail>
36 %<*a&!a>
37 % The following ensures that the driver part is not seen by makebst
38 % The driver part must not contain any \end other than \end{document} !
39 \ifx\endoptions\undefined\let\tempx=\relax\else
40 \long\def\tempx#1\end#2{}\fi\tempx
41 %</a&!a>
42 %<*driver>
43 \NeedsTeXFormat{LaTeX2e}%
44 \documentclass[article,oneside,11pt,x11names,french]{memoir}
45 \usepackage{babel}
46 \usepackage{metalogo}
47 \usepackage{enumitem}
48
49 %% Le chargement de doc.sty cause des conflits avec memoir. Il faut:
50 %%
51 %% - annuler la définition de l'environnement 'glossary' de memoir;
52
53 %% - remettre en place les définitions standards des commandes pour
54 %% le glossaire sur lesquelles se base doc.sty (nécessaire aussi
55 %% pour l'index, mais il n'est pas utilisé).
56 \let\theglossary\relax % avoid conflict with doc.sty
57 \let\endtheglossary\relax % avoid conflict with doc.sty
58 \makeatletter
59 \def\makeglossary{%
60 \newwrite\@glossaryfile
61 \immediate\openout\@glossaryfile=\jobname.glo
62 \def\glossary{\@bsphack\begingroup
63 \@sanitize
64 \@wrglossary}\typeout
65 {Writing glossary file \jobname.glo }%
66 \let\makeglossary\@empty
67 }
68 \@onlypreamble\makeglossary
69 \def\@wrglossary#1{%
70 \protected@write\@glossaryfile{}%
71 {\string\glossaryentry{#1}{\thepage}}%
72 \endgroup
73 \@esphack}
74 \def\glossary{\@bsphack\begingroup\@sanitize\@index}
75 \@twosidefalse\@mparswitchfalse % turn off twoside option
76 \makeatother
77 \usepackage{doc}
78 \def\changes#1#2#3{\glossary{#1>#3}} % simplification
79 \DisableCrossrefs
80 \CodelineNumbered
81 \RecordChanges
82 \OnlyDescription
83 \DontCheckModules
84
85 %% Polices de caractères
86 \iftutex
87 \usepackage[babel=true]{microtype}
88 \usepackage{fontspec}
89 \usepackage{unicode-math}
90 \setmainfont{STIXTwoText}
91 [
92 Extension = .otf,
93 UprightFont = *-Regular,
94 BoldFont = *-SemiBold,
95 ItalicFont = *-Italic,
96 BoldItalicFont = *-SemiBoldItalic,
97 Numbers = {Proportional,OldStyle},
98 Scale = 1,
99 Ligatures = TeX
100 ]
101 \setsecheadstyle{\normalfont\Large\sffamily\bfseries\raggedright}
102 \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\raggedright}
103 \setsubsubsecheadstyle{\normalfont\sffamily\bfseries\raggedright}
104 \else
105 \usepackage[babel=true]{microtype}
106 \usepackage[utf8]{inputenc}
107 \usepackage[T1]{fontenc}
108 \usepackage[stix2]{newtxmath}
109 \fi
110 \usepackage[book,medium,proportional,oldstyle,scale=0.92]{FiraSans}
111 \usepackage[medium,lining,scale=0.90]{FiraMono}
112
113 %% Couleurs
114 \usepackage{xcolor}
115 \definecolor{link}{rgb}{0,0.4,0.6} % liens internes
116 \definecolor{url}{rgb}{0.6,0,0} % liens externes
117 \definecolor{citation}{rgb}{0,0.5,0} % citations
118
119 %% Hyperliens
120 \AtEndPreamble{%
121 \usepackage{bookmark} % charge hyperref
122 \hypersetup{%
123 colorlinks = true,
124 urlcolor = {url},
125 linkcolor = {link},
126 citecolor = {citation}}
127 \bookmarksetup{%
128 open = true,
129 depth = 3,
130 numbered = true}
131 }
132
133 %% Désactiver le niveau des chapitres de memoir
134 \let\chapter\relax
135 \counterwithout{section}{chapter}
136
137 %% Aligner à gauche l'environnement enumerate
138 \setlist[enumerate]{leftmargin=*,align=left}
139
140 %% Configurer le glossaire
141 \addto\extrasfrench{%
142 \def\glossaryname{Historique des versions}}
143 \GlossaryPrologue{\section*{\glossaryname}%
144 \addcontentsline{toc}{section}{\glossaryname}}
145 \setcounter{GlossaryColumns}{2}
146 \setlength{\GlossaryMin}{5cm}
147
148 %% Commandes sémantiques additionnelles
149 \let\class\textsf
150 \let\pkg\textbf
151 \makeatletter
152 \renewcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\code@}
153 \def\code@#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup}
154 \makeatother
155 \newcommand*\frbstname{francais}
156 \newcommand*\frscbstname{francaissc}
157 \newcommand*\frbst{\code{\frbstname}}
158 \newcommand*\frscbst{\code{\frscbstname}}
159 \newcommand*\btx{\textsc{Bib}\TeX}
160 \newcommand*\dtx{\textsf{docstrip}}
161
162 %% Redéfinir \year pour utiliser l'information de \filedate plutôt
163 %% que la date de compilation
164 \def\parsedate#1/#2/#3\relax{\def\year{#1}}
165
166 %% Convertir la date en format ISO
167 \def\isodate#1/#2/#3\relax{#1-#2-#3}
168
169 \MakeShortVerb{\|}
170
171 \begin{document}
172 \DocInput{francais-bst.mbs}
173 \end{document}
174 %</driver>
175 % end of meta-comment \fi
176 % \GetFileInfo{francais-bst.mbs}
177 % \expandafter\parsedate\filedate\relax
178 %
179 % \changes{1.0}{2012-10-18}{Version initiale.}
180 % \changes{1.0a}{2013-05-03}{Corrections à la documentation dans le
181 % fichier \texttt{README}.}
182 % \changes{1.1}{2013-05-12}{Modifications à \texttt{francaissc.bst}
183 % pour que la conjonction «et» et le marqueur «et collab.» soient en
184 % romain plutôt qu'en petites capitales. Merci à François Legendre
185 % \url{[email protected]} pour le tuyau.}
186 % \changes{1.1}{2013-05-12}{Introduction d'un numéro de version.}
187 % \changes{2.0}{2023-10-28}{Documentation améliorée en format PDF.}
188 % \changes{2.0}{2023-10-28}{Le titre d'un rapport technique est
189 % maintenant composé comme celui d'un livre, plutôt que comme celui
190 % d'un article.}
191 % \changes{2.0}{2023-10-28}{Les URL ne sont plus précédées de
192 % l'étiquette «URL».}
193 % \changes{2.0}{2023-10-28}{La présentation des identificateurs
194 % d'objets numériques (DOI) a été complètement révisée.}
195 % \changes{2.0}{2023-10-28}{Le numéro ISSN n'est plus affiché dans les
196 % notices bibliographiques (il demeure permis dans les bases de
197 % données).}
198 % \changes{2.0}{2023-10-28}{La disposition de certains éléments dans
199 % la notice bibliographique a été révisée.}
200 % \changes{2.0a}{2024-02-13}{Correction de coquilles dans la
201 % documentation.}
202 %
203 % \title{Styles bibliographiques {\frbst} et {\frscbst}}
204 % \author{Vincent Goulet \\ École d'actuariat, Université Laval}
205 % \date{Version {\fileversion} du {\expandafter\isodate\filedate\relax}}
206 %
207 % \maketitle
208 %
209 % \section{Introduction}
210 %
211 % Les styles bibliographiques {\frbst} et {\frscbst} permettent de
212 % composer des bibliographies en français conformes aux règles de
213 % présentation de la méthode auteur-date proposées dans l'ouvrage de
214 % référence de Marie Malo, \emph{Guide de la communication écrite au
215 % cégep, à l'université et en entreprise} (Québec Amérique, 1996).
216 %
217 % Les styles ont été développés à l'origine à l'aide du programme
218 % \code{makebst} de Patrick W.~Daly. Le fichier maitre de styles
219 % bibliographiques \code{\filename} dérive étroitement du fichier
220 % \code{merlin.mbs} du paquetage %
221 % \href{https://ctan.org/pkg/custom-bib}{\pkg{custom-bib}}.
222 %
223 % \section{Installation}
224 % \label{sec:installation}
225 %
226 % Les styles bibliographiques sont distribués dans le paquetage %
227 % \href{https://ctan.org/pkg/francais-bst}{\pkg{francais-bst}} %
228 % via le réseau de sites \emph{Comprehensive {\TeX} Archive Network}
229 % (CTAN). Le paquetage fait partie des distributions {\TeX} standards
230 % telles que {TeX}~Live, Mac{\TeX} et MiK{\TeX}.
231 %
232 % Je recommande fortement d'installer ou de mettre à jour le paquetage
233 % à l'aide du gestionnaire de paquetages de votre distribution {\TeX}.
234 % Par exemple, avec {\TeX}~Live, vous pouvez effectuer ces opérations
235 % dans l'assistant graphique, ou encore avec l'une ou l'autre des
236 % commandes ci-dessous:
237 % \begin{quote}
238 % \code{tlmgr install francais-bst}
239 % \end{quote}
240 % ou
241 % \begin{quote}
242 % \code{tlmgr update francais-bst}
243 % \end{quote}
244 %
245 % S'il vous est impossible d'installer des paquetages ou de mettre à
246 % jour la distribution {\TeX} --- notamment si vous utilisez une
247 % plateforme de rédaction en ligne --- vous pouvez procéder à une
248 % installation simplifiée des styles, mais dont la portée sera
249 % limitée à votre projet. Pour ce faire, téléchargez l'archive %
250 % \begin{quote}
251 % \code{francais-bst-project-install.zip}
252 % \end{quote}
253 % depuis le %
254 % \href{https://gitlab.com/vigou3/francais-bst/-/releases}{%
255 % dépôt du projet \code{francais-bst}} %
256 % et décompressez celle-ci dans le répertoire de votre projet. Vous
257 % disposerez alors de tous les fichiers essentiels du paquetage à
258 % l'intérieur de ce projet. %
259 %
260 % Si votre expertise {\TeX} vous pousse à préférer une installation
261 % manuelle avec accès à l'intégralité du code source des styles
262 % bibliographiques, consultez les instructions qui se trouvent dans le
263 % fichier \code{README.md} du paquetage. %
264 %
265 % \section{Utilisation des styles bibliographiques}
266 % \label{sec:utilisation}
267 %
268 % Les styles {\frbst} et {\frscbst} sont conçus pour composer des
269 % bibliographies selon la méthode auteur-date dans des documents en
270 % français. Ils reposent sur les paquetages %
271 % \href{https://ctan.org/pkg/babel}{\pkg{babel}} %
272 % et %
273 % \href{https://ctan.org/pkg/natbib}{\pkg{natbib}}. %
274 % Ce dernier doit être chargé avant \pkg{babel}. Le préambule du
275 % document devrait donc contenir les commandes:
276 % \begin{quote}
277 % \cmdprint{\usepackage}\code{\{natbib\}} \\
278 % \cmdprint{\usepackage}\code{[french]\{babel\}}
279 % \end{quote}
280 %
281 % Je recommande fortement d'enregistrer le code source d'un ouvrage en
282 % français dans le codage de caractères %
283 % \href{https://fr.wikipedia.org/wiki/UTF-8}{UTF-8} %
284 % et de le compiler avec un moteur {\TeX} moderne qui prend d'emblée
285 % en charge ce type de codage, comme {\XeLaTeX}. Vous pourrez ainsi
286 % entrer les lettres accentuées directement au clavier («\code{é}»)
287 % sans devoir passer par les commandes {\TeX} («\code{{\bs}'e}»).
288 %
289 % Si vous utilisez toujours {\LaTeX} ou {pdf\LaTeX}, vous devrez
290 % charger les polices T1 pour que la césure de mots fonctionne
291 % adéquatement avec les mots comportant des lettres accentuées:
292 % \begin{quote}
293 % \cmdprint{\usepackage}\code{[T1]\{fontenc\}}
294 % \end{quote}
295 % Les guillemets français «~» devraient normalement apparaitre
296 % correctement dans la bibliographie (notamment autour des titres
297 % d'articles). Si ce n'est pas le cas, essayez aussi de charger les
298 % paquetages
299 % \href{https://ctan.org/pkg/ae}{\pkg{ae}} %
300 % et
301 % \href{https://ctan.org/pkg/aeguill}{\pkg{aeguill}}:
302 % \begin{quote}
303 % \cmdprint{\usepackage}\code{\{ae,aeguill\}}
304 % \end{quote}
305 %
306 % Enfin, pour utiliser les styles de bibliographie, insérez dans le
307 % document l'une ou l'autre des commandes
308 % \begin{quote}
309 % \cmdprint{\bibliographystyle}\code{\{francais\}} \\
310 % \cmdprint{\bibliographystyle}\code{\{francaissc\}}
311 % \end{quote}
312 %
313 % \section{Caractéristiques des styles bibliographiques}
314 % \label{sec:caracteristiques}
315 %
316 % Les styles {\frbst} et {\frscbst} sont conçus pour produire des
317 % bibliographies auteur-date conformes aux règles de typographie
318 % française.
319 %
320 % Avec le style {\frbst}, les noms d'auteurs apparaissent en police
321 % standard tant dans la bibliographie que dans dans les citations.
322 % C'est la pratique usuelle au Québec. Avec le style {\frscbst}, les
323 % noms d'auteurs apparaissent plutôt en petites capitales dans la
324 % bibliographie et dans les citations. Cela semble être la pratique
325 % usuelle en France et ailleurs dans la Francophonie.
326 %
327 % Les styles prennent en charge tous les types de documents standards
328 % de {\BibTeX} (\code{article}, \code{book}, \code{proceedings},
329 % etc.), ainsi que tous les champs standards (\code{author},
330 % \code{title}, \code{journal}, etc.). Ils ajoutent toutefois les
331 % champs suivants:
332 % \begin{description}[font=\mdseries\ttfamily,style=nextline,leftmargin=3em]
333 % \item[doi] L'identificateur d'objet numérique (DOI) d'une ressource.
334 % Entrez la valeur sous la forme
335 % \meta{préfixe}\code{/}\meta{suffixe} (par exemple:
336 % \code{10.1000/182}). Les styles créent automatiquement un
337 % hyperlien vers la ressource.
338 % \item[isbn] Le numéro international normalisé du livre (ISBN) d'un
339 % ouvrage. Lorsque disponible, le numéro est affiché dans la liste
340 % des références.
341 % \item[issn] Le numéro international normalisé des publications en
342 % série (ISSN) d'une publication en série, tel qu'un magazine. Bien
343 % que permis dans la base de données bibliographiques, ce numéro
344 % n'est pas affiché dans la liste des références.
345 % \item[language] La langue de la référence, exprimée selon la
346 % nomenclature de \pkg{babel}. Inclure cette information dans une
347 % entrée assure que la coupure des mots du titre sera effectuée
348 % selon les règles de la langue de celui-ci.
349 % \item[url] L'adresse URL de la référence. Si une adresse URL et un
350 % identificateur DOI sont tous deux présents dans la base de
351 % données, ce dernier aura priorité.
352 % \end{description}
353 %
354 % \section{Personnalisation des mots-clés}
355 % \label{sec:personnalisation}
356 %
357 % Les bibliographies comportent nombre de termes et de locutions ---
358 % \emph{editor}, \emph{edited by}, \emph{et~al.}, etc. --- qui doivent
359 % être adaptés pour le français. Les styles {\frbst} et {\frscbst} ont
360 % recours aux définitions qui se trouvent dans le fichier de
361 % localisation \code{francaisbst.tex}.
362 %
363 % Vous pouvez personnaliser le fichier \code{francaisbst.tex} pour
364 % l'adapter à vos besoins. Pour ce faire, créez une copie du fichier
365 % livré dans le paquetage \pkg{francais-bst} et modifiez cette copie.
366 % Placez ensuite votre version de \code{francaisbst.tex} dans le
367 % répertoire de votre projet ou, encore mieux, dans l'arborescence
368 % {\TeX} de votre répertoire personnel, normalement sous
369 % \begin{quote}
370 % \code{\$TEXMFHOME/tex/latex/francais-bst/francaisbst.tex}
371 % \end{quote}
372 %
373 % \section{Production des styles bibliographiques}
374 % \label{sec:production}
375 %
376 % Les fichiers de styles bibliographiques \code{\frbstname.bst} et
377 % \code{\frscbstname.bst}, et le fichier de localisation
378 % \code{francaisbst.tex} sont générés à partir du fichier maitre de
379 % styles bibliographiques \code{\filename} en compilant leurs scripts
380 % de génération respectifs avec {\LaTeX}:
381 % \begin{quote}
382 % \code{latex francais.dbj} \\
383 % \code{latex francaissc.dbj} \\
384 % \code{latex francaisbst.dbj}
385 % \end{quote}
386 %
387 % \section{Changements par rapport à \texorpdfstring{\code{merlin.mbs}}{merlin.mbs}}
388 % \label{sec:changements}
389 %
390 % Cette section documente les changements apportés au fichier
391 % \code{merlin.mbs} du paquetage \pkg{custom-bib} pour produire le
392 % fichier maitre de styles bibliographiques \code{\filename}.
393 %
394 % \begin{enumerate}
395 % \item La fonction \code{format.url} a été retravaillée pour produire
396 % une URL simplifiée pour les identificateurs d'objet numérique
397 % (DOI). La définition de \code{merlin.mbs} produit une URL de la
398 % forme
399 % \begin{quote}
400 % URL \texttt{http://dx.doi.org/\meta{doi}}
401 % \end{quote}
402 % La nouvelle définition produit plutôt
403 % \begin{quote}
404 % doi: \meta{doi}
405 % \end{quote}
406 % Lorsque le paquetage \pkg{hyperref} est chargé, \meta{doi} est un
407 % hyperlien vers ce qui est aujourd'hui l'URL recommandée pour les
408 % DOI: \code{https://doi.org/\meta{doi}}. Le texte et l'hyperlien
409 % sont produits par la commande \cmd{\urldoi} qui est insérée dans
410 % le fichier \texttt{.bbl}. Vous pouvez redéfinir cette commande
411 % dans votre document pour l'adapter à vos besoins, si désiré.
412 % \item La commande \cmd{\urlprefix} est vide, de sorte que «URL»
413 % n'apparait pas devant les URL dans la bibliographie. De nouveau,
414 % vous pouvez redéfinir la commande dans votre document si désiré.
415 % \item Les guillemets français «~» sont produits par la commande
416 % \cmd{\frquote} de \pkg{babel-french} (version $\geq$ 3.1) plutôt
417 % qu'avec les commandes \cmd{\guillemotleft} et
418 % \cmd{\guillemotright}.
419 % \item Les définitions françaises de mots-clés se trouvent dans
420 % \code{francaisbst.tex}, plutôt que dans \code{babelbst.tex}.
421 % \item L'option \code{bblbst} permet d'extraire le fichier
422 % \code{francaisbst.tex}.
423 % \item L'information sur le menu de \code{makebst} est reléguée à la
424 % documentation complète. Désactiver la commande
425 % \cmd{\OnlyDescription} dans \code{\filename}, puis compiler le
426 % fichier avec {pdf\LaTeX} ou {\XeLaTeX} pour obtenir la
427 % documentation complète.
428 % \end{enumerate}
429 %
430 % \StopEventually{\PrintChanges}
431 %
432 % \begin{quote}
433 % \itshape À partir de ce point, la documentation est celle, en
434 % anglais, du fichier \code{merlin.mbs}, dont l'auteur est Patrick
435 % W.~Daly.
436 % \end{quote}
437 %
438 % \section{The Menu Information}\label{sec:menu}
439 %
440 % Here I describe the options and menu information for this particular
441 % master file \texttt{\filename}. To construct a \dtx{} driver file
442 % to generate a desired \texttt{.bst} file, simply process \texttt{makebst.tex}
443 % with \TeX\ or \LaTeX, and give
444 % \begin{quote}\code{\filename}\end{quote}
445 % when prompted for the name of the master file. Then answer the questions
446 % in the menus that follow. The menu information is extracted from here.
447 %
448 % All the menu information is nested between \dtx{} guard options
449 % |%<*options>| \dots\ |%</options>|, and the last command is
450 % |\endoptions|. The rest of the file is nested between
451 % \begin{quote}
452 % |%<*!options&!driver&!bblbst>| \dots\ |</!options&!driver&!bblbst>|
453 % \end{quote}
454 % in order to exclude it if \dtx{} is used to
455 % extract the menu information, the documentation driver, or the
456 % \texttt{francaisbst.tex} file.
457 %
458 % The main coding is divided into two sections, the \emph{head} and
459 % \emph{tail}; in between come any external language or journal name
460 % support files. The head part is marked with the \dtx{} guard option
461 % |<!tail>| and the tail with |<!head>|. This roundabout means of
462 % doing things makes it possible to process \texttt{\filename} with
463 % \texttt{.dbj} files that were generated for the older
464 % \texttt{genbst.mbs} file by simply changing the name of the source
465 % file. If both \texttt{head} and \texttt{tail} (and \texttt{exlang})
466 % options are omitted, as they are in the older \texttt{.dbj} files,
467 % \texttt{\filename} is processed completely in one pass. To include
468 % external files, two passes are needed, one for each part, with the
469 % external file(s) coming in between.
470 %
471 % Note too that if the internal language commands are taken (i.e., if
472 % \texttt{exlang} option is not given) then the default language is
473 % English, which is tested for as |<!babel>|. This too permits the simple
474 % update of older \texttt{.dbj}, at least for English.
475 %
476 % \subsection*{Selecting Language}
477 % Explicit words in the bibliography style, such as \textsl{and},
478 % \textsl{editor}, etc.,
479 % are represented by functions \texttt{bbl.and}, \texttt{bbl.editor}, and so on.
480 % By default these functions translate to the normal English text, but
481 % other languages are also possible.
482 %
483 % The definitions of these functions for other languages are contained in
484 % external files. At this point, we can make use of features in
485 % \texttt{makebst} (version~3.0 or later) to ask for the name of such a
486 % definition file, and store it in |\cfile|. If no external file is
487 % specified, then the internal definitions are taken, for which there are
488 % two possibilities: English or \LaTeX{} commands (Babel).
489 %
490 % The commands |\MBswitch|, |\mes|, |\MBaskfile|, |\wr|, |\pc|, |\spsp| are
491 % defined in \texttt{makebst.tex}.
492 %
493 % If |\MBswitch| does not exist, then the version of \texttt{makebst}
494 % cannot support external files.
495 %
496 % \begin{macrocode}
497 %<*options>
498 \expandafter\ifx\csname beginoptiongroup\endcsname\relax
499 \mes{^^J******************^^J%
500 !!!!!! VERSION CLASH !!!!!!!!!^^J%
501 This mbs file requires makebst version 4.0 or more^^J%
502 You must update makebst to run it with this mbs file^^J%
503 No docstrip batch file can be produced on this run^^J%
504 ******************}
505 \let\temp\endinput\else\let\temp\relax\fi\temp
506
507 \newif\ifnumerical
508 \newif\ifmytemp
509 \mes{<<< For more information about the meanings of^^J%
510 <<< the various options, see the section on ^^J%
511 <<< Menu Information in the .mbs file documentation.}
512
513 \umes{EXTERNAL FILES:}
514 \expandafter\ifx\csname MBswitch\endcsname\relax
515 \mes{^^J**************^^J%
516 Makebst version is less than 3.0^^J%
517 Cannot add external file for language definition^^J%
518 **************}
519 \umes{No included files.}%
520 \def\cfile{}\def\jfile{}%
521 \else
522 \MBaskfile{^^JName of language definition file}(\mroot.\mext)i\cfile
523 \edef\ctemp{\mroot.\mext}
524 \ifx\ctemp\cfile\def\cfile{}\fi
525 \umes{Name of language file: \string\cfile=\cfile.}%
526 % \end{macrocode}
527 %
528 % A second type of external file that can be added is one containing names
529 % of journals that are to be prestored into the \texttt{.bst} file.
530 % Several file names are allowed here, with the root names separated by
531 % commas, and with the common extension added at the end. To assist later
532 % parsing of the names, an additional comma is added before the extension.
533 %
534 % Note that in this case |\MBaskfile| treats the file(s) as output, i.e.,
535 % it does not check if the file(s) actually exist.
536 %
537 % The macro |\Mgetnext| allows the root names to be extracted from the
538 % list of file names.
539 % \begin{macrocode}
540 \def\jfile{}
541 \ask{\yn}{^^JInclude file(s) for extra journal names? (NO)}
542 \mytempfalse
543 \if!\yn!\else\if\yn n\else\if\yn N\else\mytemptrue\fi\fi\fi
544 \ifmytemp
545 \MBaskfile{^^JFile to include}(physjour,geojour,photjour.mbs)o\jfile
546 \edef\jfile{\froot,.\fext}
547 \umes{Name of included files: \string\jfile=\jfile.}%
548 \else
549 \umes{No included files.}%
550 \fi
551 \fi%MBswitch
552 \def\Mgetnext#1,#2.#3??{\def\froot{#1}\def\Mrest{#2}\def\fext{#3}}
553 % \end{macrocode}
554 %
555 % If no external files are specified, then both |\cfile| and |\jfile| are
556 % empty. In this case, do \emph{not} set the options \texttt{head} and
557 % \texttt{tail}, which control the \dtx{} passes through
558 % \texttt{filename}. Now only one pass is made.
559 %
560 % If there is an external definition file, or an external list of
561 % journal names, then some extra text must be
562 % written to fit in with that already written by \texttt{makebst}. This is
563 % explained in that documentation. The |\MBswitch| command turns the curly
564 % braces |{..}| into normal characters, and the parentheses |(..)| take on
565 % their grouping functionality. This permits unbalanced braces to be
566 % written to the output file.
567 %
568 % \begin{macrocode}
569 \if!\cfile\jfile!\else
570 \begingroup\MBswitch
571 \wr(\spsp head,\string\MBopta})
572 \if!\cfile!\else
573 \wr(\string\from{\cfile}{\string\MBopta})
574 \fi
575 \if!\jfile!\else
576 \let\jxfile\jfile
577 \loop
578 % \end{macrocode}
579 %
580 % Parse the list of journal name files, adding a new |\from| for each one.
581 %
582 % \begin{macrocode}
583 \expandafter\Mgetnext\jxfile??
584 \wr(\string\from{\froot.\fext}{\string\MBopta})
585 \edef\jxfile(\Mrest.\fext)
586 \if!\Mrest!\def\Mtst(1)\else\def\Mtst()\fi
587 \if!\Mtst!
588 \repeat
589 \fi
590 \wr(\string\from{\mroot.\mext}{tail,\string\MBopta}})
591 \wr(\string\def\string\MBopta{\pc)
592 \endgroup
593 \fi
594 % \end{macrocode}
595 %
596 % Ask whether there is a need for
597 % explicit English words or \LaTeX{} commands whose definitions are
598 % to be found in the file \texttt{francaisbst.tex}.
599 %
600 % \begin{macrocode}
601 \beginoptiongroup{INTERNAL LANGUAGE SUPPORT
602 (if no external language file)}%
603 {\if!\cfile!\relax*\fi}%
604 \optdef{*}{}{English}{words used explicitly}
605 \optdef{b}{babel}{Babel}
606 {(words replaced by commands defined in francaisbst.tex)}
607 \getans
608 \endoptiongroup
609 \if!\cfile!\relax\else
610 \wr{\spsp\spsp exlang,\pc: External language file}
611 \fi
612 % \end{macrocode}
613 %
614 % \subsection*{Author--year or numerical}
615 % The first question is whether a numerical or author--year citation
616 % style is to be used. If the latter, the supporting system is my
617 % \code{natbib.sty}, which expects |\bibitem| to have an optional
618 % argument containing the short form of the authors, plus year in
619 % parentheses. E.g.,
620 % \begin{quote}
621 % |\bibitem[Daly et al.(1990)]{key}...|
622 % \end{quote}
623 % There is now a newer version of \texttt{natbib.sty} (v5.3) that
624 % supports an optional full author list too, as
625 % \begin{quote}
626 % |\bibitem[Daly et al.(1990)Daly, Keppler, and Williams]{key}...|
627 % \end{quote}
628 % Other systems are also supported, such as the Harvard family of
629 % bibliography styles (with \texttt{harvard.sty}), which have entries in the
630 % form
631 % \begin{quote}
632 % |\harvarditem[Daly et al.]{Daly, Keppler,|\\
633 % | and Williams}{1990}{key}...|
634 % \end{quote}
635 % or the astronomy family (with \texttt{astron.sty}) with entries like
636 % \begin{quote}
637 % |\bibitem[\protect\astroncite{Daly et al.}{1990}]{key}...|
638 % \end{quote}
639 % or the Chicago family (with \texttt{chicago.sty}) with entries like
640 % \begin{quote}
641 % |\bibitem[\protect\citeautheryear{Daly, Keppler, and|\\
642 % | Williams}{Daly et al.}{1990}]{key}...|
643 % \end{quote}
644 % or the `named' variant of Chicago (with \texttt{named.sty}) with entries like
645 % \begin{quote}
646 % |\bibitem[\protect\citeauthoryear{Daly et al.}{1990}]{key}...|
647 % \end{quote}
648 % or the so-called ``author--date'' group (with \texttt{authordate1-4.sty})
649 % with entries of the form
650 % \begin{quote}
651 % |\bibitem[\protect\citename{Daly et al.}1990]{key}...|
652 % \end{quote}
653 % Finally, there is the \texttt{apalike} format of Oren Patashnik, for use
654 % with \texttt{apalike.sty} that has entries of the form
655 % \begin{quote}
656 % |\bibitem[Daly et al., 1990]{key}...|
657 % \end{quote}
658 %
659 % In addition to numerical or author--year citation styles, there is also a
660 % \texttt{cite} style available in which the label is the same as the cite
661 % key. This is for listing entire contents of databases with the cite key
662 % visible.
663 %
664 % A flag |\ifnumerical| is established because some of the following menu
665 % features depend on which system is to be used.
666 %
667 % The \texttt{alph} option produces labels as in \texttt{alpha.bst}; options
668 % \texttt{alf-1} and \texttt{alf-f} modify these. Standard is: first three
669 % letters of the single author (Dal90 for Daly, 1990) and first letters of
670 % first three authors (DK90 for Daly and Kopka, 1990). Alternatives are first
671 % three letters of the first author, no matter how many authors there are, and
672 % full name of first author.
673 % \begin{macrocode}
674 \beginoptiongroup{STYLE OF CITATIONS:}{}
675 \optdef{*}{}{Numerical}{as in standard LaTeX}
676 \optdef{a}{ay}{Author-year}{with some non-standard interface}
677 \optdef{b}{alph}{Alpha style, Jon90 or JWB90}{for single or multiple authors}
678 \optdef{o}{alph,alf-1}{Alpha style, Jon90}{even for multiple authors}
679 \optdef{f}{alph,alf-f}{Alpha style, Jones90}{(full name of first author)}
680 \optdef{c}{cite}{Cite key}{(special for listing contents of bib file)}
681 \getans
682 \endoptiongroup
683 \if\ans a\numericalfalse\else\numericaltrue\fi
684 \if\ans b\mytempfalse \else\mytemptrue \fi
685 \beginoptiongroup{HTML OUTPUT
686 (if non author-year citations)}
687 {\ifnumerical*\fi}
688 \optdef{*}{}{Normal LaTeX}{output}
689 \optdef{h}{html}{Hypertext}{output, in HTML code, in paragraphs}
690 \optdef{n}{html,htlist}{Hypertext list}{with sequence numbers}
691 \optdef{k}{html,htdes}{Hypertext with keys}{for viewing databases}
692 \getans
693 \endoptiongroup
694 \beginoptiongroup{AUTHOR--YEAR SUPPORT SYSTEM
695 (if author-year citations)}
696 {\ifnumerical\else*\fi}
697 \optdef{*}{nat}{Natbib}{for use with natbib v5.3 or later}
698 \optdef{o}{}{Older Natbib}{without full authors citations}
699 \optdef{l}{alk}{Apalike}{for use with apalike.sty}
700 \optdef{h}{har}{Harvard}{system with harvard.sty}
701 \optdef{a}{ast}{Astronomy}{system with astron.sty}
702 \optdef{c}{cay}{Chicago}{system with chicago.sty}
703 \optdef{n}{nmd}{Named}{system with named.sty}
704 \optdef{d}{cn}{Author-date}{system with authordate1-4.sty}
705 \getans
706 % \end{macrocode}
707 % The \texttt{harvard} family has been extended for \LaTeXe, and the new
708 % \texttt{.bst} files allow the word \textsl{and} and the brackets around years
709 % to be variable with commands. These features may be added too.
710 % The URL field used to be exclusively part of Harvard, but now exists
711 % independently of it too.
712 %
713 % \begin{macrocode}
714 \beginoptiongroup{HARVARD EXTENSIONS INCLUDED
715 (if Harvard support selected)}
716 {\if\ans h*\fi}%
717 \optdef{*}{harnm}{With Harvard extensions}{for LaTeX2e version of harvard.sty}
718 \optdef{n}{}{Older Harvard}{style, for LaTeX 2.09}
719 \getans
720 \endoptiongroup
721 \endoptiongroup
722 % \end{macrocode}
723 %
724 % \subsection*{Language switching}
725 % A \texttt{language} field can be present to specify the original language of
726 % the reference; with \verb!\setlanguage!, the hyphenation patterns are set for
727 % setting the title in that language.
728 % \begin{macrocode}
729 \beginoptiongroup{LANGUAGE FIELD}{}
730 \optdef{*}{}{No language field}{}
731 \optdef{l}{lang}{Add language field}{to switch hyphenation patterns temporarily}
732 \getans
733 \endoptiongroup
734 % \end{macrocode}
735 %
736 % \subsection*{Annotations}
737 % Annotations to a reference are additional information not normally printed
738 % out in the list of references. They are used for listing databases.
739 % The coding here was offered by Soren Dayton.
740 % \begin{macrocode}
741 \beginoptiongroup{ANNOTATIONS:}{}
742 \optdef{*}{}{No annotations}{will be recognized}
743 \optdef{a}{annote}{Annotations}{in annote field or in .tex file of citekey name}
744 \getans
745 \endoptiongroup
746 % \end{macrocode}
747 %
748 % \subsection*{Presentations}
749 % Presentations are talks at meetings, oral or poster, that are not otherwise
750 % published. The author making the presentation is indicated with the \texttt{key}
751 % entry, which is the speaker's number within the author list. The font used
752 % to highlight the speaker is either bold or italics, depending on the secondary
753 % option, otherwise not highlighted.
754 % \begin{macrocode}
755 \beginoptiongroup{PRESENTATIONS:}{}
756 \optdef{*}{}{Do not add presentation type}{for conference talks}
757 \optdef{p}{pres}{Add presentation, speaker not highlighted}{}
758 \optdef{b}{pres,pres-bf}{Presentation, speaker bold face}{}
759 \optdef{i}{pres,pres-it}{Presentaion, speaker italic}{}
760 \optdef{c}{pres,pres-sc}{Presentaion, speaker in small caps}{}
761 \getans
762 \endoptiongroup
763 % \end{macrocode}
764 %
765 % \subsection*{Ordering of the listed references}
766 % Choices here depend on citation style. The default in both cases is
767 % alphabetical order of all authors. For numerical style, one may also
768 % choose an unsorted order, which means the order is the same as the original
769 % citations. This corresponds to \texttt{unsrt.bst}. Order of citation is
770 % also offered for author--year for \texttt{natbib}-type styles that can
771 % also be used for numerical listings.
772 %
773 % Another possibility is to order first by year, then authors. This too only
774 % makes sense for numerical citations. However, it is offered for author--year
775 % in the event that a \texttt{natbib}-type style is used for numerical
776 % listings.
777 %
778 % For the alpha style, the ordering is by label only, so no option is
779 % offered here (|\ifnumerical| is \meta{true} and |\ifmytemp| is \meta{false}).
780 %
781 % For author--year, the second choice is by label. (The label is the
782 % optional |\bibitem| argument, and is what is printed in place of the
783 % |\cite| command.) With this option, all the papers with the same first
784 % author are ordered so that the one-author papers come first, followed by
785 % the two-author papers, followed by the multiple-author papers. This is a
786 % more sensible system for author--year citations, and is demanded by some
787 % journals (like JGR).
788 %
789 % One problem that can arise here is when two or more references have the
790 % same set of authors and year; normally they are then ordered by the
791 % title, ignoring initial words like \textsl{the} and \textsl{a}, with the
792 % letters a, b,
793 % c, \dots, added to the year. This can mean that a set of references with
794 % a natural sequence will be put into a different order. An alternative is
795 % to order them by the citation keyword instead of by title. This of course
796 % assumes that the keywords in this case reflect that natural sequence.
797 % \begin{macrocode}
798 \let\ans\relax
799 \beginoptiongroup{ORDERING OF REFERENCES
800 (if non-author/year and non-alph)}
801 {\ifnumerical\ifmytemp*\fi\fi}%
802 \optdef{*}{}{Alphabetical}{by all authors}
803 \optdef{c}{seq-no}{Citation order}{(unsorted, like unsrt.bst)}
804 \optdef{d}{seq-yr}{Year ordered}{and then by authors}
805 \optdef{r}{seq-yrr}{Reverse year ordered}{and then by authors}
806 \getans
807 \endoptiongroup
808 %
809 \beginoptiongroup{ORDERING OF REFERENCES
810 (if author-year citations)}
811 {\ifnumerical\else*\fi}%
812 \optdef{*}{}{Alphabetical}{by all authors}
813 \optdef{l}{seq-lab}{By label}%
814 {(Jones before Jones and James before Jones et al)}
815 \optdef{m}{seq-labc}{By label and cite order}%
816 {(like above but all Jones et al ordered as cited)}
817 \optdef{k}{seq-key}{By label and cite key}{instead of label and title, as above}
818 \optdef{d}{seq-yr}{Year ordered}{and then by authors (for publication lists)}
819 \optdef{r}{seq-yrr}{Reverse year ordered}{and then by authors (most recent first)}
820 \optdef{c}{seq-no}{Citation order}{(unsorted, only meaningful for numericals)}
821 \getans
822 \endoptiongroup
823 % \end{macrocode}
824 % The standard \btx\ styles consider the \emph{von} part of the name to be a
825 % fixed part of the surname. European usage tends to alphabetize ignoring these
826 % honorifics.
827 % \begin{macrocode}
828 \beginoptiongroup{ORDER ON VON PART
829 (if not citation order)}
830 {\if\ans c\else*\fi}%
831 \optdef{*}{}{Sort on von part}{(de la Maire before Defoe)}
832 \optdef{x}{vonx}{Sort without von part}{(de la Maire after Mahone)}
833 \getans
834 \endoptiongroup
835 % \end{macrocode}
836 %
837 % Sorting normally treats authors with the same surname but different initials
838 % or first name separately; but a strict ordering by cite label would lump all
839 % Smiths together.
840 % \begin{macrocode}
841 \beginoptiongroup{IGNORE FIRST NAMES (if author-year citations)}
842 {\ifnumerical\else*\fi}%
843 \optdef{*}{}{Respect first names}{or initials, treat as different authors}
844 \optdef{x}{xintls}{Sort on surname only}{and treat all Smiths as one}
845 \getans
846 \endoptiongroup
847 % \end{macrocode}
848 %
849 % \subsection*{Formatting author names}
850 % The default is that the full names of the authors are listed, given names
851 % first, unabbreviated. Of course, if only the initials have been given in
852 % the \texttt{.bib} file, then that is all that can appear in the list. Other
853 % possibilities are to use initials (even if full names in the \texttt{.bib}
854 % file) either before or after the surnames. A specialty of the journals of
855 % the American Geophysical Union is to have only the first name with
856 % reversed initials.
857 %
858 % If the reference is part of a larger work with editors, then the editor
859 % names appear later in the reference text, usually as ``edited by \dots''
860 % or as ``\emph{names} (editors)''. In these cases, the editor names are
861 % not usually reversed (surname first) even if the authors' names are.
862 % An option is provided to format such editor names exactly as the authors'.
863 % \begin{macrocode}
864 \beginoptiongroup{AUTHOR NAMES:}{}
865 \optdef{*}{ed-au}{Full, surname last}{(John Frederick Smith)}
866 \optdef{f}{nm-revf}{Full, surname first}{(Smith, John Frederick)}
867 \optdef{i}{nm-init,ed-au}{Initials + surname}{(J. F. Smith)}
868 \optdef{r}{nm-rev}{Surname + initials}{(Smith, J. F.)}
869 \optdef{s}{nm-rv}{Surname + dotless initials}{(Smith J F)}
870 \optdef{w}{nm-rvvc}{Surname + comma + spaceless initials}{(Smith, J.F.)}
871 \optdef{x}{nm-rvx}{Surname + pure initials}{(Smith JF)}
872 \optdef{y}{nm-rvcx}{Surname + comma + pure initials}{(Smith, JF)}
873 \optdef{z}{nm-rvv}{Surname + spaceless initials}{(Smith J.F.)}
874 \optdef{a}{nm-rev1}{Only first name reversed, initials}%
875 {(AGU style: Smith, J. F., H. K. Jones)}
876 \optdef{b}{nm-revv1}{First name reversed, with full names}%
877 {(Smith, John Fred, Harry Kab Jones)}
878 \getans
879 \endoptiongroup
880 \mytempfalse
881 \if\ans f\mytemptrue\fi
882 \if\ans r\mytemptrue\fi
883 \if\ans s\mytemptrue\fi
884 \if\ans x\mytemptrue\fi
885 \if\ans y\mytemptrue\fi
886 \if\ans a\mytemptrue\fi
887 \if\ans b\mytemptrue\fi
888 \beginoptiongroup{EDITOR NAMES IN COLLECTIONS
889 (if author names reversed)}
890 {\ifmytemp*\fi}
891 \if\ans r
892 \optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith}
893 \fi
894 \if\ans s
895 \optdef{*}{}{Editor names NOT reversed}{as edited by J J Smith}
896 \fi
897 \if\ans a
898 \optdef{*}{}{Editor names NOT reversed}{as edited by J. J. Smith}
899 \fi
900 \if\ans x
901 \optdef{*}{}{Editor names NOT reversed}{as edited by JJ Smith}
902 \fi
903 \if\ans f
904 \optdef{*}{}{Editor names NOT reversed}{as edited by John James Smith}
905 \fi
906 \if\ans y
907 \optdef{*}{}{Editor names NOT reversed}{as edited by J.J. Smith}
908 \fi
909 \if\ans b
910 \optdef{*}{}{Editor names NOT reversed}{as edited by John James Smith}
911 \fi
912 \optdef{r}{ed-rev}{Editor names reversed}{just like authors'}
913 \getans
914 \beginoptiongroup{POSITION OF JUNIOR
915 (if author names reversed)}
916 {}
917 \optdef{*}{jnrlst}{Junior comes last}{as Smith, John, Jr.}
918 \optdef{m}{}{Junior between}{as Smith, Jr., John}
919 \getans
920 \endoptiongroup
921 \endoptiongroup
922
923 \beginoptiongroup{JUNIOR PART IN THE CITATION
924 (if author-year citations)}
925 {\ifnumerical\else*\fi}%
926 \optdef{*}{}{No `junior' part in the citations}{but in the ref listing}
927 \optdef{j}{jnrlab}{`Junior' in citations}{as well as in ref listing}
928 \getans
929 \endoptiongroup
930
931 \beginoptiongroup{PUNCTUATION BETWEEN AUTHOR NAMES:}{}
932 \optdef{*}{}{Author names separated by commas}{}
933 \optdef{s}{aunm-semi}{Names separated by semi-colon}{}
934 \optdef{h}{aunm-sl}{Names separated by slash}{/}
935 \getans
936 \endoptiongroup
937
938 \beginoptiongroup{ADJACENT REFERENCES WITH REPEATED NAMES:}{}
939 \optdef{*}{}{Author/editor names always present}{}
940 \optdef{d}{nmdash}{Repeated author/editor names replaced by dash}{}
941 \optdef{2}{nmdash,nmd-2}{Repeated author/editor names replaced by 2 dashes}{}
942 \optdef{3}{nmdash,nmd-3}{Repeated author/editor names replaced by 3 dashes}{}
943 \getans
944 \endoptiongroup
945 % \end{macrocode}
946 %
947 % \subsection*{Number of authors}
948 % Normally the complete list of authors as given in the \texttt{.bib} file is
949 % presented in the reference list. However, some journals prefer to limit
950 % them to a maximum. If there are more than this maximum number of author
951 % names, then a minimum number plus \textsl{et al.} are listed.
952 %
953 % Because no test for consistency of the numbers is carried out in the
954 % \texttt{.bst} file itself (it might be possible, but I found it too complex),
955 % this is done here.
956 % \begin{macrocode}
957 \beginoptiongroup{NUMBER OF AUTHORS IN BIBLIOGRAPHY:}{}
958 \optdef{*}{}{All authors}{included in listing}
959 \optdef{l}{nmlm}{Limited authors}{(et al replaces missing names)}
960 \getans
961 \endoptiongroup
962 \if\ans l
963 \loop
964 \ask{\num}{Maximum number of authors (1-99)}
965 \ifnum\num>99\relax
966 \mes{*** Must be between 1 and 99}
967 \repeat
968 \def\parsenum#1#2{\if#2\relax\wr{\spsp\spsp x#1,\pc: Maximum of #1\space authors}
969 \else\wr{\spsp\spsp x#10,x#2,\pc: Maximum of #1#2\space authors}\fi}
970 \expandafter\parsenum\num\relax
971 \mes{\spsp You have selected maximum \num\space authors}
972 \edef\numx{\num}
973 \loop
974 \ask{\num}{Minimum number (before et al given) (1-\numx)}
975 \ifnum\num>\numx
976 \mes{*** Must be between 1 and \numx}
977 \repeat
978 \def\parsenum#1#2{\if#2\relax\wr{\spsp\spsp m#1,\pc: Minimum of #1\space authors}
979 \else\wr{\spsp\spsp m#10,m#2,\pc: Minimum of #1#2\space authors}\fi}
980 \expandafter\parsenum\num\relax
981 \mes{\spsp You have selected minimum \num\space authors}
982 \fi
983
984 % \end{macrocode}
985 %
986 % Something that I finally added after being asked many times, is to allow for
987 % more than one name in the citation before inserting \textsl{et~al.}
988 % to allow more than 2 authors before truncating
989 % \begin{macrocode}
990 \beginoptiongroup{AUTHORS IN CITATIONS:}{}
991 \optdef{*}{}{One author et al}{for three or more authors}
992 \optdef{m}{mcite}{Some other truncation scheme}{}
993 \getans
994 \endoptiongroup
995 \mytempfalse
996 \if\ans m\mytemptrue\fi
997 \beginoptiongroup{MAX AUTHORS BEFORE ET AL:
998 (if regular cite not selected)}
999 {\ifmytemp*\fi}%
1000 \optdef{*}{mct-1}{One et al}{}
1001 \optdef{2}{mct-2}{One, Two et al}{}
1002 \optdef{3}{mct-3}{One, Two, Three et al}{}
1003 \optdef{4}{mct-4}{One, Two, Three, Four et al}{}
1004 \optdef{5}{mct-5}{One, Two, Three, Four, Five et al}{}
1005 \optdef{6}{mct-6}{One, Two, Three, Four, Five, Six et al}{}
1006 \getans
1007 \endoptiongroup
1008 \beginoptiongroup{MAX AUTHORS WITHOUT ET AL:
1009 (if regular cite not selected)}
1010 {\ifmytemp*\fi}%
1011 \optdef{*}{mct-x2}{Two authors without truncating}{}
1012 \optdef{3}{mct-x3}{Three authors}{without truncating}
1013 \optdef{4}{mct-x4}{Four authors}{without truncating}
1014 \optdef{5}{mct-x5}{Five authors}{without truncating}
1015 \optdef{6}{mct-x6}{Six authors}{without truncating}
1016 \getans
1017 \endoptiongroup
1018 % \end{macrocode}
1019 %
1020 % \subsection*{Typeface of names}
1021 % The author names in the list of references normally appear in the current
1022 % typeface. This may be changed to small caps, bold, or italics.
1023 %
1024 % Alternatively, the surnames only can be formatted, with the first names in the
1025 % regular font. One can also specify that the words `and' and `et~al.'\ should be
1026 % in the regular font, or that `et~al.'\ be italic.
1027 %
1028 % Another possibility is that the names be put into a command |\bibnamefont{..}|,
1029 % which must be defined in the \LaTeX\ document. By default, this command does
1030 % not format its argument. There is also a |\bibfnamefont| command for the first
1031 % names, to be user-defined.
1032 %
1033 % Editor names in a collection or in a book will not normally have these
1034 % fonts applied to them; this may be additionally selected.
1035 %
1036 % \begin{macrocode}
1037 \beginoptiongroup{TYPEFACE FOR AUTHORS IN LIST OF REFERENCES:}{}
1038 \optdef{*}{}{Normal font for author names}{}
1039 \optdef{s}{nmft,nmft-sc}{Small caps authors}{(\string\sc)}
1040 \optdef{i}{nmft,nmft-it}{Italic authors}{(\string\it\space or \string\em)}
1041 \optdef{b}{nmft,nmft-bf}{Bold authors}{(\string\bf)}
1042 \optdef{u}{nmft,nmft-def}{User defined author font}{(\string\bibnamefont)}
1043 \getans
1044 \endoptiongroup
1045 \mytempfalse
1046 \if\ans i\mytemptrue\fi
1047 \if\ans s\mytemptrue\fi
1048 \if\ans b\mytemptrue\fi
1049 \if\ans u\mytemptrue\fi
1050 \beginoptiongroup{FONT FOR FIRST NAMES
1051 (if non-default font for authors)}
1052 {\ifmytemp*\fi}%
1053 \optdef{*}{}{First names same font as surnames}{}
1054 \optdef{r}{fnm-rm}{First names in normal font}{}
1055 \optdef{u}{fnm-def}{First names in user defined font}{(\string\bibfnamefont)}
1056 \getans
1057 \beginoptiongroup{EDITOR NAMES IN INCOLLECTION ETC:}{}
1058 \optdef{*}{}{Editors incollection normal font}{}
1059 \optdef{a}{nmfted}{Editors incollection like authors}{font}
1060 \getans
1061 \endoptiongroup
1062
1063 \beginoptiongroup{FONT FOR `AND' IN LIST:}{}
1064 \optdef{*}{}{`And' in author font}{(JONES AND JAMES)}
1065 \optdef{r}{nmand-rm}{`And' in normal font}{(JONES and JAMES)}
1066 \getans
1067 \endoptiongroup
1068 \endoptiongroup
1069 % \end{macrocode}
1070 %
1071 % \subsection*{Names in Citation label}
1072 % This applies to author--year style only. The label is the text written
1073 % by the |\cite| command, and for author--year style, this is something like
1074 % `Daly et al.\ (1990b)'. One may select italics for the authors and for the
1075 % extra label attached to the year. The year always remains plain.
1076 %
1077 % This parallels the font selection for the names in the list of references
1078 % except that there no choice for the first names, since only surnames
1079 % are used in the labels. A user-defined |\citefontname| may also
1080 % be selected, but this \emph{must} be defined by the user since there
1081 % will be no default definition for it.
1082 %
1083 % If a font is selected for the cited authors, then the word `and' may be
1084 % optionally put in the normal font.
1085 %
1086 % It is not possible to select the type of brackets for the year, since
1087 % this is determined by the \LaTeX{} style option that manages the
1088 % author--year citations. This is not standard \LaTeX, so that there are a
1089 % number of private style files for achieving this.
1090 % \begin{macrocode}
1091 \beginoptiongroup{FONT OF CITATION LABELS IN TEXT
1092 (if author-year citations)}
1093 {\ifnumerical\else*\fi}%
1094 \optdef{*}{}{Cited authors plain}{as result of \string\cite\space command}
1095 \optdef{i}{lab,lab-it}{Cited authors italic}{}
1096 \optdef{s}{lab,lab-sc}{Cited authors small caps}{}
1097 \optdef{b}{lab,lab-bf}{Cited authors bold}{}
1098 \optdef{u}{lab,lab-def}{User defined citation font}{(\string\citenamefont)}
1099 \getans
1100
1101 \mytempfalse
1102 \if\ans i\mytemptrue\fi
1103 \if\ans s\mytemptrue\fi
1104 \if\ans b\mytemptrue\fi
1105 \if\ans u\mytemptrue\fi
1106 \beginoptiongroup{FONT FOR `AND' IN CITATIONS
1107 (if non-default font for citation lables)}
1108 {\ifmytemp*\fi}%
1109 \optdef{*}{}{Cited `and' in author font}{}
1110 \optdef{r}{and-rm}{Cited `and' in normal font}{}
1111 \getans
1112 \endoptiongroup
1113 \beginoptiongroup{FONT OF EXTRA LABEL
1114 (The extra letter on the year)}{}
1115 \optdef{*}{}{Extra label plain}{}
1116 \optdef{i}{xlab-it}{Extra label italic}{}
1117 \getans
1118 \endoptiongroup
1119 \endoptiongroup
1120 % \end{macrocode}
1121 %
1122 % \subsection*{Label for missing author names}
1123 %
1124 % If the author and/or editor is missing, the standard \texttt{.bst} files
1125 % use the \texttt{key} field in place of the names for purposes of ordering the
1126 % entries.
1127 %
1128 % For author--year styles, the \texttt{key} field is even inserted in the
1129 % reference list and in the label in place of the authors. Optionally, one can
1130 % suppress the year in this case, which causes \texttt{natbib} (version~7)
1131 % to print only that key text as a code designation for the work. Thus if
1132 % \texttt{KEY = "CS1-345"} and there are no authors, then |\citep| produces
1133 % (CS1-345) and |\citet| simply CS1-345. That is, they behave like
1134 % |\citeauthor|. If \texttt{natbib} did not recognize the blank year, one would
1135 % get (CS1-345, ) and CS1-345 (). (Earlier versions of \texttt{natbib} crash on
1136 % a blank year.)
1137 % \begin{macrocode}
1138 \beginoptiongroup{LABEL WHEN AUTHORS MISSING
1139 (if author-year citations)}
1140 {\ifnumerical\else*\fi}%
1141 \optdef{*}{keyxyr}{Year blank when KEY replaces missing author}{(for natbib 7.0)}
1142 \optdef{y}{}{Year included when KEY replaces missing author}{}
1143 \getans
1144 \endoptiongroup
1145 % \end{macrocode}
1146 %
1147 % \subsection*{Missing date}
1148 % A missing date can be set to ???? or simply left blank. In the latter case,
1149 % \texttt{natbib} version~7 will print only the authors without any year
1150 % punctuation or brackets.
1151 %
1152 % \begin{macrocode}
1153 \beginoptiongroup{MISSING DATE
1154 (if author-year citations)}
1155 {\ifnumerical\else*\fi}%
1156 \optdef{*}{}{Missing date set to ????}{in label and text}
1157 \optdef{b}{blkyear}{Missing date left blank}{}
1158 \getans
1159 \endoptiongroup
1160 % \end{macrocode}
1161 %
1162 % \subsection*{Position of date}
1163 % This applies to author--year style only. It makes sense to put the date
1164 % immediately after the author list, since the two items (author and year)
1165 % are the identifiers of the reference. Default position is at the
1166 % end of the references, before any notes. It is also possible to place
1167 % it even after the notes.
1168 %
1169 % Medical journals have a system where the date is part of the journal
1170 % specification, as Lancet 1994;45(2):34--40. Otherwise the date appears at
1171 % the end.
1172 % \begin{macrocode}
1173 \beginoptiongroup{DATE POSITION:}{}
1174 \optdef{*}{}{Date at end}{}
1175 \optdef{b}{dt-beg}{Date after authors}{}
1176 \optdef{j}{dt-jnl}{Date part of journal spec.}{(as 1994;45:34-40) else at end}
1177 \optdef{e}{dt-end}{Date at very end}{after any notes}
1178 \getans
1179 \endoptiongroup
1180 \if\ans b\mytemptrue\else\if\ans j\mytemptrue\else\mytempfalse\fi\fi
1181 % \end{macrocode}
1182 %
1183 % \subsection*{Format of date}
1184 % The year may be enclosed in parentheses, brackets, or preceded by a
1185 % colon. If none of these are selected, the date (month plus year) appears.
1186 % For author--year, the date normally consists only of the year, no month,
1187 % but this may be overridden.
1188 %
1189 % If the date comes just after the authors, then one might want special
1190 % punctuation following it, like a colon, or space only. The latter is
1191 % probably desirable if the date is brackets or parentheses.
1192 %
1193 % The date can even be put into bold face.
1194 % \begin{macrocode}
1195 \beginoptiongroup{DATE FORMAT
1196 (if non author-year citations)}
1197 {\ifnumerical*\fi}%
1198 \optdef{*}{}{Plain month and year}{without any brackets}
1199 \optdef{p}{yr-par}{Date in parentheses}{as (May 1993)}
1200 \optdef{b}{yr-brk}{Date in brackets}{as [May 1993]}
1201 \optdef{c}{yr-col}{Date preceded by colon}{as `: May 1993'}
1202 \optdef{d}{yr-per}{Date preceded by period}{as `. May 1993'}
1203 \optdef{m}{yr-com}{Date preceded by comma}{as `, May 1993'}
1204 \optdef{s}{yr-blk}{Date preceded by space}{only, as ` May 1993'}
1205 \getans
1206 \beginoptiongroup{SUPPRESS MONTH:}{}
1207 \optdef{*}{}{Date is month and year}{}
1208 \optdef{x}{xmth}{Date is year only}{}
1209 \getans
1210 \endoptiongroup
1211 \beginoptiongroup{REVERSED DATE
1212 (if including month)}
1213 {\if\ans x\else*\fi}%
1214 \optdef{*}{}{Date as month year}{}
1215 \optdef{r}{dtrev}{Date as year month}{}
1216 \getans
1217 \endoptiongroup
1218 \endoptiongroup
1219
1220 \beginoptiongroup{DATE FORMAT
1221 (if author-year citations)}
1222 {\ifnumerical\else*\fi}%
1223 \optdef{*}{}{Year plain}{without any brackets}
1224 \optdef{p}{yr-par}{Year in parentheses}{as (1993)}
1225 \optdef{b}{yr-brk}{Year in brackets}{as [1993]}
1226 \optdef{c}{yr-col}{Year preceded by colon}{as `: 1993'}
1227 \optdef{d}{yr-per}{Year preceded by period}{as `. 1993'}
1228 \optdef{m}{yr-com}{Date preceded by comma}{as `, 1993'}
1229 \optdef{s}{yr-blk}{Year preceded by space}{only, as ` 1993'}
1230 \getans
1231 \beginoptiongroup{INCLUDE MONTHS:}{}
1232 \optdef{*}{}{Date is year only}{without the month}
1233 \optdef{m}{aymth}{Include month in date}{}
1234 \getans
1235 \endoptiongroup
1236 \beginoptiongroup{REVERSED DATE
1237 (if including month)}
1238 {\if\ans m*\fi}%
1239 \optdef{*}{}{Date as month year}{}
1240 \optdef{r}{dtrev}{Date as year month}{}
1241 \getans
1242 \endoptiongroup
1243 \endoptiongroup
1244
1245 \beginoptiongroup{DATE PUNCTUATION
1246 (if date not at end)}
1247 {\ifmytemp*\fi}%
1248 \optdef{*}{}{Date with standard block punctuation}{(comma or period)}
1249 \optdef{c}{yrp-col}{Colon after date}{as 1994:}
1250 \optdef{s}{yrp-semi}{Semi-colon after date}{as 1994;}
1251 \optdef{p}{yrp-per}{Period after date}{even when blocks use commas}
1252 \optdef{x}{yrp-x}{No punct. after date}{}
1253 \getans
1254 \beginoptiongroup{BLANK AFTER DATE:}{}
1255 \optdef{*}{}{Space after date}{and punctuation}
1256 \optdef{x}{yrpp-xsp}{No space after date}{as 1994:45}
1257 \getans
1258 \endoptiongroup
1259 \endoptiongroup
1260 \beginoptiongroup{DATE FONT:}{}
1261 \optdef{*}{}{Date in normal font}{}
1262 \optdef{b}{dtbf}{Date in bold face}{}
1263 \getans
1264 \endoptiongroup
1265 % \end{macrocode}
1266 %
1267 % Normally in author--year citations, the \texttt{year} entry is truncated
1268 % to the last 4 characters, which should be the 4 digits of the year. Some
1269 % users have requested the possibility of suppressing this truncation so
1270 % that they may put text in the \texttt{year} field, such as ``in press.''
1271 % Another use for it is when years are given as ``1968--72''. Actually,
1272 % I have no idea why the year should be truncated at all.
1273 % \begin{macrocode}
1274 \beginoptiongroup{TRUNCATE YEAR
1275 (if author-year citations)}
1276 {\ifnumerical\else*\fi}%
1277 \optdef{*}{note-yr}{Year text full}{as 1990--1993 or `in press'}
1278 \optdef{t}{}{Year truncated}{to last 4 digits}
1279 \getans
1280 \endoptiongroup
1281 % \end{macrocode}
1282 %
1283 % \subsection*{Article title in journal}
1284 % The title of an article in a journal or in a collection (a book, or
1285 % conference proceedings) may appear plain, in italics, within single
1286 % or double quotes or even in guillemets. The last is best with T1 coding; a
1287 % poor man's version for OT1 is provided; \LaTeXe\ is required in both cases.
1288 %
1289 % Furthermore, it may have sentence capitalization (first
1290 % word and word following colon) or be capitalized as in the \texttt{.bib} file
1291 % entry. That is why it is recommended to capitalize the entry text as it
1292 % should appear when fully capitalized, putting words that are always
1293 % capitalized in braces. Example:
1294 % \begin{quote}
1295 % |TITLE="The Results of the {Giotto} Mission"|
1296 % \end{quote}
1297 % which produces either ``The results of the Giotto mission'' or ``The
1298 % Results of the Giotto Mission'', depending on option.
1299 %
1300 % Additionally, the article titles may be fully suppressed.
1301 % \begin{macrocode}
1302 \beginoptiongroup{TITLE OF ARTICLE:}{}
1303 \optdef{*}{}{Title plain}{with no special font}
1304 \optdef{i}{tit-it}{Title italic}{(\string\em)}
1305 \optdef{q}{tit-qq,qt-s}{Title and punctuation in single quotes}{(`Title,' ..)}
1306 \optdef{d}{tit-qq}{Title and punctuation in double quotes}{(``Title,'' ..)}
1307 \optdef{g}{tit-qq,qt-g}{Title and punctuation in guillemets}{(<<Title,>> ..)}
1308 \optdef{x}{tit-qq,qt-s,qx}{Title in single quotes}{(`Title', ..)}
1309 \optdef{y}{tit-qq,qx}{Title in double quotes}{(``Title'', ..)}
1310 \optdef{z}{tit-qq,qt-g,qx}{Title in guillemets}{(<<Title>>, ..)}
1311 \getans
1312 \endoptiongroup
1313 \mytempfalse
1314 \if\ans q\mytemptrue\fi
1315 \if\ans d\mytemptrue\fi
1316 \if\ans g\mytemptrue\fi
1317 \if\ans x\mytemptrue\fi
1318 \if\ans y\mytemptrue\fi
1319 \if\ans z\mytemptrue\fi
1320 \beginoptiongroup{COLLECTION/PROCEEDINGS TITLES
1321 (if quoted title)}
1322 {\ifmytemp*\fi}%
1323 \optdef{*}{bt-qq}{Quote collection and proceedings titles}{too}
1324 \optdef{x}{}{Collection and proceedings titles not in quotes}{}
1325 \getans
1326 \endoptiongroup
1327 \beginoptiongroup{CAPITALIZATION OF ARTICLE TITLE:}{}
1328 \optdef{*}{}{Sentence style}{(capitalize first word and those in braces)}
1329 \optdef{t}{atit-u}{Title style}{(just as in bib entry)}
1330 \getans
1331 \endoptiongroup
1332
1333 \beginoptiongroup{ARTICLE TITLE PRESENT:}{}
1334 \optdef{*}{}{Article title present}{in journals and proceedings}
1335 \optdef{x}{jtit-x}{No article title}{}
1336 \getans
1337 \endoptiongroup
1338 % \end{macrocode}
1339 %
1340 % \subsection*{Journal names}
1341 % Abbreviated journal names normally contain periods; the periods may be
1342 % removed with this option. In fact, only letters, numbers, and spacing are
1343 % retained.
1344 % \begin{macrocode}
1345 \beginoptiongroup{JOURNAL NAMES:}{}
1346 \optdef{*}{}{Periods in journal names}{are retained, as `Phys. Rev.'}
1347 \optdef{x}{jxper}{Dotless journal names}{as `Phys Rev'}
1348 \getans
1349 \endoptiongroup
1350 % \end{macrocode}
1351 % Journal name is normally printed in italics; can be left in normal font.
1352 % \begin{macrocode}
1353 \beginoptiongroup{JOURNAL NAME FONT:}{}
1354 \optdef{*}{}{Journal name italics}{}
1355 \optdef{r}{jttl-rm}{Journal name normal}{font}
1356 \getans
1357 \endoptiongroup
1358 % \end{macrocode}
1359 %
1360 % \subsection*{Title of Theses and Technical Reports}
1361 % The title of a these (PhD or Master's) is normally treated the same
1362 % as that of a book. Optionally, it may be formatted like that of
1363 % an article.
1364 %
1365 % The title of a technical report is normally treated the same as that
1366 % of an article. Optionally, it may be formatted like that of a book.
1367 %
1368 % \begin{macrocode}
1369 \beginoptiongroup{THESIS TITLE:}{}
1370 \optdef{*}{}{Thesis titles like books}{}
1371 \optdef{a}{thtit-a}{Thesis title like article}{}
1372 \optdef{x}{thtit-x}{No thesis title}{}
1373 \getans
1374 \endoptiongroup
1375
1376 \beginoptiongroup{TECHNICAL REPORT TITLE:}{}
1377 \optdef{*}{}{Tech. report title like articles}{}
1378 \optdef{b}{trtit-b}{Tech. report title like books}{}
1379 \getans
1380 \endoptiongroup
1381
1382 \beginoptiongroup{TECHNICAL REPORT NUMBER:}{}
1383 \optdef{*}{}{Tech. report and number plain}{as `Tech. Rep. 123'}
1384 \optdef{i}{trnum-it}{Tech. report and number italic}%
1385 {as `{\string\it\space Tech. Rep. 123'}}
1386 \getans
1387 \endoptiongroup
1388 % \end{macrocode}
1389 %
1390 % \subsection*{Journal reference}
1391 % Great diversity of opinion exists as to how a journal reference is to be
1392 % formatted. It consists of a volume, possibly a number, and page limits.
1393 % The number is really only necessary if the page numbers within one volume
1394 % start at 1 for each physical `number'. Since journals are often bound
1395 % together in one volume later, it makes more sense to number the pages
1396 % continuously through the whole volume.
1397 %
1398 % I am only aware of one journal that used to reset the pagination for each
1399 % `number', in which case the number was part of the page designation.
1400 % I had erroneously provided an option \texttt{vnum-pg} to achieve this, but I
1401 % now realize that instead, for this one journal, the database entries must
1402 % contain \texttt{pages="(2)33--2(55)"}. This option has been removed at
1403 % version 3.84.
1404 %
1405 % A number of styles for journal specifications are
1406 % \begin{quote}
1407 % \begin{tabular}{l@{\qquad}l}
1408 % 21(2):33--55 & 21, no.\ 2: 33--55\\
1409 % \textbf{21}(2):33--55 & \textbf{21}, \#2, 33--55\\
1410 % \textit{21}(2), 33--55 & \textit{21} (2); 33--55 \\
1411 % 21(2) (1995) 33--55 & 21(1995), 33-55\\
1412 % 21(2) 33--55 & vol.~21 (2), pp.~33--55
1413 % \end{tabular}
1414 % \end{quote}
1415 %
1416 % Here both start and stop page numbers have been given; often only the
1417 % start page is wanted.
1418 %
1419 % It is also possible to include the year as part of the journal specification,
1420 % in which case the year is always in parentheses, attached snugly or with space
1421 % to the volume, or preceding the pages.
1422 %
1423 % \begin{macrocode}
1424 \beginoptiongroup{JOURNAL VOLUME:}{}
1425 \optdef{*}{}{Volume plain}{as vol(num)}
1426 \optdef{i}{vol-it}{Volume italic}{as {\string\em\space vol}(num)}
1427 \optdef{b}{vol-bf}{Volume bold}{as {\string\bf\space vol}(num)}
1428 \optdef{d}{vol-2bf}{Volume and number bold}{as {\string\bf\space vol(num)}}
1429 \getans
1430 \endoptiongroup
1431 % \end{macrocode}
1432 %
1433 % The form of the `number' is also given: in parentheses, with `no.',
1434 % with \#, or omitted. The \texttt{vnum-b} option is meant to be used
1435 % with \texttt{jdt-v} and \texttt{jdt-vs} but could be used alone.
1436 % \begin{macrocode}
1437 \beginoptiongroup{JOURNAL VOL AND NUMBER:}{}
1438 \optdef{*}{}{Journal vol(num)}{as 34(2)}
1439 \optdef{s}{vnum-sp}{Journal vol (num)}{as 34 (2)}
1440 \optdef{c}{vnum-cm}{Journal vol, num}{as 34, 2}
1441 \optdef{n}{vnum-nr}{Journal vol, no. num}{as 34, no. 2}
1442 \optdef{h}{vnum-h}{Journal vol, \string\# number}{as 34, \string\#2}
1443 \optdef{b}{vnum-b}{Journal vol number}{as 34 2}
1444 \optdef{x}{vnum-x}{Journal vol, without number}{as 34}
1445 \getans
1446 \endoptiongroup
1447
1448 \beginoptiongroup{VOLUME PUNCTUATION:}{}
1449 \optdef{*}{}{Volume with colon}{as vol(num):ppp}
1450 \optdef{s}{volp-sp}{Volume with colon and space}{as vol(num): ppp}
1451 \optdef{h}{volp-semi}{Volume with semi-colon}{as vol(num); ppp}
1452 \optdef{c}{volp-com}{Volume with comma}{as vol(num), ppp}
1453 \optdef{b}{volp-blk}{Volume with blank}{as vol(num) ppp}
1454 \getans
1455 \endoptiongroup
1456
1457 \beginoptiongroup{YEAR IN JOURNAL SPECIFICATION:}{}
1458 \optdef{*}{}{Journal year like others}{as given by date position}
1459 \optdef{v}{jdt-v}{Journal vol(year)}{as 34(1995)}
1460 \optdef{s}{jdt-vs}{Journal vol (year)}{as 34 (1995)}
1461 \optdef{p}{jdt-p}{Year with pages}{as 34(2), (1995) 1345--1387}
1462 \optdef{c}{jdt-pc}{Year, comma, pages}{as 34(2), (1995), 1345--1387}
1463 \getans
1464 \endoptiongroup
1465
1466 \beginoptiongroup{PAGE NUMBERS:}{}
1467 \optdef{*}{}{Start and stop page numbers}{given}
1468 \optdef{f}{jpg-1}{Only start page number}{}
1469 \getans
1470 \endoptiongroup
1471
1472 \beginoptiongroup{LARGE PAGE NUMBERS:}{}
1473 \optdef{*}{}{No separators for large page numbers}{}
1474 \optdef{c}{pgsep-c}{Comma inserted over 9999}{as 11,234}
1475 \optdef{s}{pgsep-s}{Thin space inserted over 9999}{as 11 234}
1476 \optdef{p}{pgsep-p}{Period inserted over 9999}{as 11.234}
1477 \getans
1478 \endoptiongroup
1479
1480 \beginoptiongroup{WORD `PAGE' IN ARTICLES:}{}
1481 \optdef{*}{}{Article pages numbers only}{as 234-256}
1482 \optdef{p}{jwdpg}{Include `page' in articles}{as pp. 234--256}
1483 \getans
1484 \endoptiongroup
1485 % \end{macrocode}
1486 %
1487 % Some journals want page numbers at the end, even for books, proceedings, as
1488 % well as for journals.
1489 % \begin{macrocode}
1490 \beginoptiongroup{POSITION OF PAGES:}{}
1491 \optdef{*}{}{Pages given mid text}{as is normal}
1492 \optdef{e}{pp-last}{Pages at end}{but before any notes}
1493 \getans
1494 \endoptiongroup
1495
1496 \beginoptiongroup{WORD `VOLUME' IN ARTICLES:}{}
1497 \optdef{*}{}{Article volume as number only}{as 21}
1498 \optdef{p}{jwdvol}{Include `volume' in articles}{as vol. 21}
1499 \getans
1500 \endoptiongroup
1501 % \end{macrocode}
1502 %
1503 % Fiddle with the format and location of the number/series for collections and
1504 % inproceedings.
1505 % \begin{macrocode}
1506 \beginoptiongroup{NUMBER AND SERIES FOR COLLECTIONS:}{}
1507 \optdef{*}{num-xser}{Allows number without series}{and suppresses word "number"}
1508 \optdef{s}{}{Standard BibTeX}{as: "number 123 in Total Works"; error if number and no series}
1509 \getans
1510 \endoptiongroup
1511
1512 \beginoptiongroup{POSITION OF NUMBER AND SERIES:}{}
1513 \optdef{*}{}{After chapter and pages}{as in standard BibTeX}
1514 \optdef{t}{numser}{Just before publisher}{or organization}
1515 \getans
1516 \endoptiongroup
1517 % \end{macrocode}
1518 %
1519 % Fiddle with the format and location of series and volume with books and collections.
1520 % \begin{macrocode}
1521 \beginoptiongroup{VOLUME AND SERIES FOR BOOKS/COLLECTIONS:}{}
1522 \optdef{*}{}{Vol. 23 of Series}{as in standard BibTeX}
1523 \optdef{s}{ser-vol}{Series, vol. 23}{}
1524 \getans
1525 \endoptiongroup
1526
1527 \beginoptiongroup{POSITION OF VOLUME AND SERIES FOR INCOLLECTIONS:}{}
1528 \optdef{*}{}{Series and volume after the editors}{}
1529 \optdef{e}{ser-ed}{Series and volume after booktitle}{and before editors}
1530 \getans
1531 \endoptiongroup
1532 % \end{macrocode}
1533 %
1534 % It is possible to decide whether the journal name should be
1535 % separated from the following specifications with a blank or comma.
1536 % \begin{macrocode}
1537 \beginoptiongroup{JOURNAL NAME PUNCTUATION:}{}
1538 \optdef{*}{}{Comma after journal}{name}
1539 \optdef{x}{jnm-x}{Space after journal}{name}
1540 \getans
1541 \endoptiongroup
1542 % \end{macrocode}
1543 %
1544 % \subsection*{Books}
1545 % The title of a book (as opposed to an article in a book or journal) is
1546 % normally italicized. This may be set to the regular font.
1547 %
1548 % The page numbers in books may be set in parentheses, as (pp.\ 345--350).
1549 % \begin{macrocode}
1550 \beginoptiongroup{BOOK TITLE:}{}
1551 \optdef{*}{}{Book title italic}{(\string\em)}
1552 \optdef{p}{btit-rm,bt-rm}{Book title plain}{(no font command)}
1553 \getans
1554 \endoptiongroup
1555
1556 \beginoptiongroup{PAGES IN BOOKS:}{}
1557 \optdef{*}{}{Pages in book plain}{as pp. 50-55}
1558 \optdef{p}{bkpg-par}{Pages in book in parentheses}{as (pp. 50-55)}
1559 \optdef{x}{bkpg-x}{Pages in book bare}{as 50-55}
1560 \getans
1561 \endoptiongroup
1562 \beginoptiongroup{TOTAL PAGES OF A BOOK:}{}
1563 \optdef{*}{}{Total book pages not printed}{}
1564 \optdef{p}{pg-bk}{For book: 345 pages}{or pp.}
1565 \optdef{a}{pg-bk,pg-pre}{Total book pages before publisher}{}
1566 \getans
1567 \endoptiongroup
1568 % \end{macrocode}
1569 % Some psychology journals wish to have the publisher's address preceding
1570 % the name, separated by colon, as
1571 % \begin{quote}New York: Wiley and Sons\end{quote}
1572 %
1573 % Some journals (e.g.\ Nature) put publisher in parentheses with date,
1574 % as (Wiley and Sons, New York, 1983). These normally put the date in
1575 % parentheses at the end anyway, so this is a merging of the two sets of
1576 % parentheses.
1577 % \begin{macrocode}
1578 \beginoptiongroup{PUBLISHER ADDRESS:}{}
1579 \optdef{*}{}{Publisher, address}{as Harcourt, New York}
1580 \optdef{a}{add-pub}{Address: Publisher}{as New York: Harcourt}
1581 \getans
1582 \endoptiongroup
1583
1584 \beginoptiongroup{PUBLISHER IN PARENTHESES:}{}
1585 \optdef{*}{}{Publisher as normal block}{without parentheses}
1586 \optdef{p}{pub-par}{Publisher in parentheses}{}
1587 \optdef{d}{pub-date}{Publisher and date in parentheses}{(Oxford, 1994)}
1588 \optdef{c}{pub-date,pub-xc}{Publisher and date in parentheses, no comma}{(Oxford 1994)}
1589 \optdef{f}{pub-date,pub-xpar}{Publisher and date without parentheses}{Oxford, 1994}
1590 \optdef{k}{pub-date,pub-xpar,pub-xc}{Publisher and date, no parentheses, no comma}{Oxford 1994}
1591 \getans
1592 \endoptiongroup
1593
1594 \beginoptiongroup{PUBLISHER POSITION:}{}
1595 \optdef{*}{}{Publisher after chapter, pages}{}
1596 \optdef{p}{pre-pub}{Publisher before chapter, pages}{}
1597 \optdef{e}{pre-edn}{Publisher after edition}{}
1598 \getans
1599 \endoptiongroup
1600 % \end{macrocode}
1601 %
1602 % \subsection*{ISBN, ISSN, DOI numbers}
1603 % Books normally possess an ISBN number. This may be included as an
1604 % optional entry for \texttt{book}, \texttt{inbook}, \texttt{booklet},
1605 % \texttt{incollection}, \texttt{proceedings}, \texttt{inproceedings}.
1606 % However, it should be suppressed for \texttt{inbook} etc.\ when
1607 % there is a crossref to another book with the ISBN number.
1608 %
1609 % Periodicals contain an ISSN number. Add this to \texttt{article}, or
1610 % course, but also to \texttt{inproceedings} and \texttt{proceedings}, since
1611 % they are sometimes printed in a periodical.
1612 %
1613 % Journal articles that appear online are given a DOI number, something more
1614 % robust than a URL that can change as machines are upgraded.
1615 % The American Geophysical Union (AGU) uses the DOI as part of the
1616 % page number substitution for electronic journals, placing the number
1617 % where the pages would normally appear.
1618 % \begin{macrocode}
1619 \beginoptiongroup{ISBN NUMBER:}{}
1620 \optdef{*}{isbn}{Include ISBN}{for books, booklets, etc.}
1621 \optdef{x}{}{No ISBN}{}
1622 \getans
1623 \endoptiongroup
1624
1625 \beginoptiongroup{ISSN NUMBER:}{}
1626 \optdef{*}{issn}{Include ISSN}{for periodicals}
1627 \optdef{x}{}{No ISSN}{}
1628 \getans
1629 \endoptiongroup
1630
1631 \beginoptiongroup{DOI NUMBER:}{}
1632 \optdef{*}{doi}{Include DOI}{as "doi: number"}
1633 \optdef{u}{url-doi}{Format DOI as URL //doi.org/doi}{(must give url options!)}
1634 \optdef{a}{agu-doi,doi}{Insert DOI AGU style}{as part of page number}
1635 \optdef{x}{}{No DOI}{}
1636 \getans
1637 \endoptiongroup
1638 % \end{macrocode}
1639 %
1640 % \subsection*{Editor of book without author}
1641 %
1642 % This is normally
1643 % \begin{quote}
1644 % J. K. James, editor
1645 % \end{quote}
1646 % but may also be
1647 % \begin{quote}
1648 % J. K. James, (editor)\\
1649 % J. K. James (editor),
1650 % \end{quote}
1651 % Alternatively, the word \textsl{editor} may be capitalized and/or
1652 % abbreviated.
1653 %
1654 % \begin{macrocode}
1655 \beginoptiongroup{`EDITOR' AFTER NAMES (EDITED BOOKS WITHOUT AUTHORS):}{}
1656 \optdef{*}{}{Word `editor' after name}{}
1657 \optdef{a}{edpar}{`Name (editor),'}{in parentheses, after name, comma after}
1658 \optdef{b}{edpar,bkedcap}{`Name (Editor),'}{as above, editor upper case}
1659 \optdef{c}{edparc}{`Name, (editor)'}{in parentheses, after name, comma between}
1660 \optdef{d}{edparc,bkedcap}{`Name, (Editor)'}{as above, editor upper case}
1661 \optdef{e}{edparxc}{`Name (editor)'}{in parentheses, after name, no commas}
1662 \optdef{f}{edparxc,bkedcap}{`Name (Editor)'}{as above, editor upper case}
1663 \getans
1664 \endoptiongroup
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 % If none of the \texttt{edby} variations is used, then the same system is
1679 % used as for edited books, i.e. \texttt{edpar} applies.
1680 % \begin{macrocode}
1681 \beginoptiongroup{EDITOR IN COLLECTIONS:}{}
1682 \optdef{*}{}{Same as for edited book}{(names before booktitle)}
1683 \optdef{b}{edby}{In booktitle, edited by .. }{(where .. is names)}
1684 \optdef{p}{edby-par}{In booktitle (edited by ..)}{}
1685 \optdef{c}{edby-parc}{In booktitle, (edited by ..)}{}
1686 \optdef{e}{edby,edbyx}{In booktitle, editor ..}{}
1687 \optdef{f}{edby,edbyw}{In booktitle, (editor) ..}{}
1688 \optdef{k}{edby-par,edbyx}{In booktitle (editor..)}{}
1689 \optdef{g}{edby-parc,edbyx}{In booktitle, (editor..)}{}
1690 \optdef{j}{edby,edbyy}{In booktitle, .., editor}{}
1691 \optdef{m}{edby-par,edbyy}{In booktitle (.., editor)}{}
1692 \getans
1693 \endoptiongroup
1694 \mytempfalse
1695 \if\ans p\mytemptrue\fi
1696 \if\ans k\mytemptrue\fi
1697 \if\ans c\mytemptrue\fi
1698 \if\ans f\mytemptrue\fi
1699 \beginoptiongroup{CAPITALIZE `EDITOR' OR `EDITED BY'
1700 (if editor capitalizable)}
1701 {\ifmytemp*\fi}%
1702 \optdef{*}{}{`(editor,..)' or `(edited by..)'}{in lower case}
1703 \optdef{c}{edcap}{`(Editor,..)' or `(Edited by..)'}{in upper case}
1704 \getans
1705 \endoptiongroup
1706 % \end{macrocode}
1707 %
1708 % \subsection*{Block punctuation}
1709 % Blocks are logical sections of the reference specification, such as the
1710 % author block, the journal block, editor block, etc. These are normally
1711 % separated by periods, but alternatively a comma may be used. Another
1712 % choice is to use commas except after titles where a period is given.
1713 %
1714 % \LaTeX\ offers an \texttt{openbib} option, which means that the blocks
1715 % are not only new sentences, but new lines as well. This can only
1716 % function when the default option here is taken, for then the command
1717 % |\newblock| is placed between the blocks. This command is normally
1718 % defined to do nothing, but \LaTeX\ redefines it to issue a new line
1719 % when open bibliographies are wanted.
1720 % \begin{macrocode}
1721 \beginoptiongroup{PUNCTUATION BETWEEN SECTIONS (BLOCKS):}{}
1722 \optdef{*}{}{\string\newblock\space after blocks}
1723 {(periods or new lines with openbib option)}
1724 \optdef{c}{blk-com}{Comma between blocks}{}
1725 \optdef{s}{blk-com,com-semi}{Semi-colon between blocks}{}
1726 \optdef{b}{blk-com,com-blank}{Blanks between blocks}{}
1727 \optdef{t}{blk-tit}{Period after titles of articles, books, etc}{else commas}
1728 \optdef{u}{blk-tit,tit-col}{Colon after titles of articles, books, etc}{else commas}
1729 \optdef{a}{blk-tita}{Period after titles of articles}{else commas}
1730 \optdef{d}{blk-tita,tit-col}{Colon after titles of articles}{else commas}
1731 \getans
1732 \endoptiongroup
1733 \mytempfalse
1734 \if\ans c\mytemptrue\fi
1735 \if\ans s\mytemptrue\fi
1736 \if\ans b\mytemptrue\fi
1737 \if\ans t\mytemptrue\fi
1738 \if\ans a\mytemptrue\fi
1739 \beginoptiongroup{PUNCTUATION BEFORE NOTES
1740 (if not using \string\newblock)}
1741 {\ifmytemp*\fi}%
1742 \optdef{*}{}{Notes have regular punctuation}{like all other blocks}
1743 \optdef{p}{blknt}{Notes preceded by period}{}
1744 \getans
1745 \endoptiongroup
1746 \beginoptiongroup{PUNCTUATION AFTER AUTHORS:}{}
1747 \optdef{*}{}{Author block normal}{with regular block punctuation}
1748 \optdef{c}{au-col}{Author block with colon}{}
1749 \getans
1750 \endoptiongroup
1751 % \end{macrocode}
1752 %
1753 % \subsection*{\textsl{In} with colon}
1754 % When referring to works in a collection, one begins the block describing
1755 % that collection with \textsl{In}. Optionally, one may add a colon.
1756 % \begin{macrocode}
1757 \beginoptiongroup{PUNCTUATION AFTER `IN':}{}
1758 \optdef{*}{}{Space after `in'}{for incollection or inproceedings}
1759 \optdef{c}{in-col}{Colon after `in'}{(as `In: ...')}
1760 \optdef{i}{in-it}{Italic `in'}{and space}
1761 \optdef{d}{in-col,in-it}{Italic `in' and colon}{}
1762 \optdef{x}{in-x}{No word `in'}{for edited works}
1763 \getans
1764 \endoptiongroup
1765 \beginoptiongroup{`IN' WITH JOURNAL NAMES
1766 (if using 'in' with collections)}
1767 {\if\ans x\else*\fi}
1768 \optdef{*}{}{No `in' before journal name}{}
1769 \optdef{i}{injnl}{Add `in' before journal name}{in style for incollection}
1770 \getans
1771 \endoptiongroup
1772 % \end{macrocode}
1773 %
1774 % \subsection*{Final punctuation}
1775 % The punctuation at the end of the reference is normally a period. This
1776 % may be suppressed.
1777 % \begin{macrocode}
1778 \beginoptiongroup{FINAL PUNCTUATION:}{}
1779 \optdef{*}{}{Period at very end}{of the listed reference}
1780 \optdef{x}{fin-bare}{No period at end}{}
1781 \getans
1782 \endoptiongroup
1783 % \end{macrocode}
1784 %
1785 % \subsection*{Abbreviations}
1786 % A number of words may be abbreviated: pages, editors, volume, chapter,
1787 % and so on. The first two may be independently set to abbreviation, the
1788 % rest with a single option.
1789 %
1790 % Additionally, the edition numbers may be
1791 % output as words (first, second, etc.) or as numbers (1st, 2nd, etc.).
1792 % (Recall that the input in the \texttt{.bib} file is always as English
1793 % words.)
1794 % \begin{macrocode}
1795 \beginoptiongroup{ABBREVIATE WORD `PAGES'
1796 (if not using external language file)}
1797 {\if!\cfile!\relax*\fi}%
1798 \optdef{*}{}{`Page(s)'}{(no abbreviation)}
1799 \optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}
1800 \optdef{x}{ppx}{`Page' omitted}{}
1801 \getans
1802 \beginoptiongroup{ABBREVIATE WORD `EDITORS':}{}
1803 \optdef{*}{}{`Editor(s)'}{(no abbreviation)}
1804 \optdef{a}{ed}{`Editor' abbreviated}{as ed. or eds.}
1805 \getans
1806 \endoptiongroup
1807
1808 \beginoptiongroup{OTHER ABBREVIATIONS:}{}
1809 \optdef{*}{}{No abbreviations}{of volume, edition, chapter, etc}
1810 \optdef{a}{abr}{Abbreviations}{of such words}
1811 \getans
1812 \endoptiongroup
1813 \beginoptiongroup{ABBREVIATION FOR `EDITION'
1814 (if abbreviating words)}
1815 {\if\ans a*\fi}%
1816 \optdef{*}{}{`Edition' abbreviated as `edn'}{}
1817 \optdef{a}{ednx}{`Edition' abbreviated as `ed'}{}
1818 \getans
1819 \beginoptiongroup{MONTHS WITH DOTS:}{}
1820 \optdef{*}{}{Months with dots}{as Jan.}
1821 \optdef{x}{mth-bare}{Months without dots}{as Feb Mar}
1822 \getans
1823 \endoptiongroup
1824 \endoptiongroup
1825 \beginoptiongroup{EDITION NUMBERS:}{}
1826 \optdef{*}{xedn}{Editions as in database}{saving much processing memory}
1827 \optdef{w}{}{Write out editions}{as first, second, third, etc}
1828 \optdef{n}{ord}{Numerical editions}{as 1st, 2nd, 3rd, etc}
1829 \getans
1830 \endoptiongroup
1831 \endoptiongroup
1832 % \end{macrocode}
1833 %
1834 % The above choices about abbreviations are made only if the internal
1835 % languages are taken (English or \texttt{babel}). For an external language
1836 % definition file, these choices, along with possible other ones, are made
1837 % in the external file, which is read in at this point.
1838 % \begin{macrocode}
1839 \umes{Reading external language file \string\cfile=\cfile}%
1840 \if!\cfile!\relax\else
1841 \input\cfile
1842 \fi
1843 % \end{macrocode}
1844 %
1845 % This file contains the standard set of stored journal names present in
1846 % the basic bibliography style files. If other files containing journal
1847 % names are to be included, they may only contain the options \texttt{jabr}
1848 % or \texttt{jaa} since these options are selected here. No option
1849 % menus from the journal-name files will be read in.
1850 % \begin{macrocode}
1851 \beginoptiongroup{STORED JOURNAL NAMES:}{}
1852 \optdef{*}{}{Full journal names}{for prestored journals}
1853 \optdef{a}{jabr}{Abbreviated journal names}{}
1854 \optdef{s}{jabr,jaa}{Abbreviated with astronomy shorthands}{like ApJ and AJ}
1855 \getans
1856 \endoptiongroup
1857 % \end{macrocode}
1858 %
1859 % \subsection*{Variations on \textsl{and}}
1860 % It is possible to replace the word \textsl{and} with an ampersand \&, and to
1861 % specify whether a comma is to precede \textsl{and} in a list of more than two
1862 % names.
1863 %
1864 % A variable \textsl{and} may be provided for with the command |\BIBand|
1865 % in place of the word. In this case, the command must be defined in the
1866 % document file or some other package called. (This is intended for situations
1867 % where an ampersand is wanted in parenthetical citations, but the word in
1868 % textual ones.)
1869 %
1870 % \begin{macrocode}
1871 \beginoptiongroup{AMPERSAND:}{}
1872 \optdef{*}{}{Use word `and'}{in author lists}
1873 \optdef{a}{amper}{Use ampersand}{in place of `and'}
1874 \optdef{v}{varand}{Use \string\BIBand}{in place of `and'}
1875 \getans
1876 \endoptiongroup
1877
1878 \beginoptiongroup{COMMA BEFORE `AND':}{}
1879 \optdef{*}{}{Comma before `and'}{as `Tom, Dick, and Harry'}
1880 \optdef{n}{and-xcom}{No comma before `and'}{as `Tom, Dick and Harry'}
1881 \optdef{c}{and-com}{Comma even with 2 authors}{as `Tom, and Harry'}
1882 \getans
1883 \endoptiongroup
1884 \beginoptiongroup{COMMA BEFORE `AND' EVEN FOR COLLECTION EDITORS
1885 (if using comma before `and' with authors)}
1886 {\if\ans c*\fi}%
1887 \optdef{*}{and-com-ed}{Comma with 2 editors}{in collections}
1888 \optdef{x}{}{Two editors without comma}{as `Tom and Harry'}
1889 \getans
1890 \endoptiongroup
1891 \beginoptiongroup{NO `AND' IN REFERENCE LIST:}{}
1892 \optdef{*}{}{With `and'}{before last author in reference list}
1893 \optdef{x}{xand}{No `and'}{as `Tom, Dick, Harry'}
1894 \getans
1895 \endoptiongroup
1896
1897 \beginoptiongroup{COMMA BEFORE `ET AL':}{}
1898 \optdef{*}{}{Comma before `et al'}{in reference list}
1899 \optdef{x}{etal-xc}{No comma before `et al'}{}
1900 \getans
1901 \endoptiongroup
1902 % \end{macrocode}
1903 %
1904 % \subsection*{Font of \textsl{et al}}
1905 % One can chose that \textsl{et~al.}\ be put into italics.
1906 % Or, if the authors are in a different font from the regular one, the
1907 % \textsl{et~al.}\ can still be Roman.
1908 % \begin{macrocode}
1909 \beginoptiongroup{FONT OF `ET AL':}{}
1910 \optdef{*}{}{Plain et al}{}
1911 \optdef{i}{etal-it}{Italic et al}{}
1912 \optdef{r}{etal-rm}{Roman et al}{even when authors something else}
1913 \getans
1914 \endoptiongroup
1915 % \end{macrocode}
1916 %
1917 % \subsection*{Additional Data Fields}\label{sec:revtex}
1918 % The American Physical Society's REV\TeX\ package contains \btx\ support
1919 % with a \texttt{bst} file generated from a variant of
1920 % \texttt{\filename}. The extra fields are also available here.
1921 % \begin{itemize}
1922 % \item \textbf{collaboration}: A collaboration name associated with a
1923 % reference.
1924 % \item \textbf{eprint}: The e-print citation for the reference (Los Alamos
1925 % or otherwise). E-print numbers can be turned into hyperlinks to the
1926 % online article. The output is\\
1927 % \hspace*{2em}|\eprint{|\textit{eprint-spec}|}|
1928 % \item \textbf{archive}: is an optional argument for |\eprint|, as\\
1929 % \hspace*{2em}|\eprint[|\textit{archive-des}|]{|\textit{eprint-spec}|}|\\
1930 % The \textit{archive-des} is some code such as \texttt{arXiv} that is
1931 % translated to a base URL by a class or package file. The default definition
1932 % of |\eprint| ignores \textit{archive-des} and prints \textit{eprint-spec}
1933 % as a URL.
1934 % \item \textbf{url}: A URL associated with the reference. Can be turned
1935 % into a hyperlink.
1936 % \end{itemize}
1937 %
1938 % A collaboration appears as part of the author list and the other two
1939 % appear at the end of the citaton. The URL field can be selected
1940 % independently of this option.
1941 %
1942 % In addition there are new fields for journals like Phys.\ Rev.~D that
1943 % no longer use page numbers.
1944 % \begin{itemize}
1945 % \item \textbf{eid}: Electronic article identifier.
1946 % \item \textbf{numpages}: Number of pages in an article. For use in
1947 % conjunction with the \textbf{eid} field when page counts are
1948 % desired. Deprecated when submitting to Phys.\ Rev.
1949 %
1950 % The \texttt{eprint} (with \texttt{archive}) and \texttt{url} fields may be
1951 % included independently of the other REV\TeX\ fields.
1952 %
1953 % The \texttt{eid} field is now always included, although it is optional for
1954 % the bibliography entries. This electronic identifier is a replacement for the
1955 % page number in electronic journals: it is the sequence number in the printed
1956 % volume. If present, it will be used in place of the page number.
1957 %
1958 % \end{itemize}
1959 %
1960 % \begin{macrocode}
1961 \beginoptiongroup{ADDITIONAL REVTeX DATA FIELDS:}{}
1962 \optdef{*}{}{No additional fields}{for REVTeX}
1963 \optdef{r}{revdata,eprint,url,url-blk}{Include REVTeX data fields}
1964 {collaboration, eid, eprint, archive, numpages, url}
1965 \getans
1966 \mytemptrue
1967 \if\ans r\mytempfalse\fi
1968 \beginoptiongroup{E-PRINT DATA FIELD:
1969 (without REVTeX fields)}
1970 {\ifmytemp*\fi}
1971 \optdef{*}{}{Do not include eprint field}{}
1972 \optdef{e}{eprint}{Include eprint and archive fields}{for electronic publications}
1973 \getans
1974 \endoptiongroup
1975 % \end{macrocode}
1976 %
1977 % \subsection*{URL address}
1978 % For electronic documents with an Internet address, add a URL entry.
1979 % Harvard already has this, but here it is done for all styles.
1980 % The URL text will be set with the \verb!\url! command in the \texttt{url}
1981 % package by Donald Arseneau. This package must be loaded for the command
1982 % to work right. It allows line breaks at punctuations. Otherwise,
1983 % \verb!\texttt! is used instead, with no line breaks. The URL text is preceded
1984 % by \verb!\urlprefix! which defaults to ``URL '' but may be redefined by the
1985 % user to be whatever s/he wants. The final space must be included.
1986 %
1987 % Note: selecting the REV\TeX\ fields automatically includes this, so the
1988 % offer only is made if REV\TeX\ has been rejected.
1989 %
1990 % \begin{macrocode}
1991 \beginoptiongroup{URL ADDRESS:
1992 (without REVTeX fields)}{\ifmytemp*\fi}
1993 \optdef{*}{}{No URL}{for electronic (Internet) documents}
1994 \optdef{u}{url,url-blk}{Include URL}{as regular item block}
1995 \optdef{n}{url,url-nt}{URL as note}{}
1996 \optdef{l}{url,url-nl}{URL on new line}{after rest of reference}
1997 \getans
1998 \endoptiongroup
1999 \endoptiongroup
2000 % \end{macrocode}
2001 %
2002 % \subsection*{Reference Component Tagging}
2003 % If reference component tagging is enabled, we
2004 % apply tags like |\bibinfo| and |\eprint| to the fields of data
2005 % in the content of the |\bibitem| statement. We also ensure that
2006 % these commands have a default meaning within the scope of the |thebibliography|
2007 % environment. The default definitions simply print the field and ignore the
2008 % tag. However, other programs or packages might make use of the tag
2009 % information to separate authors from title, for example.
2010 %
2011 % \begin{macrocode}
2012 \beginoptiongroup{REFERENCE COMPONENT TAGS:}{}
2013 \optdef{*}{}{No reference component tags}
2014 {in the \string\bibitem\space entries}
2015 \optdef{b}{bibinfo}{Reference component tags}
2016 {like \string\bibinfo\space in the content of \string\bibitem}
2017 \getans
2018 \endoptiongroup
2019 % \end{macrocode}
2020 %
2021 % \subsection*{Define emphasis}
2022 % In everything that been mentioned so far, italicization should be
2023 % understood to mean `emphasize' in the \LaTeX{} sense. This means that the
2024 % command |\em| is used. This is not the same as |\it|, which is always
2025 % italics. Rather, with |\em|, the font style switches between |\rm| and
2026 % |\it| depending on the context. Here one may choose to true italics, or
2027 % to switch off italics altogether.
2028 % \begin{macrocode}
2029 \beginoptiongroup{EMPHASIS:
2030 (affects all so-called italics)}{}
2031 \optdef{*}{}{Use emphasis}{ie, \string\em, allows font switching}
2032 \optdef{i}{em-it}{Use true italics}{ie, \string\it, absolute italics}
2033 \optdef{x}{em-x}{No italics}{at all}
2034 \optdef{u}{em-ul}{Underlining}{in place of italics, best with ulem package}
2035 \getans
2036 \endoptiongroup
2037 % \end{macrocode}
2038 %
2039 % \subsection*{Plain \TeX\ compatibility}
2040 % Bold face, italics, and emphasis are made with the \LaTeXe\ commands,
2041 % which makes them incompatible with the obsolete \LaTeX2.09, and with
2042 % Plain \TeX. There are also some extra testing for existing commands
2043 % that best work with \LaTeXe\ syntax.
2044 %
2045 % If the bibliography style file is to be fully compatible with Plain \TeX,
2046 % do not select the option \texttt{nfss} but do take \texttt{plntx}.
2047 % \begin{macrocode}
2048 \beginoptiongroup{COMPATIBILITY WITH PLAIN TEX:}{}
2049 \optdef{*}{nfss}{Use LaTeX commands}{which may not work with Plain TeX}
2050 \optdef{t}{plntx}{Use only Plain TeX}{commands for fonts and testing}
2051 \getans
2052 \endoptiongroup
2053 % \end{macrocode}
2054 %
2055 % Terminate the options list. If a language definition file has been called,
2056 % then we have a closing brace too many, so add another dummy opening brace.
2057 % \begin{macrocode}
2058 \if!\cfile\jfile!\else
2059 \begingroup\MBswitch
2060 \wr(,{\pc)
2061 \endgroup
2062 \fi
2063
2064 \endoptions
2065 %</options>
2066 % \end{macrocode}
2067 %
2068 % \section{The Bibliographic Coding}
2069 %
2070 % \begin{macrocode}
2071 %<*!options&!driver&!bblbst>
2072 %<*!tail>
2073 % For use with BibTeX version 0.99a or later
2074 % -------------------------------------------------------------------
2075 %<*(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
2076 % WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2077 % The input dbj file contains one of the options
2078 %<nmft-it|nmft-sc|nmft-bf|nmft-def> % nmft-it, nmft-bf, nmft-sc, or nmft-def
2079 %<lab-it|lab-sc|lab-bf|lab-def> % lab-it, lab-bf, lab-sc, or lab-def
2080 % without the corresponding general option(s):
2081 %<nmft-it|nmft-sc|nmft-bf|nmft-def> % nmft
2082 %<lab-it|lab-sc|lab-bf|lab-def> % lab
2083 % (You may be using an older dbj with a newer version of merlin.mbs)
2084 % Please edit your dbj file to add the general option(s) and reprocess.
2085 %
2086 %</(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
2087 %<*!exlang>
2088 %<!babel> % This bibliography style file is intended for texts in ENGLISH
2089 %<*babel>
2090 % This bibliography style file requires a file named francaisbst.tex
2091 % containing the definitions of word commands like \bbleditor, etc.
2092 %</babel>
2093 %</!exlang>
2094 %<*exlang>
2095 % This bibliography style file is intended for texts in
2096 %<bahasa> % BAHASA
2097 %<brazilian> % BRAZILIAN
2098 %<catalan> % CATALAN
2099 %<croatian> % CROATIAN
2100 %<czech> % CZECH
2101 %<danish> % DANISH
2102 %<dansk> % DANSK
2103 %<dutch> % DUTCH
2104 %<english> % ENGLISH
2105 %<esperanto> % ESPERANTO
2106 %<finnish> % FINNISH
2107 %<french> % FRENCH
2108 %<galacian> % GALACIAN
2109 %<german> % GERMAN
2110 %<hungarian> % HUNGARIAN
2111 %<italian> % ITALIAN
2112 %<norwegian> % NORWEGIAN
2113 %<norsk> % NORWEGIAN
2114 %<polski> % POLISH
2115 %<polish> % POLISH
2116 %<portuguese> % PORTUGUESE
2117 %<romanian> % ROMANIAN
2118 %<russian> % RUSSIAN
2119 %<slovak> % SLOVAK
2120 %<slovenian> % SLOVENIAN
2121 %<slovene> % SLOVENIAN
2122 %<spanish> % SPANISH
2123 %<swedish> % SWEDISH
2124 %<turkish> % TURKISH
2125 %</exlang>
2126 %<*!html>
2127 %<*ay>
2128 % This is an author-year citation style bibliography. As such, it is
2129 % non-standard LaTeX, and requires a special package file to function properly.
2130 % Such a package is natbib.sty by Patrick W. Daly
2131 %<*alk>
2132 % or: apalike.sty by Oren Patashnik
2133 % The form of the \bibitem entries is
2134 % \bibitem[Jones et al., 1990]{key}...
2135 %</alk>
2136 %<*!(har|ast|alk|cay|nmd|cn)>
2137 % The form of the \bibitem entries is
2138 % \bibitem[Jones et al.(1990)]{key}...
2139 %<nat> % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
2140 % The essential feature is that the label (the part in brackets) consists
2141 % of the author names, as they should appear in the citation, with the year
2142 % in parentheses following. There must be no space before the opening
2143 % parenthesis!
2144 %<nat> % With natbib v5.3, a full list of authors may also follow the year.
2145 % In natbib.sty, it is possible to define the type of enclosures that is
2146 % really wanted (brackets or parentheses), but in either case, there must
2147 % be parentheses in the label.
2148 % The \cite command functions as follows:
2149 % \citet{key} ==>> Jones et al. (1990)
2150 %<nat> % \citet*{key} ==>> Jones, Baker, and Smith (1990)
2151 % \citep{key} ==>> (Jones et al., 1990)
2152 %<nat> % \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
2153 % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
2154 % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
2155 % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32)
2156 % \citeauthor{key} ==>> Jones et al.
2157 %<nat> % \citeauthor*{key} ==>> Jones, Baker, and Smith
2158 % \citeyear{key} ==>> 1990
2159 %</!(har|ast|alk|cay|nmd|cn)>
2160 %<*har>
2161 % or: harvard.sty by Peter Williams and Thorsten Schnier
2162 %<harnm> % (needs natbib v5.3 or harvard v2.0.3)
2163 % The form of the bibitem entries is
2164 % \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}...
2165 %</har>
2166 %<*cay>
2167 % or: chicago.sty
2168 % The form of the bibitem entries is
2169 % \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
2170 % {Jones et al.}{1990}{key}...
2171 %</cay>
2172 %<*nmd>
2173 % or: named.sty
2174 % The form of the bibitem entries is
2175 % \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
2176 %</nmd>
2177 %<*ast>
2178 % or: astron.sty
2179 % The form of the bibitem entries is
2180 % \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
2181 %</ast>
2182 %<*cn>
2183 % or: authordate1-4.sty
2184 % The form of the bibitem entries is
2185 % \bibitem[\protect\citename{Jones et al.}1990]{key}...
2186 %</cn>
2187 %</ay>
2188 %<*!ay>
2189 %<*!alph&!cite>
2190 % This is a numerical citation style, and as such is standard LaTeX.
2191 %</!alph&!cite>
2192 %<*alph>
2193 % This is a labelled citation style similar to the standard alpha.bst,
2194 % where labels are of the form Dal90 or DBK89.
2195 %</alph>
2196 %<*cite&!alph>
2197 % This is a special pseudo-numerical bibliography style, intended to be
2198 % used to list all the entries in a bib database
2199 %</cite&!alph>
2200 % It requires no extra package to interface to the main text.
2201 % The form of the \bibitem entries is
2202 %<!alph&!cite> % \bibitem{key}...
2203 %<alph> % \bibitem[label]{key}...
2204 %<!alph&cite> % \bibitem[key]{key}...
2205 %<*!cite|alph>
2206 % Usage of \cite is as follows:
2207 %<*!alph&!cite>
2208 % \cite{key} ==>> [#]
2209 % \cite[chap. 2]{key} ==>> [#, chap. 2]
2210 % where # is a number determined by the ordering in the reference list.
2211 %</!alph&!cite>
2212 %<*alph>
2213 % \cite{key} ==>> [label]
2214 % \cite[chap. 2]{key} ==>> [label, chap. 2]
2215 % The order in the reference list is by label.
2216 %</alph>
2217 %<*seq-no&!alph>
2218 % The order in the reference list is that by which the works were originally
2219 % cited in the text, or that in the database.
2220 %</seq-no&!alph>
2221 %<*!seq-no&!alph>
2222 % The order in the reference list is alphabetical by authors.
2223 %</!seq-no&!alph>
2224 %</!cite|alph>
2225 %</!ay>
2226 %</!html>
2227 %<*html>
2228 % This bibliographic style file produces HTML output instead of LaTeX.
2229 % The LaTeX special characters are not translated, so that the output
2230 % (which has the .bbl ending still) will have to be further massaged,
2231 % and renamed with .html or .htm. The title and heading may also need
2232 % to be revised.
2233 %
2234 %<htlist&!htdes> % The output is a numbered list.
2235 %<htdes> % The output is an unnumbered list with the keys printed
2236 %<htdes> % before each entry.
2237 %<!htlist&!htdes> % The output is lists each entry as one paragraph.
2238 %</html>
2239 % -------------------------------------------------------------------
2240
2241 % \end{macrocode}
2242 %
2243 % \begin{macro}{`ENTRY'}
2244 % The new \texttt{harvard.sty} of \LaTeXe{} includes an entry URL, or
2245 % rather it is included in the new \texttt{.bst} files for it. Add it
2246 % here too, but only for option \texttt{harnm}.
2247 %
2248 % Books normally have an ISBN number.
2249 % This entry is (optionally) included, modelled after that in
2250 % \texttt{xbtxbst.doc}.
2251 % \begin{macrocode}
2252 ENTRY
2253 { address
2254 %<annote> annote
2255 %<eprint> archive
2256 author
2257 booktitle
2258 chapter
2259 %<revdata> collaboration
2260 %<doi|url-doi> doi
2261 edition
2262 editor
2263 eid
2264 %<eprint> eprint
2265 howpublished
2266 institution
2267 %<isbn> isbn
2268 %<issn> issn
2269 journal
2270 key
2271 %<lang> language
2272 month
2273 note
2274 number
2275 %<revdata> numpages
2276 organization
2277 pages
2278 publisher
2279 school
2280 series
2281 title
2282 type
2283 %<url|harnm|revdata> url
2284 volume
2285 year
2286 }
2287 {}
2288 %<!ay&!alph> { label }
2289 %<!ay&alph> { label extra.label sort.label }
2290 %<ay> { label extra.label sort.label short.list }
2291 % \end{macrocode}
2292 % \end{macro}
2293 %
2294 % \begin{macrocode}
2295 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
2296 % \end{macrocode}
2297 %
2298 % \begin{macro}{`init.state.consts'}
2299 % \begin{macrocode}
2300 FUNCTION {init.state.consts}
2301 { #0 'before.all :=
2302 #1 'mid.sentence :=
2303 #2 'after.sentence :=
2304 #3 'after.block :=
2305 }
2306 % \end{macrocode}
2307 % \end{macro}
2308 %
2309 % |s| and |t| are general-purpose scratch registers whose value does not persist
2310 % past the end of a function. They also do not appear to be used to communicate
2311 % between functions or to be clobbered within a sub-function call. Hopefully.
2312 % \begin{macrocode}
2313 STRINGS { s t}
2314 % \end{macrocode}
2315 %
2316 % \begin{macro}{`output.nonnull'}
2317 % \begin{macrocode}
2318 FUNCTION {output.nonnull}
2319 { 's :=
2320 output.state mid.sentence =
2321 %<!blk-com|(!com-semi&!com-blank)> { ", " * write$ }
2322 %<blk-com&com-semi> { "; " * write$ }
2323 %<blk-com&!com-semi&com-blank> { " " * write$ }
2324 { output.state after.block =
2325 { add.period$ write$
2326 newline$
2327 %<!html> "\newblock " write$
2328 }
2329 { output.state before.all =
2330 'write$
2331 { add.period$ " " * write$ }
2332 if$
2333 }
2334 if$
2335 mid.sentence 'output.state :=
2336 }
2337 if$
2338 s
2339 }
2340 % \end{macrocode}
2341 % \end{macro}
2342 %
2343 % \begin{macro}{`output'}
2344 % \begin{macrocode}
2345 FUNCTION {output}
2346 { duplicate$ empty$
2347 'pop$
2348 'output.nonnull
2349 if$
2350 }
2351 % \end{macrocode}
2352 % \end{macro}
2353 %
2354 % \begin{macro}{`output.check'}
2355 % \begin{macrocode}
2356 FUNCTION {output.check}
2357 { 't :=
2358 duplicate$ empty$
2359 { pop$ "empty " t * " in " * cite$ * warning$ }
2360 'output.nonnull
2361 if$
2362 }
2363 % \end{macrocode}
2364 % \end{macro}
2365 %
2366 % \begin{macro}{`fin.entry'}
2367 % I have often been asked to add an annotation function. This suggestion is
2368 % from Soren Dayton; it inputs a file with the same name as the cite key, or
2369 % uses the text in the \texttt{annote} field. It will only work with \LaTeXe.
2370 % \begin{macrocode}
2371 FUNCTION {fin.entry}
2372 %<*!fin-bare>
2373 { add.period$
2374 write$
2375 %</!fin-bare>
2376 %<*fin-bare>
2377 { duplicate$ empty$
2378 'pop$
2379 'write$
2380 if$
2381 %</fin-bare>
2382 %<html&htdes> "</dd>" write$
2383 %<html&!htdes&htlist> "</li>" write$
2384 %<html&!htdes&!htlist> "</p>" write$
2385 newline$
2386 %<*annote>
2387 %<*!html>
2388 annote missing$
2389 { "\bibAnnoteFile{" cite$ * "}" * write$ newline$ }
2390 { "\bibAnnote{" cite$ * "}{" * annote * "}" * write$ newline$
2391 }
2392 if$
2393 %</!html>
2394 %<*html>
2395 "<blockquote><strong>Key:</strong> "
2396 cite$ * write$
2397 annote missing$
2398 { newline$ }
2399 { "<br><strong>Annotation:</strong>" write$ newline$
2400 annote write$ newline$
2401 }
2402 if$
2403 "</blockquote>" write$ newline$
2404 %</html>
2405 %</annote>
2406 }
2407
2408 % \end{macrocode}
2409 % \end{macro}
2410 %
2411 % \begin{macro}{`new.block'}
2412 % \begin{macrocode}
2413 FUNCTION {new.block}
2414 { output.state before.all =
2415 'skip$
2416 { after.block 'output.state := }
2417 if$
2418 }
2419 % \end{macrocode}
2420 % \end{macro}
2421 %
2422 % \begin{macro}{`new.sentence'}
2423 % \begin{macrocode}
2424 FUNCTION {new.sentence}
2425 { output.state after.block =
2426 'skip$
2427 { output.state before.all =
2428 'skip$
2429 { after.sentence 'output.state := }
2430 if$
2431 }
2432 if$
2433 }
2434 % \end{macrocode}
2435 % \end{macro}
2436 %
2437 % \begin{macro}{`add.blank'}
2438 % When text is printed with \texttt{output} or
2439 % \texttt{output.check}, the \texttt{output.state} is set such that
2440 % a comma will precede the next output text. For special effects, we want to
2441 % suppress this comma, inserting a blank instead. Hence the
2442 % \texttt{output.state} is changed to \texttt{before.all}, meaning no
2443 % punctuation is to be inserted.
2444 % \begin{macrocode}
2445 FUNCTION {add.blank}
2446 { " " * before.all 'output.state :=
2447 }
2448
2449 % \end{macrocode}
2450 % \end{macro}
2451 %
2452 % \begin{macro}{`add.colon'}
2453 % \begin{macrocode}
2454 %<*au-col|tit-col>
2455 FUNCTION {add.colon}
2456 { duplicate$ empty$
2457 'skip$
2458 { ":" * add.blank }
2459 if$
2460 }
2461
2462 %</au-col|tit-col>
2463 % \end{macrocode}
2464 % \end{macro}
2465 %
2466 % \begin{macro}{`no.blank.or.punct'}
2467 % Another frill is to suppresss both blanks and punctuation. The |\hspace|
2468 % permits a line break at this point.
2469 % \begin{macrocode}
2470 %<*yrpp-xsp>
2471 FUNCTION {no.blank.or.punct}
2472 %<*!html>
2473 { "\hspace{0pt}" * before.all 'output.state :=
2474 }
2475 %</!html>
2476 %<html>{ before.all 'output.state := }
2477
2478 %</yrpp-xsp>
2479 % \end{macrocode}
2480 % \end{macro}
2481 %
2482 % \begin{macro}{`date.block'}
2483 % The \texttt{date.block} function is used for special punctuating effects
2484 % after the date.
2485 % \begin{macrocode}
2486 FUNCTION {date.block}
2487 {
2488 %<*!yrp-x>
2489 %<yrp-col> ":" *
2490 %<*!yrp-col>
2491 %<yrp-semi> ";" *
2492 %<*!yrp-semi>
2493 %<!blk-com&!blk-tit&!blk-tita> new.block
2494 %<(blk-com|blk-tit|blk-tita)&!yrp-per> skip$
2495 %<(blk-com|blk-tit|blk-tita)&yrp-per> new.sentence
2496 %</!yrp-semi>
2497 %</!yrp-col>
2498 %</!yrp-x>
2499 %<*yrp-x|yrp-col|yrp-semi>
2500 %<!yrpp-xsp> add.blank
2501 %<yrpp-xsp> no.blank.or.punct
2502 %</yrp-x|yrp-col|yrp-semi>
2503 }
2504
2505 % \end{macrocode}
2506 % \end{macro}
2507 %
2508 % \begin{macro}{`not'}
2509 % \begin{macrocode}
2510 FUNCTION {not}
2511 { { #0 }
2512 { #1 }
2513 if$
2514 }
2515 % \end{macrocode}
2516 % \end{macro}
2517 %
2518 % \begin{macro}{`and'}
2519 % \begin{macrocode}
2520 FUNCTION {and}
2521 { 'skip$
2522 { pop$ #0 }
2523 if$
2524 }
2525 % \end{macrocode}
2526 % \end{macro}
2527 %
2528 % \begin{macro}{`or'}
2529 % \begin{macrocode}
2530 FUNCTION {or}
2531 { { pop$ #1 }
2532 'skip$
2533 if$
2534 }
2535 % \end{macrocode}
2536 % \end{macro}
2537 %
2538 % \begin{macro}{`non.stop'}
2539 % This function (my invention) tests if the last character in the string
2540 % on the stack is \texttt{. ! ?} by using \texttt{add.period\$}. It is to
2541 % be used for conditional italic correction or adding commas.
2542 % \begin{macrocode}
2543 %<*!tit-it&tit-qq>
2544 FUNCTION {non.stop}
2545 { duplicate$
2546 "}" * add.period$
2547 #-1 #1 substring$ "." =
2548 }
2549
2550 %</!tit-it&tit-qq>
2551 % \end{macrocode}
2552 % \end{macro}
2553 %
2554 % \begin{macro}{`remove.dots'}
2555 % This macro removes any periods from the string on the stack. To be used
2556 % for undotting journal names, months, and juniors. Previously
2557 % \texttt{purify\$} was used for this, but that removes more than just
2558 % dots.
2559 %
2560 % May 2007, Joseph A. Wright (Morning Star, UK) contributed a revision to allow
2561 % the dot accent |\.| to be retained.
2562 % \begin{macrocode}
2563 %<*nm-rv|nm-rvx|nm-rvcx|mth-bare|jxper>
2564 STRINGS {z}
2565
2566 FUNCTION {remove.dots}
2567 { 'z :=
2568 ""
2569 { z empty$ not }
2570 { z #1 #2 substring$
2571 duplicate$ "\." =
2572 { z #3 global.max$ substring$ 'z := * }
2573 { pop$
2574 z #1 #1 substring$
2575 z #2 global.max$ substring$ 'z :=
2576 duplicate$ "." = 'pop$
2577 { * }
2578 if$
2579 }
2580 if$
2581 }
2582 while$
2583 }
2584 %</nm-rv|nm-rvx|nm-rvcx|mth-bare|jxper>
2585 % \end{macrocode}
2586 % \end{macro}
2587 %
2588 % \begin{macro}{`new.block.checka'}
2589 % \begin{macrocode}
2590 %<*!ay>
2591 FUNCTION {new.block.checka}
2592 { empty$
2593 'skip$
2594 'new.block
2595 if$
2596 }
2597 %</!ay>
2598 % \end{macrocode}
2599 % \end{macro}
2600 %
2601 % \begin{macro}{`new.block.checkb'}
2602 % \begin{macrocode}
2603 FUNCTION {new.block.checkb}
2604 { empty$
2605 swap$ empty$
2606 and
2607 'skip$
2608 'new.block
2609 if$
2610 }
2611 % \end{macrocode}
2612 % \end{macro}
2613 %
2614 % \begin{macro}{`new.sentence.checka'}
2615 % \begin{macrocode}
2616 %<*!ay>
2617 FUNCTION {new.sentence.checka}
2618 { empty$
2619 'skip$
2620 'new.sentence
2621 if$
2622 }
2623 %</!ay>
2624 % \end{macrocode}
2625 % \end{macro}
2626 %
2627 % \begin{macro}{`new.sentence.checkb'}
2628 % \begin{macrocode}
2629 %<*!ay>
2630 FUNCTION {new.sentence.checkb}
2631 { empty$
2632 swap$ empty$
2633 and
2634 'skip$
2635 'new.sentence
2636 if$
2637 }
2638 %</!ay>
2639 % \end{macrocode}
2640 % \end{macro}
2641 %
2642 % \begin{macro}{`field.or.null'}
2643 % \begin{macrocode}
2644 FUNCTION {field.or.null}
2645 { duplicate$ empty$
2646 { pop$ "" }
2647 'skip$
2648 if$
2649 }
2650 % \end{macrocode}
2651 % \end{macro}
2652 %
2653 % \begin{macro}{`emphasize'}
2654 % Emphasis can be either italic or the alternating font. The font command
2655 % may be NFSS or regular \LaTeX~2.09 declarations.
2656 % \begin{macrocode}
2657 FUNCTION {emphasize}
2658 %<*!em-x>
2659 { duplicate$ empty$
2660 { pop$ "" }
2661 %<html> { "<i>" swap$ * "</i>" * }
2662 %<*!html>
2663 %<em-ul> { "\uline{" swap$ * "}" * }
2664 %<*!em-ul>
2665 %<*!nfss>
2666 %<!em-it> { "{\em " swap$ * "\/}" * }
2667 %<em-it> { "{\it " swap$ * "\/}" * }
2668 %</!nfss>
2669 %<*nfss>
2670 %<!em-it> { "\emph{" swap$ * "}" * }
2671 %<em-it> { "\textit{" swap$ * "}" * }
2672 %</nfss>
2673 %</!em-ul>
2674 %</!html>
2675 if$
2676 }
2677 %</!em-x>
2678 %<em-x>{ skip$ }
2679 % \end{macrocode}
2680 % \end{macro}
2681 %
2682 % \begin{macro}{`bolden'}
2683 % The bold font command may be NFSS or the regular \LaTeX~2.09 declaration.
2684 % \begin{macrocode}
2685 %<*nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf|pres-bf>
2686 FUNCTION {bolden}
2687 { duplicate$ empty$
2688 { pop$ "" }
2689 %<html> { "<b>" swap$ * "</b>" * }
2690 %<*!html>
2691 %<!nfss> { "{\bf " swap$ * "}" * }
2692 %<nfss> { "\textbf{" swap$ * "}" * }
2693 %</!html>
2694 if$
2695 }
2696 %</nmft-bf|vol-bf|vol-2bf|lab-bf|dtbf|pres-bf>
2697 % \end{macrocode}
2698 % \end{macro}
2699 %
2700 % \begin{macro}{`scaps'}
2701 % To put text into small caps.
2702 % \begin{macrocode}
2703 %<*lab-sc|nmft-sc|pres-sc>
2704 FUNCTION {scaps}
2705 { duplicate$ empty$
2706 { pop$ "" }
2707 %<html> { skip$ }
2708 %<*!html>
2709 %<!nfss> { "{\sc " swap$ * "}" * }
2710 %<nfss> { "\textsc{" swap$ * "}" * }
2711 %</!html>
2712 if$
2713 }
2714 %</lab-sc|nmft-sc|pres-sc>
2715 % \end{macrocode}
2716 % \end{macro}
2717 %
2718 % \begin{macro}{`bib.name.font'}
2719 % \begin{macro}{`bib.fname.font'}
2720 % \begin{macro}{`cite.name.font'}
2721 % Define functions for formatting the author/editor names, one for the
2722 % surnames (\texttt{bib.name.font}) and one for the first names
2723 % (\texttt{bib.fname.font}). These could be identical, or the latter is
2724 % deactivated if first names are not to be formatted, only the last names.
2725 %
2726 % For citations, we have \texttt{cite.name.font}. Here only surnames appear.
2727 %
2728 % It is also possible to have a user-defined font command for each, which the
2729 % user must define in his work. These are |\bibnamefont{}| and |\bibfnamefont{}|,
2730 % and some defaults are provided that simply repeat the arguments. Two commands
2731 % are needed if \texttt{nmft-def} and \texttt{fnm-def} are both given.
2732 %
2733 % If neither \texttt{fnm-def} nor \texttt{fnm-rm} are given, then the first names
2734 % are formatted the same as the surnames.
2735 % \begin{macrocode}
2736 %<*nmft>
2737 FUNCTION {bib.name.font}
2738 %<nmft-it>{ emphasize }
2739 %<!nmft-it&nmft-bf>{ bolden }
2740 %<!nmft-it&!nmft-bf&nmft-sc>{ scaps }
2741 %<*!nmft-it&!nmft-bf&!nmft-sc&nmft-def>
2742 { duplicate$ empty$
2743 { pop$ "" }
2744 %<!html> { "\bibnamefont{" swap$ * "}" * }
2745 %<html> { skip$ }
2746 if$
2747 }
2748 %</!nmft-it&!nmft-bf&!nmft-sc&nmft-def>
2749 FUNCTION {bib.fname.font}
2750 %<!fnm-rm&!fnm-def>{ bib.name.font }
2751 %<fnm-rm>{ skip$ }
2752 %<*!fnm-rm&fnm-def>
2753 { duplicate$ empty$
2754 { pop$ "" }
2755 %<!html> { "\bibfnamefont{" swap$ * "}" * }
2756 %<html> { skip$ }
2757 if$
2758 }
2759 %</!fnm-rm&fnm-def>
2760 %</nmft>
2761 % \end{macrocode}
2762 %
2763 % \begin{macrocode}
2764 %<*lab>
2765 FUNCTION {cite.name.font}
2766 %<lab-it>{ emphasize }
2767 %<!lab-it&lab-bf>{ bolden }
2768 %<!lab-it&!lab-bf&lab-sc>{ scaps }
2769 %<*!lab-it&!lab-bf&!lab-sc&lab-def>
2770 { duplicate$ empty$
2771 { pop$ "" }
2772 %<!html> { "\citenamefont{" swap$ * "}" * }
2773 %<html> { skip$ }
2774 if$
2775 }
2776 %</!lab-it&!lab-bf&!lab-sc&lab-def>
2777 %</lab>
2778 % \end{macrocode}
2779 % \end{macro}
2780 % \end{macro}
2781 % \end{macro}
2782 %
2783 % \begin{macro}{`tie.or.space.prefix'}
2784 % The function \texttt{tie.or.space.prefix} determines whether
2785 % the top item on the stack requires a tie character and
2786 % slips that (or a space character if not) ahead of it.
2787 % At this point a font switch or other function can be applied to
2788 % the top item on the stack, and the appropriate space found
2789 % just ahead of it on the stack.
2790 %
2791 % The sequence \texttt{tie.or.space.prefix} \texttt{*} \texttt{*} is a common idiom
2792 % for joining the top two stack objects with a tie or space
2793 % depending on the length of the top object.
2794 %
2795 % Another idiom is to apply \texttt{tie.or.space.prefix}, apply a font switch,
2796 % and then swap and join. In this case the tie or space follows the object.
2797 % \begin{macrocode}
2798 FUNCTION {tie.or.space.prefix}
2799 { duplicate$ text.length$ #3 <
2800 { "~" }
2801 { " " }
2802 if$
2803 swap$
2804 }
2805 % \end{macrocode}
2806 % \end{macro}
2807 %
2808 % \begin{macro}{`capitalize'}
2809 % Capitalizing is easy for regular languages, but for \texttt{babel},
2810 % some trickery stuff is needed; definitions of |\capitalize| and
2811 % |\Capitalize| are written to the \texttt{.bbl} file.
2812 % \begin{macrocode}
2813
2814 FUNCTION {capitalize}
2815 %<!babel>{ "u" change.case$ "t" change.case$ }
2816 %<babel>{ "\capitalize" swap$ * }
2817
2818 % \end{macrocode}
2819 % \end{macro}
2820 %
2821 % \begin{macro}{`space.word'}
2822 % The function \texttt{space.word} adds a space before and after the word or
2823 % words currently on the stack. This was added for the \texttt{bbl.}$nnn$
2824 % functions, that contain only a word without spacing, but replace explicit
2825 % text in the originals that were spaced out. Its seems more flexible to
2826 % define the word functions to be without spacing.
2827 % \begin{macrocode}
2828 FUNCTION {space.word}
2829 { " " swap$ * " " * }
2830 % \end{macrocode}
2831 % \end{macro}
2832 %
2833 % \begin{macrocode}
2834 % Here are the language-specific definitions for explicit words.
2835 % Each function has a name bbl.xxx where xxx is the English word.
2836 % \end{macrocode}
2837 %
2838 % \begin{macrocode}
2839 %<*!exlang>
2840 % \end{macrocode}
2841 %
2842 % \begin{macro}{`bbl.xxx'}
2843 % These are the default English words. There is no default language
2844 % option: one of \texttt{english} or \texttt{babel} must be given.
2845 % \begin{macrocode}
2846 %<*!babel>
2847 % The language selected here is ENGLISH
2848 FUNCTION {bbl.and}
2849 %<!varand|html>{ "and"}
2850 %<varand&!html>{ "\protect\BIBand{}"}
2851
2852 FUNCTION {bbl.etal}
2853 { "et~al." }
2854
2855 FUNCTION {bbl.editors}
2856 %<!ed>{ "editors" }
2857 %<ed>{ "eds." }
2858
2859 FUNCTION {bbl.editor}
2860 %<!ed>{ "editor" }
2861 %<ed>{ "ed." }
2862
2863 FUNCTION {bbl.edby}
2864 { "edited by" }
2865
2866 FUNCTION {bbl.edition}
2867 %<!abr>{ "edition" }
2868 %<abr&!ednx>{ "edn." }
2869 %<abr&ednx>{ "ed." }
2870
2871 FUNCTION {bbl.volume}
2872 %<!abr>{ "volume" }
2873 %<abr>{ "vol." }
2874
2875 FUNCTION {bbl.of}
2876 { "of" }
2877
2878 FUNCTION {bbl.number}
2879 %<!abr>{ "number" }
2880 %<abr>{ "no." }
2881
2882 FUNCTION {bbl.nr}
2883 { "no." }
2884
2885 FUNCTION {bbl.in}
2886 { "in" }
2887
2888 FUNCTION {bbl.pages}
2889 %<!pp&!ppx>{ "pages" }
2890 %<pp>{ "pp." }
2891 %<!pp&ppx>{ "" }
2892
2893 FUNCTION {bbl.page}
2894 %<!pp&!ppx>{ "page" }
2895 %<pp>{ "p." }
2896 %<!pp&ppx>{ "" }
2897
2898 %<*revdata>
2899 FUNCTION {bbl.eidpp}
2900 { "pages" }
2901
2902 %</revdata>
2903 FUNCTION {bbl.chapter}
2904 %<!abr>{ "chapter" }
2905 %<abr>{ "chap." }
2906
2907 FUNCTION {bbl.techrep}
2908 %<!abr>{ "Technical Report" }
2909 %<abr>{ "Tech. Rep." }
2910
2911 FUNCTION {bbl.mthesis}
2912 { "Master's thesis" }
2913
2914 FUNCTION {bbl.phdthesis}
2915 { "Ph.D. thesis" }
2916
2917 %<*!xedn>
2918 FUNCTION {bbl.first}
2919 %<!ord>{ "First" }
2920 %<ord>{ "1st" }
2921
2922 FUNCTION {bbl.second}
2923 %<!ord>{ "Second" }
2924 %<ord>{ "2nd" }
2925
2926 FUNCTION {bbl.third}
2927 %<!ord>{ "Third" }
2928 %<ord>{ "3rd" }
2929
2930 FUNCTION {bbl.fourth}
2931 %<!ord>{ "Fourth" }
2932 %<ord>{ "4th" }
2933
2934 FUNCTION {bbl.fifth}
2935 %<!ord>{ "Fifth" }
2936 %<ord>{ "5th" }
2937
2938 FUNCTION {bbl.st}
2939 { "st" }
2940
2941 FUNCTION {bbl.nd}
2942 { "nd" }
2943
2944 FUNCTION {bbl.rd}
2945 { "rd" }
2946
2947 FUNCTION {bbl.th}
2948 { "th" }
2949
2950 %</!xedn>
2951 %<*!abr>
2952 MACRO {jan} {"January"}
2953
2954 MACRO {feb} {"February"}
2955
2956 MACRO {mar} {"March"}
2957
2958 MACRO {apr} {"April"}
2959
2960 MACRO {may} {"May"}
2961
2962 MACRO {jun} {"June"}
2963
2964 MACRO {jul} {"July"}
2965
2966 MACRO {aug} {"August"}
2967
2968 MACRO {sep} {"September"}
2969
2970 MACRO {oct} {"October"}
2971
2972 MACRO {nov} {"November"}
2973
2974 MACRO {dec} {"December"}
2975
2976 %</!abr>
2977 %<*abr>
2978 MACRO {jan} {"Jan."}
2979
2980 MACRO {feb} {"Feb."}
2981
2982 MACRO {mar} {"Mar."}
2983
2984 MACRO {apr} {"Apr."}
2985
2986 MACRO {may} {"May"}
2987
2988 MACRO {jun} {"Jun."}
2989
2990 MACRO {jul} {"Jul."}
2991
2992 MACRO {aug} {"Aug."}
2993
2994 MACRO {sep} {"Sep."}
2995
2996 MACRO {oct} {"Oct."}
2997
2998 MACRO {nov} {"Nov."}
2999
3000 MACRO {dec} {"Dec."}
3001
3002 %</abr>
3003 %</!babel>
3004 % \end{macrocode}
3005 %
3006 % Here are the definitions for \texttt{babel} option, i.e., explicit
3007 % translations are not used, but rather only \LaTeX{} macros that must be
3008 % defined in the file \texttt{francaisbst.tex}. This could allow automatic
3009 % language selection.
3010 % \begin{macrocode}
3011 %<*babel>
3012 % The BABEL language selection is made here; definitions in francaisbst.tex.
3013 FUNCTION {bbl.and}
3014 { "\bbland{}"}
3015
3016 FUNCTION {bbl.etal}
3017 { "\bbletal{}"}
3018
3019 FUNCTION {bbl.editors}
3020 %<!ed>{ "\bbleditors{}" }
3021 %<ed>{ "\bbleds{}" }
3022
3023 FUNCTION {bbl.editor}
3024 %<!ed>{ "\bbleditor{}" }
3025 %<ed>{ "\bbled{}" }
3026
3027 FUNCTION {bbl.edby}
3028 { "\bbledby{}" }
3029
3030 FUNCTION {bbl.edition}
3031 %<!abr>{ "\bbledition{}" }
3032 %<abr>{ "\bbledn{}" }
3033
3034 FUNCTION {bbl.volume}
3035 %<!abr>{ "\bblvolume{}" }
3036 %<abr>{ "\bblvol{}" }
3037
3038 FUNCTION {bbl.of}
3039 { "\bblof{}" }
3040
3041 FUNCTION {bbl.number}
3042 %<!abr>{ "\bblnumber{}" }
3043 %<abr>{ "\bblno{}" }
3044
3045 FUNCTION {bbl.nr}
3046 { "\bblno{}" }
3047
3048 FUNCTION {bbl.in}
3049 { "\bblin{}" }
3050
3051 FUNCTION {bbl.pages}
3052 %<!pp&!ppx>{ "\bblpages{}" }
3053 %<pp>{ "\bblpp{}" }
3054 %<!pp&ppx>{ "" }
3055
3056 FUNCTION {bbl.page}
3057 %<!pp&!ppx>{ "\bblpage{}" }
3058 %<pp>{ "\bblp{}" }
3059 %<!pp&ppx>{ "" }
3060
3061 FUNCTION {bbl.chapter}
3062 %<!abr>{ "\bblchapter{}" }
3063 %<abr>{ "\bblchap{}" }
3064
3065 FUNCTION {bbl.techrep}
3066 %<!abr>{ "\bbltechreport{}" }
3067 %<abr>{ "\bbltechrep{}" }
3068
3069 FUNCTION {bbl.mthesis}
3070 { "\bblmthesis{}" }
3071
3072 FUNCTION {bbl.phdthesis}
3073 { "\bblphdthesis{}" }
3074
3075 %<*revdata>
3076 FUNCTION {bbl.eidpp}
3077 { "\bbleidpp{}" }
3078
3079 %</revdata>
3080 %<*!xedn>
3081 FUNCTION {bbl.first}
3082 %<!ord>{ "\bblfirst{}" }
3083 %<ord>{ "\bblfirsto{}" }
3084
3085 FUNCTION {bbl.second}
3086 %<!ord>{ "\bblsecond{}" }
3087 %<ord>{ "\bblsecondo{}" }
3088
3089 FUNCTION {bbl.third}
3090 %<!ord>{ "\bblthird{}" }
3091 %<ord>{ "\bblthirdo{}" }
3092
3093 FUNCTION {bbl.fourth}
3094 %<!ord>{ "\bblfourth{}" }
3095 %<ord>{ "\bblfourtho{}" }
3096
3097 FUNCTION {bbl.fifth}
3098 %<!ord>{ "\bblfifth{}" }
3099 %<ord>{ "\bblfiftho{}" }
3100
3101 FUNCTION {bbl.st}
3102 { "\bblst{}" }
3103
3104 FUNCTION {bbl.nd}
3105 { "\bblnd{}" }
3106
3107 FUNCTION {bbl.rd}
3108 { "\bblrd{}" }
3109
3110 FUNCTION {bbl.th}
3111 { "\bblth{}" }
3112
3113 %</!xedn>
3114 MACRO {jan} {"\bbljan{}"}
3115
3116 MACRO {feb} {"\bblfeb{}"}
3117
3118 MACRO {mar} {"\bblmar{}"}
3119
3120 MACRO {apr} {"\bblapr{}"}
3121
3122 MACRO {may} {"\bblmay{}"}
3123
3124 MACRO {jun} {"\bbljun{}"}
3125
3126 MACRO {jul} {"\bbljul{}"}
3127
3128 MACRO {aug} {"\bblaug{}"}
3129
3130 MACRO {sep} {"\bblsep{}"}
3131
3132 MACRO {oct} {"\bbloct{}"}
3133
3134 MACRO {nov} {"\bblnov{}"}
3135
3136 MACRO {dec} {"\bbldec{}"}
3137
3138 %</babel>
3139 % \end{macrocode}
3140 %
3141 % \begin{macro}{`eng.ord'}
3142 % This function adds English endings for ordinals 1, 2, 3. However, if
3143 % the second last digit is 1, then the ending is `th' for all last digits.
3144 % So far, all other languages included do not have this problem, and it is
3145 % sufficient to add the \textsl{th} equivalent. This might change with further
3146 % languages.
3147 %
3148 % This function must be included with \texttt{babel} too, since that includes
3149 % English. This means that the language definition files must also provide
3150 % for |\bblst|, |\bblnd|, and |\bblrd|, setting them all equal to |\bblth|.
3151 %
3152 % \begin{macrocode}
3153 %<*(english|!exlang)&!xedn>
3154 FUNCTION {eng.ord}
3155 { duplicate$ "1" swap$ *
3156 #-2 #1 substring$ "1" =
3157 { bbl.th * }
3158 { duplicate$ #-1 #1 substring$
3159 duplicate$ "1" =
3160 { pop$ bbl.st * }
3161 { duplicate$ "2" =
3162 { pop$ bbl.nd * }
3163 { "3" =
3164 { bbl.rd * }
3165 { bbl.th * }
3166 if$
3167 }
3168 if$
3169 }
3170 if$
3171 }
3172 if$
3173 }
3174
3175 %</(english|!exlang)&!xedn>
3176 % \end{macrocode}
3177 % \end{macro}
3178 %
3179 % \begin{macrocode}
3180 %</!exlang>
3181 % \end{macrocode}
3182 %
3183 % \begin{macrocode}
3184 %</!tail>
3185 % \end{macrocode}
3186 %
3187 % \begin{macrocode}
3188 %<*!head>
3189 % \end{macrocode}
3190 % \end{macro}
3191 %
3192 % \begin{macrocode}
3193 %<*!jabr>
3194 MACRO {acmcs} {"ACM Computing Surveys"}
3195
3196 MACRO {acta} {"Acta Informatica"}
3197
3198 MACRO {cacm} {"Communications of the ACM"}
3199
3200 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
3201
3202 MACRO {ibmsj} {"IBM Systems Journal"}
3203
3204 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
3205
3206 MACRO {ieeetc} {"IEEE Transactions on Computers"}
3207
3208 MACRO {ieeetcad}
3209 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
3210
3211 MACRO {ipl} {"Information Processing Letters"}
3212
3213 MACRO {jacm} {"Journal of the ACM"}
3214
3215 MACRO {jcss} {"Journal of Computer and System Sciences"}
3216
3217 MACRO {scp} {"Science of Computer Programming"}
3218
3219 MACRO {sicomp} {"SIAM Journal on Computing"}
3220
3221 MACRO {tocs} {"ACM Transactions on Computer Systems"}
3222
3223 MACRO {tods} {"ACM Transactions on Database Systems"}
3224
3225 MACRO {tog} {"ACM Transactions on Graphics"}
3226
3227 MACRO {toms} {"ACM Transactions on Mathematical Software"}
3228
3229 MACRO {toois} {"ACM Transactions on Office Information Systems"}
3230
3231 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
3232
3233 MACRO {tcs} {"Theoretical Computer Science"}
3234 %</!jabr>
3235 % \end{macrocode}
3236 %
3237 % Journal abbreviations have been revised from the original Patashnik
3238 % ones with help of Conrado Badenas and the IUA recommendations.
3239 % \begin{macrocode}
3240 %<*jabr>
3241 MACRO {acmcs} {"ACM Comput. Surv."}
3242
3243 MACRO {acta} {"Acta Inf."}
3244
3245 MACRO {cacm} {"Commun. ACM"}
3246
3247 MACRO {ibmjrd} {"IBM J. Res. Dev."}
3248
3249 MACRO {ibmsj} {"IBM Syst.~J."}
3250
3251 MACRO {ieeese} {"IEEE Trans. Software Eng."}
3252
3253 MACRO {ieeetc} {"IEEE Trans. Comput."}
3254
3255 MACRO {ieeetcad}
3256 {"IEEE Trans. Comput. Aid. Des."}
3257
3258 MACRO {ipl} {"Inf. Process. Lett."}
3259
3260 MACRO {jacm} {"J.~ACM"}
3261
3262 MACRO {jcss} {"J.~Comput. Syst. Sci."}
3263
3264 MACRO {scp} {"Sci. Comput. Program."}
3265
3266 MACRO {sicomp} {"SIAM J. Comput."}
3267
3268 MACRO {tocs} {"ACM Trans. Comput. Syst."}
3269
3270 MACRO {tods} {"ACM Trans. Database Syst."}
3271
3272 MACRO {tog} {"ACM Trans. Graphic."}
3273
3274 MACRO {toms} {"ACM Trans. Math. Software"}
3275
3276 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
3277
3278 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
3279
3280 MACRO {tcs} {"Theor. Comput. Sci."}
3281
3282 %</jabr>
3283 % \end{macrocode}
3284 %
3285 % \begin{macro}{`bibinfo.check'}
3286 % Define functions that encapsulate the argument
3287 % in a \TeX\ macro that allows for further processing when the
3288 % bibliography is processed, or allows for a separate computer
3289 % program to parse the |\bibitem| contents.
3290 %
3291 % The following table summarizes how each of the \btx{} entries
3292 % is accessed for output; these are the points where
3293 % the \texttt{format.bibinfo} or \texttt{bibinfo.check} functions
3294 % are called.
3295 % \subsubsection*{Trapped via \texttt{format.bibinfo}}
3296 % \begin{description}
3297 % \item[ \texttt{author} ]\texttt{format.names}
3298 % \item[ \texttt{collaboration} ]\texttt{format.authors}
3299 % \item[ \texttt{editor} ]\texttt{format.editors} (\texttt{book}, \texttt{inbook}, \texttt{proceedings}), \texttt{format.names.ed} (\texttt{format.in.ed.booktitle})
3300 % \item[ \texttt{eid} ]\texttt{format.journal.eid} (\texttt{format.vol.num.pages}, article) checks the output from \texttt{format.journal.pages}
3301 % \item[ \texttt{isbn} ]\texttt{format.isbn}
3302 % \item[ \texttt{issn} ]\texttt{format.issn}
3303 % \item[ \texttt{journal} ]\texttt{format.article.crossref}, article
3304 % \item[ \texttt{numpages} ]\texttt{format.journal.eid}
3305 % \item[ \texttt{organization} ]\texttt{format.organization.address} (\texttt{inproceedings}, \texttt{proceedings}), \texttt{manual}
3306 % \item[ \texttt{pages} ]\texttt{format.book}.pages (\texttt{book}, \texttt{booklet}), \texttt{format.pages} (\texttt{format.journal.pages}, \texttt{format.chapter.pages}, \texttt{article}, \texttt{inbook}, \texttt{incollection}, \texttt{inproceedings})
3307 % \item[ \texttt{publisher} ]\texttt{format.publisher.address} (like \texttt{output.check}, \texttt{inproceedings}, \texttt{proceedings})
3308 % \item[ \texttt{title} ]\texttt{format.title}, \texttt{format.btitle}, \texttt{misc}, \texttt{presort}, \texttt{bib.sort.order}
3309 % \item[ \texttt{volume} ]\texttt{format.bvolume}, \texttt{format.vol.num.pages}, \texttt{format.book.crossref}
3310 % \item[ \texttt{year} ]in optional argument of \texttt{\char`\\bibitem}, \texttt{format.date} (as part of date), \texttt{format.year}, \texttt{format.org.or.pub}
3311 % \item[ \texttt{booktitle} ]\texttt{format.in.ed.booktitle} (\texttt{incollection}, \texttt{inproceedings}), \texttt{format.incoll.inproc.crossref}
3312 % \item[ \texttt{howpublished} ]\texttt{booklet}, \texttt{misc}
3313 % \item[ \texttt{edition} ]\texttt{convert.edition.format.edition}
3314 % \item[ \texttt{institution} ]\texttt{techreport}
3315 % \item[ \texttt{school} ]\texttt{mastersthesis}, \texttt{phdthesis}
3316 % \item[ \texttt{address} ]\texttt{format.org.or.pub}, \texttt{booklet}, \texttt{manual}, \texttt{mastersthesis}, \texttt{phdthesis}, \texttt{techreport}
3317 % \item[ \texttt{chapter} ]\texttt{format.chapter.pages}
3318 % \item[ \texttt{number} ]\texttt{format.number.series}, \texttt{format.vol.num.pages}, \texttt{format.tr.number}
3319 % \item[ \texttt{series} ]\texttt{format.bvolume}, \texttt{format.number.series}, \texttt{format.book.crossref}
3320 % \item[ \texttt{type} ]\texttt{format.chapter.pages}, \texttt{format.thesis.type}, \texttt{format.tr.number}
3321 % \item[ \texttt{month} ]\texttt{format.date}
3322 % \item[ \texttt{note} ]\texttt{format.note}
3323 % \item[ \texttt{annote} ]\texttt{fin.entry}
3324 % \end{description}
3325 %
3326 % \subsubsection*{Encapsulated via \texttt{\char`\\url}}
3327 % \begin{description}
3328 % \item[ \texttt{url} ]\texttt{format.url} (\texttt{\char`\\harvardurl}, \texttt{\char`\\url}), \texttt{format.url} (\texttt{\char`\\url}), \texttt{format.note} (\texttt{\char`\\url})
3329 % \end{description}
3330 %
3331 % \subsubsection*{Encapsulated via \texttt{\char`\\doi}}
3332 % \begin{description}
3333 % \item[ \texttt{doi} ]\texttt{format.doi} (\texttt{\char`\\doi})
3334 % \end{description}
3335 %
3336 % \subsubsection*{Encapsulated via \texttt{\char`\\eprint}}
3337 % \begin{description}
3338 % \item[ \texttt{eprint} ]\texttt{format.eprint}
3339 % \item[ \texttt{archive} ]\texttt{format.eprint}
3340 % \end{description}
3341 %
3342 % \subsubsection*{Not encapsulated:}
3343 % \begin{description}
3344 % \item[ \texttt{key} ]cite key
3345 % \item[ \texttt{language} ]operand of \texttt{\char`\\selectlanguage}
3346 % \end{description}
3347 %
3348 % \subsubsection*{\texttt{bibinfo} tag, but not a \btx{} field}
3349 % \begin{description}
3350 % \item[ \texttt{date} ]\texttt{format.date}
3351 % \end{description}
3352 %
3353 % Provides robust access to fields, checking against \texttt{missing\$}
3354 % and \texttt{empty\$}. A \dtx{} option allows giving
3355 % a warning if either is the case.
3356 %
3357 % If not, it encapsulates the argument in a \TeX\ macro |\bibinfo|.
3358 % The encapsulation is enabled by the \texttt{bibinfo} \dtx{} option:
3359 % if turned off, it simply pops the unneeded object.
3360 %
3361 % \texttt{field} \texttt{string} \texttt{->} \texttt{encapsulated-field}
3362 %
3363 % \texttt{empty} \texttt{string} \texttt{->} \texttt{empty}
3364 % Side effect: warning.
3365 % \begin{macrocode}
3366 FUNCTION {bibinfo.check}
3367 { swap$
3368 duplicate$ missing$
3369 {
3370 %<bibinfo.warning> swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
3371 %<!bibinfo.warning> pop$ pop$
3372 ""
3373 }
3374 { duplicate$ empty$
3375 {
3376 %<bibinfo.warning> swap$ "empty " swap$ * " in " * cite$ * warning$
3377 %<!bibinfo.warning> swap$ pop$
3378 }
3379 { swap$
3380 %<bibinfo> "\bibinfo{" swap$ * "}{" * swap$ * "}" *
3381 %<!bibinfo> pop$
3382 }
3383 if$
3384 }
3385 if$
3386 }
3387 % \end{macrocode}
3388 % \end{macro}
3389 %
3390 % \begin{macro}{`bibinfo.warn'}
3391 % Replaces \texttt{output.check}
3392 % with \texttt{bibinfo.warn} followed by \texttt{output}.
3393 %
3394 % \texttt{field} \texttt{string} \texttt{->} \texttt{encapsulated-field}
3395 %
3396 % \texttt{empty} \texttt{string} \texttt{->} \texttt{empty}
3397 %
3398 % Side effect: warning if the field is empty.
3399 % Note: if the \dtx{} option \texttt{bibinfo} is not in effect,
3400 % then no encapsulation is done.
3401 % \begin{macrocode}
3402 FUNCTION {bibinfo.warn}
3403 { swap$
3404 duplicate$ missing$
3405 {
3406 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
3407 ""
3408 }
3409 { duplicate$ empty$
3410 {
3411 swap$ "empty " swap$ * " in " * cite$ * warning$
3412 }
3413 { swap$
3414 %<bibinfo> "\bibinfo{" swap$ * "}{" * swap$ * "}" *
3415 %<!bibinfo> pop$
3416 }
3417 if$
3418 }
3419 if$
3420 }
3421 % \end{macrocode}
3422 % \end{macro}
3423 %
3424 % \begin{macro}{`format.eprint'}
3425 % The access function for the \texttt{eprint} field.
3426 %
3427 % If the \texttt{bibinfo} \dtx{} option is selected, then this function
3428 % encapsulates the argument in a \TeX\ macro |\eprint|.
3429 %
3430 % \texttt{->} \texttt{encapsulated-URL}
3431 % \begin{macrocode}
3432 %<*eprint>
3433 FUNCTION {format.eprint}
3434 { eprint duplicate$ empty$
3435 'skip$
3436 { "\eprint"
3437 archive empty$
3438 'skip$
3439 { "[" * archive * "]" * }
3440 if$
3441 "{" * swap$ * "}" *
3442 }
3443 if$
3444 }
3445 %</eprint>
3446 % \end{macrocode}
3447 % \end{macro}
3448 %
3449 % \begin{macro}{`write.url'}
3450 % This function taken over from \texttt{agsm.sty}, the main \texttt{harvard}
3451 % bib style. For non-Harvard styles that want to add the URL on a new line
3452 % after the reference, use this function too, but defined slightly
3453 % differently.
3454 % \begin{macrocode}
3455 %<*(harnm|url-nl)&!revdata>
3456 FUNCTION {write.url}
3457 %<*!html>
3458 {
3459 %<*url-doi&url>
3460 doi empty$
3461 { url }
3462 { "http://dx.doi.org/" doi * }
3463 if$
3464 %</url-doi&url>
3465 %<!url-doi|!url> url
3466 duplicate$ empty$
3467 { pop$ }
3468 %<harnm> { "\newline\harvardurl{" swap$ * "}" * write$ newline$ }
3469 %<!harnm&url-nl> { "\newline\urlprefix\url{" swap$ * "}" * write$ newline$ }
3470 if$
3471 }
3472 %</!html>
3473 %<*html>
3474 {
3475 %<*url-doi&url>
3476 doi empty$
3477 { url }
3478 { "http://dx.doi.org/" doi * }
3479 if$
3480 %</url-doi&url>
3481 %<!url-doi|!url> url
3482 duplicate$ empty$
3483 { pop$ }
3484 { duplicate$ "<br><a href=" quote$ * swap$ * quote$
3485 * ">" * swap$ * "</a>" * write$ newline$ }
3486 if$
3487 }
3488 %</html>
3489
3490 %</(harnm|url-nl)&!revdata>
3491 % \end{macrocode}
3492 % \end{macro}
3493 %
3494 % \begin{macro}{`format.url'}
3495 % This function is reworked for \texttt{\filename} to provide a
3496 % cleaner URL for DOIs. The definition of \cmd{\urldoi} is written in
3497 % the \texttt{.bbl} file by the function \texttt{begin.bib}. When the
3498 % package \pkg{hyperref} is loaded, the \meta{doi} is a hyperlink to
3499 % \texttt{https://doi.org/\meta{doi}}.
3500 % \begin{macrocode}
3501 %<*(url-blk&!harnm)|revdata>
3502 FUNCTION {format.url}
3503 {
3504 %<url-doi&url> doi empty$
3505 %<url-doi&url> {
3506 url
3507 duplicate$ empty$
3508 { pop$ "" }
3509 %<!html> { "\urlprefix\url{" swap$ * "}" * }
3510 %<html> {
3511 %<html> duplicate$ "<a href=" quote$ * swap$ * quote$ *
3512 %<html> ">" * swap$ * "</a>" *
3513 %<html> }
3514 if$
3515 %<*url-doi&url>
3516 }
3517 {
3518 doi
3519 %<!html> "\doiprefix\urldoi{" swap$ * "}" *
3520 %<html> duplicate$ "doi:<a href=" quote$ * "https://doi.org/" *
3521 %<html> swap$ * quote$ * ">" * swap$ * "</a>" *
3522 }
3523 if$
3524 %</url-doi&url>
3525 }
3526
3527 %</(url-blk&!harnm)|revdata>
3528 % \end{macrocode}
3529 % \end{macro}
3530 %
3531 % \begin{macro}{`check.speaker'}
3532 % The \texttt{presentation} type uses the \texttt{key} entry to indicate which
3533 % author is the speaker, as the sequence number in the author list. The speaker's
3534 % name is put into a different font, depending on the extra option. If no font
3535 % is specified, all names are the same.
3536 % \begin{macrocode}
3537 INTEGERS { nameptr namesleft numnames }
3538
3539 %<*pres-bf|pres-it|pres-sc>
3540 FUNCTION {check.speaker}
3541 { key empty$ 'skip$
3542 { key nameptr int.to.str$ =
3543 {
3544 %<pres-bf> bolden
3545 %<pres-it&!pres-bf> emphasize
3546 %<pres-sc&!pres-it&!pres-bf> scaps
3547 }
3548 'skip$
3549 if$
3550 }
3551 if$
3552 }
3553
3554 %</pres-bf|pres-it|pres-sc>
3555 % \end{macrocode}
3556 % \end{macro}
3557
3558 % \begin{macro}{`format.names'}
3559 % The \texttt{harvard} package now (version 2.0.3, for \LaTeXe) uses
3560 % |\harvardand| in place of the word \textsl{and} so that it can be changed
3561 % at run time. This is allowed for with the option \texttt{harnm}, which
3562 % need not be used only with the \texttt{har} option.
3563 % This seems like a useless feature for \texttt{.bst} files made from
3564 % this multilanguage source. However, it is included anyway, which means
3565 % if \texttt{harnm} option selected, one must redefine |\harvardand|
3566 % in the document for the language being used.
3567 %
3568 % The location of the junior part for reversed name is not obvious. Prior
3569 % to version 4.0, I always had it attached to the last name, as
3570 % Smith, Jr, John, put it probably is better as Smith, John, Jr. For the
3571 % AGU \texttt{nm-rev1} I always did it this way, probably because I had a
3572 % good AGU example to follow. Dilemma: do I just change them all or add an
3573 % option to do it? The option will maintain consistency with older
3574 % versions, but this could also be considered a bug fix rather than a new
3575 % feature. Solution: use the option, since I have found other \texttt{.bst}
3576 % files from Beebe and Harvard that put junior between surname and first
3577 % name.
3578 %
3579 % |bibinfo| is a variable used to store a string telling it whether the
3580 % names being formatted are authors or editors, since this function is called
3581 % for both purposes. Every call to this function must push the string onto the stack
3582 % just before the call.
3583 % \begin{macrocode}
3584 STRINGS { bibinfo}
3585
3586 % \end{macrocode}
3587 %
3588 % Stack note: if the names argument is a non-nil list, this function returns
3589 % one object on the stack, the formatted list of names.
3590 %
3591 % \texttt{names`string} \texttt{bibinfo`string} \texttt{->} \texttt{author-list`string}
3592 % \begin{macrocode}
3593 FUNCTION {format.names}
3594 { 'bibinfo :=
3595 duplicate$ empty$ 'skip$ {
3596 's :=
3597 "" 't :=
3598 #1 'nameptr :=
3599 s num.names$ 'numnames :=
3600 numnames 'namesleft :=
3601 { namesleft #0 > }
3602 { s nameptr
3603 % \end{macrocode}
3604 % Here is the author formatting when the names are not set in any special
3605 % font, or when the entire name set in a single special font.
3606 % \begin{macrocode}
3607 %<*!(nmft&(fnm-rm|fnm-def))>
3608 %<*!nm-rev1&!nm-revv1>
3609 %<nm-init> "{f.~}{vv~}{ll}{, jj}"
3610 %<*!nm-init>
3611 %<nm-rev&!jnrlst> "{vv~}{ll}{, jj}{, f.}"
3612 %<nm-rev&jnrlst> "{vv~}{ll}{, f.}{, jj}"
3613 %<*!nm-rev>
3614 %<nm-rv&!jnrlst> "{vv~}{ll}{ jj}{ f{~}}"
3615 %<nm-rv&jnrlst> "{vv~}{ll}{ f{~}}{ jj}"
3616 %<*!nm-rv>
3617 %<nm-rvx&!jnrlst> "{vv~}{ll}{ jj}{ f{}}"
3618 %<nm-rvx&jnrlst> "{vv~}{ll}{ f{}}{ jj}"
3619 %<*!nm-rvx>
3620 %<nm-rvcx&!jnrlst> "{vv~}{ll}{, jj}{, f{}}"
3621 %<nm-rvcx&jnrlst> "{vv~}{ll}{, f{}}{, jj}"
3622 %<*!nm-rvcx>
3623 %<nm-rvv&!jnrlst> "{vv~}{ll}{ jj}{ f{.}.}"
3624 %<nm-rvv&jnrlst> "{vv~}{ll}{ f{.}.}{ jj}"
3625 %<*!nm-rvv>
3626 %<nm-rvvc&!jnrlst> "{vv~}{ll}{, jj}{, f{.}.}"
3627 %<nm-rvvc&jnrlst> "{vv~}{ll}{, f{.}.}{, jj}"
3628 %<*!nm-rvvc>
3629 %<nm-revf&!jnrlst> "{vv~}{ll}{, jj}{, ff}"
3630 %<nm-revf&jnrlst> "{vv~}{ll}{, ff}{, jj}"
3631 %<*!nm-revf>
3632 "{ff~}{vv~}{ll}{, jj}"
3633 %</!nm-revf>
3634 %</!nm-rvvc>
3635 %</!nm-rvv>
3636 %</!nm-rvcx>
3637 %</!nm-rvx>
3638 %</!nm-rv>
3639 %</!nm-rev>
3640 %</!nm-init>
3641 %</!nm-rev1&!nm-revv1>
3642 %<*nm-rev1>
3643 duplicate$ #1 >
3644 { "{f.~}{vv~}{ll}{, jj}" }
3645 %<!jnrlst> { "{vv~}{ll}{, jj}{, f.}" }
3646 %<jnrlst> { "{vv~}{ll}{, f.}{, jj}" }
3647 if$
3648 %</nm-rev1>
3649 %<*!nm-rev1&nm-revv1>
3650 duplicate$ #1 >
3651 { "{ff~}{vv~}{ll}{, jj}" }
3652 %<!jnrlst> { "{vv~}{ll}{, jj}{, ff}" }
3653 %<jnrlst> { "{vv~}{ll}{, ff}{, jj}" }
3654 if$
3655 %</!nm-rev1&nm-revv1>
3656 format.name$
3657 %<nm-rv|nm-rvx> remove.dots
3658 %<nmft&nmand-rm> bib.name.font
3659 %</!(nmft&(fnm-rm|fnm-def))>
3660 % \end{macrocode}
3661 % Here is the author formatting when the first and last names are
3662 % set in (possibly different) special fonts.
3663 %
3664 % The junior part is optionally between the reversed names, or after them.
3665 % \begin{macrocode}
3666 %<*nmft&(fnm-rm|fnm-def)>
3667 %<*!nm-rev1&!nm-revv1>
3668 %<*nm-init>
3669 "{f.}" format.name$ duplicate$ empty$ 'skip$
3670 { tie.or.space.prefix bib.fname.font swap$ * }
3671 if$
3672 s nameptr
3673 "{vv~}{ll}" format.name$ bib.name.font *
3674 s nameptr
3675 "{jj}" format.name$ duplicate$ empty$ 'skip$
3676 { bib.fname.font ", " swap$ * }
3677 if$
3678 %</nm-init>
3679 %<*!nm-init>
3680 %<*nm-rev>
3681 "{vv~}{ll}" format.name$ bib.name.font
3682 s nameptr
3683 %<!jnrlst> "{jj, }{f.}"
3684 %<jnrlst> "{f.}{, jj}"
3685 format.name$ duplicate$ empty$ 'skip$
3686 { bib.fname.font ", " swap$ * }
3687 if$
3688 %</nm-rev>
3689 %<*!nm-rev>
3690 %<*nm-rv>
3691 "{vv~}{ll}" format.name$ bib.name.font
3692 s nameptr
3693 %<!jnrlst> "{jj }{f{~}}"
3694 %<jnrlst> "{f{~}}{ jj}"
3695 format.name$ duplicate$ empty$ 'skip$
3696 { remove.dots bib.fname.font " " swap$ * }
3697 if$
3698 %</nm-rv>
3699 %<*!nm-rv>
3700 %<*nm-rvx>
3701 "{vv~}{ll}" format.name$ bib.name.font
3702 s nameptr
3703 %<!jnrlst> "{jj }{f{}}"
3704 %<jnrlst> "{f{}}{ jj}"
3705 format.name$ duplicate$ empty$ 'skip$
3706 { remove.dots bib.fname.font " " swap$ * }
3707 if$
3708 %</nm-rvx>
3709 %<*!nm-rvx>
3710 %<*nm-rvcx>
3711 "{vv~}{ll}" format.name$ bib.name.font
3712 s nameptr
3713 %<!jnrlst> "{jj, }{f{}}"
3714 %<jnrlst> "{f{}}{, jj}"
3715 format.name$ duplicate$ empty$ 'skip$
3716 { remove.dots bib.fname.font ", " swap$ * }
3717 if$
3718 %</nm-rvcx>
3719 %<*!nm-rvcx>
3720 %<*nm-rvv>
3721 "{vv~}{ll}" format.name$ bib.name.font
3722 s nameptr
3723 %<!jnrlst> "{jj }{f{.}.}"
3724 %<jnrlst> "{f{.}.}{ jj}"
3725 format.name$ duplicate$ empty$ 'skip$
3726 { bib.fname.font " " swap$ * }
3727 if$
3728 %</nm-rvv>
3729 %<*!nm-rvv>
3730 %<*nm-rvvc>
3731 "{vv~}{ll}" format.name$ bib.name.font
3732 s nameptr
3733 %<!jnrlst> "{jj, }{f{.}.}"
3734 %<jnrlst> "{f{.}.}{, jj}"
3735 format.name$ duplicate$ empty$ 'skip$
3736 { bib.fname.font ", " swap$ * }
3737 if$
3738 %</nm-rvvc>
3739 %<*!nm-rvvc>
3740 %<*nm-revf>
3741 "{vv~}{ll}" format.name$ bib.name.font
3742 s nameptr
3743 %<!jnrlst> "{jj, }{ff}"
3744 %<jnrlst> "{ff}{, jj}"
3745 format.name$ duplicate$ empty$ 'skip$
3746 { bib.fname.font ", " swap$ * }
3747 if$
3748 %</nm-revf>
3749 %<*!nm-revf>
3750 "{ff}" format.name$ duplicate$ empty$ 'skip$
3751 { tie.or.space.prefix bib.fname.font swap$ * }
3752 if$
3753 s nameptr
3754 "{vv~}{ll}" format.name$ bib.name.font *
3755 s nameptr
3756 "{jj}" format.name$ duplicate$ empty$ 'skip$
3757 { bib.fname.font ", " swap$ * }
3758 if$
3759 %</!nm-revf>
3760 %</!nm-rvvc>
3761 %</!nm-rvv>
3762 %</!nm-rvcx>
3763 %</!nm-rvx>
3764 %</!nm-rv>
3765 %</!nm-rev>
3766 %</!nm-init>
3767 %</!nm-rev1&!nm-revv1>
3768 %<*nm-rev1>
3769 nameptr #1 >
3770 { "{f.}" format.name$ duplicate$ empty$ 'skip$
3771 { tie.or.space.prefix bib.fname.font swap$ * }
3772 if$
3773 s nameptr
3774 "{vv~}{ll}" format.name$ bib.name.font *
3775 s nameptr
3776 "{jj}" format.name$ duplicate$ empty$ 'skip$
3777 { bib.fname.font ", " swap$ * }
3778 if$
3779 }
3780 { "{vv~}{ll}" format.name$ bib.name.font
3781 s nameptr
3782 %<!jnrlst> "{jj, }{f.}"
3783 %<jnrlst> "{f.}{, jj}"
3784 format.name$ duplicate$ empty$ 'skip$
3785 { bib.fname.font ", " swap$ * }
3786 if$
3787 }
3788 if$
3789 %</nm-rev1>
3790 %<*!nm-rev1&nm-revv1>
3791 nameptr #1 >
3792 { "{ff}" format.name$ duplicate$ empty$ 'skip$
3793 { tie.or.space.prefix bib.fname.font swap$ * }
3794 if$
3795 s nameptr
3796 "{vv~}{ll}" format.name$ bib.name.font *
3797 s nameptr
3798 "{jj}" format.name$ duplicate$ empty$ 'skip$
3799 { bib.fname.font ", " swap$ * }
3800 if$
3801 }
3802 { "{vv~}{ll}" format.name$ bib.name.font
3803 s nameptr
3804 %<!jnrlst> "{jj, }{ff}"
3805 %<jnrlst> "{ff}{, jj}"
3806 format.name$ duplicate$ empty$ 'skip$
3807 { bib.fname.font ", " swap$ * }
3808 if$
3809 }
3810 if$
3811 %</!nm-rev1&nm-revv1>
3812 *
3813 %</nmft&(fnm-rm|fnm-def)>
3814 bibinfo bibinfo.check
3815 %<*pres-bf|pres-it|pres-sc>
3816 type$ "presentation" =
3817 { check.speaker }
3818 'skip$
3819 if$
3820 %</pres-bf|pres-it|pres-sc>
3821 't :=
3822 nameptr #1 >
3823 {
3824 %<*nmlm>
3825 %<m1> nameptr #1
3826 %<m2> nameptr #2
3827 %<m3> nameptr #3
3828 %<m4> nameptr #4
3829 %<m5> nameptr #5
3830 %<m6> nameptr #6
3831 %<m7> nameptr #7
3832 %<m8> nameptr #8
3833 %<m9> nameptr #9
3834 %<m0> nameptr #0
3835 %<m10> #10 +
3836 %<m20> #20 +
3837 %<m30> #30 +
3838 %<m40> #40 +
3839 %<m50> #50 +
3840 %<m60> #60 +
3841 %<m70> #70 +
3842 %<m80> #80 +
3843 %<m90> #90 +
3844 #1 + =
3845 %<x1> numnames #1
3846 %<x2> numnames #2
3847 %<x3> numnames #3
3848 %<x4> numnames #4
3849 %<x5> numnames #5
3850 %<x6> numnames #6
3851 %<x7> numnames #7
3852 %<x8> numnames #8
3853 %<x9> numnames #9
3854 %<x0> numnames #0
3855 %<x10> #10 +
3856 %<x20> #20 +
3857 %<x30> #30 +
3858 %<x40> #40 +
3859 %<x50> #50 +
3860 %<x60> #60 +
3861 %<x70> #70 +
3862 %<x80> #80 +
3863 %<x90> #90 +
3864 > and
3865 { "others" 't :=
3866 #1 'namesleft := }
3867 'skip$
3868 if$
3869 %</nmlm>
3870 namesleft #1 >
3871 %<!aunm-semi&!aunm-sl> { ", " * t * }
3872 %<aunm-semi> { "; " * t * }
3873 %<aunm-sl&!aunm-semi> { "/ " * t * }
3874 {
3875 s nameptr "{ll}" format.name$ duplicate$ "others" =
3876 { 't := }
3877 { pop$ }
3878 if$
3879 %<(and-com|xand)&!aunm-semi&!aunm-sl> "," *
3880 %<(and-com|xand)&aunm-semi> ";" *
3881 %<(and-com|xand)&aunm-sl&!aunm-semi> "/" *
3882 %<*!and-xcom&!and-com&!xand>
3883 numnames #2 >
3884 %<etal-xc> t "others" = not and
3885 %<!aunm-semi&!aunm-sl> { "," * }
3886 %<aunm-semi> { ";" * }
3887 %<aunm-sl&!aunm-semi> { "/" * }
3888 'skip$
3889 if$
3890 %</!and-xcom&!and-com&!xand>
3891 t "others" =
3892 {
3893 %<nmft&!nmand-rm&!(fnm-rm|fnm-def)&(etal-it|etal-rm)> bib.name.font
3894 %<*!etal-it>
3895 %<nmft&(nmand-rm|(fnm-rm|fnm-def))&!etal-rm> " " * bbl.etal bib.name.font *
3896 %<!(nmft&(nmand-rm|(fnm-rm|fnm-def)))|etal-rm> " " * bbl.etal *
3897 %</!etal-it>
3898 %<etal-it> " " * bbl.etal emphasize *
3899 %<nmft&!nmand-rm&!(fnm-rm|fnm-def)&!(etal-it|etal-rm)> bib.name.font
3900 }
3901 %<*!xand>
3902 {
3903 %<*!harnm>
3904 %<!amper> bbl.and
3905 %<amper> "\&"
3906 %</!harnm>
3907 %<harnm> "\harvardand{}"
3908 %<nmft&!nmand-rm&(fnm-rm|fnm-def)> bib.name.font
3909 space.word * t *
3910 }
3911 %</!xand>
3912 %<xand> { " " * t * }
3913 if$
3914 }
3915 if$
3916 }
3917 't
3918 if$
3919 nameptr #1 + 'nameptr :=
3920 namesleft #1 - 'namesleft :=
3921 }
3922 while$
3923 %<*nmft&!nmand-rm&!(fnm-rm|fnm-def)>
3924 t "others" =
3925 'skip$
3926 { bib.name.font }
3927 if$
3928 %</nmft&!nmand-rm&!(fnm-rm|fnm-def)>
3929 } if$
3930 }
3931 % \end{macrocode}
3932 % \end{macro}
3933 %
3934 % \begin{macro}{`format.names.ed'}
3935 % When editors are used in place of authors to identify the work, the
3936 % names are always formatted just like authors'. However, in collections,
3937 % where ``edited by'' or ``\emph{names} (editors)'' are given, it is
3938 % normal not to reverse the names, even if the authors' are. The option
3939 % \texttt{ed-rev} sees to it that editor names are always formatted exactly
3940 % like those of authors, being reversed if necessary.
3941 %
3942 % The option \texttt{ed-au} is identical to \texttt{ed-rev}, but is more
3943 % logical. It means editors (in incollections) are formatted exactly like
3944 % authors, with all the font, reversing, and number limitations. This is
3945 % selected automatically with \texttt{nm-init} and \texttt{nm-} default to save
3946 % programming memory.
3947 %
3948 % The option \texttt{nm-revf} in this case acts the same as the default
3949 % when no \texttt{nm-} option given: full names with surname last. Therefore
3950 % it is not necessary to test for it at all, since it, like the default,
3951 % has the lowest priority: any other \texttt{nm-} option clobbers it.
3952 %
3953 % The options \texttt{aunm-semi} and \texttt{aunm-sl} will put a semi-colon or
3954 % slash between editor names, just as for authors, when \texttt{ed-rev} not
3955 % selected, in keeping with the idea that in this case both authors and editors
3956 % are to be formatted the same.
3957 %
3958 % This function either dispatches to \texttt{format.names} or executes code
3959 % which is similar. In the latter case, names are always presented first
3960 % followed by surname (``last name''); name limit processing (\texttt{nmlm}) is not executed;
3961 % and endgame processing differs in being qualified by \texttt{nmfted}.
3962 %
3963 % Stack note: if the names (second) argument is a non-nil list, this function returns
3964 % with one object on the stack, the formatted list of names.
3965 %
3966 % \texttt{names`string} \texttt{bibinfo`string} \texttt{->} \texttt{author-list`string}
3967 % \begin{macrocode}
3968 FUNCTION {format.names.ed}
3969 {
3970 %<ed-rev|ed-au> format.names
3971 %<*!ed-rev&!ed-au>
3972 'bibinfo :=
3973 duplicate$ empty$ 'skip$ {
3974 's :=
3975 "" 't :=
3976 #1 'nameptr :=
3977 s num.names$ 'numnames :=
3978 numnames 'namesleft :=
3979 { namesleft #0 > }
3980 { s nameptr
3981 % \end{macrocode}
3982 % Editor name is handled as a single object, with no separation of first and last name.
3983 % \begin{macrocode}
3984 %<*!(nmft&nmfted&(fnm-rm|fnm-def))>
3985 %<nm-init|nm-rev|nm-rev1> "{f.~}{vv~}{ll}{, jj}"
3986 %<*!nm-init&!nm-rev&!nm-rev1>
3987 %<nm-revv1> "{ff~}{vv~}{ll}{, jj}"
3988 %<*!nm-revv1>
3989 %<nm-rv> "{f{~}~}{vv~}{ll}{ jj}"
3990 %<*!nm-rv>
3991 %<nm-rvx> "{f{}~}{vv~}{ll}{ jj}"
3992 %<*!nm-rvx>
3993 %<nm-rvcx> "{f{}~}{vv~}{ll}{ jj}"
3994 %<*!nm-rvcx>
3995 %<nm-rvv|nm-rvvc> "{f{.}.~}{vv~}{ll}{ jj}"
3996 %<*!nm-rvv&!nm-rvvc>
3997 "{ff~}{vv~}{ll}{, jj}"
3998 %</!nm-rvv&!nm-rvvc>
3999 %</!nm-rvcx>
4000 %</!nm-rvx>
4001 %</!nm-rv>
4002 %</!nm-revv1>
4003 %</!nm-init&!nm-rev&!nm-rev1>
4004 format.name$
4005 %<nm-rv|nm-rvx|nm-rvcx> remove.dots
4006 %<nmft&nmfted&nmand-rm> bib.name.font
4007 %</!(nmft&nmfted&(fnm-rm|fnm-def))>
4008 % \end{macrocode}
4009 % Editor first and last name handled separately.
4010 % \begin{macrocode}
4011 %<*(nmft&nmfted&(fnm-rm|fnm-def))>
4012 %<*nm-init|nm-rev|nm-rev1>
4013 "{f.}" format.name$ duplicate$ empty$ 'skip$
4014 { tie.or.space.prefix bib.fname.font swap$ * }
4015 if$
4016 s nameptr
4017 "{vv~}{ll}" format.name$ bib.name.font *
4018 s nameptr
4019 "{jj}" format.name$ duplicate$ empty$ 'skip$
4020 { bib.fname.font ", " swap$ * }
4021 if$
4022 %</nm-init|nm-rev|nm-rev1>
4023 %<*!nm-init&!nm-rev&!nm-rev1>
4024 %<*nm-revv1>
4025 "{ff}" format.name$ duplicate$ empty$ 'skip$
4026 { tie.or.space.prefix bib.fname.font swap$ * }
4027 if$
4028 s nameptr
4029 "{vv~}{ll}" format.name$ bib.name.font *
4030 s nameptr
4031 "{jj}" format.name$ duplicate$ empty$ 'skip$
4032 { bib.fname.font ", " swap$ * }
4033 if$
4034 %</nm-revv1>
4035 %<*!nm-revv1>
4036 %<*nm-rv>
4037 "{f{~}}" format.name$ duplicate$ empty$ 'skip$
4038 { tie.or.space.prefix bib.fname.font swap$ * }
4039 if$
4040 s nameptr
4041 "{vv~}{ll}" format.name$ bib.name.font *
4042 s nameptr
4043 "{jj}" format.name$ duplicate$ empty$ 'skip$
4044 { remove.dots bib.fname.font " " swap$ * }
4045 if$
4046 %</nm-rv>
4047 %<*!nm-rv>
4048 %<*nm-rvx|nm-rvcx>
4049 "{f{}}" format.name$ duplicate$ empty$ 'skip$
4050 { tie.or.space.prefix bib.fname.font swap$ * }
4051 if$
4052 s nameptr
4053 "{vv~}{ll}" format.name$ bib.name.font *
4054 s nameptr
4055 "{jj}" format.name$ duplicate$ empty$ 'skip$
4056 { remove.dots bib.fname.font " " swap$ * }
4057 if$
4058 %</nm-rvx|nm-rvcx>
4059 %<*!nm-rvx&!nm-rvcx>
4060 %<*nm-rvv|nm-rvvc>
4061 "{f{.}.}" format.name$ duplicate$ empty$ 'skip$
4062 { tie.or.space.prefix bib.fname.font swap$ * }
4063 if$
4064 s nameptr
4065 "{vv~}{ll}" format.name$ bib.name.font *
4066 s nameptr
4067 "{jj}" format.name$ duplicate$ empty$ 'skip$
4068 { bib.fname.font " " swap$ * }
4069 if$
4070 %</nm-rvv|nm-rvvc>
4071 %<*!nm-rvv&!nm-rvvc>
4072 "{ff}" format.name$ duplicate$ empty$ 'skip$
4073 { tie.or.space.prefix bib.fname.font swap$ * }
4074 if$
4075 s nameptr
4076 "{vv~}{ll}" format.name$ bib.name.font *
4077 s nameptr
4078 "{jj}" format.name$ duplicate$ empty$ 'skip$
4079 { bib.fname.font ", " swap$ * }
4080 if$
4081 %</!nm-rvv&!nm-rvvc>
4082 %</!nm-rvx&!nm-rvcx>
4083 %</!nm-rv>
4084 %</!nm-revv1>
4085 %</!nm-init&!nm-rev&!nm-rev1>
4086 *
4087 %</(nmft&nmfted&(fnm-rm|fnm-def))>
4088 bibinfo bibinfo.check
4089 't :=
4090 nameptr #1 >
4091 {
4092 namesleft #1 >
4093 %<!aunm-semi&!aunm-sl> { ", " * t * }
4094 %<aunm-semi> { "; " * t * }
4095 %<aunm-sl&!aunm-semi> { "/ " * t * }
4096 {
4097 s nameptr "{ll}" format.name$ duplicate$ "others" =
4098 { 't := }
4099 { pop$ }
4100 if$
4101 %<(and-com-ed|xand)&!aunm-semi&!aunm-sl> "," *
4102 %<(and-com-ed|xand)&aunm-semi> ";" *
4103 %<(and-com-ed|xand)&aunm-sl&!aunm-semi> "/" *
4104 %<*!and-xcom&!and-com-ed&!xand>
4105 numnames #2 >
4106 %<etal-xc> t "others" = not and
4107 %<!aunm-semi&!aunm-sl> { "," * }
4108 %<aunm-semi> { ";" * }
4109 %<aunm-sl&!aunm-semi> { "/" * }
4110 'skip$
4111 if$
4112 %</!and-xcom&!and-com-ed&!xand>
4113 t "others" =
4114 {
4115
4116 %<nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)&(etal-it|etal-rm)> bib.name.font
4117 %<*!etal-it>
4118 %<nmft&nmfted&(nmand-rm|(fnm-rm|fnm-def))&!etal-rm> " " * bbl.etal bib.name.font *
4119 %<!(nmft&nmfted&(nmand-rm|(fnm-rm|fnm-def)))|etal-rm> " " * bbl.etal *
4120 %</!etal-it>
4121 %<etal-it> " " * bbl.etal emphasize *
4122 %<nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)&!(etal-it|etal-rm)> bib.name.font
4123 }
4124 %<*!xand>
4125 {
4126 %<*!harnm>
4127 %<!amper> bbl.and
4128 %<amper> "\&"
4129 %</!harnm>
4130 %<harnm> "\harvardand{}"
4131 %<nmft&nmfted&!nmand-rm&(fnm-rm|fnm-def)> bib.name.font
4132 space.word * t *
4133 }
4134 %</!xand>
4135 %<xand> { " " * t * }
4136 if$
4137 }
4138 if$
4139 }
4140 't
4141 if$
4142 nameptr #1 + 'nameptr :=
4143 namesleft #1 - 'namesleft :=
4144 }
4145 while$
4146 %<*nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)>
4147 t "others" =
4148 'skip$
4149 { bib.name.font }
4150 if$
4151 %</nmft&nmfted&!nmand-rm&!(fnm-rm|fnm-def)>
4152 } if$
4153 %</!ed-rev&!ed-au>
4154 }
4155 % \end{macrocode}
4156 % \end{macro}
4157 %
4158 % \begin{macro}{`format.key'}
4159 % \begin{macrocode}
4160 %<*ay>
4161 FUNCTION {format.key}
4162 { empty$
4163 { key field.or.null }
4164 { "" }
4165 if$
4166 }
4167
4168 %</ay>
4169 % \end{macrocode}
4170 % \end{macro}
4171 %
4172 % \begin{macro}{`format.authors'}
4173 %
4174 % \begin{macrocode}
4175 FUNCTION {format.authors}
4176 { author "author" format.names
4177 %<*revdata>
4178 duplicate$ empty$ 'skip$
4179 { collaboration "collaboration" bibinfo.check
4180 duplicate$ empty$ 'skip$
4181 { " (" swap$ * ")" * }
4182 if$
4183 *
4184 }
4185 if$
4186 %</revdata>
4187 }
4188 % \end{macrocode}
4189 % \end{macro}
4190 %
4191 % \begin{macro}{`get.bbl.editor'}
4192 % Use this function universally when accessing the ``editor'' text entity.
4193 % \begin{macrocode}
4194 FUNCTION {get.bbl.editor}
4195 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
4196
4197 % \end{macrocode}
4198 % \end{macro}
4199 %
4200 % \begin{macro}{`format.editors'}
4201 % The option \texttt{edpar} puts the word `editor' in parentheses.
4202 % In \texttt{genbst.mbs}, this occurred automatically with the option
4203 % \texttt{ed}, to abbreviate `editor' to `ed'. In \texttt{babel.mbs},
4204 % this was not the case, because of complications with the word functions.
4205 % Now this possibility is added as a special option, which means there is
4206 % some inconsistency with older \texttt{.dbj} files that called \texttt{ed}:
4207 % the abbreviated `ed' is not put in parentheses unless \texttt{edpar} is
4208 % also called.
4209 %
4210 % Note that the code here is very similar to code in \texttt{format.in.ed.booktitle};
4211 % the two should be kept coordinated.
4212 % \begin{macrocode}
4213 FUNCTION {format.editors}
4214 { editor "editor" format.names duplicate$ empty$ 'skip$
4215 {
4216 %<!edpar&!edparxc> "," *
4217 " " *
4218 get.bbl.editor
4219 %<bkedcap> capitalize
4220 %<edpar|edparc|edparxc> "(" swap$ * ")" *
4221 *
4222 }
4223 if$
4224 }
4225 % \end{macrocode}
4226 % \end{macro}
4227 %
4228 % \begin{macro}{`format.in.editors'}
4229 % See the note about the option \texttt{edpar} above.
4230 %
4231 % \end{macro}
4232 %
4233 % \begin{macro}{`format.book.pages'}
4234 % \begin{macrocode}
4235 %<*pg-bk>
4236 FUNCTION {format.book.pages}
4237 { pages "pages" bibinfo.check
4238 duplicate$ empty$ 'skip$
4239 { " " * bbl.pages * }
4240 if$
4241 }
4242 %</pg-bk>
4243 % \end{macrocode}
4244 % \end{macro}
4245 %
4246 % \begin{macro}{`format.isbn'}
4247 % \begin{macrocode}
4248 %<*isbn>
4249 FUNCTION {format.isbn}
4250 { isbn "isbn" bibinfo.check
4251 duplicate$ empty$ 'skip$
4252 {
4253 %<!blk-com&!blk-tit&!blk-tita> new.block
4254 "ISBN " swap$ *
4255 }
4256 if$
4257 }
4258
4259 %</isbn>
4260 % \end{macrocode}
4261 % \end{macro}
4262 %
4263 % \begin{macro}{`format.issn'}
4264 % \begin{macrocode}
4265 %<*issn>
4266 FUNCTION {format.issn}
4267 { issn "issn" bibinfo.check
4268 duplicate$ empty$ 'skip$
4269 {
4270 %<!blk-com&!blk-tit&!blk-tita> new.block
4271 "ISSN " swap$ *
4272 }
4273 if$
4274 }
4275
4276 %</issn>
4277 % \end{macrocode}
4278 % \end{macro}
4279 %
4280 % \begin{macro}{`format.doi'}
4281 % DOIs like URLs are encapsulated by their own commands, so need no \texttt{bibinfo.check}.
4282 % \begin{macrocode}
4283 %<*doi|(url-doi&!url)>
4284 FUNCTION {format.doi}
4285 { doi empty$
4286 { "" }
4287 {
4288 %<!blk-com&!blk-tit&!blk-tita> new.block
4289 %<!html> "\doi{" doi * "}" *
4290 %<html> "doi:" doi *
4291 }
4292 if$
4293 }
4294 %</doi|(url-doi&!url)>
4295 % \end{macrocode}
4296 % \end{macro}
4297 %
4298 % \begin{macro}{`select.language'}
4299 % The \texttt{language} field code has been provided by Bernd Feige, of the
4300 % University of Freiburg.
4301 % \begin{macrocode}
4302 %<*lang>
4303 FUNCTION {select.language}
4304 { duplicate$ empty$
4305 'pop$
4306 { language empty$
4307 'skip$
4308 { "{\selectlanguage{" language * "}" * swap$ * "}" * }
4309 if$
4310 }
4311 if$
4312 }
4313
4314 %</lang>
4315 % \end{macrocode}
4316 % \end{macro}
4317 %
4318 % \begin{macro}{`format.note'}
4319 % Notes should be entered as though they were a sentence on their own.
4320 % However, if they appear mid-sentence rather than after a block or sentence,
4321 % the first letter must be lowercase. Thus if a note begins with a proper
4322 % noun, it must be in braces. To avoid a warning about unmatched braces
4323 % with the \texttt{change.case\$} function, check first if the leading
4324 % character is an opening brace.
4325 %
4326 % With options \texttt{url,url-nt}, the URL text is treated as a note, and
4327 % added here. It is output directly, not prepended to the note text. This
4328 % means, if the note is to be a new sentence, the URL text starts that
4329 % sentence, and the regular note is added to that sentence, comma between.
4330 %
4331 % \begin{macrocode}
4332 FUNCTION {format.note}
4333 {
4334 %<*url-nt&!revdata>
4335 url empty$
4336 'skip$
4337 %<!html> { "\urlprefix\url{" url * "}" * output }
4338 %<html> { "<a href=" quote$ * url * quote$
4339 %<html> * ">" * url * "</a>" * output }
4340 if$
4341 %</url-nt&!revdata>
4342 note empty$
4343 { "" }
4344 { note #1 #1 substring$
4345 duplicate$ "{" =
4346 'skip$
4347 { output.state mid.sentence =
4348 { "l" }
4349 { "u" }
4350 if$
4351 change.case$
4352 }
4353 if$
4354 note #2 global.max$ substring$ * "note" bibinfo.check
4355 }
4356 if$
4357 }
4358
4359 % \end{macrocode}
4360 % \end{macro}
4361 %
4362 % \begin{macro}{`format.title'}
4363 % For a quoted title, any punctuation in the title goes inside the quote.
4364 % Otherwise, the comma or period following the title also goes inside.
4365 % Exception is with \texttt{qx} option, in which case the comma goes
4366 % outside, even when punctuation present; for period (\texttt{!blk-com})
4367 % is added outside only when punctuation is absent.
4368 % \begin{macrocode}
4369 FUNCTION {format.title}
4370 { title
4371 %<*!atit-u>
4372 duplicate$ empty$ 'skip$
4373 { "t" change.case$ }
4374 if$
4375 %</!atit-u>
4376 "title" bibinfo.check
4377 %<*tit-it|tit-qq|lang>
4378 duplicate$ empty$ 'skip$
4379 {
4380 %<tit-it> emphasize
4381 %<*!tit-it&tit-qq>
4382 "\enquote{" swap$ *
4383 %<*!qx>
4384 %<*blk-com>
4385 non.stop
4386 %<!com-semi&!com-blank> { ",} " * }
4387 %<com-semi> { ";} " * }
4388 %<!com-semi&com-blank> { "} " * }
4389 { "} " * }
4390 if$
4391 %</blk-com>
4392 %<!blk-com> add.period$ "}" *
4393 %</!qx>
4394 %<*qx>
4395 %<*blk-com>
4396 %<!com-semi&!com-blank> "}, " *
4397 %<com-semi> "}; " *
4398 %<!com-semi&com-blank> "} " *
4399 %</blk-com>
4400 %<!blk-com> "}" *
4401 %</qx>
4402 %</!tit-it&tit-qq>
4403 %<lang> select.language
4404 }
4405 if$
4406 %</tit-it|tit-qq|lang>
4407 }
4408 % \end{macrocode}
4409 % \end{macro}
4410 %
4411 % \begin{macro}{`end.quote.title'}
4412 % For a quoted title, the punctuation appears in the quotes. For commas
4413 % between block, this means the inter-block punctuation is already present,
4414 % so it must be suppressed after every \texttt{format.title output}. This
4415 % is done by setting the \texttt{output.state} to \texttt{before.all}, but
4416 % only if there really was a title. Call this macro every time after
4417 % titles are output.
4418 % \begin{macrocode}
4419 %<*blk-com&tit-qq>
4420 FUNCTION {end.quote.title}
4421 { title empty$
4422 'skip$
4423 { before.all 'output.state := }
4424 if$
4425 }
4426 %</blk-com&tit-qq>
4427 % \end{macrocode}
4428 % \end{macro}
4429 %
4430 % \begin{macro}{`end.quote.btitle'}
4431 % Similar to |end.quote.title| except that it is only applied if titles of
4432 % proceedings and collections are quoted, and if
4433 % neither \texttt{edby}, \texttt{edby-par}, nor \texttt{edby-par} are selected
4434 % (this is the default case in the relevant menu of the \texttt{makebst.tex} run).
4435 % These options add text after the booktitle,
4436 % so additional punctuation need not be suppressed. Unless there is no editor!
4437 %
4438 % Note: this function is called after the result of \texttt{format.in.ed.booktitle}
4439 % has been output, and attempts to predict what that output had been.
4440 % Would it not be better to call this function while that result is still
4441 % on the stack?
4442 % \begin{macrocode}
4443 %<*bt-qq>
4444 FUNCTION {end.quote.btitle}
4445 { booktitle empty$
4446 'skip$
4447 %<!edby&!edby-par&!edby-parc> { before.all 'output.state := }
4448 %<*edby|edby-par|edby-parc>
4449 { editor empty$
4450 { before.all 'output.state := }
4451 'skip$
4452 if$
4453 }
4454 %</edby|edby-par|edby-parc>
4455 if$
4456 }
4457 %</bt-qq>
4458 % \end{macrocode}
4459 % \end{macro}
4460 %
4461 % \begin{macro}{`make.full.names'}
4462 % In versions before 2.2, there were two functions \texttt{calc.long.label}
4463 % and \texttt{format.long.lab.names} that made up the string
4464 % \texttt{long.label} for each entry. This contains the full author list.
4465 % However, there was a bug in the one routine, entered by mistake when an
4466 % earlier bug was removed, and more seriously, the string
4467 % \texttt{long.label} was limited to \texttt{entry.max\$} characters, 100 on
4468 % my system. Author lists were truncated. Thus, \texttt{make.full.names}
4469 % is used instead to enter the full list of names directly in the
4470 % \texttt{output.bibitem} function, without an intermediate string. This
4471 % involves changing the order of some function definitions, especially
4472 % \texttt{output.bibitem} must come later.
4473 % \begin{macrocode}
4474 %<*har|cay|nat>
4475 FUNCTION {format.full.names}
4476 {'s :=
4477 "" 't :=
4478 #1 'nameptr :=
4479 s num.names$ 'numnames :=
4480 numnames 'namesleft :=
4481 { namesleft #0 > }
4482 { s nameptr
4483 %<!jnrlab> "{vv~}{ll}" format.name$
4484 %<*jnrlab>
4485 %<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> "{vv~}{ll}{, jj}" format.name$
4486 %<nm-rv|nm-rvv|nm-rvx|nm-rvcx> "{vv~}{ll}{ jj}" format.name$
4487 %</jnrlab>
4488 %<lab&and-rm> cite.name.font
4489 't :=
4490 nameptr #1 >
4491 {
4492 %<*nmlm>
4493 %<m1> nameptr #1
4494 %<m2> nameptr #2
4495 %<m3> nameptr #3
4496 %<m4> nameptr #4
4497 %<m5> nameptr #5
4498 %<m6> nameptr #6
4499 %<m7> nameptr #7
4500 %<m8> nameptr #8
4501 %<m9> nameptr #9
4502 %<m0> nameptr #0
4503 %<m10> #10 +
4504 %<m20> #20 +
4505 %<m30> #30 +
4506 %<m40> #40 +
4507 %<m50> #50 +
4508 %<m60> #60 +
4509 %<m70> #70 +
4510 %<m80> #80 +
4511 %<m90> #90 +
4512 #1 + =
4513 %<x1> numnames #1
4514 %<x2> numnames #2
4515 %<x3> numnames #3
4516 %<x4> numnames #4
4517 %<x5> numnames #5
4518 %<x6> numnames #6
4519 %<x7> numnames #7
4520 %<x8> numnames #8
4521 %<x9> numnames #9
4522 %<x0> numnames #0
4523 %<x10> #10 +
4524 %<x20> #20 +
4525 %<x30> #30 +
4526 %<x40> #40 +
4527 %<x50> #50 +
4528 %<x60> #60 +
4529 %<x70> #70 +
4530 %<x80> #80 +
4531 %<x90> #90 +
4532 > and
4533 { "others" 't :=
4534 #1 'namesleft := }
4535 'skip$
4536 if$
4537 %</nmlm>
4538 namesleft #1 >
4539 { ", " * t * }
4540 {
4541 s nameptr "{ll}" format.name$ duplicate$ "others" =
4542 { 't := }
4543 { pop$ }
4544 if$
4545 t "others" =
4546 {
4547 %<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
4548 %<*!etal-it>
4549 %<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
4550 %<!lab|!and-rm|etal-rm> " " * bbl.etal *
4551 %</!etal-it>
4552 %<etal-it> " " * bbl.etal emphasize *
4553 %<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
4554 }
4555 {
4556 %<*!harnm>
4557 %<*!and-xcom>
4558 numnames #2 >
4559 { "," * }
4560 'skip$
4561 if$
4562 %</!and-xcom>
4563 %<!amper> bbl.and
4564 %<amper> "\&"
4565 %</!harnm>
4566 %<harnm> "\harvardand{}"
4567 space.word * t *
4568 }
4569 if$
4570 }
4571 if$
4572 }
4573 't
4574 if$
4575 nameptr #1 + 'nameptr :=
4576 namesleft #1 - 'namesleft :=
4577 }
4578 while$
4579 %<*lab&!and-rm>
4580 t "others" =
4581 'skip$
4582 { cite.name.font }
4583 if$
4584 %</lab&!and-rm>
4585 }
4586
4587 FUNCTION {author.editor.key.full}
4588 { author empty$
4589 { editor empty$
4590 { key empty$
4591 { cite$ #1 #3 substring$ }
4592 'key
4593 if$
4594 }
4595 { editor format.full.names }
4596 if$
4597 }
4598 { author format.full.names }
4599 if$
4600 }
4601
4602 FUNCTION {author.key.full}
4603 { author empty$
4604 { key empty$
4605 { cite$ #1 #3 substring$ }
4606 'key
4607 if$
4608 }
4609 { author format.full.names }
4610 if$
4611 }
4612
4613 FUNCTION {editor.key.full}
4614 { editor empty$
4615 { key empty$
4616 { cite$ #1 #3 substring$ }
4617 'key
4618 if$
4619 }
4620 { editor format.full.names }
4621 if$
4622 }
4623
4624 FUNCTION {make.full.names}
4625 { type$ "book" =
4626 type$ "inbook" =
4627 or
4628 'author.editor.key.full
4629 { type$ "proceedings" =
4630 'editor.key.full
4631 'author.key.full
4632 if$
4633 }
4634 if$
4635 }
4636
4637 %</har|cay|nat>
4638 % \end{macrocode}
4639 % \end{macro}
4640 %
4641 % \begin{macro}{`output.bibitem'}
4642 % A user has pointed out to me that if the label argument in square brackets
4643 % are put into braces (within the squares) it is then resistent to any
4644 % problems if square braces should appear within the label. Do this, but
4645 % only for the \texttt{nat} option.
4646 % \begin{macrocode}
4647 FUNCTION {output.bibitem}
4648 { newline$
4649 %<*!html>
4650 %<*ay>
4651 %<!har&!nat> "\bibitem[" write$
4652 %<!har&nat> "\bibitem[{" write$
4653 %<har> "\harvarditem" write$
4654 %<nmd> "\protect\citeauthoryear{" write$
4655 %<ast> "\protect\astroncite{" write$
4656 %<cay> "\protect\citeauthoryear{" make.full.names * "}{" * write$
4657 %<cn> "\protect\citename{" write$
4658 %<!har> label write$
4659 %<har> make.full.names duplicate$ label =
4660 %<har> 'skip$
4661 %<har> { "[" label * "]" * write$ }
4662 %<har> if$
4663 %<har> "{" swap$ * "}{" * write$
4664 %<har> year duplicate$ empty$
4665 %<cn> ", }" year duplicate$ empty$
4666 %<cay|nmd|ast> "}{" year duplicate$ empty$
4667 %<(har|cn|cay|nmd|ast)&blkyear> { pop$ "" }
4668 %<(har|cn|cay|nmd|ast)&!blkyear> { pop$ "????" }
4669 %<har|cn|cay|nmd|ast> 'skip$
4670 %<har|cn|cay|nmd|ast> if$
4671 %<har> extra.label * "}{" * write$
4672 %<cn> * extra.label * "]{" * write$
4673 %<cay|nmd|ast> * extra.label * "}]{" * write$
4674 %<alk> "]{" write$
4675 %<!(har|cay|nmd|ast|alk|cn|nat)> ")]{" write$
4676 %<nat> ")" make.full.names duplicate$ short.list =
4677 %<nat> { pop$ }
4678 %<nat> { * }
4679 %<nat> if$
4680 %<nat> "}]{" * write$
4681 %</ay>
4682 %<!ay&!(cite|alph)> "\bibitem{" write$
4683 %<!ay&(cite|alph)> "\bibitem[" label * "]{" * write$
4684 cite$ write$
4685 "}" write$
4686 newline$
4687 ""
4688 %</!html>
4689 %<*html>
4690 %<*htdes>
4691 "<dt><strong><tt>" write$
4692 cite$ write$
4693 "</tt></strong></dt>" write$ newline$
4694 "<dd>"
4695 %</htdes>
4696 %<htlist&!htdes> "<li>"
4697 %<!htlist&!htdes> "<p>"
4698 %</html>
4699 before.all 'output.state :=
4700 }
4701
4702 % \end{macrocode}
4703 % \end{macro}
4704 %
4705 % \begin{macro}{`if.digit'}
4706 % Add \texttt{if.digit} and \texttt{n.separate} to convert large page numbers
4707 % to a separated number.
4708 % \begin{macrocode}
4709 %<*pgsep-c|pgsep-s|pgsep-p>
4710 FUNCTION {if.digit}
4711 { duplicate$ "0" =
4712 swap$ duplicate$ "1" =
4713 swap$ duplicate$ "2" =
4714 swap$ duplicate$ "3" =
4715 swap$ duplicate$ "4" =
4716 swap$ duplicate$ "5" =
4717 swap$ duplicate$ "6" =
4718 swap$ duplicate$ "7" =
4719 swap$ duplicate$ "8" =
4720 swap$ "9" = or or or or or or or or or
4721 }
4722 % \end{macrocode}
4723 % \end{macro}
4724 %
4725 % \begin{macro}{`n.separate'}
4726 % \texttt{pgsep-s}, \texttt{pgsep-p}
4727 % Large page numbers are to be separated in threes, with thin space, comma
4728 % or period. The number must be 5 digits before the separation occurs.
4729 % No provision is made for numbers of 7 or more digits.
4730 % \begin{macrocode}
4731 FUNCTION {n.separate}
4732 { 't :=
4733 ""
4734 #0 'numnames :=
4735 { t empty$ not }
4736 { t #-1 #1 substring$ if.digit
4737 { numnames #1 + 'numnames := }
4738 { #0 'numnames := }
4739 if$
4740 t #-1 #1 substring$ swap$ *
4741 t #-2 global.max$ substring$ 't :=
4742 numnames #5 =
4743 { duplicate$ #1 #2 substring$ swap$
4744 #3 global.max$ substring$
4745 %<pgsep-c> "," swap$ * *
4746 %<pgsep-p> "." swap$ * *
4747 %<pgsep-s&!html> "\," swap$ * *
4748 %<pgsep-s&html> " " swap$ * *
4749 }
4750 'skip$
4751 if$
4752 }
4753 while$
4754 }
4755 %</pgsep-c|pgsep-s|pgsep-p>
4756 % \end{macrocode}
4757 % \end{macro}
4758 %
4759 % \begin{macro}{`n.dashify'}
4760 % \begin{macrocode}
4761 FUNCTION {n.dashify}
4762 {
4763 %<pgsep-c|pgsep-s|pgsep-p> n.separate
4764 't :=
4765 ""
4766 { t empty$ not }
4767 { t #1 #1 substring$ "-" =
4768 { t #1 #2 substring$ "--" = not
4769 { "--" *
4770 t #2 global.max$ substring$ 't :=
4771 }
4772 { { t #1 #1 substring$ "-" = }
4773 { "-" *
4774 t #2 global.max$ substring$ 't :=
4775 }
4776 while$
4777 }
4778 if$
4779 }
4780 { t #1 #1 substring$ *
4781 t #2 global.max$ substring$ 't :=
4782 }
4783 if$
4784 }
4785 while$
4786 }
4787
4788 % \end{macrocode}
4789 % \end{macro}
4790 %
4791 % \begin{macro}{`word.in'}
4792 % The function \texttt{word.in} prints the word \textsl{in} for references
4793 % that are
4794 % contained in a larger work, or in conference proceedings. One may have a
4795 % colon after the word with the option \texttt{in-col}. If blocks of text are
4796 % to be separated with commas (option \texttt{blk-com}) then the word remains
4797 % in lower case, as it is defined in \texttt{bbl.in}; but if blocks act as
4798 % sentences, then it must be capitalized.
4799 % \begin{macrocode}
4800 FUNCTION {word.in}
4801 %<in-x>{ "" }
4802 %<*!in-x>
4803 %<blk-com|blk-tita>{ bbl.in
4804 %<!blk-com&!blk-tita>{ bbl.in capitalize
4805 %<in-col> ":" *
4806 %<in-it> emphasize
4807 " " * }
4808 %</!in-x>
4809
4810 % \end{macrocode}
4811 % \end{macro}
4812 %
4813 % \begin{macro}{`format.date'}
4814 % The new \texttt{harvard.sty} allows variable brackets around the date
4815 % in the reference list. It uses |\harvardyearleft| and |\harvardyearright|
4816 % in the \texttt{.bst} files. Allow this with the option \texttt{harnm},
4817 % which could actually be used without the \texttt{har} option. Note that
4818 % this overrides the other year formatting options, except for the preceding punctuation.
4819 % \begin{macrocode}
4820 %<*ay>
4821 FUNCTION {format.date}
4822 { year "year" bibinfo.check duplicate$ empty$
4823 {
4824 %<*!blkyear>
4825 "empty year in " cite$ * "; set to ????" * warning$
4826 pop$ "????"
4827 %</!blkyear>
4828 }
4829 'skip$
4830 if$
4831 %<*aymth>
4832 month "month" bibinfo.check duplicate$ empty$
4833 'skip$
4834 {
4835 %<dtrev> swap$
4836 " " * swap$
4837 }
4838 if$
4839 *
4840 %<mth-bare> remove.dots
4841 %</aymth>
4842 %<dtbf> bolden
4843 extra.label *
4844 %<*!harnm>
4845 %<*yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per>
4846 before.all 'output.state :=
4847 %<yr-par> " (" swap$ * ")" *
4848 %<!yr-par&yr-brk> " [" swap$ * "]" *
4849 %<!yr-par&!yr-brk&yr-col> ": " swap$ *
4850 %<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ *
4851 %<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
4852 %<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
4853 %</yr-par|yr-brk|yr-col|yr-blk|yr-com|yr-per>
4854 %</!harnm>
4855 %<*harnm>
4856 before.all 'output.state :=
4857 " \harvardyearleft " swap$ * "\harvardyearright{}" *
4858 %<yr-col> ":" swap$ *
4859 %<!yr-col&yr-com> "," swap$ *
4860 %<!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
4861 %<!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
4862 %</harnm>
4863 }
4864 %</ay>
4865 %<*!ay>
4866 FUNCTION {format.date}
4867 {
4868 %<!xmth> month "month" bibinfo.check
4869 %<xmth> ""
4870 duplicate$ empty$
4871 year "year" bibinfo.check duplicate$ empty$
4872 { swap$ 'skip$
4873 { "there's a month but no year in " cite$ * warning$ }
4874 if$
4875 *
4876 }
4877 { swap$ 'skip$
4878 {
4879 %<showstack> month year
4880 %<!dtrev> swap$
4881 " " * swap$
4882 }
4883 if$
4884 *
4885 %<mth-bare> remove.dots
4886 }
4887 if$
4888 %<dtbf> bolden
4889 %<*yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk>
4890 duplicate$ empty$
4891 'skip$
4892 {
4893 before.all 'output.state :=
4894 %<yr-par> " (" swap$ * ")" *
4895 %<!yr-par&yr-brk> " [" swap$ * "]" *
4896 %<!yr-par&!yr-brk&yr-col> ": " swap$ *
4897 %<!yr-par&!yr-brk&!yr-col&yr-com> ", " swap$ *
4898 %<!yr-par&!yr-brk&!yr-col&!yr-com&yr-per> after.sentence 'output.state :=
4899 %<!yr-par&!yr-brk&!yr-col&!yr-com&!yr-per&yr-blk> " " swap$ *
4900 }
4901 if$
4902 %</yr-par|yr-brk|yr-col|yr-com|yr-per|yr-blk>
4903 }
4904 %</!ay>
4905 % \end{macrocode}
4906 % \end{macro}
4907 %
4908 % \begin{macro}{`format.year'}
4909 % For the options that put the year into the journal specifications, use a
4910 % special formatter separate from the regular date formatter.
4911 % The year is always in parentheses (except for appended to journal name).
4912 % \begin{macrocode}
4913 %<*jdt-p|jdt-pc|jdt-v|jdt-vs>
4914 FUNCTION{format.year}
4915 { year "year" bibinfo.check duplicate$ empty$
4916 { "empty year in " cite$ *
4917 %<ay&!blkyear> "; set to ????" *
4918 warning$
4919 %<ay&!blkyear> pop$ "????"
4920 }
4921 {
4922 %<!ay&jdt-vs> " (" swap$ * ")" *
4923 %<!ay&!jdt-vs> "(" swap$ * ")" *
4924 }
4925 if$
4926 %<*ay>
4927 extra.label *
4928 %<jdt-vs> " (" swap$ * ")" *
4929 %<!jdt-vs> "(" swap$ * ")" *
4930 %</ay>
4931 }
4932 %</jdt-p|jdt-pc|jdt-v|jdt-vs>
4933 % \end{macrocode}
4934 % \end{macro}
4935 %
4936 % \begin{macro}{`format.btitle'}
4937 % \begin{macrocode}
4938 FUNCTION {format.btitle}
4939 { title "title" bibinfo.check
4940 duplicate$ empty$ 'skip$
4941 {
4942 %<!btit-rm> emphasize
4943 %<lang> select.language
4944 }
4945 if$
4946 }
4947 % \end{macrocode}
4948 % \end{macro}
4949 %
4950 % \begin{macro}{`either.or.check'}
4951 % \begin{macrocode}
4952 FUNCTION {either.or.check}
4953 { empty$
4954 'pop$
4955 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
4956 if$
4957 }
4958 % \end{macrocode}
4959 % \end{macro}
4960 %
4961 % \begin{macro}{`format.bvolume'}
4962 % \begin{macrocode}
4963 FUNCTION {format.bvolume}
4964 { volume empty$
4965 { "" }
4966 { bbl.volume volume tie.or.space.prefix
4967 "volume" bibinfo.check * *
4968 series "series" bibinfo.check
4969 duplicate$ empty$ 'pop$
4970 %<*!ser-vol>
4971 { swap$ bbl.of space.word * swap$
4972 emphasize * }
4973 %</!ser-vol>
4974 %<ser-vol> { emphasize ", " * swap$ * }
4975 if$
4976 "volume and number" number either.or.check
4977 }
4978 if$
4979 }
4980 % \end{macrocode}
4981 % \end{macro}
4982 %
4983 % \begin{macro}{`format.number.series'}
4984 % \begin{macrocode}
4985 FUNCTION {format.number.series}
4986 { volume empty$
4987 { number empty$
4988 { series field.or.null }
4989 %<*num-xser>
4990 { series empty$
4991 { number "number" bibinfo.check }
4992 { output.state mid.sentence =
4993 { bbl.number }
4994 { bbl.number capitalize }
4995 if$
4996 number tie.or.space.prefix "number" bibinfo.check * *
4997 bbl.in space.word *
4998 series "series" bibinfo.check *
4999 }
5000 if$
5001 }
5002 %</num-xser>
5003 %<*!num-xser>
5004 { output.state mid.sentence =
5005 { bbl.number }
5006 { bbl.number capitalize }
5007 if$
5008 number tie.or.space.prefix "number" bibinfo.check * *
5009 series empty$
5010 { "there's a number but no series in " cite$ * warning$ }
5011 { bbl.in space.word *
5012 series "series" bibinfo.check *
5013 }
5014 if$
5015 }
5016 %</!num-xser>
5017 if$
5018 }
5019 { "" }
5020 if$
5021 }
5022 % \end{macrocode}
5023 % \end{macro}
5024 %
5025 % \begin{macro}{`is.num'}
5026 % This function takes the single-character string on the stack and returns
5027 % 1 if it is a digit, else 0.
5028 % \begin{macrocode}
5029 %<*!xedn>
5030 FUNCTION {is.num}
5031 { chr.to.int$
5032 duplicate$ "0" chr.to.int$ < not
5033 swap$ "9" chr.to.int$ > not and
5034 }
5035
5036 % \end{macrocode}
5037 % \end{macro}
5038 %
5039 % \begin{macro}{`extract.num'}
5040 % This function tests the string on the stack to see if it begins with a
5041 % number. If so, that number is left on the stack; if the string contains
5042 % no numbers at the start, it is left unchanged. The idea is to convert
5043 % \textsl{1st} to \textsl{1} and leave \textsl{first} as is.
5044 % This is used by \code{convert.edition}.
5045 % \begin{macrocode}
5046 FUNCTION {extract.num}
5047 { duplicate$ 't :=
5048 "" 's :=
5049 { t empty$ not }
5050 { t #1 #1 substring$
5051 t #2 global.max$ substring$ 't :=
5052 duplicate$ is.num
5053 { s swap$ * 's := }
5054 { pop$ "" 't := }
5055 if$
5056 }
5057 while$
5058 s empty$
5059 'skip$
5060 { pop$ s }
5061 if$
5062 }
5063
5064 % \end{macrocode}
5065 % \end{macro}
5066 %
5067 % \begin{macro}{`convert.edition'}
5068 % The function \texttt{convert.edition} takes the text in the field
5069 % \texttt{edition} and changes it to the language-specific equivalent. As
5070 % originally planned for \btx, this field should contain the words
5071 % \textsl{First}, \textsl{Second}, etc. Being so explicit,
5072 % it is not so easy to translate, nor to
5073 % convert to \textsl{1st}, \textsl{2nd}, etc., if one wanted.
5074 % This function carries out the translation, by changing
5075 % \textsl{first} or \textsl{1} to \texttt{bbl.first}, and so
5076 % on. The field is reduced to lower case to make it case insensitive. If no
5077 % translation is found, then the original text in \texttt{edition} is used
5078 % instead, as it stands. However, if the original is a number greater than
5079 % the maximum for which text is provided, then \texttt{bbl.th} is added to
5080 % it.
5081 % \begin{macrocode}
5082 FUNCTION {convert.edition}
5083 { extract.num "l" change.case$ 's :=
5084 s "first" = s "1" = or
5085 { bbl.first 't := }
5086 { s "second" = s "2" = or
5087 { bbl.second 't := }
5088 { s "third" = s "3" = or
5089 { bbl.third 't := }
5090 { s "fourth" = s "4" = or
5091 { bbl.fourth 't := }
5092 { s "fifth" = s "5" = or
5093 { bbl.fifth 't := }
5094 { s #1 #1 substring$ is.num
5095 %<!english&exlang> { s bbl.th * 't := }
5096 %<english|!exlang> { s eng.ord 't := }
5097 { edition 't := }
5098 if$
5099 }
5100 if$
5101 }
5102 if$
5103 }
5104 if$
5105 }
5106 if$
5107 }
5108 if$
5109 t
5110 }
5111 %</!xedn>
5112
5113 % \end{macrocode}
5114 % \end{macro}
5115 %
5116 % \begin{macro}{`format.edition'}
5117 % This function formats the text for the edition specification, such as
5118 % ``Second edition''. It combines the edition number with the word
5119 % \textsl{edition}.
5120 % \begin{macrocode}
5121 FUNCTION {format.edition}
5122 { edition duplicate$ empty$ 'skip$
5123 {
5124 %<!xedn> convert.edition
5125 output.state mid.sentence =
5126 { "l" }
5127 { "t" }
5128 if$ change.case$
5129 "edition" bibinfo.check
5130 " " * bbl.edition *
5131 }
5132 if$
5133 }
5134 % \end{macrocode}
5135 % \end{macro}
5136 %
5137 % \begin{macrocode}
5138 INTEGERS { multiresult }
5139 % \end{macrocode}
5140 %
5141 % \begin{macro}{`multi.page.check'}
5142 % \begin{macrocode}
5143 FUNCTION {multi.page.check}
5144 { 't :=
5145 #0 'multiresult :=
5146 { multiresult not
5147 t empty$ not
5148 and
5149 }
5150 { t #1 #1 substring$
5151 duplicate$ "-" =
5152 swap$ duplicate$ "," =
5153 swap$ "+" =
5154 or or
5155 { #1 'multiresult := }
5156 { t #2 global.max$ substring$ 't := }
5157 if$
5158 }
5159 while$
5160 multiresult
5161 }
5162 % \end{macrocode}
5163 % \end{macro}
5164 %
5165 % \begin{macro}{`format.pages'}
5166 % \begin{macrocode}
5167 FUNCTION {format.pages}
5168 { pages duplicate$ empty$ 'skip$
5169 { duplicate$ multi.page.check
5170 {
5171 %<!bkpg-x&!ppx> bbl.pages swap$
5172 n.dashify
5173 }
5174 {
5175 %<!bkpg-x&!ppx> bbl.page swap$
5176 }
5177 if$
5178 %<!bkpg-x&!ppx> tie.or.space.prefix
5179 "pages" bibinfo.check
5180 %<!bkpg-x&!ppx> * *
5181 %<bkpg-par> "(" swap$ * ")" *
5182 }
5183 if$
5184 }
5185 % \end{macrocode}
5186 % \end{macro}
5187 %
5188 % \begin{macro}{`first.page'}
5189 % \begin{macrocode}
5190 %<*jpg-1>
5191 FUNCTION {first.page}
5192 { 't :=
5193 ""
5194 { t empty$ not t #1 #1 substring$ "-" = not and }
5195 { t #1 #1 substring$ *
5196 t #2 global.max$ substring$ 't :=
5197 }
5198 while$
5199 }
5200
5201 %</jpg-1>
5202 % \end{macrocode}
5203 % \end{macro}
5204 %
5205 % \begin{macro}{`format.journal.pages'}
5206 % Note: this function gets called with something on the stack.
5207 % It may be the volume and number.
5208 % \begin{macrocode}
5209 FUNCTION {format.journal.pages}
5210 { pages duplicate$ empty$ 'pop$
5211 { swap$ duplicate$ empty$
5212 { pop$ pop$ format.pages }
5213 {
5214 %<volp-sp> ": " *
5215 %<*!volp-sp>
5216 %<volp-blk> " " *
5217 %<*!volp-blk>
5218 %<volp-com> ", " *
5219 %<*!volp-com>
5220 %<volp-semi> "; " *
5221 %<!volp-semi> ":" *
5222 %</!volp-com>
5223 %</!volp-blk>
5224 %</!volp-sp>
5225 %<!jdt-v&!jdt-vs&jdt-p> format.year * " " *
5226 %<!jdt-v&!jdt-vs&!jdt-p&jdt-pc> format.year * ", " *
5227 swap$
5228 %<jpg-1> first.page
5229 %<!jpg-1> n.dashify
5230 %<*jwdpg>
5231 pages multi.page.check
5232 'bbl.pages
5233 'bbl.page
5234 if$
5235 swap$ tie.or.space.prefix
5236 %</jwdpg>
5237 "pages" bibinfo.check
5238 %<jwdpg> * *
5239 *
5240 }
5241 if$
5242 }
5243 if$
5244 }
5245 % \end{macrocode}
5246 % \end{macro}
5247 %
5248 % \begin{macro}{`format.journal.eid'}
5249 %
5250 % This function is called with something on the stack (journal vol, number)
5251 % and appends \texttt{eid} and \texttt{numpages} if those field are non-empty.
5252 % Very similar to \texttt{format.journal.pages}.
5253 %
5254 % For the AGU style of including the DOI as part of the EID, the DOI number
5255 % is appended too.
5256 % \begin{macrocode}
5257 FUNCTION {format.journal.eid}
5258 { eid "eid" bibinfo.check
5259 duplicate$ empty$ 'pop$
5260 { swap$ duplicate$ empty$ 'skip$
5261 {
5262 %<volp-sp> ": " *
5263 %<*!volp-sp>
5264 %<volp-blk> " " *
5265 %<*!volp-blk>
5266 %<volp-com> ", " *
5267 %<*!volp-com>
5268 %<volp-semi> "; " *
5269 %<!volp-semi> ":" *
5270 %</!volp-com>
5271 %</!volp-blk>
5272 %</!volp-sp>
5273 }
5274 if$
5275 swap$ *
5276 %<*revdata>
5277 numpages empty$ 'skip$
5278 { bbl.eidpp numpages tie.or.space.prefix
5279 "numpages" bibinfo.check * *
5280 " (" swap$ * ")" * *
5281 }
5282 if$
5283 %</revdata>
5284 }
5285 if$
5286 }
5287 % \end{macrocode}
5288 % \end{macro}
5289 %
5290 % \begin{macro}{`format.vol.num.pages'}
5291 % Version 3.84, I have rationalized several options that placed the date in the
5292 % journal specifications. It was rather chaotic before, but now it should be
5293 % more systematic. This means some options have been removed, something that I
5294 % do not like to do.
5295 %
5296 % The option \texttt{pp-last} suppresses the pages in the formatting macros, and
5297 % sees to it that the pages are added just before any notes in those entries
5298 % that take pages. This applies to more than just \texttt{article}, but to
5299 % \texttt{inbook}, \texttt{incollection} as well.
5300 %
5301 % \begin{macrocode}
5302 FUNCTION {format.vol.num.pages}
5303 { volume field.or.null
5304 duplicate$ empty$ 'skip$
5305 {
5306 %<jwdvol> bbl.volume swap$ tie.or.space.prefix
5307 "volume" bibinfo.check
5308 %<jwdvol> * *
5309 }
5310 if$
5311 %<vol-bf&!vol-2bf> bolden
5312 %<!vol-bf&!vol-2bf&vol-it> emphasize
5313 %<jdt-v|jdt-vs> format.year *
5314 %<*!vnum-x>
5315 number "number" bibinfo.check duplicate$ empty$ 'skip$
5316 {
5317 swap$ duplicate$ empty$
5318 { "there's a number but no volume in " cite$ * warning$ }
5319 'skip$
5320 if$
5321 swap$
5322 %<vnum-sp> "~(" swap$ * ")" *
5323 %<!vnum-sp&vnum-cm> ", " swap$ *
5324 %<!vnum-sp&!vnum-cm&vnum-nr> ", " bbl.nr * number tie.or.space.prefix pop$ * swap$ *
5325 %<!vnum-sp&!vnum-cm&!vnum-nr&vnum-h> ", \#" swap$ *
5326 %<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&vnum-b> " " swap$ *
5327 %<!vnum-sp&!vnum-cm&!vnum-nr&!vnum-h&!vnum-b> "(" swap$ * ")" *
5328 }
5329 if$ *
5330 %<!vol-bf&vol-2bf> bolden
5331 %</!vnum-x>
5332 %<*!pp-last>
5333 eid empty$
5334 { format.journal.pages }
5335 { format.journal.eid }
5336 if$
5337 %</!pp-last>
5338 }
5339
5340 % \end{macrocode}
5341 % \end{macro}
5342 %
5343 % \begin{macro}{`format.chapter.pages'}
5344 % \begin{macrocode}
5345 FUNCTION {format.chapter.pages}
5346 { chapter empty$
5347 %<!pp-last> 'format.pages
5348 %<pp-last> { "" }
5349 { type empty$
5350 { bbl.chapter }
5351 { type "l" change.case$
5352 "type" bibinfo.check
5353 }
5354 if$
5355 chapter tie.or.space.prefix
5356 "chapter" bibinfo.check
5357 * *
5358 %<*!pp-last>
5359 pages empty$
5360 'skip$
5361 { ", " * format.pages * }
5362 if$
5363 %</!pp-last>
5364 }
5365 if$
5366 }
5367
5368 % \end{macrocode}
5369 % \end{macro}
5370 %
5371 % \begin{macro}{`bt.enquote'}
5372 % This is to place the booktitle for proceedings and collections into quotes.
5373 % If punctuation is to be included, then add a comma unless a stop already
5374 % exists, or add a period under the only circumstances that
5375 % |format.in.ed.booktitle| is followed by |new.sentence|.
5376 % \begin{macrocode}
5377 %<*bt-qq>
5378 FUNCTION {bt.enquote}
5379 { duplicate$ empty$ 'skip$
5380 { "\enquote{" swap$ *
5381 %<*!qx>
5382 non.stop
5383 { ",} " * }
5384 { "}, " * }
5385 if$
5386 %</!qx>
5387 %<*qx>
5388 "}, " *
5389 %</qx>
5390 }
5391 if$
5392 }
5393 %</bt-qq>
5394 % \end{macrocode}
5395 %
5396 % \end{macro}
5397 %
5398 % \begin{macro}{`format.booktitle'}
5399 % The function \texttt{format.booktitle} pushes one object
5400 % (the book title, suitably encapsulated) onto the stack.
5401 % It is currently used in \texttt{format.incoll.inproc.crossref}
5402 % and in \texttt{format.in.ed.booktitle}, and should be used whenever accessing
5403 % the \texttt{booktitle} field for eventual output.
5404 %
5405 % If the book title is empty or missing, the function pushes an empty string.
5406 % \begin{macrocode}
5407 FUNCTION {format.booktitle}
5408 {
5409 booktitle "booktitle" bibinfo.check
5410 %<!bt-qq&!bt-rm> emphasize
5411 %<bt-qq> bt.enquote
5412 }
5413 % \end{macrocode}
5414 % \end{macro}
5415 %
5416 % \begin{macro}{`format.in.ed.booktitle'}
5417 % Prior to version 3.81, the \textsl{Editor} or \textsl{Edited by} in
5418 % parentheses was meant to be capitalized, but this did not work properly.
5419 % Now the option \texttt{edcap} produces this, and default is not capitalized.
5420 %
5421 % Notes on \dtx{} options:
5422 % \begin{itemize}
5423 % \item
5424 % The following combinations are available through the \texttt{makebst.tex} interface:
5425 % \begin{quote}
5426 % \verb+(+ \\
5427 % \verb+ <default>+ \\
5428 % \verb+ |edby ( |edbyx |edbyy|edbyw[edcap])+ \\
5429 % \verb+ |edby-par (|edcap|edbyx[edcap]|edbyy )+ \\
5430 % \verb+ |edby-parc(|edcap|edbyx )+ \\
5431 % \verb+)+
5432 % \end{quote}
5433 % \item
5434 % \texttt{edby}, \texttt{edby-par}, and \texttt{edby-parc} are mutually exclusive
5435 % and, except for the default, exhaustive.
5436 % \item
5437 % \texttt{edbyx}, \texttt{edbyw}, and \texttt{edbyy} are mutually exclusive
5438 % and, except for the default, exhaustive.
5439 % \item
5440 % \texttt{edcap} is independent of the above two groups of options.
5441 % \item
5442 % When parentheses need to be applied, we make sure that the respective
5443 % \dtx{} guard expressions are mutually exclusive.
5444 % It makes no sense for \texttt{edbyw} to be in effect if either of
5445 % \texttt{edby-par} or \texttt{edby-parc} is in effect.
5446 % \item
5447 % \texttt{makebst.tex} only activates \texttt{edcap} in certain cases,
5448 % but we do no checking here, applying it consistently to the
5449 % ``editor'' text entity.
5450 % \item
5451 % The code between \texttt{<!edpar>} and \verb+<edpar\|edparc>+
5452 % \emph{must} match the corresponding code in \texttt{format.editors}.
5453 % This means that in the default case, formatting is controlled by
5454 % a \dtx{} mechanism entirely different from the other cases.
5455 % \item \texttt{ser-ed} has been added to suit AGU. Result of series plus
5456 % volume to go between booktitle and editors; must remove \texttt{format.bvolume}
5457 % from \texttt{incollection} and \texttt{inproceedings}.
5458 % \end{itemize}
5459 %
5460 % \begin{macrocode}
5461 FUNCTION {format.in.ed.booktitle}
5462 { format.booktitle duplicate$ empty$ 'skip$
5463 {
5464 %<showstack>% btitle
5465 %<*ser-ed>
5466 format.bvolume duplicate$ empty$ 'pop$
5467 { ", " swap$ * * }
5468 if$
5469 %</ser-ed>
5470 editor "editor" format.names.ed duplicate$ empty$ 'pop$
5471 {
5472 %<*!(edby|edby-par|edby-parc)>
5473 %<showstack>% btitle ednms
5474 %<!edpar&!edparxc> "," *
5475 " " *
5476 get.bbl.editor
5477 %<bkedcap> capitalize
5478 %<edpar> "(" swap$ * "), " *
5479 %<!edpar&(edparc|edparxc)> "(" swap$ * ") " *
5480 %<!edpar&!(edparc|edparxc)> ", " *
5481 * swap$
5482 %<showstack>% eds btitle
5483 %</!(edby|edby-par|edby-parc)>
5484 %<*edby|edby-par|edby-parc>
5485 %<showstack>% btitle ednms
5486 %<edbyx|edbyy|edbyw> get.bbl.editor
5487 %<!(edbyx|edbyy|edbyw)> bbl.edby
5488 %<edcap> capitalize
5489 %<!(edby-par|edby-parc)&edbyw> "(" swap$ * ")" *
5490 %<showstack>% btitle ednms ed
5491 %<(edby-par|edby)&edbyy> swap$ "," *
5492 " " * swap$ *
5493 %<showstack>% btitle ednms-ed
5494 %<(edby-par|edby-parc)&!edbyw> "(" swap$ * ")" *
5495 swap$
5496 %<edby|edby-parc> "," *
5497 " " * swap$
5498 %</edby|edby-par|edby-parc>
5499 %<showstack>% btitle ednms-ed (or ednms-ed btitle)
5500 * }
5501 if$
5502 %<showstack>% btitle-ednms-ed (or ednms-ed-btitle) (or btitle)
5503 word.in swap$ *
5504 }
5505 if$
5506 }
5507 % \end{macrocode}
5508 % \end{macro}
5509 %
5510 % \begin{macro}{`empty.misc.check'}
5511 % \begin{macrocode}
5512 %<*!ay>
5513 FUNCTION {empty.misc.check}
5514 { author empty$ title empty$ howpublished empty$
5515 month empty$ year empty$ note empty$
5516 and and and and and
5517 %<!seq-no|alph> key empty$ not and
5518 { "all relevant fields are empty in " cite$ * warning$ }
5519 'skip$
5520 if$
5521 }
5522 %</!ay>
5523 % \end{macrocode}
5524 % \end{macro}
5525 %
5526 % \begin{macro}{`format.thesis.type'}
5527 % \begin{macrocode}
5528 FUNCTION {format.thesis.type}
5529 { type duplicate$ empty$
5530 'pop$
5531 { swap$ pop$
5532 "t" change.case$ "type" bibinfo.check
5533 }
5534 if$
5535 }
5536 % \end{macrocode}
5537 % \end{macro}
5538 %
5539 % \begin{macro}{`format.tr.number'}
5540 % \begin{macrocode}
5541 FUNCTION {format.tr.number}
5542 { number "number" bibinfo.check
5543 type duplicate$ empty$
5544 { pop$ bbl.techrep }
5545 'skip$
5546 if$
5547 "type" bibinfo.check
5548 swap$ duplicate$ empty$
5549 { pop$ "t" change.case$ }
5550 { tie.or.space.prefix * * }
5551 if$
5552 }
5553 % \end{macrocode}
5554 % \end{macro}
5555 %
5556 % \begin{macro}{`format.article.crossref'}
5557 % The \texttt{journal} field was emphasized emplicitly, but it should be
5558 % done by command.
5559 % \begin{macrocode}
5560 FUNCTION {format.article.crossref}
5561 {
5562 %<*!ay>
5563 key duplicate$ empty$
5564 { pop$
5565 journal duplicate$ empty$
5566 { "need key or journal for " cite$ * " to crossref " * crossref * warning$ }
5567 { "journal" bibinfo.check emphasize word.in swap$ * }
5568 if$
5569 }
5570 { word.in swap$ * " " *}
5571 if$
5572 %</!ay>
5573 %<ay> word.in
5574 %<!html> " \cite{" * crossref * "}" *
5575 %<html> " <tt>" * crossref * "</tt>" *
5576 }
5577 % \end{macrocode}
5578 % \end{macro}
5579 %
5580 % \begin{macro}{`format.crossref.editor'}
5581 % \begin{macrocode}
5582 %<*!ay>
5583 FUNCTION {format.crossref.editor}
5584 { editor #1 "{vv~}{ll}" format.name$
5585 %<nmft&nmfted&nmand-rm> bib.name.font
5586 "editor" bibinfo.check
5587 editor num.names$ duplicate$
5588 #2 >
5589 { pop$
5590 %<nmft&nmfted&!nmand-rm&(etal-it|etal-rm)> bib.name.font
5591 "editor" bibinfo.check
5592 " " * bbl.etal
5593 %<etal-it> emphasize
5594 *
5595 %<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> bib.name.font
5596 %<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> "others" 't :=
5597 }
5598 { #2 <
5599 'skip$
5600 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
5601 {
5602 %<nmft&nmfted&!nmand-rm&(etal-it|etal-rm)> bib.name.font
5603 "editor" bibinfo.check
5604 " " * bbl.etal
5605 %<etal-it> emphasize
5606 *
5607 %<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> bib.name.font
5608 %<nmft&nmfted&!nmand-rm&!(etal-it|etal-rm)> "others" 't :=
5609 }
5610 {
5611 %<*!harnm>
5612 %<!amper> bbl.and space.word
5613 %<amper> " \& "
5614 %</!harnm>
5615 %<harnm> " \harvardand\ "
5616 * editor #2 "{vv~}{ll}" format.name$
5617 %<nmft&nmfted&nmand-rm> bib.name.font
5618 "editor" bibinfo.check
5619 *
5620 }
5621 if$
5622 }
5623 if$
5624 }
5625 if$
5626 %<*nmft&nmfted&!nmand-rm>
5627 t "others" =
5628 'skip$
5629 { bib.name.font "editor" bibinfo.check }
5630 if$
5631 %</nmft&nmfted&!nmand-rm>
5632 }
5633 %</!ay>
5634 % \end{macrocode}
5635 % \end{macro}
5636 %
5637 % \begin{macro}{`format.book.crossref'}
5638 % The \texttt{series} field was emphasized emplicitly, but it should be
5639 % done by command.
5640 % \begin{macrocode}
5641 FUNCTION {format.book.crossref}
5642 { volume duplicate$ empty$
5643 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
5644 pop$ word.in
5645 }
5646 { bbl.volume
5647 %<!(blk-com|blk-tita)> capitalize
5648 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
5649 }
5650 if$
5651 %<*!ay>
5652 editor empty$
5653 editor field.or.null author field.or.null =
5654 or
5655 { key empty$
5656 { series empty$
5657 { "need editor, key, or series for " cite$ * " to crossref " *
5658 crossref * warning$
5659 "" *
5660 }
5661 { series emphasize * }
5662 if$
5663 }
5664 { key * }
5665 if$
5666 }
5667 { format.crossref.editor * }
5668 if$
5669 %</!ay>
5670 %<!html> " \cite{" * crossref * "}" *
5671 %<html> " <tt>" * crossref * "</tt>" *
5672 }
5673 % \end{macrocode}
5674 % \end{macro}
5675 %
5676 % \begin{macro}{`format.incoll.inproc.crossref'}
5677 % The \texttt{booktitle} field was emphasized emplicitly, but it should be
5678 % done by command.
5679 % \begin{macrocode}
5680 FUNCTION {format.incoll.inproc.crossref}
5681 {
5682 %<*!ay>
5683 editor empty$
5684 editor field.or.null author field.or.null =
5685 or
5686 { key empty$
5687 { format.booktitle duplicate$ empty$
5688 { "need editor, key, or booktitle for " cite$ * " to crossref " *
5689 crossref * warning$
5690 }
5691 { word.in swap$ * }
5692 if$
5693 }
5694 { word.in key * " " *}
5695 if$
5696 }
5697 { word.in format.crossref.editor * " " *}
5698 if$
5699 %</!ay>
5700 %<ay> word.in
5701 %<!html> " \cite{" * crossref * "}" *
5702 %<html> " <tt>" * crossref * "</tt>" *
5703 }
5704 % \end{macrocode}
5705 % \end{macro}
5706 %
5707 % \begin{macro}{`format.org.or.pub'}
5708 % Psychology journals often want \textit{address}: \textit{publisher}.
5709 %
5710 % \textsl{Nature} wants publisher and date in parentheses, and when both
5711 % are there, they are merged into one set.
5712 %
5713 % Call function \texttt{add.blank} before parentheses so suppress preceding
5714 % punctuation, which looks strange when publisher in parentheses.
5715 %
5716 % MPG Jahrbuch wants publisher and year, but without parentheses. Add
5717 % \texttt{pub-nopar} to be used with \texttt{pub-date}.
5718 %
5719 % Have now (3.87.h) extended this function to include the organization, if
5720 % present. This is for \texttt{inproceedings} and \texttt{proceedings} where
5721 % the publisher is optional, and organization too. If the publisher is missing,
5722 % but the organization present, it is formatted like the publisher. This
5723 % complication comes from styles that want the publisher/organization to have
5724 % the date included, all in parentheses.
5725 %
5726 % This function is called by \texttt{format.publisher.address} and
5727 % \texttt{format.organization.address}, each putting the appropriate text
5728 % into the stack first.
5729 %
5730 % \begin{macrocode}
5731 FUNCTION {format.org.or.pub}
5732 { 't :=
5733 ""
5734 %<*pub-date&!ay>
5735 year empty$
5736 { "empty year in " cite$ * warning$ }
5737 'skip$
5738 if$
5739 %</pub-date&!ay>
5740 %<*!(pub-date&ay)>
5741 address empty$ t empty$ and
5742 %<pub-date> year empty$ and
5743 'skip$
5744 {
5745 %</!(pub-date&ay)>
5746 %<pub-par|(pub-date&!pub-xpar)> add.blank "(" *
5747 %<*add-pub>
5748 address "address" bibinfo.check *
5749 t empty$
5750 'skip$
5751 %</add-pub>
5752 %<*!add-pub>
5753 t empty$
5754 { address "address" bibinfo.check *
5755 }
5756 { t *
5757 address empty$
5758 'skip$
5759 { ", " * address "address" bibinfo.check * }
5760 if$
5761 }
5762 %</!add-pub>
5763 %<*add-pub>
5764 { address empty$
5765 'skip$
5766 { ": " * }
5767 if$
5768 t *
5769 }
5770 %</add-pub>
5771 if$
5772 %<*pub-date&!ay>
5773 year empty$
5774 'skip$
5775 { t empty$ address empty$ and
5776 'skip$
5777 %<!pub-xc> { ", " swap$ * * }
5778 %<pub-xc> { " " swap$ * * }
5779 if$
5780 year "year" bibinfo.check
5781 %<dtbf> bolden
5782 *
5783 }
5784 if$
5785 %</pub-date&!ay>
5786 %<*pub-date&ay>
5787 year duplicate$ empty$
5788 %<*!blkyear>
5789 { "empty year in " cite$ * "; set to ????" * warning$
5790 pop$ "????" }
5791 %</!blkyear>
5792 %<*blkyear>
5793 { "empty year in " cite$ * warning$
5794 pop$ "" }
5795 %</blkyear>
5796 %<!dtbf> { "year" bibinfo.check extra.label * }
5797 %<dtbf> { "year" bibinfo.check bolden extra.label * }
5798 if$
5799 t empty$ address empty$ and
5800 { * }
5801 %<!pub-xc> { ", " swap$ * * }
5802 %<pub-xc> { " " swap$ * * }
5803 if$
5804 %</pub-date&ay>
5805 %<pub-par|(pub-date&!pub-xpar)> ")" *
5806 %<*!(pub-date&ay)>
5807 }
5808 if$
5809 %</!(pub-date&ay)>
5810 }
5811 % \end{macrocode}
5812 % \end{macro}
5813 %
5814 % \begin{macro}{`format.publisher.address'}
5815 % \begin{macrocode}
5816 FUNCTION {format.publisher.address}
5817 { publisher "publisher" bibinfo.warn format.org.or.pub
5818 }
5819
5820 % \end{macrocode}
5821 % \end{macro}
5822 %
5823 % \begin{macro}{`format.organization.address'}
5824 % \begin{macrocode}
5825 FUNCTION {format.organization.address}
5826 { organization "organization" bibinfo.check format.org.or.pub
5827 }
5828
5829 % \end{macrocode}
5830 % \end{macro}
5831 %
5832 % \begin{macro}{`name.or.dash'}
5833 % This function stores what is on the stack, compares it with previous value,
5834 % and replaces it with a long dash if they are equal. What is on the stack
5835 % should be author or editor names for the current entry.
5836 % \begin{macrocode}
5837 %<*nmdash>
5838 STRINGS {oldname}
5839
5840 FUNCTION {name.or.dash}
5841 { 's :=
5842 oldname empty$
5843 { s 'oldname := s }
5844 { s oldname =
5845 %<*!au-col>
5846 %<!nmd-2&!nmd-3> { "---" }
5847 %<nmd-2&!nmd-3> { "---{}---" }
5848 %<nmd-3> { "---{}---{}---" }
5849 %</!au-col>
5850 %<*au-col>
5851 %<!nmd-2&!nmd-3> { "---" add.blank }
5852 %<nmd-2&!nmd-3> { "---{}---" add.blank }
5853 %<nmd-3> { "---{}---{}---" add.blank }
5854 %</au-col>
5855 { s 'oldname := s }
5856 if$
5857 }
5858 if$
5859 }
5860
5861 %</nmdash>
5862 % \end{macrocode}
5863 % \end{macro}
5864 %
5865 % \begin{macro}{`article'}
5866 % \begin{macrocode}
5867 FUNCTION {article}
5868 { output.bibitem
5869 format.authors "author" output.check
5870 %<ay> author format.key output
5871 %<au-col> add.colon
5872 %<nmdash> name.or.dash
5873 %<*dt-beg&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5874 format.date "year" output.check
5875 date.block
5876 %</dt-beg&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5877 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
5878 %<*!jtit-x>
5879 format.title "title" output.check
5880 %<blk-com&tit-qq> end.quote.title
5881 %<!blk-com&!blk-tit&!blk-tita> new.block
5882 %<*blk-tit|blk-tita>
5883 %<!tit-col> new.sentence
5884 %<tit-col> add.colon
5885 %</blk-tit|blk-tita>
5886 %</!jtit-x>
5887 crossref missing$
5888 {
5889 journal
5890 %<jxper> remove.dots
5891 "journal" bibinfo.check
5892 %<!jttl-rm> emphasize
5893 %<injnl> word.in swap$ *
5894 "journal" output.check
5895 %<jnm-x> add.blank
5896 %<*!dt-beg&!dt-end&dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5897 format.date "year" output.check
5898 date.block
5899 %</!dt-beg&!dt-end&dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5900 format.vol.num.pages output
5901 %<doi&agu-doi> format.doi output
5902 %<*!dt-beg&!dt-end&!dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5903 format.date "year" output.check
5904 %</!dt-beg&!dt-end&!dt-jnl&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5905 }
5906 { format.article.crossref output.nonnull
5907 %<!pp-last> format.pages output
5908 }
5909 if$
5910 %<*pp-last>
5911 eid empty$
5912 { format.journal.pages }
5913 { format.journal.eid }
5914 if$
5915 %</pp-last>
5916 %<issn> format.issn output
5917 %<(doi|(url-doi&!url))&!agu-doi> format.doi output
5918 %<*url-blk&!harnm&!revdata>
5919 %<!blk-com&!blk-tit&!blk-tita> new.block
5920 format.url output
5921 %</url-blk&!harnm&!revdata>
5922 %<!blk-com&!blk-tit&!blk-tita> new.block
5923 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
5924 format.note output
5925 %<*!dt-beg&dt-end&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5926 %<!blk-com&!blk-tit&!blk-tita> new.block
5927 format.date "year" output.check
5928 %</!dt-beg&dt-end&!jdt-p&!jdt-pc&!jdt-vs&!jdt-v>
5929 %<eprint> format.eprint output
5930 %<*revdata>
5931 format.url output
5932 %</revdata>
5933 fin.entry
5934 %<harnm|url-nl> write.url
5935 }
5936 % \end{macrocode}
5937 % \end{macro}
5938 %
5939 % \begin{macro}{`book'}
5940 % \begin{macrocode}
5941 FUNCTION {book}
5942 { output.bibitem
5943 author empty$
5944 { format.editors "author and editor" output.check
5945 %<ay> editor format.key output
5946 %<!edpar&(edparc|edparxc)&!au-col> add.blank
5947 %<au-col> add.colon
5948 %<nmdash> name.or.dash
5949 }
5950 { format.authors output.nonnull
5951 %<au-col> add.colon
5952 %<nmdash> name.or.dash
5953 crossref missing$
5954 { "author and editor" editor either.or.check }
5955 'skip$
5956 if$
5957 }
5958 if$
5959 %<dt-beg&!pub-date> format.date "year" output.check
5960 %<dt-beg&!pub-date> date.block
5961 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
5962 format.btitle "title" output.check
5963 crossref missing$
5964 { format.bvolume output
5965 %<!blk-com&!blk-tit&!blk-tita> new.block
5966 %<blk-tit&!tit-col> new.sentence
5967 %<blk-tit&tit-col> add.colon
5968 %<!numser> format.number.series output
5969 %<pre-edn> format.edition output
5970 %<!blk-com&!blk-tit&!blk-tita> new.sentence
5971 %<numser> format.number.series output
5972 %<pg-bk&pg-pre> format.book.pages output
5973 format.publisher.address output
5974 }
5975 {
5976 %<!blk-com&!blk-tit&!blk-tita> new.block
5977 %<blk-tit&!tit-col> new.sentence
5978 %<blk-tit&tit-col> add.colon
5979 format.book.crossref output.nonnull
5980 %<!dt-beg&!dt-end&pub-date> format.date "year" output.check
5981 }
5982 if$
5983 %<!pre-edn> format.edition output
5984 %<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
5985 %<isbn> format.isbn output
5986 %<pg-bk&!pg-pre> format.book.pages output
5987 %<doi|(url-doi&!url)> format.doi output
5988 %<*url-blk&!harnm&!revdata>
5989 %<!blk-com&!blk-tit&!blk-tita> new.block
5990 format.url output
5991 %</url-blk&!harnm&!revdata>
5992 %<!blk-com&!blk-tit&!blk-tita> new.block
5993 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
5994 format.note output
5995 %<*!dt-beg&dt-end&!pub-date>
5996 %<!blk-com&!blk-tit&!blk-tita> new.block
5997 format.date "year" output.check
5998 %</!dt-beg&dt-end&!pub-date>
5999 %<eprint> format.eprint output
6000 %<revdata> format.url output
6001 fin.entry
6002 %<(harnm|url-nl)&!revdata> write.url
6003 }
6004 % \end{macrocode}
6005 % \end{macro}
6006 %
6007 % \begin{macro}{`booklet'}
6008 % \begin{macrocode}
6009 FUNCTION {booklet}
6010 { output.bibitem
6011 format.authors output
6012 %<ay> author format.key output
6013 %<au-col> add.colon
6014 %<nmdash> name.or.dash
6015 %<ay&dt-beg> format.date "year" output.check
6016 %<!ay&dt-beg> format.date output
6017 %<dt-beg> date.block
6018 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6019 format.title "title" output.check
6020 %<blk-com&tit-qq> end.quote.title
6021 %<!blk-com&!blk-tit&!blk-tita> new.block
6022 %<blk-tit&!tit-col> new.sentence
6023 %<blk-tit&tit-col> add.colon
6024 howpublished "howpublished" bibinfo.check output
6025 address "address" bibinfo.check output
6026 %<ay&!dt-beg&!dt-end> format.date "year" output.check
6027 %<!ay&!dt-beg&!dt-end> format.date output
6028 %<isbn> format.isbn output
6029 %<pg-bk> format.book.pages output
6030 %<doi|(url-doi&!url)> format.doi output
6031 %<*url-blk&!harnm&!revdata>
6032 %<!blk-com&!blk-tit&!blk-tita> new.block
6033 format.url output
6034 %</url-blk&!harnm&!revdata>
6035 %<!blk-com&!blk-tit&!blk-tita> new.block
6036 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6037 format.note output
6038 %<*ay&!dt-beg&dt-end>
6039 %<!blk-com&!blk-tit&!blk-tita> new.block
6040 format.date "year" output.check
6041 %</ay&!dt-beg&dt-end>
6042 %<*!ay&!dt-beg&dt-end>
6043 %<!blk-com&!blk-tit&!blk-tita> new.block
6044 format.date output
6045 %</!ay&!dt-beg&dt-end>
6046 %<eprint> format.eprint output
6047 %<revdata> format.url output
6048 fin.entry
6049 %<(harnm|url-nl)&!revdata> write.url
6050 }
6051
6052 % \end{macrocode}
6053 % \end{macro}
6054 %
6055 % \begin{macro}{`inbook'}
6056 % The medical journals, with option \texttt{dt-jnl}, have the date as part of
6057 % the journal specification. For chapters in books, they want date and pages
6058 % to appear at the end, with a space between them. (For journals, there is to be
6059 % no space.) Suppress the chapter specification (for now).
6060 %
6061 % The \texttt{dt-jnl} option usually behaves as the default, except for some
6062 % special entries, like this one.
6063 %
6064 % Restore the chapter specification (2004 Feb 9) after someone complained.
6065 % There are still some bugs here. If some date punctuation is specified, say
6066 % with \texttt{yrp-semi} for a semi-colon after the year, this appears always,
6067 % even if there is no text following. But then this to be an unlikely wish anyway,
6068 % since such punctuation options are best suited for \texttt{dt-beg}.
6069 % \begin{macrocode}
6070 FUNCTION {inbook}
6071 { output.bibitem
6072 author empty$
6073 { format.editors "author and editor" output.check
6074 %<ay> editor format.key output
6075 %<au-col> add.colon
6076 %<nmdash> name.or.dash
6077 }
6078 { format.authors output.nonnull
6079 %<au-col> add.colon
6080 %<nmdash> name.or.dash
6081 crossref missing$
6082 { "author and editor" editor either.or.check }
6083 'skip$
6084 if$
6085 }
6086 if$
6087 %<dt-beg&!pub-date> format.date "year" output.check
6088 %<dt-beg&!pub-date> date.block
6089 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6090 format.btitle "title" output.check
6091 crossref missing$
6092 {
6093 %<pre-pub&numser> format.number.series output
6094 %<pre-pub> format.publisher.address output
6095 format.bvolume output
6096 %<*dt-beg|dt-end|!dt-jnl|a|!a>
6097 format.chapter.pages "chapter and pages" output.check
6098 %</dt-beg|dt-end|!dt-jnl|a|!a>
6099 %<!blk-com&!blk-tit&!blk-tita> new.block
6100 %<blk-tit&!tit-col> new.sentence
6101 %<blk-tit&tit-col> add.colon
6102 %<!numser> format.number.series output
6103 %<pre-edn> format.edition output
6104 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6105 %<!pre-pub&numser> format.number.series output
6106 %<!pre-pub> format.publisher.address output
6107 }
6108 {
6109 %<*dt-beg|dt-end|!dt-jnl|a|!a>
6110 format.chapter.pages "chapter and pages" output.check
6111 %</dt-beg|dt-end|!dt-jnl|a|!a>
6112 %<!blk-com&!blk-tit&!blk-tita> new.block
6113 %<blk-tit&!tit-col> new.sentence
6114 %<blk-tit&tit-col> add.colon
6115 format.book.crossref output.nonnull
6116 %<!dt-beg&!dt-end&!dt-jnl&pub-date> format.date "year" output.check
6117 }
6118 if$
6119 %<!pre-edn> format.edition output
6120 %<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
6121 %<*isbn>
6122 crossref missing$
6123 { format.isbn output }
6124 'skip$
6125 if$
6126 %</isbn>
6127 %<*(!dt-beg&!dt-end&dt-jnl)&!pub-date>
6128 format.date "year" output.check
6129 date.block
6130 %</(!dt-beg&!dt-end&dt-jnl)&!pub-date>
6131 %<pp-last> format.pages "pages" output.check
6132 %<doi|(url-doi&!url)> format.doi output
6133 %<*url-blk&!harnm&!revdata>
6134 %<!blk-com&!blk-tit&!blk-tita> new.block
6135 format.url output
6136 %</url-blk&!harnm&!revdata>
6137 %<!blk-com&!blk-tit&!blk-tita> new.block
6138 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6139 format.note output
6140 %<*!dt-beg&dt-end&!pub-date>
6141 %<!blk-com&!blk-tit&!blk-tita> new.block
6142 format.date "year" output.check
6143 %</!dt-beg&dt-end&!pub-date>
6144 %<eprint> format.eprint output
6145 %<revdata> format.url output
6146 fin.entry
6147 %<(harnm|url-nl)&!revdata> write.url
6148 }
6149
6150 % \end{macrocode}
6151 % \end{macro}
6152 %
6153 % \begin{macro}{`incollection'}
6154 % \begin{macrocode}
6155 FUNCTION {incollection}
6156 { output.bibitem
6157 format.authors "author" output.check
6158 %<ay> author format.key output
6159 %<au-col> add.colon
6160 %<nmdash> name.or.dash
6161 %<dt-beg&!pub-date> format.date "year" output.check
6162 %<dt-beg&!pub-date> date.block
6163 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6164 %<*!jtit-x>
6165 format.title "title" output.check
6166 %<blk-com&tit-qq> end.quote.title
6167 %<!blk-com&!blk-tit&!blk-tita> new.block
6168 %<blk-tit&!tit-col> new.sentence
6169 %<blk-tit&tit-col> add.colon
6170 %</!jtit-x>
6171 crossref missing$
6172 { format.in.ed.booktitle "booktitle" output.check
6173 %<bt-qq> end.quote.btitle
6174 %<pre-pub&numser> format.number.series output
6175 %<pre-pub> format.publisher.address output
6176 %<!ser-ed> format.bvolume output
6177 %<!numser> format.number.series output
6178 %<pre-edn> format.edition output
6179 format.chapter.pages output
6180 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6181 %<!pre-pub&numser> format.number.series output
6182 %<!pre-pub> format.publisher.address output
6183 %<!pre-edn> format.edition output
6184 %<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
6185 %<isbn> format.isbn output
6186 }
6187 { format.incoll.inproc.crossref output.nonnull
6188 format.chapter.pages output
6189 }
6190 if$
6191 %<*(!dt-beg&!dt-end&dt-jnl)&!pub-date>
6192 format.date "year" output.check
6193 date.block
6194 %</(!dt-beg&!dt-end&dt-jnl)&!pub-date>
6195 %<pp-last> format.pages "pages" output.check
6196 %<doi|(url-doi&!url)> format.doi output
6197 %<*url-blk&!harnm&!revdata>
6198 %<!blk-com&!blk-tit&!blk-tita> new.block
6199 format.url output
6200 %</url-blk&!harnm&!revdata>
6201 %<!blk-com&!blk-tit&!blk-tita> new.block
6202 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6203 format.note output
6204 %<*!dt-beg&dt-end&!pub-date>
6205 %<!blk-com&!blk-tit&!blk-tita> new.block
6206 format.date "year" output.check
6207 %</!dt-beg&dt-end&!pub-date>
6208 %<eprint> format.eprint output
6209 %<revdata> format.url output
6210 fin.entry
6211 %<(harnm|url-nl)&!revdata> write.url
6212 }
6213 % \end{macrocode}
6214 % \end{macro}
6215 %
6216 % \begin{macro}{`inproceedings'}
6217 % \begin{macrocode}
6218 FUNCTION {inproceedings}
6219 { output.bibitem
6220 format.authors "author" output.check
6221 %<ay> author format.key output
6222 %<au-col> add.colon
6223 %<nmdash> name.or.dash
6224 %<dt-beg&!pub-date> format.date "year" output.check
6225 %<dt-beg&!pub-date> date.block
6226 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6227 %<*!jtit-x>
6228 format.title "title" output.check
6229 %<blk-com&tit-qq> end.quote.title
6230 %<!blk-com&!blk-tit&!blk-tita> new.block
6231 %<blk-tit&!tit-col> new.sentence
6232 %<blk-tit&tit-col> add.colon
6233 %</!jtit-x>
6234 crossref missing$
6235 { format.in.ed.booktitle "booktitle" output.check
6236 %<bt-qq> end.quote.btitle
6237 %<*!pre-pub>
6238 %<!ser-ed> format.bvolume output
6239 %<!numser> format.number.series output
6240 %<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
6241 %</!pre-pub>
6242 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6243 %<numser> format.number.series output
6244 publisher empty$
6245 { format.organization.address output }
6246 { organization "organization" bibinfo.check output
6247 format.publisher.address output
6248 }
6249 if$
6250 %<!dt-beg&!dt-end&!dt-jnl&!pub-date> format.date "year" output.check
6251 %<*pre-pub>
6252 format.bvolume output
6253 %<!numser> format.number.series output
6254 %<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
6255 %</pre-pub>
6256 %<isbn> format.isbn output
6257 %<issn> format.issn output
6258 }
6259 { format.incoll.inproc.crossref output.nonnull
6260 %<(dt-beg|dt-end|!dt-jnl)&!pp-last> format.pages output
6261 }
6262 if$
6263 %<*!dt-beg&!dt-end&dt-jnl&!pp-last>
6264 %<!pub-date> format.date "year" output.check
6265 %<!pub-date> date.block
6266 %<jdt-v|jdt-vs|jdt-p|!jdt-pc> add.blank
6267 format.pages "pages" output.check
6268 %</!dt-beg&!dt-end&dt-jnl&!pp-last>
6269 %<pp-last> format.pages "pages" output.check
6270 %<doi|(url-doi&!url)> format.doi output
6271 %<*url-blk&!harnm&!revdata>
6272 %<!blk-com&!blk-tit&!blk-tita> new.block
6273 format.url output
6274 %</url-blk&!harnm&!revdata>
6275 %<!blk-com&!blk-tit&!blk-tita> new.block
6276 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6277 format.note output
6278 %<*!dt-beg&dt-end&!pub-date>
6279 %<!blk-com&!blk-tit&!blk-tita> new.block
6280 format.date "year" output.check
6281 %</!dt-beg&dt-end&!pub-date>
6282 %<eprint> format.eprint output
6283 %<revdata> format.url output
6284 fin.entry
6285 %<(harnm|url-nl)&!revdata> write.url
6286 }
6287 % \end{macrocode}
6288 % \end{macro}
6289 %
6290 % \begin{macro}{`conference'}
6291 % \begin{macrocode}
6292 FUNCTION {conference} { inproceedings }
6293 % \end{macrocode}
6294 % \end{macro}
6295 %
6296 % \begin{macro}{`manual'}
6297 % \begin{macrocode}
6298 %<*ay>
6299 FUNCTION {manual}
6300 { output.bibitem
6301 format.authors output
6302 author format.key output
6303 %<au-col> add.colon
6304 %<nmdash> name.or.dash
6305 %<dt-beg> format.date "year" output.check
6306 %<dt-beg> date.block
6307 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6308 format.btitle "title" output.check
6309 %<blk-tit&!tit-col> new.sentence
6310 %<blk-tit&tit-col> add.colon
6311 %<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb
6312 organization "organization" bibinfo.check output
6313 address "address" bibinfo.check output
6314 format.edition output
6315 %<!dt-beg&!dt-end> format.date "year" output.check
6316 %<doi|(url-doi&!url)> format.doi output
6317 %<*url-blk&!harnm&!revdata>
6318 %<!blk-com&!blk-tit&!blk-tita> new.block
6319 format.url output
6320 %</url-blk&!harnm&!revdata>
6321 %<!blk-com&!blk-tit&!blk-tita> new.block
6322 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6323 format.note output
6324 %<*!dt-beg&dt-end>
6325 %<!blk-com&!blk-tit&!blk-tita> new.block
6326 format.date "year" output.check
6327 %</!dt-beg&dt-end>
6328 %<eprint> format.eprint output
6329 %<revdata> format.url output
6330 fin.entry
6331 %<(harnm|url-nl)&!revdata> write.url
6332 }
6333
6334 %</ay>
6335 %<*!ay>
6336 FUNCTION {manual}
6337 { output.bibitem
6338 author empty$
6339 { organization "organization" bibinfo.check
6340 duplicate$ empty$ 'pop$
6341 { output
6342 address "address" bibinfo.check output
6343 }
6344 if$
6345 }
6346 { format.authors output.nonnull }
6347 if$
6348 %<au-col> add.colon
6349 %<nmdash> name.or.dash
6350 %<ay&dt-beg> format.date "year" output.check
6351 %<!ay&dt-beg> format.date output
6352 %<dt-beg> date.block
6353 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6354 format.btitle "title" output.check
6355 %<blk-tit&!tit-col> new.sentence
6356 %<blk-tit&tit-col> add.colon
6357 author empty$
6358 { organization empty$
6359 {
6360 %<!blk-com&!blk-tit&!blk-tita> address new.block.checka
6361 address "address" bibinfo.check output
6362 }
6363 'skip$
6364 if$
6365 }
6366 {
6367 %<!blk-com&!blk-tit&!blk-tita> organization address new.block.checkb
6368 organization "organization" bibinfo.check output
6369 address "address" bibinfo.check output
6370 }
6371 if$
6372 format.edition output
6373 %<ay&!dt-beg&!dt-end> format.date "year" output.check
6374 %<!ay&!dt-beg&!dt-end> format.date output
6375 %<doi|(url-doi&!url)> format.doi output
6376 %<*url-blk&!harnm&!revdata>
6377 %<!blk-com&!blk-tit&!blk-tita> new.block
6378 format.url output
6379 %</url-blk&!harnm&!revdata>
6380 %<!blk-com&!blk-tit&!blk-tita> new.block
6381 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6382 format.note output
6383 %<*ay&!dt-beg&dt-end>
6384 %<!blk-com&!blk-tit&!blk-tita> new.block
6385 format.date "year" output.check
6386 %</ay&!dt-beg&dt-end>
6387 %<*!ay&!dt-beg&dt-end>
6388 %<!blk-com&!blk-tit&!blk-tita> new.block
6389 format.date output
6390 %</!ay&!dt-beg&dt-end>
6391 %<eprint> format.eprint output
6392 %<revdata> format.url output
6393 fin.entry
6394 %<(harnm|url-nl)&!revdata> write.url
6395 }
6396
6397 %</!ay>
6398 % \end{macrocode}
6399 % \end{macro}
6400 %
6401 % \begin{macro}{`mastersthesis'}
6402 % To format a master's thesis.
6403 % \begin{macrocode}
6404 FUNCTION {mastersthesis}
6405 { output.bibitem
6406 format.authors "author" output.check
6407 %<ay> author format.key output
6408 %<au-col> add.colon
6409 %<nmdash> name.or.dash
6410 %<dt-beg> format.date "year" output.check
6411 %<dt-beg> date.block
6412 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6413 %<*!thtit-x>
6414 %<!thtit-a> format.btitle
6415 %<thtit-a> format.title
6416 "title" output.check
6417 %<thtit-a&blk-com&tit-qq> end.quote.title
6418 %<!blk-com&!blk-tit&!blk-tita> new.block
6419 %<blk-tit&!tit-col> new.sentence
6420 %<blk-tit&tit-col> add.colon
6421 %</!thtit-x>
6422 bbl.mthesis format.thesis.type output.nonnull
6423 school "school" bibinfo.warn output
6424 address "address" bibinfo.check output
6425 %<!dt-beg&!dt-end> format.date "year" output.check
6426 %<doi|(url-doi&!url)> format.doi output
6427 %<*url-blk&!harnm&!revdata>
6428 %<!blk-com&!blk-tit&!blk-tita> new.block
6429 format.url output
6430 %</url-blk&!harnm&!revdata>
6431 %<!blk-com&!blk-tit&!blk-tita> new.block
6432 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6433 format.note output
6434 %<*!dt-beg&dt-end>
6435 %<!blk-com&!blk-tit&!blk-tita> new.block
6436 format.date "year" output.check
6437 %</!dt-beg&dt-end>
6438 %<eprint> format.eprint output
6439 %<revdata> format.url output
6440 fin.entry
6441 %<(harnm|url-nl)&!revdata> write.url
6442 }
6443
6444 % \end{macrocode}
6445 % \end{macro}
6446 %
6447 % \begin{macro}{`misc'}
6448 % \begin{macrocode}
6449 FUNCTION {misc}
6450 { output.bibitem
6451 format.authors output
6452 %<ay> author format.key output
6453 %<au-col> add.colon
6454 %<nmdash> name.or.dash
6455 %<ay&dt-beg> format.date "year" output.check
6456 %<!ay&dt-beg> format.date output
6457 %<*ay>
6458 %<dt-beg> date.block
6459 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6460 format.title output
6461 %<blk-com&tit-qq> end.quote.title
6462 %<!blk-com&!blk-tit&!blk-tita> new.block
6463 %<blk-tit&!tit-col> new.sentence
6464 %<blk-tit&tit-col> add.colon
6465 %</ay>
6466 %<*!ay>
6467 %<!blk-com&!blk-tit&!blk-tita> title howpublished new.block.checkb
6468 format.title output
6469 %<blk-com&tit-qq> end.quote.title
6470 %<blk-tit&!tit-col> new.sentence
6471 %<blk-tit&tit-col> add.colon
6472 %<!blk-com&!blk-tit&!blk-tita> howpublished new.block.checka
6473 %</!ay>
6474 howpublished "howpublished" bibinfo.check output
6475 %<ay&!dt-beg&!dt-end> format.date "year" output.check
6476 %<!ay&!dt-beg&!dt-end> format.date output
6477 %<doi|(url-doi&!url)> format.doi output
6478 %<*url-blk&!harnm&!revdata>
6479 %<!blk-com&!blk-tit&!blk-tita> new.block
6480 format.url output
6481 %</url-blk&!harnm&!revdata>
6482 %<!blk-com&!blk-tit&!blk-tita> new.block
6483 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6484 format.note output
6485 %<*ay&!dt-beg&dt-end>
6486 %<!blk-com&!blk-tit&!blk-tita> new.block
6487 format.date "year" output.check
6488 %</ay&!dt-beg&dt-end>
6489 %<*!ay&!dt-beg&dt-end>
6490 %<!blk-com&!blk-tit&!blk-tita> new.block
6491 format.date output
6492 %</!ay&!dt-beg&dt-end>
6493 %<eprint> format.eprint output
6494 %<revdata> format.url output
6495 fin.entry
6496 %<(harnm|url-nl)&!revdata> write.url
6497 %<!ay> empty.misc.check
6498 }
6499 % \end{macrocode}
6500 % \end{macro}
6501 %
6502 % \begin{macro}{`phdthesis'}
6503 % To format a doctoral thesis.
6504 % \begin{macrocode}
6505 FUNCTION {phdthesis}
6506 { output.bibitem
6507 format.authors "author" output.check
6508 %<ay> author format.key output
6509 %<au-col> add.colon
6510 %<nmdash> name.or.dash
6511 %<dt-beg> format.date "year" output.check
6512 %<dt-beg> date.block
6513 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6514 %<*!thtit-x>
6515 %<!thtit-a> format.btitle
6516 %<thtit-a> format.title
6517 "title" output.check
6518 %<thtit-a&blk-com&tit-qq> end.quote.title
6519 %<!blk-com&!blk-tit&!blk-tita> new.block
6520 %<blk-tit&!tit-col> new.sentence
6521 %<blk-tit&tit-col> add.colon
6522 %</!thtit-x>
6523 bbl.phdthesis format.thesis.type output.nonnull
6524 school "school" bibinfo.warn output
6525 address "address" bibinfo.check output
6526 %<!dt-beg&!dt-end> format.date "year" output.check
6527 %<doi|(url-doi&!url)> format.doi output
6528 %<*url-blk&!harnm&!revdata>
6529 %<!blk-com&!blk-tit&!blk-tita> new.block
6530 format.url output
6531 %</url-blk&!harnm&!revdata>
6532 %<!blk-com&!blk-tit&!blk-tita> new.block
6533 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6534 format.note output
6535 %<*!dt-beg&dt-end>
6536 %<!blk-com&!blk-tit&!blk-tita> new.block
6537 format.date "year" output.check
6538 %</!dt-beg&dt-end>
6539 %<eprint> format.eprint output
6540 %<revdata> format.url output
6541 fin.entry
6542 %<(harnm|url-nl)&!revdata> write.url
6543 }
6544
6545 % \end{macrocode}
6546 % \end{macro}
6547 %
6548 % \begin{macro}{`presentation'}
6549 % \begin{macrocode}
6550 %<*pres>
6551 FUNCTION {presentation}
6552 { output.bibitem
6553 format.authors output
6554 %<ay> author format.key output
6555 %<au-col> add.colon
6556 %<nmdash> name.or.dash
6557 %<!blk-com&!blk-tit&!blk-tita> new.block
6558 format.title output
6559 %<blk-com&tit-qq> end.quote.title
6560 %<!blk-com&!blk-tit&!blk-tita> new.block
6561 %<blk-tit&!tit-col> new.sentence
6562 %<blk-tit&tit-col> add.colon
6563 format.organization.address "organization and address" output.check
6564 month "month" output.check
6565 year "year" output.check
6566 %<!blk-com&!blk-tit&!blk-tita> new.block
6567 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6568 format.note output
6569 new.sentence
6570 type missing$ 'skip$
6571 {"(" type capitalize * ")" * output}
6572 if$
6573 %<*url-blk&!harnm>
6574 %<!blk-com&!blk-tit&!blk-tita> new.block
6575 format.url output
6576 %</url-blk&!harnm>
6577 fin.entry
6578 %<(harnm|url-nl)&!revdata> write.url
6579 }
6580
6581 %</pres>
6582 % \end{macrocode}
6583 % \end{macro}
6584 %
6585 % \begin{macro}{`proceedings'}
6586 % \begin{macrocode}
6587 %<*ay>
6588 FUNCTION {proceedings}
6589 { output.bibitem
6590 format.editors output
6591 editor format.key output
6592 %<au-col> add.colon
6593 %<nmdash> name.or.dash
6594 %<dt-beg> format.date "year" output.check
6595 %<dt-beg> date.block
6596 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6597 format.btitle "title" output.check
6598 format.bvolume output
6599 %<!numser> format.number.series output
6600 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6601 %<numser> format.number.series output
6602 publisher empty$
6603 { format.organization.address output }
6604 { organization "organization" bibinfo.check output
6605 format.publisher.address output
6606 }
6607 if$
6608 %<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
6609 %<isbn> format.isbn output
6610 %<issn> format.issn output
6611 %<doi|(url-doi&!url)> format.doi output
6612 %<*url-blk&!harnm&!revdata>
6613 %<!blk-com&!blk-tit&!blk-tita> new.block
6614 format.url output
6615 %</url-blk&!harnm&!revdata>
6616 %<!blk-com&!blk-tit&!blk-tita> new.block
6617 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6618 format.note output
6619 %<*!dt-beg&dt-end&!pub-date>
6620 %<!blk-com&!blk-tit&!blk-tita> new.block
6621 format.date "year" output.check
6622 %</!dt-beg&dt-end&!pub-date>
6623 %<eprint> format.eprint output
6624 %<revdata> format.url output
6625 fin.entry
6626 %<(harnm|url-nl)&!revdata> write.url
6627 }
6628
6629 %</ay>
6630 % \end{macrocode}
6631 % \begin{macrocode}
6632 %<*!ay>
6633 FUNCTION {proceedings}
6634 { output.bibitem
6635 editor empty$
6636 { organization "organization" bibinfo.check output
6637 }
6638 { format.editors output.nonnull }
6639 if$
6640 %<au-col> add.colon
6641 %<nmdash> name.or.dash
6642 %<dt-beg> format.date "year" output.check
6643 %<dt-beg> date.block
6644 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6645 format.btitle "title" output.check
6646 format.bvolume output
6647 %<!numser> format.number.series output
6648 editor empty$
6649 { publisher empty$
6650 %<!numser> 'skip$
6651 %<numser> { format.number.series output }
6652 {
6653 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6654 %<numser> format.number.series output
6655 format.publisher.address output
6656 }
6657 if$
6658 }
6659 { publisher empty$
6660 {
6661 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6662 %<numser> format.number.series output
6663 format.organization.address output }
6664 {
6665 %<!blk-com&!blk-tit&!blk-tita> new.sentence
6666 %<numser> format.number.series output
6667 organization "organization" bibinfo.check output
6668 format.publisher.address output
6669 }
6670 if$
6671 }
6672 if$
6673 %<!dt-beg&!dt-end&!pub-date> format.date "year" output.check
6674 %<isbn> format.isbn output
6675 %<issn> format.issn output
6676 %<doi|(url-doi&!url)> format.doi output
6677 %<*url-blk&!harnm&!revdata>
6678 %<!blk-com&!blk-tit&!blk-tita> new.block
6679 format.url output
6680 %</url-blk&!harnm&!revdata>
6681 %<!blk-com&!blk-tit&!blk-tita> new.block
6682 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6683 format.note output
6684 %<*!dt-beg&dt-end>
6685 %<!blk-com&!blk-tit&!blk-tita> new.block
6686 format.date "year" output.check
6687 %</!dt-beg&dt-end>
6688 %<eprint> format.eprint output
6689 %<revdata> format.url output
6690 fin.entry
6691 %<(harnm|url-nl)&!revdata> write.url
6692 }
6693
6694 %</!ay>
6695 % \end{macrocode}
6696 % \end{macro}
6697 %
6698 % \begin{macro}{`techreport'}
6699 % \begin{macrocode}
6700 FUNCTION {techreport}
6701 { output.bibitem
6702 format.authors "author" output.check
6703 %<ay> author format.key output
6704 %<au-col> add.colon
6705 %<nmdash> name.or.dash
6706 %<dt-beg> format.date "year" output.check
6707 %<dt-beg> date.block
6708 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6709 %<trtit-b> format.btitle
6710 %<!trtit-b> format.title
6711 "title" output.check
6712 %<!trtit-b&blk-com&tit-qq> end.quote.title
6713 %<!blk-com&!blk-tit&!blk-tita> new.block
6714 %<blk-tit&!tit-col> new.sentence
6715 %<blk-tit&tit-col> add.colon
6716 %<!trnum-it> format.tr.number output.nonnull
6717 %<trnum-it> format.tr.number emphasize output.nonnull
6718 institution "institution" bibinfo.warn output
6719 address "address" bibinfo.check output
6720 %<!dt-beg&!dt-end> format.date "year" output.check
6721 %<doi|(url-doi&!url)> format.doi output
6722 %<*url-blk&!harnm&!revdata>
6723 %<!blk-com&!blk-tit&!blk-tita> new.block
6724 format.url output
6725 %</url-blk&!harnm&!revdata>
6726 %<!blk-com&!blk-tit&!blk-tita> new.block
6727 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6728 format.note output
6729 %<*!dt-beg&dt-end>
6730 %<!blk-com&!blk-tit&!blk-tita> new.block
6731 format.date "year" output.check
6732 %</!dt-beg&dt-end>
6733 %<eprint> format.eprint output
6734 %<revdata> format.url output
6735 fin.entry
6736 %<(harnm|url-nl)&!revdata> write.url
6737 }
6738
6739 % \end{macrocode}
6740 % \end{macro}
6741 %
6742 % \begin{macro}{`unpublished'}
6743 % \begin{macrocode}
6744 FUNCTION {unpublished}
6745 { output.bibitem
6746 format.authors "author" output.check
6747 %<ay> author format.key output
6748 %<au-col> add.colon
6749 %<nmdash> name.or.dash
6750 %<ay&dt-beg> format.date "year" output.check
6751 %<!ay&dt-beg> format.date output
6752 %<dt-beg> date.block
6753 %<!dt-beg&!blk-com&!blk-tit&!blk-tita> new.block
6754 format.title "title" output.check
6755 %<blk-com&tit-qq> end.quote.title
6756 %<ay&!dt-beg&!dt-end> format.date "year" output.check
6757 %<!ay&!dt-beg&!dt-end> format.date output
6758 %<doi|(url-doi&!url)> format.doi output
6759 %<*url-blk&!harnm&!revdata>
6760 %<!blk-com&!blk-tit&!blk-tita> new.block
6761 format.url output
6762 %</url-blk&!harnm&!revdata>
6763 %<!blk-com&!blk-tit&!blk-tita> new.block
6764 %<(blk-com|blk-tit|blk-tita)&blknt> new.sentence
6765 format.note "note" output.check
6766 %<*ay&!dt-beg&dt-end>
6767 %<!blk-com&!blk-tit&!blk-tita> new.block
6768 format.date output
6769 %</ay&!dt-beg&dt-end>
6770 %<*!ay&!dt-beg&dt-end>
6771 %<!blk-com&!blk-tit&!blk-tita> new.block
6772 format.date output
6773 %</!ay&!dt-beg&dt-end>
6774 %<eprint> format.eprint output
6775 %<revdata> format.url output
6776 fin.entry
6777 %<(harnm|url-nl)&!revdata> write.url
6778 }
6779
6780 % \end{macrocode}
6781 % \end{macro}
6782 %
6783 % \begin{macro}{`default.type'}
6784 % \begin{macrocode}
6785 FUNCTION {default.type} { misc }
6786 % \end{macrocode}
6787 % \end{macro}
6788 %
6789 % \begin{macrocode}
6790 READ
6791 % \end{macrocode}
6792 %
6793 % \begin{macrocode}
6794 %<*ay|alph|!seq-no>
6795 % \end{macrocode}
6796 %
6797 % \begin{macro}{`sortify'}
6798 % In \texttt{btxbst.doc}/\texttt{.mbs}, the \texttt{sortify} function is
6799 % left out for unsorted alpha-style citations. This leads to an error,
6800 % because it is still used. So leave it in here too. \emph{In fact, do away
6801 % with unsorted alpha style, since it is as useless as unsorted author--year
6802 % listings.}
6803 % \begin{macrocode}
6804 FUNCTION {sortify}
6805 { purify$
6806 "l" change.case$
6807 }
6808 % \end{macrocode}
6809 % \end{macro}
6810 %
6811 % \begin{macrocode}
6812 INTEGERS { len }
6813 % \end{macrocode}
6814 %
6815 % \begin{macro}{`chop.word'}
6816 % \begin{macrocode}
6817 FUNCTION {chop.word}
6818 { 's :=
6819 'len :=
6820 s #1 len substring$ =
6821 { s len #1 + global.max$ substring$ }
6822 's
6823 if$
6824 }
6825 % \end{macrocode}
6826 % \end{macro}
6827 %
6828 % \begin{macrocode}
6829 %<*!ay&alph>
6830 % \end{macrocode}
6831 %
6832 % \begin{macro}{`format.lab.names'}
6833 % The function \texttt{format.lab.names} formats by author--year or the
6834 % \texttt{alpha} style as in the original \texttt{alpha.bst}.
6835 % Only major difference is that there should be no unsorted (\texttt{seq-no})
6836 % versions of this. Patashnik was clearly very unhappy about accommodating
6837 % such an animal, and in fact, his unsorted alpha style crashes \btx.
6838 % I also provide the \texttt{vonx} option here to ignore the \textsl{von}
6839 % part of the name.
6840 %
6841 % \begin{macrocode}
6842 INTEGERS { et.al.char.used }
6843 % \end{macrocode}
6844 %
6845 % \begin{macrocode}
6846 FUNCTION {initialize.et.al.char.used}
6847 { #0 'et.al.char.used :=
6848 }
6849 % \end{macrocode}
6850 %
6851 % \begin{macrocode}
6852 EXECUTE {initialize.et.al.char.used}
6853 % \end{macrocode}
6854 %
6855 % \begin{macrocode}
6856 FUNCTION {format.lab.names}
6857 { 's :=
6858 %<*alf-1>
6859 %<!vonx> s #1 "{v{}}{l{}}" format.name$
6860 %<vonx> s #1 "{l{}}" format.name$
6861 duplicate$ text.length$ #2 <
6862 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
6863 'skip$
6864 if$
6865 %</alf-1>
6866 %<*!alf-1&alf-f>
6867 %<!vonx> s #1 "{vv{}}{ll}" format.name$
6868 %<vonx> s #1 "{ll}" format.name$
6869 %</!alf-1&alf-f>
6870 %<*!alf-1&!alf-f>
6871 s num.names$ 'numnames :=
6872 numnames #1 >
6873 { numnames #4 >
6874 { #3 'namesleft := }
6875 { numnames 'namesleft := }
6876 if$
6877 #1 'nameptr :=
6878 ""
6879 { namesleft #0 > }
6880 { nameptr numnames =
6881 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
6882 { "{\etalchar{+}}" *
6883 #1 'et.al.char.used :=
6884 }
6885 %<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * }
6886 %<vonx> { s nameptr "{l{}}" format.name$ * }
6887 if$
6888 }
6889 %<!vonx> { s nameptr "{v{}}{l{}}" format.name$ * }
6890 %<vonx> { s nameptr "{l{}}" format.name$ * }
6891 if$
6892 nameptr #1 + 'nameptr :=
6893 namesleft #1 - 'namesleft :=
6894 }
6895 while$
6896 numnames #4 >
6897 { "{\etalchar{+}}" *
6898 #1 'et.al.char.used :=
6899 }
6900 'skip$
6901 if$
6902 }
6903 %<!vonx> { s #1 "{v{}}{l{}}" format.name$
6904 %<vonx> { s #1 "{l{}}" format.name$
6905 duplicate$ text.length$ #2 <
6906 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
6907 'skip$
6908 if$
6909 }
6910 if$
6911 %</!alf-1&!alf-f>
6912 }
6913 % \end{macrocode}
6914 %
6915 % \begin{macrocode}
6916 %</!ay&alph>
6917 % \end{macrocode}
6918 % The function for the standard citation: one or two authors cited full, but for
6919 % more than two, only the first with \emph{et~al.} given.
6920 % \begin{macrocode}
6921 %<*ay&!mcite>
6922 FUNCTION {format.lab.names}
6923 { 's :=
6924 "" 't :=
6925 %<!jnrlab> s #1 "{vv~}{ll}" format.name$
6926 %<*jnrlab>
6927 %<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> s #1 "{vv~}{ll}{, jj}" format.name$
6928 %<nm-rv|nm-rvv|nm-rvx|nm-rvcx> s #1 "{vv~}{ll}{ jj}" format.name$
6929 %</jnrlab>
6930 %<lab&and-rm> cite.name.font
6931 s num.names$ duplicate$
6932 #2 >
6933 { pop$
6934 %<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
6935 %<*!etal-it>
6936 %<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
6937 %<!lab|!and-rm|etal-rm> " " * bbl.etal *
6938 %</!etal-it>
6939 %<etal-it> " " * bbl.etal emphasize *
6940 %<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
6941 %<lab&!and-rm> "others" 't :=
6942 }
6943 { #2 <
6944 'skip$
6945 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
6946 {
6947 % %<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
6948 %<*!etal-it>
6949 %<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
6950 %<!lab|!and-rm|etal-rm> " " * bbl.etal *
6951 %</!etal-it>
6952 %<etal-it> " " * bbl.etal emphasize *
6953 %<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
6954 %<lab&!and-rm> "others" 't :=
6955 }
6956 %<*!harnm>
6957 %<*!amper>
6958 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
6959 %<lab&and-rm> cite.name.font
6960 * }
6961 %</!amper>
6962 %<*amper>
6963 { " \& " * s #2 "{vv~}{ll}" format.name$
6964 %<lab&and-rm> cite.name.font
6965 * }
6966 %</amper>
6967 %</!harnm>
6968 %<*harnm>
6969 { " \harvardand{} " * s #2 "{vv~}{ll}" format.name$
6970 %<lab&and-rm> cite.name.font
6971 * }
6972 %</harnm>
6973 if$
6974 }
6975 if$
6976 }
6977 if$
6978 %<*lab&!and-rm>
6979 t "others" =
6980 'skip$
6981 { cite.name.font }
6982 if$
6983 %</lab&!and-rm>
6984 }
6985
6986 %</ay&!mcite>
6987 % \end{macrocode}
6988 %
6989 % The code for formating author--year citations with more than one author
6990 % before \emph{et al.} or selecting a number other than two for truncating,
6991 % is much the same as the \texttt{format.full.names} function.
6992 % \begin{macrocode}
6993 %<*ay&mcite>
6994 FUNCTION {format.lab.names}
6995 {'s :=
6996 "" 't :=
6997 #1 'nameptr :=
6998 s num.names$ 'numnames :=
6999 numnames 'namesleft :=
7000 { namesleft #0 > }
7001 { s nameptr
7002 %<!jnrlab> "{vv~}{ll}" format.name$
7003 %<*jnrlab>
7004 %<!nm-rv&!nm-rvv&!nm-rvx&!nm-rvcx> "{vv~}{ll}{, jj}" format.name$
7005 %<nm-rv|nm-rvv|nm-rvx|nm-rvcx> "{vv~}{ll}{ jj}" format.name$
7006 %</jnrlab>
7007 %<lab&and-rm> cite.name.font
7008 't :=
7009 nameptr #1 >
7010 {
7011 %<mct-1> nameptr #2 =
7012 %<mct-2> nameptr #3 =
7013 %<mct-3> nameptr #4 =
7014 %<mct-4> nameptr #5 =
7015 %<mct-5> nameptr #6 =
7016 %<mct-6> nameptr #7 =
7017 %<mct-x2> numnames #2 > and
7018 %<mct-x3> numnames #3 > and
7019 %<mct-x4> numnames #4 > and
7020 %<mct-x5> numnames #5 > and
7021 %<mct-x6> numnames #6 > and
7022 { "others" 't :=
7023 #1 'namesleft := }
7024 'skip$
7025 if$
7026 namesleft #1 >
7027 { ", " * t * }
7028 {
7029 s nameptr "{ll}" format.name$ duplicate$ "others" =
7030 { 't := }
7031 { pop$ }
7032 if$
7033 t "others" =
7034 {
7035 %<lab&!and-rm&(etal-it|etal-rm)> cite.name.font
7036 %<*!etal-it>
7037 %<lab&and-rm&!etal-rm> " " * bbl.etal cite.name.font *
7038 %<!lab|!and-rm|etal-rm> " " * bbl.etal *
7039 %</!etal-it>
7040 %<etal-it> " " * bbl.etal emphasize *
7041 %<lab&!and-rm&!(etal-it|etal-rm)> cite.name.font
7042 }
7043 {
7044 %<*!harnm>
7045 %<*!and-xcom>
7046 numnames #2 >
7047 { "," * }
7048 'skip$
7049 if$
7050 %</!and-xcom>
7051 %<!amper> bbl.and
7052 %<amper> "\&"
7053 %</!harnm>
7054 %<harnm> "\harvardand{}"
7055 space.word * t *
7056 }
7057 if$
7058 }
7059 if$
7060 }
7061 't
7062 if$
7063 nameptr #1 + 'nameptr :=
7064 namesleft #1 - 'namesleft :=
7065 }
7066 while$
7067 %<*lab&!and-rm>
7068 t "others" =
7069 'skip$
7070 { cite.name.font }
7071 if$
7072 %</lab&!and-rm>
7073 }
7074
7075 %</ay&mcite>
7076 % \end{macrocode}
7077 % \end{macro}
7078 %
7079 % \begin{macro}{`author.key.label'}
7080 % \begin{macro}{`author.editor.key.label'}
7081 % \begin{macro}{`author.key.organization.label'}
7082 % \begin{macro}{`editor.key.organization.label'}
7083 % \begin{macro}{`editor.key.label'}
7084 % Have to be very careful with the options \texttt{ay}, \texttt{alph}, and
7085 % \texttt{seq-no} here. The first two are actually mutually exclusive, and
7086 % \texttt{ay} should dominate. The \texttt{seq-no} option only applies for
7087 % numerical (\texttt{!ay}) but not alphabetic (\texttt{alph}) selections.
7088 % This whole block of coding dealing with labels is only included for
7089 % author--year or alphabetic or ordered numerical.
7090 % That is, \texttt{ay} or \texttt{alph} or \texttt{!seq-no} is true.
7091 % \begin{macrocode}
7092 %<*ay|alph>
7093 FUNCTION {author.key.label}
7094 { author empty$
7095 { key empty$
7096 { cite$ #1 #3 substring$ }
7097 %<ay> 'key
7098 %<!ay> { key #3 text.prefix$ }
7099 if$
7100 }
7101 { author format.lab.names }
7102 if$
7103 }
7104
7105 FUNCTION {author.editor.key.label}
7106 { author empty$
7107 { editor empty$
7108 { key empty$
7109 { cite$ #1 #3 substring$ }
7110 %<ay> 'key
7111 %<!ay> { key #3 text.prefix$ }
7112 if$
7113 }
7114 { editor format.lab.names }
7115 if$
7116 }
7117 { author format.lab.names }
7118 if$
7119 }
7120
7121 %</ay|alph>
7122 %<*!ay&alph>
7123 FUNCTION {author.key.organization.label}
7124 { author empty$
7125 { key empty$
7126 { organization empty$
7127 { cite$ #1 #3 substring$ }
7128 { "The " #4 organization chop.word #3 text.prefix$ }
7129 if$
7130 }
7131 { key #3 text.prefix$ }
7132 if$
7133 }
7134 { author format.lab.names }
7135 if$
7136 }
7137
7138 FUNCTION {editor.key.organization.label}
7139 { editor empty$
7140 { key empty$
7141 { organization empty$
7142 { cite$ #1 #3 substring$ }
7143 { "The " #4 organization chop.word #3 text.prefix$ }
7144 if$
7145 }
7146 { key #3 text.prefix$ }
7147 if$
7148 }
7149 { editor format.lab.names }
7150 if$
7151 }
7152
7153 %</!ay&alph>
7154 %<*ay>
7155 FUNCTION {editor.key.label}
7156 { editor empty$
7157 { key empty$
7158 { cite$ #1 #3 substring$ }
7159 'key
7160 if$
7161 }
7162 { editor format.lab.names }
7163 if$
7164 }
7165
7166 % \end{macrocode}
7167 % \end{macro}
7168 % \end{macro}
7169 % \end{macro}
7170 % \end{macro}
7171 % \end{macro}
7172 %
7173 % \begin{macro}{`calc.short.authors'}
7174 % \begin{macrocode}
7175 FUNCTION {calc.short.authors}
7176 { type$ "book" =
7177 type$ "inbook" =
7178 or
7179 'author.editor.key.label
7180 { type$ "proceedings" =
7181 'editor.key.label
7182 'author.key.label
7183 if$
7184 }
7185 if$
7186 'short.list :=
7187 }
7188
7189 % \end{macrocode}
7190 % \end{macro}
7191 %
7192 % \begin{macro}{`calc.label'}
7193 % \begin{macrocode}
7194 FUNCTION {calc.label}
7195 { calc.short.authors
7196 short.list
7197 %<!(har|ast|cay|nmd|alk|cn)> "("
7198 %<har|ast|cay|nmd|alk|cn> ", "
7199 *
7200 year duplicate$ empty$
7201 %<keyxyr> short.list key field.or.null = or
7202 %<(blkyear|keyxyr)> { pop$ "" }
7203 %<!(blkyear|keyxyr)> { pop$ "????" }
7204 %<!note-yr> { purify$ #-1 #4 substring$ }
7205 %<note-yr> 'skip$
7206 if$
7207 *
7208 'label :=
7209 }
7210
7211 %</ay>
7212 %<*!ay&alph>
7213 FUNCTION {calc.label}
7214 { type$ "book" =
7215 type$ "inbook" =
7216 or
7217 'author.editor.key.label
7218 { type$ "proceedings" =
7219 'editor.key.organization.label
7220 { type$ "manual" =
7221 'author.key.organization.label
7222 'author.key.label
7223 if$
7224 }
7225 if$
7226 }
7227 if$
7228 duplicate$
7229 year field.or.null purify$ #-1 #2 substring$
7230 *
7231 'label :=
7232 year field.or.null purify$ #-1 #4 substring$
7233 *
7234 sortify 'sort.label :=
7235 }
7236 % \end{macrocode}
7237 % \end{macro}
7238 %
7239 % \begin{macrocode}
7240 %</!ay&alph>
7241 % \end{macrocode}
7242 %
7243 % \begin{macrocode}
7244 %<*ay>
7245 % \end{macrocode}
7246 %
7247 % \begin{macrocode}
7248 %<*har|cay|nmd|ast|cn>
7249 % \end{macrocode}
7250 %
7251 % \begin{macro}{`calc.short.label'}
7252 % \begin{macrocode}
7253 FUNCTION {calc.short.label}
7254 { calc.short.authors short.list
7255 'label :=
7256 }
7257 % \end{macrocode}
7258 % \end{macro}
7259 %
7260 % \begin{macrocode}
7261 %</har|cay|nmd|ast|cn>
7262 % \end{macrocode}
7263 %
7264 % \begin{macrocode}
7265 %</ay>
7266 % \end{macrocode}
7267 %
7268 % \begin{macro}{`sort.format.names'}
7269 % \begin{macrocode}
7270 FUNCTION {sort.format.names}
7271 { 's :=
7272 #1 'nameptr :=
7273 ""
7274 s num.names$ 'numnames :=
7275 numnames 'namesleft :=
7276 { namesleft #0 > }
7277 { s nameptr
7278 %<*xintls>
7279 %<!vonx> "{vv{ } }{ll{ }}"
7280 %<vonx> "{ll{ }}"
7281 %</xintls>
7282 %<*!xintls>
7283 %<*!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
7284 %<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
7285 %<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
7286 %</!nm-init&!nm-rev&!nm-rev1&!nm-rv&!nm-rvx&!nm-rvcx&!nm-rvv&!nm-rvvc>
7287 %<*nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
7288 %<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
7289 %<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
7290 %</nm-init|nm-rev|nm-rev1|nm-rv|nm-rvx|nm-rvcx|nm-rvv|nm-rvvc>
7291 %</!xintls>
7292 format.name$ 't :=
7293 nameptr #1 >
7294 {
7295 %<*nmlm>
7296 %<m1> nameptr #1
7297 %<m2> nameptr #2
7298 %<m3> nameptr #3
7299 %<m4> nameptr #4
7300 %<m5> nameptr #5
7301 %<m6> nameptr #6
7302 %<m7> nameptr #7
7303 %<m8> nameptr #8
7304 %<m9> nameptr #9
7305 %<m0> nameptr #0
7306 %<m10> #10 +
7307 %<m20> #20 +
7308 %<m30> #30 +
7309 %<m40> #40 +
7310 %<m50> #50 +
7311 %<m60> #60 +
7312 %<m70> #70 +
7313 %<m80> #80 +
7314 %<m90> #90 +
7315 #1 + =
7316 %<x1> numnames #1
7317 %<x2> numnames #2
7318 %<x3> numnames #3
7319 %<x4> numnames #4
7320 %<x5> numnames #5
7321 %<x6> numnames #6
7322 %<x7> numnames #7
7323 %<x8> numnames #8
7324 %<x9> numnames #9
7325 %<x0> numnames #0
7326 %<x10> #10 +
7327 %<x20> #20 +
7328 %<x30> #30 +
7329 %<x40> #40 +
7330 %<x50> #50 +
7331 %<x60> #60 +
7332 %<x70> #70 +
7333 %<x80> #80 +
7334 %<x90> #90 +
7335 > and
7336 { "others" 't :=
7337 #1 'namesleft := }
7338 'skip$
7339 if$
7340 %</nmlm>
7341 " " *
7342 namesleft #1 = t "others" = and
7343 { "zzzzz" 't := }
7344 'skip$
7345 if$
7346 %<*seq-lab|seq-key|seq-labc>
7347 numnames #2 > nameptr #2 = and
7348 { "zz" * year field.or.null * " " *
7349 %<seq-labc> #1 'namesleft :=
7350 }
7351 %<seq-labc> { t sortify * }
7352 %<!seq-labc> 'skip$
7353 if$
7354 %</seq-lab|seq-key|seq-labc>
7355 %<!seq-labc> t sortify *
7356 }
7357 { t sortify * }
7358 if$
7359 nameptr #1 + 'nameptr :=
7360 namesleft #1 - 'namesleft :=
7361 }
7362 while$
7363 }
7364
7365 % \end{macrocode}
7366 % \end{macro}
7367 %
7368 % \begin{macro}{`sort.format.title'}
7369 % \begin{macrocode}
7370 FUNCTION {sort.format.title}
7371 { 't :=
7372 "A " #2
7373 "An " #3
7374 "The " #4 t chop.word
7375 chop.word
7376 chop.word
7377 sortify
7378 #1 global.max$ substring$
7379 }
7380 % \end{macrocode}
7381 % \end{macro}
7382 %
7383 % \begin{macro}{`author.sort'}
7384 % \begin{macrocode}
7385 FUNCTION {author.sort}
7386 { author empty$
7387 { key empty$
7388 { "to sort, need author or key in " cite$ * warning$
7389 ""
7390 }
7391 { key sortify }
7392 if$
7393 }
7394 { author sort.format.names }
7395 if$
7396 }
7397 % \end{macrocode}
7398 % \end{macro}
7399 %
7400 % \begin{macro}{`author.editor.sort'}
7401 % \begin{macrocode}
7402 FUNCTION {author.editor.sort}
7403 { author empty$
7404 { editor empty$
7405 { key empty$
7406 { "to sort, need author, editor, or key in " cite$ * warning$
7407 ""
7408 }
7409 { key sortify }
7410 if$
7411 }
7412 { editor sort.format.names }
7413 if$
7414 }
7415 { author sort.format.names }
7416 if$
7417 }
7418 % \end{macrocode}
7419 % \end{macro}
7420 %
7421 % \begin{macro}{`negate.year'}
7422 % This function negates the year by substituting each digit by its
7423 % complement. That is, 0 $\rightarrow$ 9, 1 $\rightarrow$ 8, etc. This is used
7424 % to provide ordering by descending year (latest year first).
7425 % \begin{macrocode}
7426 %<*seq-yrr&!seq-yr>
7427 FUNCTION {negate.year}
7428 { year empty$
7429 { "99999" }
7430 { year #1 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$
7431 year #2 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
7432 year #3 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
7433 year #4 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
7434 }
7435 if$
7436 }
7437 %</seq-yrr&!seq-yr>
7438 % \end{macrocode}
7439 % \end{macro}
7440 %
7441 % \begin{macrocode}
7442 %<*ay>
7443 % \end{macrocode}
7444 %
7445 % \begin{macro}{`editor.sort'}
7446 % \begin{macrocode}
7447 FUNCTION {editor.sort}
7448 { editor empty$
7449 { key empty$
7450 { "to sort, need editor or key in " cite$ * warning$
7451 ""
7452 }
7453 { key sortify }
7454 if$
7455 }
7456 { editor sort.format.names }
7457 if$
7458 }
7459 % \end{macrocode}
7460 % \end{macro}
7461 %
7462 % \begin{macrocode}
7463 %<*seq-no>
7464 % \end{macrocode}
7465 %
7466 % \begin{macrocode}
7467 INTEGERS { seq.num }
7468 % \end{macrocode}
7469 %
7470 % \begin{macro}{`init.seq'}
7471 % \begin{macrocode}
7472 FUNCTION {init.seq}
7473 { #0 'seq.num :=}
7474 % \end{macrocode}
7475 % \end{macro}
7476 %
7477 % \begin{macrocode}
7478 EXECUTE {init.seq}
7479 % \end{macrocode}
7480 %
7481 % \begin{macro}{`int.to.fix'}
7482 % \begin{macrocode}
7483 FUNCTION {int.to.fix}
7484 { "000000000" swap$ int.to.str$ *
7485 #-1 #10 substring$
7486 }
7487 % \end{macrocode}
7488 % \end{macro}
7489 %
7490 % \begin{macrocode}
7491 %</seq-no>
7492 % \end{macrocode}
7493 %
7494 % \begin{macro}{`presort'}
7495 % For unsorted author--year, make up the final sorting order in
7496 % \texttt{sort.label} with the original sequence number, for unsorting later.
7497 % \begin{macrocode}
7498 FUNCTION {presort}
7499 { calc.label
7500 label sortify
7501 " "
7502 *
7503 %<*!seq-no>
7504 type$ "book" =
7505 type$ "inbook" =
7506 or
7507 'author.editor.sort
7508 { type$ "proceedings" =
7509 'editor.sort
7510 'author.sort
7511 if$
7512 }
7513 if$
7514 #1 entry.max$ substring$
7515 %</!seq-no>
7516 %<*seq-no>
7517 seq.num #1 + 'seq.num :=
7518 seq.num int.to.fix
7519 %</seq-no>
7520 'sort.label :=
7521 sort.label
7522 *
7523 %<seq-yr> " " * year field.or.null *
7524 %<seq-yrr&!seq-yr> " " * negate.year field.or.null *
7525 %<*!seq-key&!seq-labc&!seq-yr&!seq-yrr>
7526 " "
7527 *
7528 title field.or.null
7529 sort.format.title
7530 *
7531 %</!seq-key&!seq-labc&!seq-yr&!seq-yrr>
7532 %<seq-key|seq-yr|seq-yrr> " " * cite$ *
7533 #1 entry.max$ substring$
7534 'sort.key$ :=
7535 % "For " cite$ * ", sort.key=" * sort.key$ * warning$
7536 }
7537
7538 % \end{macrocode}
7539 % \end{macro}
7540 %
7541 % \begin{macrocode}
7542 %</ay>
7543 % \end{macrocode}
7544 %
7545 % \begin{macrocode}
7546 %<*!ay>
7547 % \end{macrocode}
7548 %
7549 % \begin{macro}{`author.organization.sort'}
7550 % \begin{macrocode}
7551 FUNCTION {author.organization.sort}
7552 { author empty$
7553 { organization empty$
7554 { key empty$
7555 { "to sort, need author, organization, or key in " cite$ * warning$
7556 ""
7557 }
7558 { key sortify }
7559 if$
7560 }
7561 { "The " #4 organization chop.word sortify }
7562 if$
7563 }
7564 { author sort.format.names }
7565 if$
7566 }
7567 % \end{macrocode}
7568 % \end{macro}
7569 %
7570 % \begin{macro}{`editor.organization.sort'}
7571 % \begin{macrocode}
7572 FUNCTION {editor.organization.sort}
7573 { editor empty$
7574 { organization empty$
7575 { key empty$
7576 { "to sort, need editor, organization, or key in " cite$ * warning$
7577 ""
7578 }
7579 { key sortify }
7580 if$
7581 }
7582 { "The " #4 organization chop.word sortify }
7583 if$
7584 }
7585 { editor sort.format.names }
7586 if$
7587 }
7588 % \end{macrocode}
7589 % \end{macro}
7590 %
7591 % \begin{macro}{`presort'}
7592 % \begin{macrocode}
7593 FUNCTION {presort}
7594 %<*alph>
7595 { calc.label
7596 sort.label
7597 " "
7598 *
7599 type$ "book" =
7600 %</alph>
7601 %<!alph>{ type$ "book" =
7602 type$ "inbook" =
7603 or
7604 'author.editor.sort
7605 { type$ "proceedings" =
7606 'editor.organization.sort
7607 { type$ "manual" =
7608 'author.organization.sort
7609 'author.sort
7610 if$
7611 }
7612 if$
7613 }
7614 if$
7615 %<alph> *
7616 " "
7617 *
7618 %<seq-yrr> negate.year field.or.null sortify
7619 %<!seq-yrr> year field.or.null sortify
7620 %<!(seq-yr|seq-yrr)|alph> *
7621 " "
7622 *
7623 %<(seq-yr|seq-yrr)&!alph> swap$ *
7624 title field.or.null
7625 sort.format.title
7626 *
7627 #1 entry.max$ substring$
7628 'sort.key$ :=
7629 }
7630 % \end{macrocode}
7631 % \end{macro}
7632 %
7633 % \begin{macrocode}
7634 %</!ay>
7635 % \end{macrocode}
7636 %
7637 % \begin{macrocode}
7638 ITERATE {presort}
7639 % \end{macrocode}
7640 %
7641 % \begin{macrocode}
7642 SORT
7643 % \end{macrocode}
7644 %
7645 % \begin{macrocode}
7646 %</ay|alph|!seq-no>
7647 % \end{macrocode}
7648 %
7649 % With version~6.0 of \texttt{natbib}, the author-year styles can also be
7650 % used for numerical citations; then the \texttt{thebibliography} environment
7651 % must have an argument indicating the length of the longest label.
7652 % Simply count the references and add this number as the argument.
7653 % \begin{macrocode}
7654 %<*ay>
7655 % \end{macrocode}
7656 %
7657 % \begin{macrocode}
7658 STRINGS { last.label next.extra }
7659 % \end{macrocode}
7660 %
7661 % With computer-generated articles, it is possible to have more than 26 articles
7662 % in one year. It has finally occurred that the extra labels go beyond `z'.
7663 % The current code now allows for `aa', \dots `az', 'ba', \dots `zz'. This
7664 % code was provided by Joseph Wright (2007 Oct 10).
7665 % \begin{macrocode}
7666 INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label }
7667 % \end{macrocode}
7668 %
7669 % \begin{macro}{`initialize.extra.label.stuff'}
7670 % \begin{macrocode}
7671 FUNCTION {initialize.extra.label.stuff}
7672 { #0 int.to.chr$ 'last.label :=
7673 "" 'next.extra :=
7674 #0 'last.extra.num :=
7675 "a" chr.to.int$ #1 - 'last.extra.num.blank :=
7676 last.extra.num.blank 'last.extra.num.extended :=
7677 #0 'number.label :=
7678 }
7679 % \end{macrocode}
7680 % \end{macro}
7681 %
7682 % \begin{macro}{`forward.pass'}
7683 % \begin{macrocode}
7684 FUNCTION {forward.pass}
7685 { last.label label =
7686 { last.extra.num #1 + 'last.extra.num :=
7687 last.extra.num "z" chr.to.int$ >
7688 { "a" chr.to.int$ 'last.extra.num :=
7689 last.extra.num.extended #1 + 'last.extra.num.extended :=
7690 }
7691 'skip$
7692 if$
7693 last.extra.num.extended last.extra.num.blank >
7694 { last.extra.num.extended int.to.chr$
7695 last.extra.num int.to.chr$
7696 * 'extra.label := }
7697 { last.extra.num int.to.chr$ 'extra.label := }
7698 if$
7699 }
7700 { "a" chr.to.int$ 'last.extra.num :=
7701 "" 'extra.label :=
7702 label 'last.label :=
7703 }
7704 if$
7705 number.label #1 + 'number.label :=
7706 }
7707 % \end{macrocode}
7708 % \end{macro}
7709 %
7710 % \begin{macrocode}
7711 %</ay>
7712 % \end{macrocode}
7713 %
7714 % \begin{macrocode}
7715 %<*!ay&alph>
7716 % \end{macrocode}
7717 %
7718 % \begin{macrocode}
7719 STRINGS { longest.label last.sort.label next.extra }
7720 % \end{macrocode}
7721 %
7722 % \begin{macrocode}
7723 INTEGERS { longest.label.width last.extra.num }
7724 % \end{macrocode}
7725 %
7726 % \begin{macro}{`initialize.longest.label'}
7727 % \begin{macrocode}
7728 FUNCTION {initialize.longest.label}
7729 { "" 'longest.label :=
7730 #0 int.to.chr$ 'last.sort.label :=
7731 "" 'next.extra :=
7732 #0 'longest.label.width :=
7733 #0 'last.extra.num :=
7734 }
7735 % \end{macrocode}
7736 % \end{macro}
7737 %
7738 % \begin{macro}{`forward.pass'}
7739 % \begin{macrocode}
7740 FUNCTION {forward.pass}
7741 { last.sort.label sort.label =
7742 { last.extra.num #1 + 'last.extra.num :=
7743 last.extra.num int.to.chr$ 'extra.label :=
7744 }
7745 { "a" chr.to.int$ 'last.extra.num :=
7746 "" 'extra.label :=
7747 sort.label 'last.sort.label :=
7748 }
7749 if$
7750 }
7751 % \end{macrocode}
7752 % \end{macro}
7753 %
7754 % \begin{macrocode}
7755 %</!ay&alph>
7756 % \end{macrocode}
7757 %
7758 % \begin{macro}{`reverse.pass'}
7759 % The extra label is added in braces so that natbib can treat it as one unit.
7760 % This allows extra labels to be more than one letter long. For non-NFSS
7761 % emphasizing, this is no problem, since labels go in |{\em a}|, but for
7762 % non-emphasizing and for NFSS, it caused troubles without the braces.
7763 % The trouble arises with multiple citations in one |\cite| in which
7764 % authors and years are the same, and only the extra label is given for
7765 % the next one. Note: |\emph{a}| is more than one letter long in this sense,
7766 % so it is not just a problem for more than 26 papers with same authors and
7767 % year.
7768 %
7769 % The command |\natexlab| now encloses the extra label for \texttt{natbib}
7770 % styles. This command normally just prints its argument, but for numerical
7771 % citation mode, it swallows its argument. This allows the extra labels to
7772 % be suppressed for numerical citations where they are superfluous.
7773 % The enclosing braces mentioned above must be included here to make the
7774 % entire extra label text a single token for \texttt{natbib}.
7775 % \begin{macrocode}
7776 %<*ay>
7777 % \end{macrocode}
7778 %
7779 % \begin{macrocode}
7780 FUNCTION {reverse.pass}
7781 { next.extra "b" =
7782 { "a" 'extra.label := }
7783 'skip$
7784 if$
7785 extra.label 'next.extra :=
7786 extra.label
7787 %<xlab-it> emphasize
7788 %<*!html>
7789 duplicate$ empty$
7790 'skip$
7791 { "{\natexlab{" swap$ * "}}" * }
7792 if$
7793 %</!html>
7794 'extra.label :=
7795 %<!(har|ast|cay|nmd|cn)> label extra.label * 'label :=
7796 }
7797 % \end{macrocode}
7798 %
7799 % \begin{macrocode}
7800 %</ay>
7801 % \end{macrocode}
7802 %
7803 % \begin{macrocode}
7804 %<*!ay&alph>
7805 % \end{macrocode}
7806 %
7807 % \begin{macrocode}
7808 FUNCTION {reverse.pass}
7809 { next.extra "b" =
7810 { "a" 'extra.label := }
7811 'skip$
7812 if$
7813 label extra.label * 'label :=
7814 label width$ longest.label.width >
7815 { label 'longest.label :=
7816 label width$ 'longest.label.width :=
7817 }
7818 'skip$
7819 if$
7820 extra.label 'next.extra :=
7821 }
7822 % \end{macrocode}
7823 %
7824 % \begin{macrocode}
7825 %</!ay&alph>
7826 % \end{macrocode}
7827 % \end{macro}
7828 %
7829 % \begin{macrocode}
7830 %<ay>EXECUTE {initialize.extra.label.stuff}
7831 %<!ay&alph>EXECUTE {initialize.longest.label}
7832 % \end{macrocode}
7833 %
7834 % \begin{macrocode}
7835 %<*ay|alph>
7836 ITERATE {forward.pass}
7837 % \end{macrocode}
7838 %
7839 % \begin{macrocode}
7840 REVERSE {reverse.pass}
7841 % \end{macrocode}
7842 %
7843 % \begin{macrocode}
7844 %</ay|alph>
7845 % \end{macrocode}
7846 %
7847 % \begin{macrocode}
7848 %<*ay>
7849 FUNCTION {bib.sort.order}
7850 { sort.label
7851 " "
7852 *
7853 %<seq-yrr> negate.year field.or.null sortify
7854 %<!seq-yrr> year field.or.null sortify
7855 %<(seq-yr|seq-yrr)&!(seq-lab|seq-key|seq-labc)> swap$
7856 *
7857 %<*!seq-key&!seq-labc&!seq-yr&!seq-yrr>
7858 " "
7859 *
7860 title field.or.null
7861 sort.format.title
7862 *
7863 %</!seq-key&!seq-labc&!seq-yr&!seq-yrr>
7864 %<seq-key|seq-yr|seq-yrr> " " * cite$ *
7865 #1 entry.max$ substring$
7866 'sort.key$ :=
7867 % "For " cite$ * ", bib.sort.key=" * sort.key$ * warning$
7868 %<har|cay|nmd|cn|ast> calc.short.label
7869 }
7870 % \end{macrocode}
7871 %
7872 % \begin{macrocode}
7873 ITERATE {bib.sort.order}
7874 % \end{macrocode}
7875 %
7876 % \begin{macrocode}
7877 SORT
7878 % \end{macrocode}
7879 %
7880 % \begin{macrocode}
7881 %</ay>
7882 % \end{macrocode}
7883 %
7884 % \begin{macrocode}
7885 %<*!ay&!alph>
7886 % \end{macrocode}
7887 %
7888 % \begin{macrocode}
7889 STRINGS { longest.label }
7890 % \end{macrocode}
7891 %
7892 % \begin{macrocode}
7893 INTEGERS { number.label longest.label.width }
7894 % \end{macrocode}
7895 %
7896 % \begin{macrocode}
7897 FUNCTION {initialize.longest.label}
7898 { "" 'longest.label :=
7899 #1 'number.label :=
7900 #0 'longest.label.width :=
7901 }
7902 % \end{macrocode}
7903 %
7904 % \begin{macrocode}
7905 FUNCTION {longest.label.pass}
7906 %<*!cite>
7907 { number.label int.to.str$ 'label :=
7908 number.label #1 + 'number.label :=
7909 %</!cite>
7910 %<cite>{ cite$ 'label :=
7911 label width$ longest.label.width >
7912 { label 'longest.label :=
7913 label width$ 'longest.label.width :=
7914 }
7915 'skip$
7916 if$
7917 }
7918 % \end{macrocode}
7919 %
7920 % \begin{macrocode}
7921 EXECUTE {initialize.longest.label}
7922 % \end{macrocode}
7923 %
7924 % \begin{macrocode}
7925 ITERATE {longest.label.pass}
7926 % \end{macrocode}
7927 %
7928 % \begin{macrocode}
7929 %</!ay&!alph>
7930 % \end{macrocode}
7931 %
7932 % \begin{macro}{`begin.bib'}
7933 % The function \texttt{begin.bib} writes the initial text to the \texttt{.bbl}
7934 % file. The most important matter here is that the \texttt{thebibliography}
7935 % environment is invoked.
7936 %
7937 % Note: the French quotation marks are called `guillimets'; Adobe erroneously
7938 % named the symbols `guillimot', which is an arctic bird. The error has so
7939 % propagated, that it can no longer be corrected. \LaTeX\ took it over.
7940 % \begin{macrocode}
7941 FUNCTION {begin.bib}
7942 %<*!html>
7943 %<*!ay&alph>
7944 { et.al.char.used
7945 { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
7946 'skip$
7947 if$
7948 preamble$ empty$
7949 %</!ay&alph>
7950 %<ay|!alph>{ preamble$ empty$
7951 'skip$
7952 { preamble$ write$ newline$ }
7953 if$
7954 %<ay> "\begin{thebibliography}{" number.label int.to.str$ * "}" *
7955 %<!ay> "\begin{thebibliography}{" longest.label * "}" *
7956 write$ newline$
7957 %<*(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
7958 "\typeout{**********************************}" write$ newline$
7959 "\typeout{WARNING WARNING WARNING WARNING WARNING}" write$ newline$
7960 "\typeout{The bst file has been generated with inconsistent options}"
7961 write$ newline$
7962 "\typeout{Read the warning message at the start of the bst file}"
7963 write$ newline$
7964 "\typeout{**********************************}" write$ newline$
7965 %</(!nmft&(nmft-it|nmft-sc|nmft-bf|nmft-def))|(!lab&(lab-it|lab-bf|lab-sc|lab-def))>
7966 %<*!plntx>
7967 %<!tit-it&tit-qq&qt-s> "\newcommand{\enquote}[1]{`#1'}"
7968 %<!tit-it&tit-qq&!qt-s&!qt-g> "\newcommand{\enquote}[1]{``#1''}"
7969 %</!plntx>
7970 %<*plntx>
7971 %<!tit-it&tit-qq&qt-s> "\def\enquote#1{`#1'}"
7972 %<!tit-it&tit-qq&!qt-s&!qt-g> "\def\enquote#1{``#1''}"
7973 %</plntx>
7974 %<*!tit-it&tit-qq&!qt-s&qt-g>
7975 %<!plntx> "\let\enquote\frquote"
7976 %<*plntx>
7977 "\def\guillemotleft{%"
7978 write$ newline$
7979 " \leavevmode\raise .27ex\hbox{$\scriptscriptstyle\ll$}}"
7980 write$ newline$
7981 "\def\guillemotright{%"
7982 write$ newline$
7983 " \leavevmode\raise .27ex\hbox{$\scriptscriptstyle\gg$}}"
7984 write$ newline$
7985 "\def\enquote#1{\guillemotleft#1\guillemotright}"
7986 %</plntx>
7987 %</!tit-it&tit-qq&!qt-s&qt-g>
7988 %<!tit-it&tit-qq> write$ newline$
7989 %<umlaut> "\let\qq=\" quote$ * write$ newline$
7990 %<em-ul> "\expandafter\ifx\csname uline\endcsname\relax\let\uline\underline\fi"
7991 %<em-ul> write$ newline$
7992 %<*ay>
7993 %<!plntx> "\providecommand{\natexlab}[1]{#1}"
7994 %<plntx> "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
7995 write$ newline$
7996 %<*har>
7997 "{\catcode`\|=0\catcode`\#=12\catcode`\@=11\catcode`\\=12" write$ newline$
7998 "|immediate|write|@auxout{\expandafter\ifx\csname natexlab\endcsname\relax\gdef\natexlab#1{#1}\fi}}"
7999 write$ newline$
8000 %</har>
8001 %</ay>
8002 %<*nmft&nmft-def>
8003 %<!plntx> "\providecommand{\bibnamefont}[1]{#1}"
8004 %<plntx> "\expandafter\ifx\csname bibnamefont\endcsname\relax"
8005 %<plntx> write$ newline$
8006 %<plntx> " \def\bibnamefont#1{#1}\fi"
8007 write$ newline$
8008 %</nmft&nmft-def>
8009 %<*nmft&fnm-def>
8010 %<!plntx> "\providecommand{\bibfnamefont}[1]{#1}"
8011 %<plntx> "\expandafter\ifx\csname bibfnamefont\endcsname\relax"
8012 %<plntx> write$ newline$
8013 %<plntx> " \def\bibfnamefont#1{#1}\fi"
8014 write$ newline$
8015 %</nmft&fnm-def>
8016 %<*lab&lab-def>
8017 %<!plntx> "\providecommand{\citenamefont}[1]{#1}"
8018 %<plntx> "\expandafter\ifx\csname citenamefont\endcsname\relax"
8019 %<plntx> write$ newline$
8020 %<plntx> " \def\citenamefont#1{#1}\fi"
8021 write$ newline$
8022 %</lab&lab-def>
8023 %<*(url&!harnm)|eprint>
8024 %<*!plntx>
8025 %<nfss> "\providecommand{\url}[1]{\texttt{#1}}"
8026 %<!nfss> "\providecommand{\url}[1]{{\tt #1}}"
8027 write$ newline$
8028 "\providecommand{\urlprefix}{}"
8029 write$ newline$
8030 %</!plntx>
8031 %<*plntx>
8032 "\expandafter\ifx\csname url\endcsname\relax"
8033 write$ newline$
8034 %<nfss> " \def\url#1{\texttt{#1}}\fi"
8035 %<!nfss> " \def\url#1{{\tt #1}}\fi"
8036 write$ newline$
8037 "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{}\fi"
8038 write$ newline$
8039 %</plntx>
8040 %</(url&!harnm)|eprint>
8041 %<*doi>
8042 "\expandafter\ifx\csname urlstyle\endcsname\relax"
8043 write$ newline$
8044 %<*!plntx>
8045 " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
8046 write$ newline$
8047 " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
8048 write$ newline$
8049 %</!plntx>
8050 %<*plntx>
8051 " \expandafter\ifx\csname doi\endcsname\relax"
8052 write$ newline$
8053 " \def\doi#1{doi:\discretionary{}{}{}#1}\fi \else"
8054 write$ newline$
8055 " \expandafter\ifx\csname doi\endcsname\relax"
8056 write$ newline$
8057 " \def\doi{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi \fi"
8058 write$ newline$
8059 %</plntx>
8060 %</doi>
8061 %<*url-doi&url>
8062 "\providecommand{\doiprefix}{doi: }"
8063 write$ newline$
8064 "\expandafter\ifx\csname href\endcsname\relax"
8065 write$ newline$
8066 " \providecommand{\urldoi}[1]{#1}\else"
8067 write$ newline$
8068 " \providecommand{\urldoi}[1]{\href{https://doi.org/#1}{#1}}\fi"
8069 write$ newline$
8070 %</url-doi&url>
8071 %<*lang>
8072 %<!plntx> "\providecommand{\selectlanguage}[1]{\relax}"
8073 %<*plntx>
8074 "\expandafter\ifx\csname selectlanguage\endcsname\relax"
8075 write$ newline$
8076 " \def\selectlanguage#1{}\fi"
8077 %</plntx>
8078 write$ newline$
8079 %</lang>
8080 %<*!plntx>
8081 %<*babel>
8082 "\input{francaisbst.tex}" write$ newline$
8083 "\newcommand{\Capitalize}[1]{\uppercase{#1}}" write$ newline$
8084 "\newcommand{\capitalize}[1]{\expandafter\Capitalize#1}" write$ newline$
8085 %</babel>
8086 %<*annote>
8087 "\providecommand{\bibAnnoteFile}[1]{%"
8088 write$ newline$
8089 " \IfFileExists{#1}{\begin{quotation}\noindent\textsc{Key:} #1\\"
8090 write$ newline$
8091 " \textsc{Annotation:}\ \input{#1}\end{quotation}}{}}"
8092 write$ newline$
8093 "\providecommand{\bibAnnote}[2]{%"
8094 write$ newline$
8095 " \begin{quotation}\noindent\textsc{Key:} #1\\"
8096 write$ newline$
8097 " \textsc{Annotation:}\ #2\end{quotation}}"
8098 write$ newline$
8099 %</annote>
8100 %</!plntx>
8101 %<*bibinfo>
8102 %<!plntx> "\providecommand{\bibinfo}[2]{#2}"
8103 %<plntx> "\expandafter\ifx\csname bibinfo\endcsname\relax\def\bibinfo#1#2{#2}\fi"
8104 write$ newline$
8105 %</bibinfo>
8106 %<*eprint>
8107 %<!plntx> "\providecommand{\eprint}[2][]{\url{#2}}"
8108 %<plntx> "\expandafter\ifx\csname eprint\endcsname\relax\def\eprint#1{\url{#1}}\fi"
8109 write$ newline$
8110 %</eprint>
8111 }
8112 %</!html>
8113 %<*html>
8114 {
8115 "<html><head><title>Bibliography Listing</title></head>" write$ newline$
8116 "<body>" write$ newline$
8117 "<h2>Bibliography</h2>" write$ newline$
8118 %<htdes>"<dl>" write$ newline$
8119 %<!htdes&htlist>"<ol>" write$ newline$
8120 }
8121 %</html>
8122 % \end{macrocode}
8123 % \end{macro}
8124 %
8125 % \begin{macrocode}
8126 EXECUTE {begin.bib}
8127 % \end{macrocode}
8128 %
8129 % \begin{macrocode}
8130 EXECUTE {init.state.consts}
8131 % \end{macrocode}
8132 %
8133 % \begin{macrocode}
8134 ITERATE {call.type$}
8135 % \end{macrocode}
8136 %
8137 % \begin{macro}{`end.bib'}
8138 % \begin{macrocode}
8139 FUNCTION {end.bib}
8140 { newline$
8141 %<!html> "\end{thebibliography}" write$ newline$
8142 %<html> "</dl></body></html>" write$ newline$
8143 }
8144 % \end{macrocode}
8145 % \end{macro}
8146 %
8147 % \begin{macrocode}
8148 EXECUTE {end.bib}
8149 % \end{macrocode}
8150 %
8151 % \begin{macrocode}
8152 %</!head>
8153 % \end{macrocode}
8154 %
8155 % \begin{macrocode}
8156 %</!options&!driver&!bblbst>
8157 % \end{macrocode}
8158 %
8159 % \section{The File \texttt{francaisbst.tex} for French}
8160 % The following contains the definitions for the \texttt{babel} language
8161 % selection as they apply to French. This file may be extracted with
8162 % \dtx{} and the option \texttt{bblbst}.
8163 % \changes{2.0}{2023-10-28}{La traduction française «cahier de
8164 % recherche» est remplacée par «rapport technique».}
8165 % \changes{2.0}{2023-10-28}{La traduction française «éditeur»
8166 % (éd.) est remplacée par «directeur» («dir.»).}
8167 % \changes{2.0}{2023-10-28}{La traduction française «édité par» est
8168 % remplacée par «sous la direction de».}
8169 % \begin{macrocode}
8170 %<*bblbst>
8171 % This is francaisbst.tex for French.
8172 \def\bbland{et} \def\bbletal{et~collab.}
8173 \def\bbleditors{directeurs} \def\bbleds{dir.}
8174 \def\bbleditor{directeur} \def\bbled{dir.}
8175 \def\bbledby{sous la direction de}
8176 \def\bbledition{\'edition} \def\bbledn{\'ed.}
8177 \def\bblvolume{volume} \def\bblvol{vol.}
8178 \def\bblof{de}
8179 \def\bblnumber{num\'ero} \def\bblno{{\no}}
8180 \def\bblin{dans}
8181 \def\bblpages{pages} \def\bblpp{p.}
8182 \def\bblpage{page} \def\bblp{p.}
8183 \def\bbleidpp{pages}
8184 \def\bblchapter{chaptitre} \def\bblchap{chap.}
8185 \def\bbltechreport{rapport technique}
8186 \def\bbltechrep{rapport technique}
8187 \def\bblmthesis{m\'emoire de ma\^itrise}
8188 \def\bblphdthesis{th\`ese de doctorat}
8189 \def\bblfirst{premi\`ere} \def\bblfirsto{1{\iere}}
8190 \def\bblsecond{seconde} \def\bblsecondo{2{\ieme}}
8191 \def\bblthird{troisi\`eme} \def\bblthirdo{3{\ieme}}
8192 \def\bblfourth{quatri\`eme} \def\bblfourtho{4{\ieme}}
8193 \def\bblfifth{cinqui\`eme} \def\bblfiftho{5{\ieme}}
8194 \def\bblst{{\iere}} \def\bblnd{{\ieme}} \def\bblrd{{\ieme}}
8195 \def\bblth{{\ieme}}
8196 \def\bbljan{janvier} \def\bblfeb{f\'evrier} \def\bblmar{mars}
8197 \def\bblapr{avril} \def\bblmay{mai} \def\bbljun{juin}
8198 \def\bbljul{juillet} \def\bblaug{ao\^ut} \def\bblsep{septembre}
8199 \def\bbloct{octobre} \def\bblnov{novembre} \def\bbldec{d\'ecembre}
8200 %</bblbst>
8201 % \end{macrocode}
8202 %
8203 % \Finale