Commit before breaking everything
[matches/honours.git] / thesis / styles / amsalpha.bst
1 %%% ====================================================================
2 %%%  @BibTeX-style-file{
3 %%%     author          = "American Mathematical Society",
4 %%%     version         = "1.2beta",
5 %%%     date            = "13-Oct-1994",
6 %%%     time            = "15:31:22 EDT",
7 %%%     filename        = "amsalpha.bst",
8 %%%     copyright       = "Copyright (C) 1994 American Mathematical Society,
9 %%%                        all rights reserved.  Copying of this file is
10 %%%                        authorized only if either:
11 %%%                        (1) you make absolutely no changes to your copy,
12 %%%                        including name; OR
13 %%%                        (2) if you do make changes, you first rename it
14 %%%                        to some other name.",
15 %%%     address         = "American Mathematical Society,
16 %%%                        Technical Support,
17 %%%                        Electronic Products and Services,
18 %%%                        P. O. Box 6248,
19 %%%                        Providence, RI 02940,
20 %%%                        USA",
21 %%%     telephone       = "401-455-4080 or (in the USA and Canada)
22 %%%                        800-321-4AMS (321-4267)",
23 %%%     FAX             = "401-331-3842",
24 %%%     checksum        = "16562 1382 4093 29485",
25 %%%     email           = "[email protected] (Internet)",
26 %%%     codetable       = "ISO/ASCII",
27 %%%     keywords        = "bibtex, bibliography, amslatex, ams-latex",
28 %%%     supported       = "yes",
29 %%%     abstract        = "BibTeX bibliography style amsalpha for BibTeX
30 %%%                        versions 0.99a or later and LaTeX version 2e.
31 %%%                        Produces alphabetic-label bibliography items in
32 %%%                        a form typical for American Mathematical Society
33 %%%                        publications.",
34 %%%     docstring       = "The checksum field above contains a CRC-16
35 %%%                        checksum as the first value, followed by the
36 %%%                        equivalent of the standard UNIX wc (word
37 %%%                        count) utility output of lines, words, and
38 %%%                        characters.  This is produced by Robert
39 %%%                        Solovay's checksum utility.",
40 %%%  }
41 %%% ====================================================================
42
43 % See the file btxbst.doc for extra documentation other than
44 % what is included here.  And see btxhak.tex for a description
45 % of the BibTeX language and how to use it.
46
47 % This defines the types of fields that can occur in a database entry
48 % for this particular bibliography style.  Except for `language',
49 % this is the standard list from alpha.bst.
50
51 %% Types of entries currently allowed in a BibTeX file:
52 %%
53 %% ARTICLE -- An article from a journal or magazine.
54 %%
55 %% BOOK -- A book with an explicit publisher.
56 %%
57 %% BOOKLET -- A work that is printed and bound,
58 %% but without a named publisher or sponsoring institution.
59 %%
60 %% CONFERENCE -- The same as INPROCEEDINGS,
61 %% included for Scribe compatibility.
62 %%
63 %% INBOOK -- A part of a book,
64 %% which may be a chapter (or section or whatever) and/or a range of pages.
65 %%
66 %% INCOLLECTION -- A part of a book having its own title.
67 %%
68 %% INPROCEEDINGS -- An article in a conference proceedings.
69 %%
70 %% MANUAL -- Technical documentation.
71 %%
72 %% MASTERSTHESIS -- A Master's thesis.
73 %%
74 %% MISC -- Use this type when nothing else fits.
75 %%
76 %% PHDTHESIS -- A PhD thesis.
77 %%
78 %% PROCEEDINGS -- The proceedings of a conference.
79 %%
80 %% TECHREPORT -- A report published by a school or other institution,
81 %% usually numbered within a series.
82 %%
83 %% UNPUBLISHED -- A document having an author and title, but not formally
84 %% published.
85
86 ENTRY
87   { address
88     author
89     booktitle
90     chapter
91     edition
92     editor
93     howpublished
94     institution
95     journal
96     key
97     language
98     month
99     note
100     number
101     organization
102     pages
103     publisher
104     school
105     series
106     title
107     type
108     volume
109     year
110   }
111   {}
112   { label extra.label sort.label }
113
114 % Removed after.sentence, after.block---not needed.
115
116 INTEGERS { output.state before.all mid.sentence }
117
118 FUNCTION {init.state.consts}
119 { #0 'before.all :=
120   #1 'mid.sentence :=
121 }
122
123 % Scratch variables:
124
125 STRINGS { s t }
126
127 % Utility functions
128
129 FUNCTION {shows}
130 { duplicate$ "::::  `" swap$ * "'" * top$
131 }
132
133 FUNCTION {showstack}
134 {"STACK====================================================================="
135 top$
136 stack$
137 "ENDSTACK=================================================================="
138 top$
139 }
140
141 FUNCTION {not}
142 {   { #0 }
143     { #1 }
144   if$
145 }
146
147 FUNCTION {and}
148 {   'skip$
149     { pop$ #0 }
150   if$
151 }
152
153 FUNCTION {or}
154 {   { pop$ #1 }
155     'skip$
156   if$
157 }
158
159 FUNCTION {field.or.null}
160 { duplicate$ empty$
161     { pop$ "" }
162     'skip$
163   if$
164 }
165
166 FUNCTION {emphasize}
167 { duplicate$ empty$
168     { pop$ "" }
169     { "\emph{" swap$ * "}" * }
170   if$
171 }
172
173 % n.dashify is used to make sure page ranges get the TeX code
174 % (two hyphens) for en-dashes.
175
176 FUNCTION {n.dashify}
177 { 't :=
178   ""
179     { t empty$ not }
180     { t #1 #1 substring$ "-" =
181         { t #1 #2 substring$ "--" = not
182             { "--" *
183               t #2 global.max$ substring$ 't :=
184             }
185             {   { t #1 #1 substring$ "-" = }
186                 { "-" *
187                   t #2 global.max$ substring$ 't :=
188                 }
189               while$
190             }
191           if$
192         }
193         { t #1 #1 substring$ *
194           t #2 global.max$ substring$ 't :=
195         }
196       if$
197     }
198   while$
199 }
200
201 % tie.or.space.connect connects two items with a ~ if the
202 % second item is less than 3 letters long, otherwise it just puts an
203 % ordinary space.
204
205 FUNCTION {tie.or.space.connect}
206 { duplicate$ text.length$ #3 <
207     { "~" }
208     { " " }
209   if$
210   swap$ * *
211 }
212
213 FUNCTION {add.space.if.necessary}
214 { duplicate$ "" =
215     'skip$
216     { " " * }
217   if$
218 }
219
220 % either.or.check gives a warning if two mutually exclusive fields
221 % were used in the database.
222
223 FUNCTION {either.or.check}
224 { empty$
225     'pop$
226     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
227   if$
228 }
229
230 % output.nonnull is called by output.
231
232 FUNCTION {output.nonnull}
233 % remove the top item from the stack because it's in the way.
234 { 's :=
235   output.state mid.sentence =
236 % If we're in mid-sentence, add a comma to the new top item and write it
237     { ", " * write$ }
238 % Otherwise, if we're at the beginning of a bibitem,
239     { output.state before.all =
240 % just write out the top item from the stack;
241       'write$
242 % and the last alternative is that we're at the end of the current
243 % bibitem, so we add a period to the top stack item and write it out.
244         { add.period$ " " * write$ }
245       if$
246       mid.sentence 'output.state :=
247     }
248   if$
249 % Put the top item back on the stack that we removed earlier.
250   s
251 }
252
253 % Output checks to see if the stack top is empty; if not, it
254 % calls output.nonnull to write it out.
255
256 FUNCTION {output}
257 { duplicate$ empty$
258     'pop$
259     'output.nonnull
260   if$
261 }
262
263 % Standard warning message for a missing or empty field. For the user
264 % we call any such field `missing' without respect to the distinction
265 % made by BibTeX between missing and empty.
266
267 FUNCTION {missing.warning}
268 { "missing " swap$ * " in " * cite$ * warning$ }
269
270 % Output.check is like output except that it gives a warning on-screen
271 % if the given field in the database entry is empty.  t is the field
272 % name.
273
274 FUNCTION {output.check}
275 { 't :=
276   duplicate$ empty$
277     { pop$ t missing.warning }
278     'output.nonnull
279   if$
280 }
281
282 FUNCTION {output.bibitem}
283 { newline$
284   "\bibitem[" write$
285   label write$
286   "]{" write$
287   cite$ write$
288   "}" write$
289   newline$
290 % This empty string is the first thing that will be written
291 % the next time write$ is called.  Done this way because each
292 % item is saved on the stack until we find out what punctuation
293 % should be added after it.  Therefore we need an empty first item.
294   ""
295   before.all 'output.state :=
296 }
297
298 FUNCTION {fin.entry}
299 { add.period$
300   write$
301   newline$
302 }
303
304 % Removed new.block, new.block.checka, new.block.checkb, new.sentence,
305 % new.sentence.checka, and new.sentence.checkb functions here, since they
306 % don't seem to be needed in the AMS style.  Also moved some real
307 % basic functions like `and' and 'or' earlier in the file.
308
309 INTEGERS { nameptr namesleft numnames }
310
311 % The extra section to write out a language field was added
312 % for AMSPLAIN.BST.  Not present in plain.bst.
313
314 FUNCTION {format.language}
315 { language empty$
316     { "" }
317     { " (" language * ")" * }
318   if$
319 }
320
321 % This version of format.names puts names in the format
322 %
323 % First von Last, Jr.
324 %
325 % (i.e., first name first, no abbreviating to initials).
326
327 FUNCTION {format.names}
328 { 's :=
329   #1 'nameptr :=
330   s num.names$ 'numnames :=
331   numnames 'namesleft :=
332     { namesleft #0 > }
333     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
334       nameptr #1 >
335         { namesleft #1 >
336             { ", " * t * }
337             { numnames #2 >
338                 { "," * }
339                 'skip$
340               if$
341               t "others" =
342                 { " et~al." * }
343                 { " and " * t * }
344               if$
345             }
346           if$
347         }
348         't
349       if$
350       nameptr #1 + 'nameptr :=
351       namesleft #1 - 'namesleft :=
352     }
353   while$
354 }
355
356 FUNCTION {format.authors}
357 { author empty$
358     { "" }
359     { extra.label "\bysame" =
360          {"\bysame"}
361          { author format.names }
362      if$
363     }
364   if$
365 }
366
367 FUNCTION {format.editors}
368 { editor empty$
369     { "" }
370     { editor format.names
371       editor num.names$ #1 >
372         { " (eds.)" * }
373         { " (ed.)" * }
374       if$
375     }
376   if$
377 }
378
379 FUNCTION {format.nonauthor.editors}
380 { editor empty$
381     { "" }
382     { editor format.names
383       editor num.names$ #1 >
384         { ", eds." * }
385         { ", ed." * }
386       if$
387     }
388   if$
389 }
390
391 FUNCTION {format.title}
392 { title empty$
393     { "" }
394     { title "t" change.case$ emphasize }
395   if$
396 }
397
398 FUNCTION {format.journal.vol.year}
399 { journal empty$
400     { "" "journal name" missing.warning }
401     { journal
402       volume empty$
403         'skip$
404         { " \textbf{" * volume * "}" * }
405       if$
406       year empty$
407         { "year" missing.warning }
408         { " (" * year * ")" * }
409       if$
410     }
411   if$
412 }
413
414 % For formatting the issue number for a journal article.
415
416 FUNCTION {format.number}
417 { number empty$
418     { "" }
419     { "no.~" number * }
420   if$
421 }
422
423 % For formatting miscellaneous dates
424
425 FUNCTION {format.date}
426 { year empty$
427     { month empty$
428         { "" }
429         { "there's a month but no year in " cite$ * warning$
430           month
431         }
432       if$
433     }
434     { month empty$
435         'year
436         { month " " * year * }
437       if$
438     }
439   if$
440 }
441
442 %%      The volume, series and number information is sort of tricky.
443 %%      This code handles it as follows:
444 %%      If the series is present, and the volume, but not the number,
445 %%        then we do "\emph{Book title}, Series Name, vol. 000"
446 %%      If the series is present, and the number, but not the volume,
447 %%        then we do "\emph{Book title}, Series Name, no. 000"
448 %%      If the series is present, and both number and volume,
449 %%        then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
450 %%      Finally, if the series is absent,
451 %%        then we do "\emph{Book title}, vol. XX"
452 %%        or         "\emph{Book title}, no. 000"
453 %%        and if both volume and number are present, give a warning message.
454
455 FUNCTION {format.bookvolume.series.number}
456 { volume empty$
457     { "" % Push the empty string as a placeholder in case everything else
458          % is empty too.
459       series empty$
460         'skip$
461         { pop$ series } % if series is not empty put in stack
462       if$
463       number empty$
464         'skip$
465         { duplicate$ empty$ % if no preceding material,
466             'skip$          % do nothing, otherwise
467             { ", " * }      % add a comma and space to separate.
468           if$
469           "no." number tie.or.space.connect * % add the number information
470         }
471       if$
472     }
473 %% If the volume is NOT EMPTY:
474     { "vol." volume tie.or.space.connect % vol. XX
475       number empty$
476         { series empty$
477             'skip$
478             { series ", " * swap$ *}    % Series Name, vol. XX
479           if$
480         }
481         { series empty$
482             { "can't use both volume and number if series info is missing"
483               warning$
484               "in BibTeX entry type `" type$ * "'" * top$
485             }
486             { ", " * series * ", no." * number tie.or.space.connect }
487           if$
488         }
489       if$
490     }
491   if$
492
493 }  % end of format.bookvolume.series.number
494
495 %% format.inproc.title.where.editors is used by inproceedings entry types
496
497 FUNCTION {format.inproc.title.address.editors}
498 { booktitle empty$
499     { "" }
500 %%      No case changing or emphasizing for the title.  We want initial
501 %%      caps, roman.
502     { booktitle }
503   if$
504 %%      We add parentheses around the address (place where conference
505 %%      was held).
506   address empty$
507     'skip$
508     { add.space.if.necessary "(" * address * ")" * }
509   if$
510 %%      Likewise we add parentheses around the editors' names.
511   editor empty$
512     'skip$
513     { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
514   if$
515 }
516
517 %% format.incoll.title.editors is similar to format.inproc... but
518 %% omits the address. For collections that are not proceedings volumes.
519
520 FUNCTION {format.incoll.title.editors}
521 { booktitle empty$
522     { "" }
523 %%      No case changing or emphasizing for the title.  We want initial
524 %%      caps, roman.
525     { booktitle }
526   if$
527 %%      We add parentheses around the editors' names.
528   editor empty$
529     'skip$
530     { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
531   if$
532 }
533
534 % Desired output for format.number.series:
535 %
536 % Lecture Notes in Math., no.~1224
537
538 FUNCTION {format.number.series}
539 { series empty$
540     { number empty$
541         { "" }
542         { "there's a number but no series in " cite$ * warning$ }
543       if$
544     }
545     { series
546       number empty$
547         'skip$
548         { ", no.~" * number * }
549       if$
550     }
551   if$
552 }
553
554 FUNCTION {format.edition}
555 { edition empty$
556     { "" }
557     { output.state mid.sentence =
558         { edition "l" change.case$ " ed." * }
559         { edition "t" change.case$ " ed." * }
560       if$
561     }
562   if$
563 }
564
565 INTEGERS { multiresult }
566
567 FUNCTION {multi.page.check}
568 { 't :=
569   #0 'multiresult :=
570     { multiresult not
571       t empty$ not
572       and
573     }
574     { t #1 #1 substring$
575       duplicate$ "-" =
576       swap$ duplicate$ "," =
577       swap$ "+" =
578       or or
579         { #1 'multiresult := }
580         { t #2 global.max$ substring$ 't := }
581       if$
582     }
583   while$
584   multiresult
585 }
586
587 FUNCTION {format.pages}
588 { pages empty$
589     { "" }
590     { pages n.dashify }
591   if$
592 }
593
594 FUNCTION {format.book.pages}
595 { pages empty$
596     { "" }
597     { pages multi.page.check
598         { "pp.~" pages n.dashify * }
599         { "p.~" pages * }
600       if$
601     }
602   if$
603 }
604
605 FUNCTION {format.chapter.pages}
606 { chapter empty$
607     'format.pages
608     { type empty$
609         { "ch.~" }
610         { type "l" change.case$ " " * }
611       if$
612       chapter *
613       pages empty$
614         'skip$
615         { ", " * format.book.pages * }
616       if$
617     }
618   if$
619 }
620
621 FUNCTION {empty.misc.check}
622 { author empty$ title empty$ howpublished empty$
623   month empty$ year empty$ note empty$
624   and and and and and
625   key empty$ not and
626     { "all relevant fields are empty in " cite$ * warning$ }
627     'skip$
628   if$
629 }
630
631 FUNCTION {format.thesis.type}
632 { type empty$
633     'skip$
634     { pop$
635       type "t" change.case$
636     }
637   if$
638 }
639
640 FUNCTION {format.tr.number}
641 { type empty$
642     { "Tech. Report" }
643     'type
644   if$
645   number empty$
646     { "t" change.case$ }
647     { number tie.or.space.connect }
648   if$
649 }
650
651 % The format.crossref functions haven't been paid much attention
652 % at the present time (June 1990) and could probably use some
653 % work.  MJD
654
655 FUNCTION {format.article.crossref}
656 { key empty$
657     { journal empty$
658         { "need key or journal for " cite$ * " to crossref " * crossref *
659           warning$
660           ""
661         }
662         { "In " journal * }
663       if$
664     }
665     { "In " key * }
666   if$
667   " \cite{" * crossref * "}" *
668 }
669
670 FUNCTION {format.crossref.editor}
671 { editor #1 "{vv~}{ll}" format.name$
672   editor num.names$ duplicate$
673   #2 >
674     { pop$ " et~al." * }
675     { #2 <
676         'skip$
677         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
678             { " et~al." * }
679             { " and " * editor #2 "{vv~}{ll}" format.name$ * }
680           if$
681         }
682       if$
683     }
684   if$
685 }
686
687 FUNCTION {format.book.crossref}
688 { volume empty$
689     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
690       "In "
691     }
692     { "Vol." volume tie.or.space.connect
693       " of " *
694     }
695   if$
696   editor empty$
697   editor field.or.null author field.or.null =
698   or
699     { key empty$
700         { series empty$
701             { "need editor, key, or series for " cite$ * " to crossref " *
702               crossref * warning$
703               "" *
704             }
705             { series * }
706           if$
707         }
708         { key * }
709       if$
710     }
711     { format.crossref.editor * }
712   if$
713   " \cite{" * crossref * "}" *
714 }
715
716 FUNCTION {format.incoll.inproc.crossref}
717 { editor empty$
718   editor field.or.null author field.or.null =
719   or
720     { key empty$
721         { booktitle empty$
722             { "need editor, key, or booktitle for " cite$ * " to crossref " *
723               crossref * warning$
724               ""
725             }
726             { "In \emph{" booktitle * "}" * }
727           if$
728         }
729         { "In " key * }
730       if$
731     }
732     { "In " format.crossref.editor * }
733   if$
734   " \cite{" * crossref * "}" *
735 }
736
737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738
739 % The main functions for each entry type.
740
741 % journal, vol and year are formatted together because they are
742 % not separated by commas.
743
744 FUNCTION {article}
745 { output.bibitem
746   format.authors "author" output.check
747   format.title "title" output.check
748   crossref missing$
749     { format.journal.vol.year "journal, volume, and year" output.check
750       format.number output
751       format.pages "pages" output.check
752     }
753     { format.article.crossref output.nonnull
754       format.pages output
755     }
756   if$
757   format.language *
758   note output
759   fin.entry
760 }
761
762 FUNCTION {book}
763 { output.bibitem
764   author empty$
765     { format.editors "author and editor" output.check }
766     { format.authors output.nonnull
767       crossref missing$
768         { "author and editor" editor either.or.check }
769         'skip$
770       if$
771     }
772   if$
773   format.title "title" output.check
774   format.edition output
775   crossref missing$
776     { format.bookvolume.series.number output
777       publisher "publisher" output.check
778       address output
779     }
780     { format.book.crossref output.nonnull
781     }
782   if$
783   format.date "year" output.check
784   format.language *
785   note output
786   fin.entry
787 }
788
789 FUNCTION {booklet}
790 { output.bibitem
791   format.authors output
792   format.title "title" output.check
793   howpublished output
794   address output
795   format.date output
796   note output
797   fin.entry
798 }
799
800 FUNCTION {inbook}
801 { output.bibitem
802   author empty$
803     { format.editors "author and editor" output.check }
804     { format.authors output.nonnull
805       crossref missing$
806         { "author and editor" editor either.or.check }
807         'skip$
808       if$
809     }
810   if$
811   title "title" output.check
812   crossref missing$
813     { format.bookvolume.series.number output
814       format.chapter.pages "chapter and pages" output.check
815       format.number.series output
816       publisher "publisher" output.check
817       address output
818     }
819     { format.chapter.pages "chapter and pages" output.check
820       format.book.crossref output.nonnull
821     }
822   if$
823   format.edition output
824   format.date "year" output.check
825   format.book.pages output
826   format.language *
827   note output
828   fin.entry
829 }
830
831 FUNCTION {incollection}
832 { output.bibitem
833   format.authors "author" output.check
834   format.title "title" output.check
835   crossref missing$
836     { format.inproc.title.address.editors "booktitle" output.check
837       format.bookvolume.series.number output
838       publisher "publisher" output.check
839       address output
840       format.edition output
841       format.date "year" output.check
842     }
843     { format.incoll.inproc.crossref output.nonnull
844     }
845   if$
846   note output
847   format.book.pages output
848   format.language *
849   fin.entry
850 }
851
852 FUNCTION {inproceedings}
853 { output.bibitem
854   format.authors "author" output.check
855   format.title "title" output.check
856   crossref missing$
857     { format.inproc.title.address.editors "booktitle" output.check
858       format.bookvolume.series.number output
859       organization output
860       publisher output
861       format.date "year" output.check
862     }
863     { format.incoll.inproc.crossref output.nonnull
864     }
865   if$
866   note output
867   format.book.pages output
868   format.language *
869   fin.entry
870 }
871
872 FUNCTION {conference} { inproceedings }
873
874 FUNCTION {manual}
875 { output.bibitem
876   author empty$
877     { organization empty$
878         'skip$
879         { organization output.nonnull
880           address output
881         }
882       if$
883     }
884     { format.authors output.nonnull }
885   if$
886   format.title "title" output.check
887   author empty$
888     { organization empty$
889         { address output }
890         'skip$
891       if$
892     }
893     { organization output
894       address output
895     }
896   if$
897   format.edition output
898   format.date output
899   note output
900   fin.entry
901 }
902
903 FUNCTION {mastersthesis}
904 { output.bibitem
905   format.authors "author" output.check
906   format.title "title" output.check
907   "Master's thesis" format.thesis.type output.nonnull
908   school "school" output.check
909   address output
910   format.date "year" output.check
911   note output
912   fin.entry
913 }
914
915 FUNCTION {misc}
916 { output.bibitem
917   format.authors output
918   format.title output
919   howpublished output
920   format.date output
921   note output
922   format.book.pages output
923   fin.entry
924   empty.misc.check
925 }
926
927 FUNCTION {phdthesis}
928 { output.bibitem
929   format.authors "author" output.check
930   format.title "title" output.check
931   "Ph.D. thesis" format.thesis.type output.nonnull
932   school "school" output.check
933   address output
934   format.date "year" output.check
935   note output
936   format.book.pages output
937   fin.entry
938 }
939
940 FUNCTION {proceedings}
941 { output.bibitem
942   editor empty$
943     { organization output }
944     { format.editors output.nonnull }
945   if$
946   format.title "title" output.check
947   format.bookvolume.series.number output
948   address empty$
949     { editor empty$
950         'skip$
951         { organization output }
952       if$
953       publisher output
954       format.date "year" output.check
955     }
956     { address output.nonnull
957       editor empty$
958         'skip$
959         { organization output }
960       if$
961       publisher output
962       format.date "year" output.check
963     }
964   if$
965   note output
966   fin.entry
967 }
968
969 FUNCTION {techreport}
970 { output.bibitem
971   format.authors "author" output.check
972   format.title "title" output.check
973   format.tr.number output.nonnull
974   institution "institution" output.check
975   address output
976   format.date "year" output.check
977   note output
978   fin.entry
979 }
980
981 FUNCTION {unpublished}
982 { output.bibitem
983   format.authors "author" output.check
984   format.title "title" output.check
985   note "note" output.check
986   format.date output
987   fin.entry
988 }
989
990 FUNCTION {default.type} { misc }
991
992 MACRO {jan} {"January"}
993
994 MACRO {feb} {"February"}
995
996 MACRO {mar} {"March"}
997
998 MACRO {apr} {"April"}
999
1000 MACRO {may} {"May"}
1001
1002 MACRO {jun} {"June"}
1003
1004 MACRO {jul} {"July"}
1005
1006 MACRO {aug} {"August"}
1007
1008 MACRO {sep} {"September"}
1009
1010 MACRO {oct} {"October"}
1011
1012 MACRO {nov} {"November"}
1013
1014 MACRO {dec} {"December"}
1015
1016 READ
1017
1018 FUNCTION {sortify}
1019 { purify$
1020   "l" change.case$
1021 }
1022
1023 INTEGERS { len }
1024
1025 FUNCTION {chop.word}
1026 { 's :=
1027   'len :=
1028   s #1 len substring$ =
1029     { s len #1 + global.max$ substring$ }
1030     's
1031   if$
1032 }
1033
1034 INTEGERS { et.al.char.used }
1035
1036 FUNCTION {initialize.et.al.char.used}
1037 { #0 'et.al.char.used :=
1038 }
1039
1040 EXECUTE {initialize.et.al.char.used}
1041
1042 FUNCTION {format.lab.names}
1043 { 's :=
1044   s num.names$ 'numnames :=
1045   numnames #1 >
1046     { numnames #4 >
1047         { #3 'namesleft := }
1048         { numnames 'namesleft := }
1049       if$
1050       #1 'nameptr :=
1051       ""
1052         { namesleft #0 > }
1053         { nameptr numnames =
1054             { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1055                 { "{\etalchar{+}}" *
1056                   #1 'et.al.char.used :=
1057                 }
1058                 { s nameptr "{v{}}{l{}}" format.name$ * }
1059               if$
1060             }
1061             { s nameptr "{v{}}{l{}}" format.name$ * }
1062           if$
1063           nameptr #1 + 'nameptr :=
1064           namesleft #1 - 'namesleft :=
1065         }
1066       while$
1067       numnames #4 >
1068         { "{\etalchar{+}}" *
1069           #1 'et.al.char.used :=
1070         }
1071         'skip$
1072       if$
1073     }
1074     { s #1 "{v{}}{l{}}" format.name$
1075       duplicate$ text.length$ #2 <
1076         { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1077         'skip$
1078       if$
1079     }
1080   if$
1081 }
1082
1083 FUNCTION {author.key.label}
1084 { author empty$
1085     { key empty$
1086         { cite$ #1 #3 substring$ }
1087         { key #3 text.prefix$ }
1088       if$
1089     }
1090     { author format.lab.names }
1091   if$
1092 }
1093
1094 FUNCTION {author.editor.key.label}
1095 { author empty$
1096     { editor empty$
1097         { key empty$
1098             { cite$ #1 #3 substring$ }
1099             { key #3 text.prefix$ }
1100           if$
1101         }
1102         { editor format.lab.names }
1103       if$
1104     }
1105     { author format.lab.names }
1106   if$
1107 }
1108
1109 FUNCTION {author.key.organization.label}
1110 { author empty$
1111     { key empty$
1112         { organization empty$
1113             { cite$ #1 #3 substring$ }
1114             { "The " #4 organization chop.word #3 text.prefix$ }
1115           if$
1116         }
1117         { key #3 text.prefix$ }
1118       if$
1119     }
1120     { author format.lab.names }
1121   if$
1122 }
1123
1124 FUNCTION {editor.key.organization.label}
1125 { editor empty$
1126     { key empty$
1127         { organization empty$
1128             { cite$ #1 #3 substring$ }
1129             { "The " #4 organization chop.word #3 text.prefix$ }
1130           if$
1131         }
1132         { key #3 text.prefix$ }
1133       if$
1134     }
1135     { editor format.lab.names }
1136   if$
1137 }
1138
1139 FUNCTION {calc.label}
1140 { type$ "book" =
1141   type$ "inbook" =
1142   or
1143     'author.editor.key.label
1144     { type$ "proceedings" =
1145         'editor.key.organization.label
1146         { type$ "manual" =
1147             'author.key.organization.label
1148             'author.key.label
1149           if$
1150         }
1151       if$
1152     }
1153   if$
1154   duplicate$
1155   year field.or.null purify$ #-1 #2 substring$
1156   *
1157   'label :=
1158   year field.or.null purify$ #-1 #4 substring$
1159   *
1160   sortify 'sort.label :=
1161 }
1162
1163 FUNCTION {sort.format.names}
1164 { 's :=
1165   #1 'nameptr :=
1166   ""
1167   s num.names$ 'numnames :=
1168   numnames 'namesleft :=
1169     { namesleft #0 > }
1170     { nameptr #1 >
1171         { "   " * }
1172         'skip$
1173       if$
1174       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
1175       nameptr numnames = t "others" = and
1176         { "et al" * }
1177         { t sortify * }
1178       if$
1179       nameptr #1 + 'nameptr :=
1180       namesleft #1 - 'namesleft :=
1181     }
1182   while$
1183 }
1184
1185 FUNCTION {sort.format.title}
1186 { 't :=
1187   "A " #2
1188     "An " #3
1189       "The " #4 t chop.word
1190     chop.word
1191   chop.word
1192   sortify
1193   #1 global.max$ substring$
1194 }
1195
1196 FUNCTION {author.sort}
1197 { author empty$
1198     { key empty$
1199         { "to sort, need author or key in " cite$ * warning$
1200           ""
1201         }
1202         { key sortify }
1203       if$
1204     }
1205     { author sort.format.names }
1206   if$
1207 }
1208
1209 FUNCTION {author.editor.sort}
1210 { author empty$
1211     { editor empty$
1212         { key empty$
1213             { "to sort, need author, editor, or key in " cite$ * warning$
1214               ""
1215             }
1216             { key sortify }
1217           if$
1218         }
1219         { editor sort.format.names }
1220       if$
1221     }
1222     { author sort.format.names }
1223   if$
1224 }
1225
1226 FUNCTION {author.organization.sort}
1227 { author empty$
1228     { organization empty$
1229         { key empty$
1230             { "to sort, need author, organization, or key in " cite$ * warning$
1231               ""
1232             }
1233             { key sortify }
1234           if$
1235         }
1236         { "The " #4 organization chop.word sortify }
1237       if$
1238     }
1239     { author sort.format.names }
1240   if$
1241 }
1242
1243 FUNCTION {editor.organization.sort}
1244 { editor empty$
1245     { organization empty$
1246         { key empty$
1247             { "to sort, need editor, organization, or key in " cite$ * warning$
1248               ""
1249             }
1250             { key sortify }
1251           if$
1252         }
1253         { "The " #4 organization chop.word sortify }
1254       if$
1255     }
1256     { editor sort.format.names }
1257   if$
1258 }
1259
1260 FUNCTION {presort}
1261 { calc.label
1262   sort.label
1263   "    "
1264   *
1265   type$ "book" =
1266   type$ "inbook" =
1267   or
1268     'author.editor.sort
1269     { type$ "proceedings" =
1270         'editor.organization.sort
1271         { type$ "manual" =
1272             'author.organization.sort
1273             'author.sort
1274           if$
1275         }
1276       if$
1277     }
1278   if$
1279   *
1280   "    "
1281   *
1282   year field.or.null sortify
1283   *
1284   "    "
1285   *
1286   title field.or.null
1287   sort.format.title
1288   *
1289   #1 entry.max$ substring$
1290   'sort.key$ :=
1291 }
1292
1293 ITERATE {presort}
1294
1295 SORT
1296
1297 STRINGS { longest.label last.sort.label next.extra }
1298
1299 INTEGERS { longest.label.width last.extra.num }
1300
1301 FUNCTION {initialize.longest.label}
1302 { "" 'longest.label :=
1303   #0 int.to.chr$ 'last.sort.label :=
1304   "" 'next.extra :=
1305   #0 'longest.label.width :=
1306   #0 'last.extra.num :=
1307 }
1308
1309 FUNCTION {forward.pass}
1310 { last.sort.label sort.label =
1311     { last.extra.num #1 + 'last.extra.num :=
1312       last.extra.num int.to.chr$ 'extra.label :=
1313     }
1314     { "a" chr.to.int$ 'last.extra.num :=
1315       "" 'extra.label :=
1316       sort.label 'last.sort.label :=
1317     }
1318   if$
1319 }
1320
1321 FUNCTION {reverse.pass}
1322 { next.extra "b" =
1323     { "a" 'extra.label := }
1324     'skip$
1325   if$
1326   label extra.label * 'label :=
1327   label width$ longest.label.width >
1328     { label 'longest.label :=
1329       label width$ 'longest.label.width :=
1330     }
1331     'skip$
1332   if$
1333   extra.label 'next.extra :=
1334 }
1335
1336 EXECUTE {initialize.longest.label}
1337
1338 ITERATE {forward.pass}
1339
1340 REVERSE {reverse.pass}
1341
1342 FUNCTION {begin.bib}
1343 { et.al.char.used
1344     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
1345     'skip$
1346   if$
1347   preamble$ empty$
1348     'skip$
1349     { preamble$ write$ newline$ }
1350   if$
1351   "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1352        write$ newline$
1353   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
1354 }
1355
1356 EXECUTE {begin.bib}
1357
1358 EXECUTE {init.state.consts}
1359
1360 ITERATE {call.type$}
1361
1362 FUNCTION {end.bib}
1363 { newline$
1364   "\end{thebibliography}" write$ newline$
1365 }
1366
1367 EXECUTE {end.bib}
1368 %% \CharacterTable
1369 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
1370 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
1371 %%   Digits        \0\1\2\3\4\5\6\7\8\9
1372 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
1373 %%   Dollar        \$     Percent       \%     Ampersand     \&
1374 %%   Acute accent  \'     Left paren    \(     Right paren   \)
1375 %%   Asterisk      \*     Plus          \+     Comma         \,
1376 %%   Minus         \-     Point         \.     Solidus       \/
1377 %%   Colon         \:     Semicolon     \;     Less than     \<
1378 %%   Equals        \=     Greater than  \>     Question mark \?
1379 %%   Commercial at \@     Left bracket  \[     Backslash     \\
1380 %%   Right bracket \]     Circumflex    \^     Underscore    \_
1381 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
1382 %%   Right brace   \}     Tilde         \~}

UCC git Repository :: git.ucc.asn.au