Debian Codegraph @

texmf-dist/source/latex/amsrefs/amsxport.dtx

raw
1 % \def\filename{amsxport.dtx}
2 % \def\fileversion{2.01}
3 % \def\filedate{2007/10/01}
4 %
5 % \iffalse meta-comment
6 %
7 % American Mathematical Society
8 % Technical Support
9 % Publications Technical Group
10 % 201 Charles Street
11 % Providence, RI 02904
12 % USA
13 % tel: (401) 455-4080
14 % (800) 321-4267 (USA and Canada only)
15 % fax: (401) 331-3842
16 % email: [email protected]
17 %
18 % Copyright 2001, 2004, 2010 American Mathematical Society.
19 %
20 % This work may be distributed and/or modified under the
21 % conditions of the LaTeX Project Public License, either version 1.3c
22 % of this license or (at your option) any later version.
23 % The latest version of this license is in
24 % http://www.latex-project.org/lppl.txt
25 % and version 1.3c or later is part of all distributions of LaTeX
26 % version 2005/12/01 or later.
27 %
28 % This work has the LPPL maintenance status `maintained'.
29 %
30 % The Current Maintainer of this work is the American Mathematical
31 % Society.
32 %
33 % \fi
34 %
35 % \iffalse
36 %<*driver>
37 \NeedsTeXFormat{LaTeX2e}
38 \documentclass[draft,oneside]{amsdtx}[1999/11/01]
39
40 \providecommand{\vn}[1]{\emph{#1}}% variable name
41
42 \renewcommand*\descriptionlabel[1]{\hspace\labelsep
43 \normalfont\bfseries #1:}
44
45 %% Use normal typesize instead of \small for code listings.
46
47 \def\MacroFont{%
48 \fontencoding\encodingdefault
49 \fontfamily\ttdefault
50 \fontseries\mddefault
51 \upshape
52 }
53
54 \makeatletter
55
56 %% Don't prepend \ to macro names.
57
58 \def\SpecialIndex@#1#2{%
59 \@SpecialIndexHelper@#1\@nil
60 \def\@tempb{ }%
61 \ifcat \@tempb\@gtempa
62 \special@index{\quotechar\space\actualchar
63 \string\verb\quotechar*\verbatimchar
64 \quotechar\space\verbatimchar#2}%
65 \else
66 \def\@tempb##1##2\relax{\ifx\relax##2\relax
67 \def\@tempc{\special@index{\quotechar##1\actualchar
68 \string\verb\quotechar*\verbatimchar
69 \quotechar##1\verbatimchar#2}}%
70 \else
71 \def\@tempc{\special@index{##1##2\actualchar
72 \string\verb\quotechar*\verbatimchar
73 ##1##2\verbatimchar#2}}%
74 \fi}%
75 \expandafter\@tempb\@gtempa\relax
76 \@tempc
77 \fi}
78
79 \makeatother
80
81 \PageIndex
82
83 \begin{document}
84 \title{The AMS Export Bib\TeX{} style [\fn{amsxport}]}
85 \author{American Mathematical Society\\Michael Downes\\David M. Jones}
86 \date{Version \fileversion, \filedate}
87 \DocInput{amsxport.dtx}
88 \PrintIndex
89 \end{document}
90 %</driver>
91 % \fi
92 %
93 % \MakeShortVerb{\|}
94 %
95 % \maketitle
96 %
97 % \tableofcontents
98 %
99 % \section{Introduction}
100 %
101 % \bst{amsxport} is the collective name for a collection of
102 % \bibtex/ styles that form a bridge between \BibTeX\ and
103 % \pkg{amsrefs}. It produces output in which the structural
104 % information of the original \bibtex/ database file is
105 % retained. No ad hoc visual formatting is introduced that would
106 % hamper the application of alternative design specifications when
107 % rendering the information on paper or screen. This makes it
108 % possible to have \bibtex/ handle only extraction and sorting and
109 % leave the visual appearance to be controlled entirely by
110 % \latex/. The process of applying typical bibliography specs to
111 % exported data is illustrated in the \pkg{amsrefs} package. The
112 % authoritative description of the export format is in the
113 % \pkg{amsrefs} documentation, inasmuch as interpreting the format
114 % is the chief task of the \pkg{amsrefs} package.
115 %
116 % Each of the five \fn{.bst} files generated from this file
117 % corresponds to a combination of \pkg{amsrefs} package options, as
118 % follows:
119 % \begin{description}
120 %
121 % \item[amsrn]
122 %
123 % This is the default style, used when none of the following is
124 % appropriate.
125 %
126 % \item[amsru]
127 %
128 % This is used when the \opt{citation-order} option is specified.
129 % It is identical to \bst{amsrn} except that the bibliography items
130 % are not sorted.
131 %
132 % \item[amsra]
133 %
134 % This is when with the \opt{alphabetic} option is specified, byt
135 % the \opt{y2k} option is \emph{not} also specified.
136 %
137 % \item[amsry]
138 %
139 % This is used when both the \opt{alphabetic} and \opt{y2k} options
140 % are specified.
141 %
142 % \item[amsrs]
143 %
144 % This is used when the \opt{shortalphabetic} option is specified.
145 %
146 % \end{description}
147 %
148 % Readers may wish to refer also to the standard \bibtex/
149 % documentation (\fn{btxdoc.tex}, \fn{btxhak.tex}, \fn{btxbst.doc})
150 % for background information.
151 %
152 % \StopEventually{}
153 %
154 % \section{Implementation}
155 %
156 % The list below gives the fields that are expected to occur. (Other
157 % fields will be discarded without comment.)
158 % suggested fields.
159 % \begin{macrocode}
160 %<*bst>
161 ENTRY
162 {
163 address institution number status
164 archive isbn organization subtitle
165 author issn pages title
166 booktitle journal part translator
167 chapter key pii type
168 date language preprint url
169 edition meeting publisher volume
170 editor month review xid
171 eprint mrnumber school year
172 howpublished note series
173 }
174 { }
175 { label }
176 % \end{macrocode}
177 %
178 % Some comments about specific fields:
179 % \begin{description}
180 % \item[archive] The archive that holds the eprint listed in the
181 % \fn{eprint} field.
182 % \item[author] \bibtex/ doesn't allow this field (or any field) to be
183 % used more than once, but in the output its contents will be split
184 % into a separate key-value pair for each name. Likewise for
185 % \fn{editor} and \fn{translator}.
186 % \item[crossref] This is a built-in field type, so it doesn't occur in
187 % the argument of ENTRY above.
188 % \item[date] This is a generalization of the \fn{year} and \fn{month}
189 % fields. Its value should be written in ISO 8601 format, e.g.,
190 % 1987-06-05; but the day and month are omissible, so this can be
191 % easily be used instead of the \fn{year} field.
192 % \item[edition] For books. The \bibtex/ documentation suggests that the
193 % value of this field should be an ordinal word such as \qq{Second}.
194 % This may be because the \bibtex/ language provides only the weakest
195 % sort of support for an \emph{is-numeric} test.
196 % \item[eprint] Electronic preprint information such as for
197 % \url{www.arXiv.org}.
198 % \item[institution] What's the difference between an \fn{institution}
199 % and an \fn{organization}? The \bibtex/ documentation says that
200 % \fn{institution} should be used for technical reports and
201 % \fn{organization} for other entry types.
202 % \item[isbn] International Standard Book Number.
203 % \item[issn] International Standard Serial Number. See the discussion
204 % of journal abbreviations.
205 % \item[language] Language of the work. This is especially desirable
206 % when the value of the title field is a translation of the true
207 % title (most often when the original language is one like Arabic or
208 % Chinese that poses rendering problems for non-native software).
209 % \item[meeting] Since \bibtex/ doesn't allow a field name to be the
210 % same as a function name, we have to use \fn{meeting} instead of
211 % \fn{conference} if we want to give the title of a conference in a
212 % dedicated field.
213 % \item[mrnumber] An alias for \fn{review} which we provide because
214 % MathSciNet has been using it in the \bibtex/ output that it
215 % provides for a couple of years already.
216 % \item[organization] See the comment for \fn{institution}.
217 % \item[pii] Publisher Item Identifier
218 % \item[part] This is for a long journal article that is published in
219 % separate issues of the same journal. There should be a separate
220 % \bibtex/ entry for each part (though all the ones after part 1
221 % could crossref the first one).
222 %
223 % \item[preprint] It is not possible quite yet to assume that all
224 % preprints should be classified as eprints. If you have a preprint
225 % that is not an eprint, use this field to give the \qq{address}
226 % where the preprint may be found (institution, preprint number,
227 % etc.).
228 %
229 % \item[review] Review numbers or similar pointers, e.g., for
230 % Mathematical Reviews or Zentralblatt.
231 %
232 % \item[school] The analog of \qq{organization}, for a thesis.
233 %
234 % \item[status] Typically used for notes such as ``to appear'' or ``in
235 % preparation'' with journal articles.
236 %
237 % \item[subtitle] Typically used with a multipart journal article to
238 % give a subtitle for each part.
239 %
240 % \item[translator] This needs no explanation, surely? Except perhaps to
241 % note that the standard \bibtex/ styles don't provide it.
242 %
243 % \item[url] Universal Resource Locator.
244 %
245 % \item[xid] This is used by a cross-referenced item to pass its
246 % identity to child entries that refer to it. It would not be
247 % necessary if \bibtex/ left the \fn{crossref} field value
248 % accessible, but for some reason that I have not found yet (skimming
249 % in the source code) it is cleared internally before there is any
250 % opportunity to save it.
251 %
252 % Practically speaking: For every \fn{crossref} in your \fn{.bib}
253 % files, the target should contain a matching \fn{xid} field.
254 %
255 % \end{description}
256 %
257 % More on extra fields. In the Shelah bibliography, the \fn{author}
258 % field is given without any accents in the author names, and the
259 % normal \tex/ version of the author names is given in a separate
260 % field called \fn{trueauthor}.
261 %
262 % Also, for MR reviews:
263 % \begin{verbatim}
264 % review = {MR 48:3735},
265 %\end{verbatim}
266 % And for each author a country is indicated with the \fn{fromwhere}
267 % field, e.g.,
268 % \begin{verbatim}
269 % fromwhere = {UK, IL},
270 %\end{verbatim}
271 % This means the first author is from the United Kingdom and the
272 % second one from Israel.
273 %
274 % \section{Macros for month names}
275 %
276 % \begin{macrocode}
277 MACRO {jan} {"-01"}
278 MACRO {feb} {"-02"}
279 MACRO {mar} {"-03"}
280 MACRO {apr} {"-04"}
281 MACRO {may} {"-05"}
282 MACRO {jun} {"-06"}
283 MACRO {jul} {"-07"}
284 MACRO {aug} {"-08"}
285 MACRO {sep} {"-09"}
286 MACRO {oct} {"-10"}
287 MACRO {nov} {"-11"}
288 MACRO {dec} {"-12"}
289 % \end{macrocode}
290 %
291 % Some scratch variables and global variables.
292 % \begin{macrocode}
293 STRINGS { p s t l }
294 % \end{macrocode}
295 %
296 % \begin{macrocode}
297 INTEGERS { len ptr }
298 %<bst>
299 % \end{macrocode}
300 %
301 % \begin{footnotesize}\itshape
302 % Note: \bibtex/ 0.99 requires a blank line in certain contexts, such
303 % as after the \fn{READ} command, and will choke if it is missing.
304 % When it is necessary to add a blank line at the boundary of a macro
305 % code section we use a \verb'<bst>' marker.\par
306 % \end{footnotesize}
307 %
308 % Some utility functions.
309 % \begin{macrocode}
310 FUNCTION {NOT} { { #0 } { #1 } if$ }
311
312 FUNCTION {AND} { 'skip$ { pop$ #0 } if$ }
313
314 FUNCTION {OR} { { pop$ #1 } 'skip$ if$ }
315
316 FUNCTION {TRUE} { #1 }
317
318 FUNCTION {FALSE} { #0 }
319 %<bst>
320 % \end{macrocode}
321 %
322 % \begin{macro}{incr.ptr}
323 % \begin{macrocode}
324 FUNCTION {incr.ptr} { ptr #1 + 'ptr := }
325 %<bst>
326 % \end{macrocode}
327 % \end{macro}
328 %
329 % \begin{macro}{current.char}
330 % Returns: first character of STRING
331 % \begin{macrocode}
332 FUNCTION {current.char} { ptr #1 substring$ }
333 % \end{macrocode}
334 % \end{macro}
335 %
336 % \begin{macro}{copy.two.chars}
337 % The function \fn{copy.two.chars} appends the next two characters
338 % from s to STRING.
339 %
340 % Arg: STRING (partial copy of pages string)
341 %
342 % Returns: Modified version of STRING
343 %
344 % Side effects: advances ptr
345 % \begin{macrocode}
346 FUNCTION {copy.two.chars} { t * incr.ptr s current.char * incr.ptr }
347 %<bst>
348 % \end{macrocode}
349 % \end{macro}
350 %
351 % \begin{macro}{is.digit}
352 % \begin{macrocode}
353 FUNCTION {is.digit} {
354 chr.to.int$
355 duplicate$
356 "0" chr.to.int$ #1 - >
357 swap$
358 "9" chr.to.int$ #1 + <
359 AND
360 }
361 %<bst>
362 % \end{macrocode}
363 % \end{macro}
364 %
365 % \begin{macro}{is.lowercase.letter}
366 % In a previous implementation the \fn{is.letter} function first
367 % lowercased the character using \verb'change.case$', then tested it
368 % against the range a--z. But \verb'change.case$' issues a warning if
369 % it is applied to a lone brace character.
370 % \begin{macrocode}
371 FUNCTION {is.lowercase.letter} {
372 chr.to.int$ duplicate$
373 "a" chr.to.int$ #1 - >
374 swap$
375 "z" chr.to.int$ #1 + <
376 AND
377 }
378 % \end{macrocode}
379 % \end{macro}
380 %
381 % \begin{macro}{is.uppercase.letter}
382 % \begin{macrocode}
383 FUNCTION {is.uppercase.letter} {
384 chr.to.int$ duplicate$
385 "A" chr.to.int$ #1 - >
386 swap$
387 "Z" chr.to.int$ #1 + <
388 AND
389 }
390 % \end{macrocode}
391 % \end{macro}
392 %
393 % \begin{macro}{is.letter}
394 % \begin{macrocode}
395 FUNCTION {is.letter} {
396 duplicate$
397 is.lowercase.letter
398 { pop$ TRUE }
399 { is.uppercase.letter }
400 if$
401 }
402 % \end{macrocode}
403 % \end{macro}
404 %
405 % \begin{macro}{skip.accent}
406 % This implementation of \fn{skip.accent} simply skips ahead one
407 % character whenever a backslash is found. This handles things like
408 % \verb'\v', \verb'\u', \verb'\k', \verb'\r'. Although this is overly
409 % simplistic it is still an improvement over the previous method
410 % which was to not even make the attempt. [mjd,2001-10-27]
411 % \begin{macrocode}
412 FUNCTION {skip.accent} { pop$ incr.ptr }
413 % \end{macrocode}
414 % \end{macro}
415 %
416 % \begin{macro}{strip.label}
417 % \begin{macrocode}
418 FUNCTION {strip.label} {
419 's :=
420 #1 'ptr :=
421 ""
422 { s ptr #1 substring$ duplicate$ empty$ NOT }
423 { duplicate$ is.letter
424 { * }
425 { duplicate$ "\" =
426 { skip.accent }
427 'pop$
428 if$
429 }
430 if$
431 incr.ptr
432 }
433 while$
434 % \end{macrocode}
435 % When the loop ends we have an extra empty-string on top of the
436 % stack to get rid of.
437 % \begin{macrocode}
438 pop$
439 }
440 % \end{macrocode}
441 % \end{macro}
442 %
443 % \begin{macro}{sortify}
444 % \begin{macrocode}
445 FUNCTION {sortify} {
446 purify$
447 "l" change.case$
448 }
449 % \end{macrocode}
450 % \end{macro}
451 %
452 % \begin{macro}{lpad}
453 % Warning: The use of |text.length$| here restricts \fn{lpad}'s use
454 % to strings that we know do not contain any special characters.
455 % Since we only use it for field names, this is ok.
456 %
457 % \<string> \<int> \fn{lpad}
458 % \begin{macrocode}
459 FUNCTION {lpad} {
460 swap$
461 'l :=
462 l text.length$ - 'len :=
463 { len #0 > }
464 {
465 " " l * 'l :=
466 len #1 - 'len :=
467 }
468 while$
469 l
470 }
471 % \end{macrocode}
472 % \end{macro}
473 %
474 % \begin{macro}{field.or.null}
475 % \begin{macrocode}
476 FUNCTION {field.or.null} {
477 duplicate$ empty$
478 { pop$ "" }
479 'skip$
480 if$
481 }
482 % \end{macrocode}
483 % \end{macro}
484 %
485 % \begin{macro}{missing.or.empty}
486 % \begin{macrocode}
487 FUNCTION {missing.or.empty} { duplicate$ missing$ swap$ empty$ OR }
488 %<bst>
489 % \end{macrocode}
490 % \end{macro}
491 %
492 % \begin{macro}{append.ndash.and.skip.hyphens}
493 % The function \fn{append.ndash.and.skip.hyphens} adds \verb'\ndash'
494 % to STRING when a hyphen is found and advances ptr to the next
495 % non-hyphen character in \fn{s}.
496 %
497 % Arg: STRING (partial copy of pages string)
498 %
499 % Returns: modified version of STRING
500 %
501 % Side effects: advances ptr
502 % \begin{macrocode}
503 FUNCTION {append.ndash.and.skip.hyphens} {
504 "\ndash " *
505 incr.ptr
506 { s current.char "-" = }
507 { incr.ptr }
508 while$
509 }
510 % \end{macrocode}
511 % \end{macro}
512 %
513 % \begin{macro}{n.dashify}
514 % In the \fn{n.dashify} function we store the given string in \fn{s},
515 % push an empty string on the stack, and start examining the
516 % characters of \fn{s}. For a non-hyphen character, we just append a
517 % copy of it to the top string. For a hyphen, we append \cs{ndash} to
518 % the top string and advance the pointer until we reach a non-hyphen
519 % character. And there is one more exceptional case: for a backslash,
520 % we copy two characters instead of one. This keeps us from
521 % erroneously translating \verb'\-' to \verb'\\ndash'. One would
522 % scarcely expect to see an instance of \verb'\-' in a page number
523 % field but let's face it, in actual use nearly anything can and does
524 % happen.
525 %
526 % Arg: STRING (value of \fn{pages} field)
527 %
528 % Returns: STRING (dashified version of input string)
529 % \begin{macrocode}
530 FUNCTION {n.dashify} {
531 's :=
532 #1 'ptr :=
533 ""
534 { s current.char 't := t "" = NOT }
535 { t "\" =
536 { copy.two.chars }
537 { t "-" =
538 { append.ndash.and.skip.hyphens }
539 { t * incr.ptr }
540 if$
541 }
542 if$
543 }
544 while$
545 }
546 % \end{macrocode}
547 % \end{macro}
548 %
549 % \begin{macro}{missing.warning}
550 % Standard warning message for a missing or empty field. For the user
551 % we call any such field `missing' without respect to the distinction
552 % made by \bibtex/ between missing and empty.
553 % \begin{macrocode}
554 FUNCTION {missing.warning} {
555 "missing " swap$ * " in " * cite$ * warning$
556 }
557 %<bst>
558 % \end{macrocode}
559 % \end{macro}
560 %
561 % \begin{macro}{string.length}
562 % Because \bibtex/ doesn't provide a straightforward
563 % \fn{string.length} function (\verb'text.length$' counts ``special
564 % characters'' as a single character), it appears necessary to
565 % implement one the hard way.
566 % \begin{macrocode}
567 INTEGERS { string.ptr }
568
569 FUNCTION {string.length} {
570 #1 'string.ptr :=
571 { duplicate$ string.ptr #1 substring$ "" = 'FALSE 'TRUE if$ }
572 { string.ptr #1 + 'string.ptr := }
573 while$
574 pop$
575 string.ptr #1 -
576 }
577 % \end{macrocode}
578 % \end{macro}
579 %
580 % \begin{macro}{format.title}
581 % \begin{macrocode}
582 FUNCTION {format.title}{
583 duplicate$
584 missing.or.empty
585 { pop$ "" }
586 { "t" change.case$ }
587 if$
588 }
589 % \end{macrocode}
590 % \end{macro}
591 %
592 % \begin{macro}{start.field}
593 % \begin{macrocode}
594 FUNCTION {start.field} {
595 #12 lpad "={" * write$
596 }
597 % \end{macrocode}
598 % \end{macro}
599 %
600 % \begin{macro}{fin.field}
601 % \begin{macrocode}
602 FUNCTION {fin.field} { "}," write$ newline$ }
603 %<bst>
604 % \end{macrocode}
605 % \end{macro}
606 %
607 % \begin{macro}{write.field}
608 % \begin{macrocode}
609 FUNCTION {write.field} {
610 duplicate$
611 missing$
612 { pop$ missing.warning }
613 { duplicate$ empty$
614 { pop$ missing.warning }
615 { swap$ start.field write$ fin.field }
616 if$
617 }
618 if$
619 }
620 % \end{macrocode}
621 % \end{macro}
622 %
623 % \begin{macro}{optional.field}
624 % \begin{macrocode}
625 FUNCTION {optional.field} {
626 duplicate$
627 missing.or.empty
628 { pop$ pop$ }
629 { swap$ start.field write$ fin.field }
630 if$
631 }
632 % \end{macrocode}
633 % \end{macro}
634 %
635 % \begin{macro}{optional.title.field}
636 % \begin{macrocode}
637 FUNCTION {optional.title.field} {
638 duplicate$
639 missing.or.empty
640 { pop$ pop$ }
641 { format.title swap$ start.field write$ fin.field }
642 if$
643 }
644 % \end{macrocode}
645 % \end{macro}
646 %
647 % \begin{macro}{optional.pages.field}
648 % \begin{macrocode}
649 FUNCTION {optional.pages.field} {
650 duplicate$
651 missing.or.empty
652 { pop$ pop$ }
653 { swap$ start.field
654 n.dashify
655 write$ fin.field
656 }
657 if$
658 }
659 % \end{macrocode}
660 % \end{macro}
661 %
662 % \begin{macro}{optional.mr.field}
663 % \begin{macrocode}
664 FUNCTION {optional.mr.field} {
665 duplicate$
666 missing.or.empty
667 { pop$ pop$ }
668 {
669 swap$ start.field
670 "\MR{" swap$ * "}" * write$ fin.field
671 }
672 if$
673 }
674 % \end{macrocode}
675 % \end{macro}
676 %
677 % \begin{macro}{remove.ordinal.suffix}
678 % \begin{macrocode}
679 FUNCTION {remove.ordinal.suffix} {
680 's :=
681 s string.length 'len :=
682 #1 'ptr :=
683 { ptr len < s ptr #1 substring$ is.digit AND }
684 'incr.ptr
685 while$
686 s ptr global.max$ substring$ 'p :=
687 p "st" =
688 { TRUE }
689 { p "nd" =
690 { TRUE }
691 { p "rd" =
692 { TRUE }
693 { p "th" =
694 { TRUE }
695 { FALSE }
696 if$
697 }
698 if$
699 }
700 if$
701 }
702 if$
703 { s #1 ptr #1 - substring$ }
704 { s }
705 if$
706 }
707 % \end{macrocode}
708 % \end{macro}
709 %
710 % \begin{macro}{optional.edition.field}
711 % \begin{macrocode}
712 FUNCTION {optional.edition.field} {
713 duplicate$ missing.or.empty
714 { pop$ pop$ }
715 { swap$ start.field
716 remove.ordinal.suffix
717 write$ fin.field
718 }
719 if$
720 }
721 % \end{macrocode}
722 % \end{macro}
723 %
724 % \section{Formatting author names and editor names}
725 %
726 % Take a name list in \bibtex/ form (names separated by the word
727 % \qq{and}) and output the desired form of each name.
728 % \begin{macrocode}
729 INTEGERS { nameptr numnames namesleft }
730 STRINGS { namelist fieldname }
731 % \end{macrocode}
732 %
733 % \begin{macro}{format.name}
734 % The \fn{format.name} function operates on a single name, producing
735 % a string of the form
736 % \begin{verbatim}
737 % von Last, First, Jr.
738 %\end{verbatim}
739 %
740 % Args: \vn{namelist}, \vn{index} (top; integer)
741 %
742 % Returns: formatted version of the $n$th name in \vn{namelist} where
743 % integer \vn{index} specifies $n$.
744 % \begin{macrocode}
745 FUNCTION {format.name} { "{vv~}{ll}{, ff}{, jj}" format.name$ }
746 %<bst>
747 % \end{macrocode}
748 % \end{macro}
749 %
750 % \begin{macro}{optional.name.field}
751 % The function \fn{optional.name.field} handles the task of splitting
752 % a multiple-name field value into multiple fields with single
753 % values.
754 %
755 % Args: \vn{fieldname}, \vn{namelist} (top)
756 %
757 % Side effects: writes a key/value pair to the output file for each
758 % name in \vn{namelist}.
759 % \begin{macrocode}
760 FUNCTION {optional.name.field}{
761 duplicate$ missing.or.empty
762 { pop$ pop$ }
763 { swap$ 'fieldname :=
764 duplicate$ num.names$
765 'namesleft :=
766 #1 'ptr :=
767 { namesleft #0 > }
768 { fieldname start.field
769 % \end{macrocode}
770 % Copy the name string before running \fn{format.name} on it.
771 % \begin{macrocode}
772 duplicate$ ptr format.name write$
773 fin.field
774 ptr #1 + 'ptr :=
775 namesleft #1 - 'namesleft :=
776 }
777 while$
778 % \end{macrocode}
779 % At this point we have an extra copy of the name string on the
780 % stack.
781 % \begin{macrocode}
782 pop$
783 }
784 if$
785 }
786 % \end{macrocode}
787 % \end{macro}
788 %
789 % \section{Handling year, month, date}
790 %
791 % \begin{macro}{assemble.date.field}
792 % In the output we produce a \fn{date} field instead of the year and
793 % month fields normally used in \bibtex/ files. In the date field we
794 % use ISO date notation (e.g., 1987-06-05) to facilitate switching
795 % between full and abbreviated month names. The month and day parts
796 % are frequently absent, making the date field equivalent to a year
797 % field.
798 % \begin{macrocode}
799 FUNCTION {assemble.date.field}
800 { date missing$
801 { year missing.or.empty
802 { status missing.or.empty
803 { "No year or other date information for "
804 cite$ * warning$ }
805 'skip$
806 if$
807 "status"
808 }
809 { year month missing$ { "" } { month } if$ * }
810 if$
811 }
812 { date }
813 if$
814 % \end{macrocode}
815 % If the date string is now equal to \qq{status}, it means that we
816 % have a status field or we already gave a warning about lack of date
817 % info; in either case omit the date field.
818 % \begin{macrocode}
819 duplicate$ "status" =
820 { pop$ pop$ }
821 { swap$ start.field write$ fin.field }
822 if$
823 }
824 % \end{macrocode}
825 % \end{macro}
826 %
827 % \section{Journal abbreviations}
828 %
829 % Use of journal abbreviations is recommended to make supplying ISSN
830 % numbers easier. To use this feature, you need a STRING definition
831 % of the form
832 % \begin{verbatim}
833 % @STRING{cpam="cpam/0010-3640/"
834 % #"Communications in Pure and Applied Mathematics"}
835 %\end{verbatim}
836 % Then when you write
837 % \begin{verbatim}
838 % journal=cpam,
839 %\end{verbatim}
840 % exporting with \fn{amsxport} will produce
841 % \begin{verbatim}
842 % journal={cpam},
843 % ISSN={0010-3640},
844 %\end{verbatim}
845 % The text before the ISSN number in the STRING definition is
846 % preferably a repetition of the abbreviation name (leaving expansion
847 % to be done on the \latex/ side); or it could be the full journal
848 % name.
849 %
850 % \textbf{Warning:} If you include braces and write
851 % \verb'journal={cpam},' \bibtex/ will not expand the abbreviation
852 % but leave it as the field value; and then you will not get
853 % automatic lookup of the ISSN number.
854 %
855 % \begin{macro}{optional.journal.field}
856 % \begin{macrocode}
857 FUNCTION {optional.journal.field} {
858 duplicate$ missing.or.empty
859 { pop$ pop$ }
860 {
861 's :=
862 start.field
863 #1 'ptr :=
864 s current.char is.lowercase.letter
865 {
866 s "/" * 's :=
867 { s ptr #1 substring$ "/" = NOT }
868 { incr.ptr }
869 while$
870 % \end{macrocode}
871 % Journal name started with a lowercase letter, but we couldn't find
872 % no slash? All right, just let it go through as it is.
873 % \begin{macrocode}
874 s ptr #1 + #1 substring$ empty$
875 { s #1 ptr #1 - substring$ }
876 % \end{macrocode}
877 % But if we did find a slash, then we probably have found us an ISSN
878 % number that we can write out.
879 % \begin{macrocode}
880 {
881 s #1 ptr #1 - substring$
882 write$
883 fin.field
884 % \end{macrocode}
885 % ISSNs are always nine characters in length (four digits, hyphen,
886 % four digits).
887 % \begin{macrocode}
888 "ISSN" start.field
889 s ptr #1 + #9 substring$
890 }
891 if$
892 }
893 { s }
894 if$
895 write$
896 fin.field
897 }
898 if$
899 }
900 % \end{macrocode}
901 % \end{macro}
902 %
903 % \section{Type info}
904 %
905 % \begin{macro}{optional.type.field}
906 % Putz around with the type info a little, for theses mainly. Two
907 % types here: the type field, and the entry type.
908 % \begin{macrocode}
909 FUNCTION {optional.type.field}
910 { duplicate$ missing.or.empty
911 { type$ "mastersthesis" = { "Master's Thesis" }
912 { type$ "phdthesis" = { "Ph.D. Thesis" }
913 { "" } if$ } if$
914 swap$ pop$
915 }
916 'skip$
917 if$
918 duplicate$ empty$
919 { pop$ pop$ }
920 { swap$ start.field write$ fin.field }
921 if$
922 }
923 % \end{macrocode}
924 % \end{macro}
925 %
926 % \section{Miscellaneous tail-end information}
927 %
928 % \begin{macro}{url.note.status.review}
929 % The following items are common to all entry types are output at
930 % the tail end of the entry.
931 % \begin{macrocode}
932 FUNCTION {url.note.status.review} {
933 "url" url optional.field
934 "note" note optional.field
935 "status" status optional.field
936 % \end{macrocode}
937 % The \fn{review} field should perhaps be translated into multiple
938 % fields like author names, if more than one review is given.
939 % \begin{macrocode}
940 "review" review optional.field
941 % \end{macrocode}
942 % Data from MathSciNet will have the Math Reviews number in an
943 % mrnumber field. We assume that a given entry will have a review
944 % field or an mrnumber field but not both.
945 % \begin{macrocode}
946 "review" mrnumber optional.mr.field
947 }
948 % \end{macrocode}
949 % \end{macro}
950 %
951 % \section{Wrapper for each entry}
952 %
953 % \begin{macro}{start.entry}
954 % \begin{macrocode}
955 FUNCTION {start.entry} {
956 newline$
957 "\bib{" cite$ * "}{" *
958 % \end{macrocode}
959 % Merge Master's thesis and Ph.D. thesis into a single type.
960 % \begin{macrocode}
961 type$ "mastersthesis" = type$ "phdthesis" = OR
962 { "thesis" }
963 { type$ }
964 if$
965 * "}{" * write$
966 newline$
967 %<*debug>
968 "sort.label" label sortify optional.field
969 "sort.key" sort.key$ optional.field
970 %</debug>
971 }
972 % \end{macrocode}
973 % \end{macro}
974 %
975 % \begin{macro}{fin.entry}
976 % \begin{macrocode}
977 FUNCTION {fin.entry} {
978 "}" write$
979 newline$
980 }
981 % \end{macrocode}
982 % \end{macro}
983 %
984 % \section{Entry types}
985 %
986 % Here are the types of entries that are normally allowed in a
987 % \bibtex/ file:
988 % \begin{description}
989 %
990 % \item[book] A book with an explicit publisher.
991 %
992 % \item[booklet] A work that is printed and bound, but without a named
993 % publisher or sponsoring institution.
994 %
995 % \item[inbook] A part of a book, which may be a chapter (or section or
996 % whatever) and/or a range of pages.
997 %
998 % \item[incollection] A part of a book having its own title.
999 %
1000 % \item[manual] Technical documentation.
1001 %
1002 % \item[mastersthesis] A Master's thesis.
1003 %
1004 % \item[phdthesis] A PhD thesis.
1005 %
1006 % \item[proceedings] The proceedings of a conference.
1007 %
1008 % \item[techreport] A report published by a school or other institution,
1009 % usually numbered within a series.
1010 %
1011 % \item[article] An article from a journal or magazine.
1012 %
1013 % \item[inproceedings] An article in a conference proceedings.
1014 %
1015 % \item[conference] An alias for \fn{inproceedings}.
1016 %
1017 % \item[unpublished] A document having an author and title, but not
1018 % formally published.
1019 %
1020 % \item[misc] Use this type when nothing else fits.
1021 %
1022 % \end{description}
1023 %
1024 % \begin{macro}{article}
1025 % A journal article differs from an inproceedings article by not
1026 % having booktitle, publisher, editor, and other such info.
1027 % \begin{macrocode}
1028 FUNCTION {article} {
1029 start.entry
1030 "author" author optional.name.field
1031 "translator" translator optional.name.field
1032 "title" title format.title write.field
1033 "subtitle" subtitle optional.title.field
1034 "language" language optional.field
1035 "organization" organization optional.field
1036 "how" howpublished optional.field
1037 % \end{macrocode}
1038 % Construct a date value from date, year, month fields
1039 % \begin{macrocode}
1040 "date" assemble.date.field
1041 "ISSN" issn optional.field
1042 "journal" journal optional.journal.field
1043 "volume" volume optional.field
1044 "number" number optional.field
1045 "pages" pages optional.pages.field
1046 "PII" pii optional.field
1047 "archive" archive optional.field
1048 "eprint" eprint optional.field
1049 "preprint" preprint optional.field
1050 url.note.status.review
1051 fin.entry
1052 }
1053 % \end{macrocode}
1054 % \end{macro}
1055 %
1056 % \begin{macro}{inproceedings}
1057 % An inproceedings entry may have xid, booktitle, meeting, publisher
1058 % info; it is not expected to have journal, eprint, or preprint info.
1059 % \begin{macrocode}
1060 FUNCTION {inproceedings} {
1061 start.entry
1062 "author" author optional.name.field
1063 "translator" translator optional.name.field
1064 "title" title format.title write.field
1065 "subtitle" subtitle optional.title.field
1066 "language" language optional.field
1067 "organization" organization optional.field
1068 "how" howpublished optional.field
1069 % \end{macrocode}
1070 % Construct a date value from date, year, month fields
1071 % \begin{macrocode}
1072 "date" assemble.date.field
1073 "xid" xid optional.field
1074 % \end{macrocode}
1075 % The following fields might be inherited from the parent of an
1076 % article in a proceedings volume or collection.
1077 % \begin{macrocode}
1078 "conference" meeting optional.field
1079 "booktitle" booktitle optional.title.field
1080 % \end{macrocode}
1081 % Include the edition in case this is an inbook entry.
1082 % \begin{macrocode}
1083 "edition" edition optional.edition.field
1084 "editor" editor optional.name.field
1085 "series" series optional.field
1086 "volume" volume optional.field
1087 "publisher" publisher optional.field
1088 "address" address optional.field
1089 "pages" pages optional.pages.field
1090 url.note.status.review
1091 fin.entry
1092 }
1093 % \end{macrocode}
1094 % \end{macro}
1095 %
1096 % \begin{macro}{inbook}
1097 % \begin{macrocode}
1098 FUNCTION {inbook} { inproceedings }
1099 % \end{macrocode}
1100 % \end{macro}
1101 %
1102 % \begin{macro}{incollection}
1103 % \begin{macrocode}
1104 FUNCTION {incollection} { inproceedings }
1105 % \end{macrocode}
1106 % \end{macro}
1107 %
1108 % \begin{macro}{inproceedings}
1109 % \begin{macrocode}
1110 FUNCTION {conference} { inproceedings }
1111 % \end{macrocode}
1112 % \end{macro}
1113 %
1114 % \begin{macro}{book}
1115 % The book type includes a meeting field because otherwise we'd have
1116 % to repeat the entire definition for the proceedings type with that
1117 % as the sole difference.
1118 % \begin{macrocode}
1119 FUNCTION {book} {
1120 start.entry
1121 "author" author optional.name.field
1122 "editor" editor optional.name.field
1123 "translator" translator optional.name.field
1124 "title" title missing$ { booktitle } { title } if$
1125 format.title write.field
1126 "subtitle" subtitle optional.title.field
1127 "type" type optional.type.field
1128 "language" language optional.field
1129 "conference" meeting optional.field
1130 "edition" edition optional.edition.field
1131 "series" series optional.field
1132 "publisher" publisher optional.field
1133 organization missing.or.empty
1134 { "institution" institution optional.field }
1135 { "organization" organization optional.field }
1136 if$
1137 "address" address optional.field
1138 "how" howpublished optional.field
1139 "date" year write.field
1140 "volume" volume optional.field
1141 % \end{macrocode}
1142 % The number here is intended for a tech report.
1143 % \begin{macrocode}
1144 "number" number optional.field
1145 "ISBN" isbn optional.field
1146 url.note.status.review
1147 fin.entry
1148 }
1149 % \end{macrocode}
1150 % \end{macro}
1151 %
1152 % \begin{macro}{booklet}
1153 % \begin{macrocode}{booklet}
1154 FUNCTION {booklet} { book }
1155 % \end{macrocode}
1156 % \end{macro}
1157 %
1158 % \begin{macro}{manual}
1159 % \begin{macrocode}
1160 FUNCTION {manual} { book }
1161 % \end{macrocode}
1162 % \end{macro}
1163 %
1164 % \begin{macro}{mastersthesis}
1165 % \begin{macrocode}
1166 FUNCTION {mastersthesis} { book }
1167
1168 FUNCTION {phdthesis} { book }
1169
1170 FUNCTION {proceedings} { book }
1171
1172 FUNCTION {collection} { book }
1173
1174 FUNCTION {techreport} { book }
1175
1176 FUNCTION {unpublished} { book }
1177
1178 FUNCTION {misc} { book }
1179
1180 FUNCTION {default.type} { misc }
1181 %<bst>
1182 % \end{macrocode}
1183 % \end{macro}
1184 %
1185 % \bibtex/ 0.99 keels over if READ does not have a blank line after
1186 % it.
1187 % \begin{macrocode}
1188 %<bst>
1189 READ
1190 %<bst>
1191 % \end{macrocode}
1192 %
1193 % \section{Sorting the entries}
1194 %
1195 % Since the final labels will be produced by the \pkg{amsrefs}
1196 % package, we don't need to worry about generating suffixes to
1197 % disambiguate between equal stems. All we have to do is strive to
1198 % generate stems that are identical to the ones that \pkg{amsrefs}
1199 % will generate, so that \bst{amsxport} will sort its output in a
1200 % fashion that will be consistent with the labels.
1201 %
1202 % Overall, this simplifies our job, since we don't have to keep
1203 % track of duplicate labels, so we can process each entry in
1204 % isolation. However, we do have to be more careful about the
1205 % handling of text accents and text symbols in order to maintain
1206 % compatibility with \pkg{amsrefs}.
1207 %
1208 % See (\emph{inter alia}) the sections ``Lexical structure of
1209 % names'' and ``Generating alphabetic lables'' in the
1210 % \pkg{amsrefs} implementation documentation for more information.
1211 %
1212 % \begin{macrocode}
1213 %<*sort>
1214 % \end{macrocode}
1215 %
1216 % \begin{macro}{chop.word}
1217 % \begin{macrocode}
1218 FUNCTION {chop.word} {
1219 's :=
1220 'len :=
1221 s #1 len substring$ =
1222 { s len #1 + global.max$ substring$ }
1223 's
1224 if$
1225 }
1226 % \end{macrocode}
1227 % \end{macro}
1228 %
1229 % \begin{macro}{sort.format.title}
1230 % \begin{macrocode}
1231 FUNCTION {sort.format.title} {
1232 't :=
1233 "A " #2
1234 "An " #3
1235 "The " #4 t chop.word
1236 chop.word
1237 chop.word
1238 sortify
1239 #1 global.max$ substring$
1240 }
1241 % \end{macrocode}
1242 % \end{macro}
1243 %
1244 % \begin{macro}{format.lab.names}
1245 % \begin{macrocode}
1246 %<*alpha|short>
1247 FUNCTION {format.lab.names} {
1248 's :=
1249 s num.names$ 'numnames :=
1250 numnames #1 >
1251 { numnames #4 >
1252 { #3 'namesleft := }
1253 { numnames 'namesleft := }
1254 if$
1255 #1 'nameptr :=
1256 ""
1257 { namesleft #0 > }
1258 { nameptr numnames =
1259 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1260 { "{\etalchar{+}}" * }
1261 { s nameptr "{v{}}{l{}}" format.name$ * }
1262 if$
1263 }
1264 { s nameptr "{v{}}{l{}}" format.name$ * }
1265 if$
1266 nameptr #1 + 'nameptr :=
1267 namesleft #1 - 'namesleft :=
1268 }
1269 while$
1270 numnames #4 >
1271 { "{\etalchar{+}}" * }
1272 'skip$
1273 if$
1274 }
1275 { s #1 "{v{}}{l{}}" format.name$
1276 duplicate$ text.length$ #2 <
1277 %<alpha> { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1278 %<short> { pop$ s #1 "{ll}" format.name$ #1 text.prefix$ }
1279 'skip$
1280 if$
1281 }
1282 if$
1283 }
1284
1285 FUNCTION {author.key.label}
1286 { author empty$
1287 { key empty$
1288 { cite$ #1 #3 substring$ }
1289 { key #3 text.prefix$ }
1290 if$
1291 }
1292 { author format.lab.names }
1293 if$
1294 }
1295
1296 FUNCTION {author.editor.key.label}
1297 { author empty$
1298 { editor empty$
1299 { key empty$
1300 { cite$ #1 #3 substring$ }
1301 { key #3 text.prefix$ }
1302 if$
1303 }
1304 { editor format.lab.names }
1305 if$
1306 }
1307 { author format.lab.names }
1308 if$
1309 }
1310
1311 FUNCTION {author.key.organization.label}
1312 { author empty$
1313 { key empty$
1314 { organization empty$
1315 { cite$ #1 #3 substring$ }
1316 { "The " #4 organization chop.word #3 text.prefix$ }
1317 if$
1318 }
1319 { key #3 text.prefix$ }
1320 if$
1321 }
1322 { author format.lab.names }
1323 if$
1324 }
1325
1326 FUNCTION {editor.key.organization.label}
1327 { editor empty$
1328 { key empty$
1329 { organization empty$
1330 { cite$ #1 #3 substring$ }
1331 { "The " #4 organization chop.word #3 text.prefix$ }
1332 if$
1333 }
1334 { key #3 text.prefix$ }
1335 if$
1336 }
1337 { editor format.lab.names }
1338 if$
1339 }
1340
1341 FUNCTION {calc.label}{
1342 type$ "book" = type$ "inbook" = OR
1343 'author.editor.key.label
1344 { type$ "proceedings" =
1345 'editor.key.organization.label
1346 { type$ "manual" =
1347 'author.key.organization.label
1348 'author.key.label
1349 if$
1350 }
1351 if$
1352 }
1353 if$
1354 strip.label
1355 sortify
1356 %<*alpha>
1357 year field.or.null
1358 %<!y2k> #3 #8 substring$
1359 purify$ *
1360 %</alpha>
1361 'label :=
1362 }
1363 %</alpha|short>
1364 % \end{macrocode}
1365 % \end{macro}
1366 %
1367 % \begin{macro}{sort.format.names}
1368 % \begin{macrocode}
1369 FUNCTION {sort.format.names} {
1370 's :=
1371 #1 'ptr :=
1372 ""
1373 s num.names$ 'numnames :=
1374 numnames 'namesleft :=
1375 { namesleft #0 > }
1376 { ptr #1 >
1377 { " " * }
1378 'skip$
1379 if$
1380 s ptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1381 ptr numnames = t "others" = AND
1382 { "et al" }
1383 { t sortify }
1384 if$
1385 *
1386 ptr #1 + 'ptr :=
1387 namesleft #1 - 'namesleft :=
1388 }
1389 while$
1390 }
1391 % \end{macrocode}
1392 % \end{macro}
1393 %
1394 % \begin{macro}{sort.warning}
1395 % \begin{macrocode}
1396 FUNCTION {sort.warning} {
1397 "to sort, need " swap$ * " or key in " * cite$ * warning$
1398 }
1399 % \end{macrocode}
1400 % \end{macro}
1401 %
1402 % \begin{macro}{author.sort}
1403 % \begin{macrocode}
1404 FUNCTION {author.sort}
1405 { author empty$
1406 { key empty$
1407 { "author" sort.warning
1408 ""
1409 }
1410 { key sortify }
1411 if$
1412 }
1413 { author sort.format.names }
1414 if$
1415 }
1416 % \end{macrocode}
1417 % \end{macro}
1418 %
1419 % \begin{macro}{author.editor.sort}
1420 % \begin{macrocode}
1421 FUNCTION {author.editor.sort}
1422 { author empty$
1423 { editor empty$
1424 { key empty$
1425 { "author, editor," sort.warning
1426 ""
1427 }
1428 { key sortify }
1429 if$
1430 }
1431 { editor sort.format.names }
1432 if$
1433 }
1434 { author sort.format.names }
1435 if$
1436 }
1437 % \end{macrocode}
1438 % \end{macro}
1439 %
1440 % \begin{macro}{author.organization.sort}
1441 % \begin{macrocode}
1442 FUNCTION {author.organization.sort}
1443 { author empty$
1444 { organization empty$
1445 { key empty$
1446 { "author, organization," sort.warning
1447 ""
1448 }
1449 { key sortify }
1450 if$
1451 }
1452 { "The " #4 organization chop.word sortify }
1453 if$
1454 }
1455 { author sort.format.names }
1456 if$
1457 }
1458 % \end{macrocode}
1459 % \end{macro}
1460 %
1461 % \begin{macro}{editor.organization.sort}
1462 % \begin{macrocode}
1463 FUNCTION {editor.organization.sort}
1464 { editor empty$
1465 { organization empty$
1466 { key empty$
1467 { "editor, organization," sort.warning
1468 ""
1469 }
1470 { key sortify }
1471 if$
1472 }
1473 { "The " #4 organization chop.word sortify }
1474 if$
1475 }
1476 { editor sort.format.names }
1477 if$
1478 }
1479 % \end{macrocode}
1480 % \end{macro}
1481 %
1482 % \begin{macro}{presort}
1483 % \begin{macrocode}
1484 FUNCTION {presort} {
1485 %<*alpha|short>
1486 calc.label
1487 label
1488 %</alpha|short>
1489 type$ "book" = type$ "inbook" = OR type$ "collection" = OR
1490 'author.editor.sort
1491 { type$ "proceedings" =
1492 'editor.organization.sort
1493 { type$ "manual" =
1494 'author.organization.sort
1495 'author.sort
1496 if$
1497 }
1498 if$
1499 }
1500 if$
1501 %<alpha|short> *
1502 " " *
1503 %<!alpha|short> year field.or.null sortify * " " *
1504 title field.or.null sort.format.title *
1505 #1 entry.max$ substring$
1506 'sort.key$ :=
1507 }
1508 % \end{macrocode}
1509 % \end{macro}
1510 %
1511 % \begin{macrocode}
1512 ITERATE {presort}
1513
1514 SORT
1515 % \end{macrocode}
1516 %
1517 % \begin{macrocode}
1518 %</sort>
1519 % \end{macrocode}
1520 %
1521 % \section{Final pass for output}
1522 %
1523 % \begin{macro}{write.with.newlines}
1524 % The \fn{write.with.newlines} functions stores a string in \fn{s}
1525 % and runs through it looking for occurrences of \verb'^^M'; when one
1526 % is found, the substring before it is written out with a newline,
1527 % the remainder is left in \fn{s}, and the cycle begins again.
1528 % \begin{macrocode}
1529 FUNCTION {write.with.newlines}
1530 { 's := #1 'ptr :=
1531 { s ptr #2 + #1 substring$ "" = NOT }
1532 { s ptr #3 substring$ "^^M" =
1533 { s #1 ptr #1 - substring$ write$ newline$
1534 ptr #3 + 'ptr :=
1535 s ptr global.max$ substring$ 's :=
1536 #1 'ptr :=
1537 }
1538 { incr.ptr }
1539 if$
1540 }
1541 while$
1542 s write$ newline$
1543 }
1544 % \end{macrocode}
1545 % \end{macro}
1546 %
1547 % \begin{macro}{begin.bin}
1548 % \begin{macrocode}
1549 FUNCTION {begin.bib} {
1550 preamble$ empty$
1551 'skip$
1552 { preamble$ write.with.newlines }
1553 if$
1554 "% \bib, bibdiv, biblist are defined by the amsrefs package."
1555 write$ newline$
1556 "\begin{bibdiv}" write$ newline$
1557 "\begin{biblist}" write$ newline$
1558 }
1559 % \end{macrocode}
1560 % \end{macro}
1561 %
1562 % \begin{macro}{end.bin}
1563 % \begin{macrocode}
1564 FUNCTION {end.bib} {
1565 newline$
1566 "\end{biblist}" write$ newline$
1567 "\end{bibdiv}" write$ newline$
1568 }
1569 % \end{macrocode}
1570 % \end{macro}
1571 %
1572 % \begin{macrocode}
1573 EXECUTE {begin.bib}
1574
1575 ITERATE {call.type$}
1576
1577 EXECUTE {end.bib}
1578 %</bst>
1579 % \end{macrocode}
1580 %
1581 % \section{Journal abbreviations}
1582 %
1583 % By putting the ISSN into the \latex/ document, we make it easier to
1584 % construct www queries from the bibliography data. These string
1585 % definitions tie together journal abbreviations, ISSN numbers, and
1586 % journal names.
1587 %
1588 % These are the journals that are cited most frequently by American
1589 % Mathematical Society authors at the present time (2000 CE).
1590 %
1591 % The format used here is designed to make it easy for BibTeX
1592 % to retrieve an ISSN number when given a journal abbreviation.
1593 % \begin{macrocode}
1594 %<*abbrevs>
1595 @string{aa="aa/0065-1036/"
1596 #"Acta Arithmetica"}
1597 @string{actamath="actamath/0001-5962/"
1598 #"Acta Mathematica"}
1599 @string{asms="asms/0001-6969/"
1600 #"Acta Scientiarum Mathematicarum"}
1601 @string{advmath="advmath/0001-8708/"
1602 #"Advances in Mathematics"}
1603 @string{ajm="ajm/0002-9327/"
1604 #"American Journal of Mathematics"}
1605 @string{amm="amm/0002-9890/"
1606 #"American Mathematical Monthly"}
1607 @string{aifg="aifg/0373-0956/"
1608 #"Annales de l'Institut Fourier"}
1609 @string{am2="am2/0003-486X/Annals of Mathematics"}
1610 @string{ap="ap/0091-1798/"
1611 #"The Annals of Probability"}
1612 @string{asens4="asens4/0012-9593/"
1613 #"Annales Scientifiques de l'\'{E}cole Normale Sup\'{e}rieure"}
1614 @string{amb="amb/0003-889X/Archiv der Mathematik"}
1615 @string{arma="arma/0003-9527/"
1616 #"Archive for Rational Mechanics and Analysis"}
1617 @string{bamsn="bamsn/0273-0979/"
1618 #"Bulletin (New Series) of the American Mathematical Society"}
1619 @string{bams="bams/0004-9727/"
1620 #"Bulletin of the Australian Mathematical Society"}
1621 @string{blms="blms/0024-6093/"
1622 #"Bulletin of the London Mathematical Society"}
1623 @string{bsmf="bsmf/0037-9484/"
1624 #"Bulletin de la Soci\'{e}t\'{e} Math\'{e}matique de France"}
1625 @string{craspi="craspi/0764-4442/"
1626 #"Comptes Rendus de l'Acad\'{e}mie des Sciences (Paris)"
1627 #" S\'{e}rie I Math\'{e}matique"}
1628 @string{cjm="cjm/0008-414X/Canadian Journal of Mathematics"}
1629 @string{cmb="cmb/0008-4395/"
1630 #"Canadian Mathematical Bulletin"}
1631 @string{colloqmath="colloqmath/0010-1354/"
1632 #"Colloquium Mathematicum"}
1633 @string{commalgebra="commalgebra/0092-7872/"
1634 #"Communications in Algebra"}
1635 @string{cmp="cmp/0010-3616/"
1636 #"Communications in Mathematical Physics"}
1637 @string{cpam="cpam/0010-3640/"
1638 #"Communications on Pure and Applied Mathematics"}
1639 @string{cmh="cmh/0010-2571/"
1640 #"Commentarii Mathematici Helvetici"}
1641 @string{cvta="cvta/0278-1077/"
1642 #"Complex Variables"}
1643 @string{compositiomath="compositiomath/0010-437X/"
1644 #"Compositio Mathematica"}
1645 @string{c="c/0010-485X/Computing"}
1646 @string{constrapprox="constrapprox/0176-4276/"
1647 #"Constructive Approximation"}
1648 @string{dmj="dmj/0012-7094/"
1649 #"Duke Mathematical Journal"}
1650 @string{eraams="eraams/1079-6762/"
1651 #"Electronic Research Announcements"
1652 #" of the American Mathematical Society"}
1653 @string{etds="etds/0143-3857/"
1654 #"Ergodic Theory and Dynamical Systems"}
1655 @string{fm="fm/0016-2736/"
1656 #"Fundamenta Mathematicae"}
1657 @string{gd="gd/0046-5755/"
1658 #"Geometriae Dedicata"}
1659 @string{illinoisjmath="illinoisjmath/0019-2082/"
1660 #"Illinois Journal of Mathematics"}
1661 @string{iumj="iumj/0022-2518/"
1662 #"Indiana University Mathematics"}
1663 @string{im="im/0020-9910/"
1664 #"Inventiones Mathematicae"}
1665 @string{israeljmath="israeljmath/0021-2172/"
1666 #"Israel Journal of Mathematics"}
1667 @string{iansm="iansm/??/"
1668 #"Izvestiya Akademii Nauk SSSR. Seriya Matematicheskaya"}
1669 @string{ja="ja/0021-8693/"
1670 #"Journal of Algebra"}
1671 @string{jams="jams/0894-0347/"
1672 #"Journal of the American Mathematical Society"}
1673 @string{jam="jam/0021-7670/"
1674 #"Journal d'Analyse Math\'{e}matique"}
1675 @string{jamm="jamm/0021-8928/"
1676 #"Journal of Applied Mathematics and Mechanics"}
1677 @string{jat="jat/0021-9045/"
1678 #"Journal of Approximation Theory"}
1679 @string{jamsa="jamsa/0263-6115/"
1680 #"Journal of the Australian Mathematical Society"}
1681 @string{jcta="jcta/0097-3165/"
1682 #"Journal of Combinatorial Theory"}
1683 @string{jde="jde/0022-0396/"
1684 #"Journal of Differential Equations"}
1685 @string{jdg="jdg/0022-040X/Journal of Differential Geometry"}
1686 @string{jfa="jfa/0022-1236/"
1687 #"Journal of Functional Analysis"}
1688 @string{jlms2="jlms2/0024-6107/"
1689 #"Journal of the London Mathematical Society"}
1690 @string{jmaa="jmaa/0022-247X/"
1691 #"Journal of Mathematical Analysis and Applications"}
1692 @string{jmp="jmp/0022-2488/"
1693 #"Journal of Mathematical Physics"}
1694 @string{jmsj="jmsj/0025-5645/"
1695 #"Journal of the Mathematical Society of Japan"}
1696 @string{jnt="jnt/0022-314X/Journal of Number Theory"}
1697 @string{jot="jot/0379-4024/"
1698 #"Journal of Operator Theory"}
1699 @string{jpaa="jpaa/0022-4049/"
1700 #"Journal of Pure and Applied Algebra"}
1701 % Braces instead of quotes, to hide the embedded \" control sequence
1702 @string{jram={jram/0075-4102/}
1703 #{Journal f\"{u}r die Reine und Angewandte Mathematik}}
1704 @string{jsl="jsl/0022-4812/"
1705 #"The Journal of Symbolic Logic"}
1706 @string{laa="laa/0024-3795/"
1707 #"Linear Algebra and its Applications"}
1708 @string{mm="mm/0025-2611/"
1709 #"Manuscripta Mathematica"}
1710 @string{matzametki="matzametki/0025-567X/Matematicheskie Zametki"}
1711 @string{ma="ma/0025-5831/"
1712 #"Mathematische Annalen"}
1713 @string{mc="mc/0025-5718/"
1714 #"Mathematics of Computation"}
1715 @string{mj="mj/0025-5513/"
1716 #"Mathematica Japonica"}
1717 @string{mn="mn/0025-584X/Mathematische Nachrichten"}
1718 @string{mpcps="mpcps/0305-0041/"
1719 #"Mathematical Proceedings of the"
1720 #" Cambridge Philosophical Society"}
1721 @string{mrl="mrl/1073-2780/"
1722 #"Mathematical Research Letters"}
1723 @string{ms="ms/0025-5521/"
1724 #"Mathematica Scandinavica"}
1725 @string{mathz="mathz/0025-5874/"
1726 #"Mathematische Zeitschrift"}
1727 @string{m="m/0025-5793/"
1728 #"Mathematika"}
1729 @string{mmj="mmj/0026-2285/"
1730 #"The Michigan Mathematical Journal"}
1731 @string{nmj="nmj/0027-7630/"
1732 #"Nagoya Mathematical Journal"}
1733 @string{na="na/0362-546X/Nonlinear Analysis"}
1734 @string{nm="nm/0029-599X/Numerische Mathematik"}
1735 @string{ojm="ojm/0030-6126/"
1736 #"Osaka Journal of Mathematics"}
1737 @string{pjm="pjm/0030-8730/"
1738 #"Pacific Journal of Mathematics"}
1739 @string{pams="pams/0002-9939/"
1740 #"Proceedings of the American Mathematical Society"}
1741 @string{pems2="pems2/0013-0915/"
1742 #"Proceedings of the Edinburgh Mathematical Society"}
1743 @string{pjaa="pjaa/0386-2194/"
1744 #"Proceedings of the Japan Academy"}
1745 @string{plms3="plms3/0024-6115/"
1746 #"Proceedings of the London Mathematical Society"}
1747 @string{qjmo2="qjmo2/0033-5606/"
1748 #"The Quarterly Journal of Mathematics"}
1749 @string{rmi="rmi/0213-2230/"
1750 #"Revista Matem\'{a}tica Iberoamericana"}
1751 @string{rmjm="rmjm/0035-7596/"
1752 #"Rocky Mountain Journal of Mathematics"}
1753 @string{sjam="sjam/0036-1399/"
1754 #"SIAM Journal on Applied Mathematics"}
1755 @string{sjc="sjc/0097-5397/"
1756 #"SIAM Journal on Computing"}
1757 @string{sjma="sjma/0036-1410/"
1758 #"SIAM Journal on Mathematical Analysis"}
1759 @string{sjna="sjna/0036-1429/"
1760 #"SIAM Journal on Numerical Analysis"}
1761 @string{sr="sr/0036-1445/"
1762 #"SIAM Review"}
1763 @string{sm="sm/0039-3223/"
1764 #"Studia Mathematica"}
1765 @string{tjm="tjm/0387-3870/"
1766 #"Tokyo Journal of Mathematics"}
1767 @string{ta="ta/0166-8641/"
1768 #"Topology and its Applications"}
1769 @string{t="t/0040-9383/"
1770 #"Topology"}
1771 @string{tams="tams/0002-9947/"
1772 #"Transactions of the American Mathematical Society"}
1773 %</abbrevs>
1774 % \end{macrocode}
1775 %
1776 % \section{To Do}
1777 %
1778 % ---When there is no author or editor info to create a label from: Use
1779 % the initial letters of all the words in the title. Plus the year.
1780 % Maybe year first.
1781 %
1782 % ---Add linelength and indent options to control the output?
1783 %
1784 % ---Discuss apacite "originalfoo" fields etc.
1785 %
1786 % ---Discuss Beebe's work.
1787 %
1788 % ---Add bibliography.
1789 %
1790 % ---Add AUDIO, VIDEO entry types.
1791 %
1792 % ---Add a field for MR subject classification numbers and the like?
1793 %
1794 % ---Write a converter to convert from typical .bib data to preferred
1795 % form. Have to go via perl or something to capture STRING defs and
1796 % PREAMBLE and interspersed comments? Or emacs lisp? Provide .bst
1797 % version as fallback.
1798 %
1799 % ---Alpha labels: add numbers after sorting? subscript option? L3Y2a
1800 % option.
1801 %
1802 % ---Test multi-author articles with ten-plus authors. What happens
1803 % with the alpha labels then?
1804 %
1805 % ---For url field especially, check length and prebreak by hand instead
1806 % of relying on \bibtex/'s slapdash stick-in-a-percent-at-column-72
1807 % regardless of where it happens to fall.
1808 %
1809 % ---How about a general `contributor' field.
1810 %
1811 % ---Test with a wimpy older version of \bibtex/.
1812 %
1813 % \CheckSum{24}
1814 % \Finale