1 %%% ====================================================================
2 %%% @BibTeX-style-file{
3 %%% filename = "uwa.bst",
5 %%% date = "1998/07/15",
6 %%% time = "14:37:33 EST",
7 %%% checksum = "38973 1474 4577 33560"
8 %%% author = "Greg Gamble",
9 %%% address = "Centre for Discrete Mathematics & Computing,
10 %%% Department of Computer Science
11 %%% & Electrical Engineering,
12 %%% The University of Queensland,
15 %%% telephone = "+61 7 336 51195",
16 %%% FAX = "+61 7 336 51999",
17 %%% copyright = "Copyright (C) 1998 Greg Gamble,
18 %%% all rights reserved. Copying of this file is
19 %%% authorised only if either:
20 %%% (1) you make absolutely no changes to your copy,
21 %%% including name; OR
22 %%% (2) if you do make changes, you first rename it
23 %%% to some other name.",
25 %%% keywords = "bibtex, bibliography, latex,",
26 %%% supported = "yes",
27 %%% abstract = "BibTeX bibliography style `uwa' for BibTeX
28 %%% versions 0.99a or later and LaTeX version 2e,
29 %%% a significantly modified version of the American
30 %%% Mathematical Society's `amsplain', incorporating
31 %%% many features of `abbrv'. Versions 1.0 and 1.0a
32 %%% of the style were written (and modified) while
33 %%% the author was at the University of Western
34 %%% Australia - hence the style name `uwa'. Note,
35 %%% that the style `uwab' provides an identical
36 %%% style except that it does not use \bysame
37 %%% (a horizontal line in place of the author(s)
38 %%% of a bibitem, indicating the author(s) are the
39 %%% same as the previous bibitem).
40 %%% Briefly the style produces bibitems that are
41 %%% either one or two (if there is both a note and
42 %%% other information) sentences. Functions are provided
43 %%% to emphasize, embolden, slantify and parenthesize.
44 %%% The general philosophy is titles (including
45 %%% booktitles and series) are either set in quotes
46 %%% (article type titles) or emphasized; prepositions
47 %%% like `in' are included to provide breaks between
48 %%% fields of similar typeface and set either in upshape
49 %%% or slanted to set it off from adjacent text;
50 %%% * volume is set in bold unless it would clash
51 %%% with a cross-reference (where the style is:
52 %%% `vol. ... of ...');
53 %%% * number is treated as if it is a volume unless
54 %%% both exist (in which case it is set as:
55 %%% `,no. ...' following the volume);
56 %%% * organization, address, edition, year are set
57 %%% together separated by commas in parentheses;
58 %%% and in many places, e.g. before a left
59 %%% parenthesis and before volume, the comma that
60 %%% is set by most styles is suppressed (the function
61 %%% no.comma is used in most places this has been done
62 %%% - a comma can be inserted, if this is desired,
63 %%% usually by simply removing the `no.comma'
64 %%% - please ... if you modify the style in this
65 %%% or any other way, heed the copyright warning
66 %%% by changing the name of the file);
67 %%% * name(s) and month(s) are set as in the `abbrv' style.
68 %%% Peculiar to the style is the use of \bysame in place
69 %%% of the authors names for succeeding bibitems by the
70 %%% same authors. If this feature is not desirable (i.e.
71 %%% explicit author lists for all papers is required),
72 %%% use the `uwab' style instead.
73 %%% The `ize' endings for many function names have been
74 %%% retained ... it would be too confusing to change such
75 %%% American spelling to English (even though, personally
76 %%% I prefer the English usage: `ise').
78 %%% - Version 1.0 [1996/02/26]: first release of `uwa.bst'
79 %%% - Version 1.0a [1996/05/24]: added field:
80 %%% * editiontype, so that technical documentation
81 %%% could use the MANUAL type and have `Version No.'
82 %%% instead of `No. ed.'
83 %%% - Version 1.1 [1998/07/15]: added fields:
84 %%% * url. It is typeset before the note field (if
85 %%% there is one) using LaTeX's \verb with | delimiters
86 %%% (by default). For the rare situation, where a |
87 %%% actually appears in the URL, the delimiter may be
88 %%% changed by setting the field verbdelim;
89 %%% * verbdelim (see description for url field).
90 %%% Examples of usage (including some that demonstrate
91 %%% `editiontype', `url' and `verbdelim') are provided in
93 %%% docstring = "The checksum field above contains a CRC-16
94 %%% checksum as the first value, followed by the
95 %%% equivalent of the standard UNIX wc (word
96 %%% count) utility output of lines, words, and
97 %%% characters. This is produced by Robert
98 %%% Solovay's checksum utility.",
100 %%% ====================================================================
102 % See the file btxbst.doc for extra documentation other than
103 % what is included here. And see btxhak.tex for a description
104 % of the BibTeX language and how to use it.
106 % This defines the types of fields that can occur in a database entry
107 % for this particular bibliography style. Except for `language',
108 % this is the standard list from plain.bst.
110 %% Types of entries currently allowed in a BibTeX file:
112 %% ARTICLE -- An article from a journal or magazine.
114 %% BOOK -- A book with an explicit publisher.
116 %% BOOKLET -- A work that is printed and bound,
117 %% but without a named publisher or sponsoring institution.
119 %% CONFERENCE -- The same as INPROCEEDINGS,
120 %% included for Scribe compatibility.
122 %% INBOOK -- A part of a book,
123 %% which may be a chapter (or section or whatever) and/or a range of pages.
125 %% INCOLLECTION -- A part of a book having its own title.
127 %% INPROCEEDINGS -- An article in a conference proceedings.
129 %% MANUAL -- Technical documentation.
131 %% MASTERSTHESIS -- A Master's thesis.
133 %% MISC -- Use this type when nothing else fits.
135 %% PHDTHESIS -- A PhD thesis.
137 %% PROCEEDINGS -- The proceedings of a conference.
139 %% TECHREPORT -- A report published by a school or other institution,
140 %% usually numbered within a series.
142 %% UNPUBLISHED -- A document having an author and title, but not formally
174 { label extra.label }
176 INTEGERS { output.state before.all mid.sentence after.sentence after.block
180 FUNCTION {init.state.consts}
183 #2 'after.sentence :=
185 #4 'mid.sentence.nocomma :=
195 { duplicate$ ":::: `" swap$ * "'" * top$
199 {"STACK====================================================================="
202 "ENDSTACK=================================================================="
224 % Standard warning message for a missing or empty field. For the user
225 % we call any such field `missing' without respect to the distinction
226 % made by BibTeX between missing and empty.
228 FUNCTION {missing.warning}
229 { "missing " swap$ * " in " * cite$ * warning$ }
231 FUNCTION {field.or.null}
238 FUNCTION {field.or.null.check}
241 { pop$ "" t missing.warning }
249 { "\emph{" swap$ * "}" * }
256 { "\textbf{" swap$ * "}" * }
263 { "\textsl{" swap$ * "}" * }
267 FUNCTION {parenthesize}
270 { "(" swap$ * ")" * }
274 % n.dashify is used to make sure page ranges get the TeX code
275 % (two hyphens) for en-dashes.
281 { t #1 #1 substring$ "-" =
282 { t #1 #2 substring$ "--" = not
284 t #2 global.max$ substring$ 't :=
286 { { t #1 #1 substring$ "-" = }
288 t #2 global.max$ substring$ 't :=
294 { t #1 #1 substring$ *
295 t #2 global.max$ substring$ 't :=
302 % tie.or.space.connect connects two items with a ~ if the
303 % second item is less than 3 letters long, otherwise it just puts an
306 FUNCTION {tie.or.space.connect}
307 { duplicate$ text.length$ #3 <
314 FUNCTION {add.space.if.necessary}
321 % either.or.check gives a warning if two mutually exclusive fields
322 % were used in the database.
324 FUNCTION {either.or.check}
327 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
331 % output.nonnull is called by output.
333 FUNCTION {output.nonnull}
334 % remove the top item from the stack because it's in the way.
336 output.state mid.sentence.nocomma =
337 % If we're in mid-sentence, but no comma is required append a space to the new
338 % top item and write it ... and then restore the normal mid-sentence state
340 mid.sentence 'output.state :=
342 { output.state mid.sentence =
343 % If we're in mid-sentence, add a comma to the new top item and write it
345 { output.state after.block =
346 % If we are finishing a block add a period and take this opportunity to
347 % start a new line and thus avoid extra long lines in the .bbl file
352 % Otherwise, if we're at the beginning of a bibitem,
353 { output.state before.all =
354 % just write out the top item from the stack;
356 % and the last alternative is that we're at the end of the current
357 % bibitem, so we add a period to the top stack item and write it out.
358 { add.period$ " " * write$ }
360 mid.sentence 'output.state :=
367 % Put the top item back on the stack that we removed earlier.
371 % Output checks to see if the stack top is empty; if not, it
372 % calls output.nonnull to write it out.
381 % Output.check is like output except that it gives a warning on-screen
382 % if the given field in the database entry is empty. t is the field
385 FUNCTION {output.check}
388 { pop$ t missing.warning }
393 FUNCTION {output.bibitem}
399 % This empty string is the first thing that will be written
400 % the next time write$ is called. Done this way because each
401 % item is saved on the stack until we find out what punctuation
402 % should be added after it. Therefore we need an empty first item.
404 before.all 'output.state :=
413 % The three append functions are like the corresponding output
415 % append.nonnull concatenates the top 2 elements on the stack
416 % putting the string append.conjuction in between if both are
417 % non-empty ... the result is left on top of the stack
419 STRINGS { append.conjunction }
421 FUNCTION {append.nonnull}
422 % remove the top item from the stack because it's in the way.
426 { append.conjunction * s * }
430 % append does exactly what append.nonnull was described to do ...
431 % if the top element is non-empty it calls append.nonnull to
432 % concatenate the top 2 stack elements ... otherwise it just
433 % throws away the top element.
442 % append.check is like append except that it gives a warning on-screen
443 % if the given field in the database entry is empty. t is the field
444 % name ... analogous to output.check.
446 FUNCTION {append.check}
449 { pop$ t missing.warning }
455 { output.state before.all =
457 { after.block 'output.state := }
461 FUNCTION {new.sentence}
462 { output.state after.block =
464 { output.state before.all =
466 { after.sentence 'output.state := }
472 FUNCTION {new.block.checka}
479 FUNCTION {new.block.checkb}
488 FUNCTION {new.sentence.checka}
495 FUNCTION {new.sentence.checkb}
507 { output.state before.all =
509 { mid.sentence.nocomma 'output.state := }
515 INTEGERS { nameptr namesleft numnames }
517 % The extra section to write out a language field was added
518 % for AMSPLAIN.BST. Not present in plain.bst.
520 FUNCTION {format.language}
521 { language no.comma parenthesize
524 FUNCTION {format.note}
531 % The url field is formatted in a similar fashion to the note field
532 % but appears before it. We use LaTeX's \verb with | delimiters
533 % by default, i.e. \verb|<URL>| is how it appears in the output.
534 % For the rare situations where a | appears in the URL, the user
535 % can set the verbdelim field to a different character.
537 FUNCTION {format.url}
541 { "\verb|" url * "|" * new.block }
542 { "\verb" verbdelim * url * verbdelim * new.block }
548 % This version of format.names puts names in the format
550 % Initials von Last, Jr.
552 FUNCTION {format.names}
555 s num.names$ 'numnames :=
556 numnames 'namesleft :=
558 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
575 nameptr #1 + 'nameptr :=
576 namesleft #1 - 'namesleft :=
581 FUNCTION {format.authors}
584 { extra.label "\bysame" =
586 { author format.names }
592 FUNCTION {format.editors}
595 { editor format.names
596 editor num.names$ #1 >
604 FUNCTION {format.nonauthor.editors}
607 { editor num.names$ #1 >
611 editor format.names tie.or.space.connect
616 % This is the only place we set anything in quotes ... so we don't
617 % provide a special function like: emphasize, embolden, slantify
620 FUNCTION {format.atitle}
623 { " `" title "t" change.case$ * "'" * }
627 FUNCTION {format.btitle}
630 { title "t" change.case$ emphasize }
634 % format.title ... treat as an article if pages are empty
635 % or as if whole book otherwise
637 FUNCTION {format.title}
644 % For formatting the volume number for a journal or book of a series
646 FUNCTION {format.journal.vol.year}
647 { " " 'append.conjunction :=
649 journal emphasize "journal name" append.check
650 volume embolden append
651 year parenthesize "year" append.check
654 % For formatting the issue number for a journal article.
656 FUNCTION {format.number}
663 FUNCTION {format.series}
667 FUNCTION {format.series.volume.number}
669 " " 'append.conjunction :=
672 { pop$ number embolden append }
676 { ", no.~" * number *
678 { "doesn't make sense to use both volume and number if series info is missing"
680 "in BibTeX entry type `" type$ * "'" * top$
690 FUNCTION {format.in.series.volume.number}
695 format.series.volume.number *
698 FUNCTION {format.edition}
702 { output.state mid.sentence =
703 { edition "l" change.case$ " ed." * }
704 { edition "t" change.case$ " ed." * }
707 { editiontype " " * edition * }
713 % For formatting miscellaneous dates ... builds the date on top of the stack
715 FUNCTION {format.date}
717 { year field.or.null }
720 { "there's a month but no year in " cite$ * warning$ }
727 FUNCTION {format.edition.date}
728 { ", " 'append.conjunction :=
730 format.edition append
731 format.date "year" append.check
735 FUNCTION {format.howpublished.address.date}
736 { ", " 'append.conjunction :=
744 FUNCTION {format.publisher.address.edition.date}
745 { ", " 'append.conjunction :=
747 publisher "publisher" append.check
749 format.edition append
750 format.date "year" append.check
754 FUNCTION {format.org.publisher.address.date}
755 { ", " 'append.conjunction :=
760 format.date "year" append.check
764 FUNCTION {format.bvolume}
770 { " of " * format.series * }
772 "volume and number" number either.or.check
777 % format.booktitle formats the booktitle field of types incollection
780 FUNCTION {format.booktitle}
787 booktitle emphasize *
792 INTEGERS { multiresult }
794 FUNCTION {multi.page.check}
803 swap$ duplicate$ "," =
806 { #1 'multiresult := }
807 { t #2 global.max$ substring$ 't := }
814 FUNCTION {format.pages}
821 FUNCTION {format.book.pages}
824 { pages multi.page.check
825 { "pp.~" pages n.dashify * }
832 FUNCTION {format.chapter.pages}
837 { type "l" change.case$ " " * }
842 { ", " * format.book.pages * }
848 FUNCTION {empty.misc.check}
849 { author empty$ title empty$ howpublished empty$
850 month empty$ year empty$ note empty$
853 { "all relevant fields are empty in " cite$ * warning$ }
858 FUNCTION {format.thesis.type}
862 type "t" change.case$
867 FUNCTION {format.techrep.type.number}
873 " " 'append.conjunction :=
874 number embolden append
877 % Now we have a number of format.crossref functions
879 FUNCTION {format.article.crossref}
882 { "need key or journal for " cite$ * " to crossref " * crossref *
886 { "in" journal emphasize tie.or.space.connect }
889 { "in" key tie.or.space.connect }
891 " \cite{" * crossref * "}" *
894 FUNCTION {format.crossref.editor}
895 { editor #1 "{vv~}{ll}" format.name$
896 editor num.names$ duplicate$
901 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
903 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
911 FUNCTION {format.book.crossref}
913 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
916 { "vol.~" volume * " of " * }
919 editor field.or.null author field.or.null =
923 { "need editor, key, or series for " cite$ * " to crossref " *
933 { format.crossref.editor * }
935 " \cite{" * crossref * "}" *
938 FUNCTION {format.incoll.inproc.crossref}
940 editor field.or.null author field.or.null =
944 { "need editor, key, or booktitle for " cite$ * " to crossref " *
948 { "in " booktitle emphasize * }
951 { "in" slantify key tie.or.space.connect }
954 { "in" slantify format.crossref.editor tie.or.space.connect }
956 " \cite{" * crossref * "}" *
959 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
961 % The main functions for each entry type.
963 % journal, vol and year are formatted together because they are
964 % not separated by commas.
968 format.authors "author" output.check
969 format.atitle "title" output.check
971 { format.journal.vol.year output
973 format.pages "pages" output.check
975 { format.article.crossref output.nonnull
979 format.language output
988 { format.editors "author and editor" output.check }
989 { format.authors output.nonnull
991 { "author and editor" editor either.or.check }
996 format.btitle "title" output.check
998 { format.in.series.volume.number output
999 format.publisher.address.edition.date no.comma output
1001 { format.book.crossref output.nonnull
1002 format.edition.date no.comma output
1005 format.language output
1013 format.authors output
1014 format.btitle "title" output.check
1015 format.howpublished.address.date no.comma output
1016 format.language output
1025 { format.editors "author and editor" output.check }
1026 { format.authors output.nonnull
1028 { "author and editor" editor either.or.check }
1033 format.btitle "title" output.check
1035 { format.in.series.volume.number output
1036 format.chapter.pages "chapter and pages" output.check
1037 format.publisher.address.edition.date no.comma output
1039 { format.book.crossref output.nonnull
1040 format.chapter.pages "chapter and pages" output.check
1041 format.edition.date no.comma output
1044 format.language output
1050 FUNCTION {incollection}
1052 format.authors "author" output.check
1053 format.title "title" output.check
1055 { format.booktitle "booktitle" output.check
1056 format.nonauthor.editors output
1057 format.in.series.volume.number output
1058 format.chapter.pages "chapter and pages" output.check
1059 format.publisher.address.edition.date no.comma output
1061 { format.incoll.inproc.crossref output.nonnull
1062 format.chapter.pages "chapter and pages" output.check
1063 format.edition.date no.comma output
1066 format.language output
1072 FUNCTION {inproceedings}
1074 format.authors "author" output.check
1075 format.title "title" output.check
1077 { format.booktitle "booktitle" output.check
1078 format.nonauthor.editors output
1079 format.series.volume.number output
1080 format.org.publisher.address.date no.comma output
1082 { format.incoll.inproc.crossref output.nonnull
1086 format.language output
1092 FUNCTION {conference} { inproceedings }
1097 { organization empty$
1099 { organization output.nonnull }
1102 { format.authors output.nonnull }
1104 format.btitle "title" output.check
1105 ", " 'append.conjunction :=
1108 { organization append }
1112 format.edition append
1113 format.date "year" append.check
1114 parenthesize no.comma output
1115 format.language output
1121 FUNCTION {mastersthesis}
1123 format.authors "author" output.check
1124 format.btitle "title" output.check
1125 ", " 'append.conjunction :=
1127 "Master's thesis" format.thesis.type append.nonnull
1128 school "school" append.check
1130 format.date "year" append.check
1131 parenthesize no.comma output
1132 format.language output
1140 format.authors output
1141 format.btitle output
1142 format.howpublished.address.date no.comma output
1144 format.language output
1151 FUNCTION {phdthesis}
1153 format.authors "author" output.check
1154 format.btitle "title" output.check
1155 ", " 'append.conjunction :=
1157 "Ph.D. thesis" format.thesis.type append.nonnull
1158 school "school" append.check
1160 format.date "year" append.check
1161 parenthesize no.comma output
1162 format.language output
1168 FUNCTION {proceedings}
1171 { organization output }
1172 { format.editors output.nonnull }
1174 format.btitle "title" output.check
1175 format.in.series.volume.number output
1176 ", " 'append.conjunction :=
1179 { organization append }
1183 format.date "year" append.check
1184 parenthesize no.comma output
1185 format.language output
1191 FUNCTION {techreport}
1193 format.authors "author" output.check
1194 format.atitle "title" output.check
1195 format.techrep.type.number output.nonnull
1196 ", " 'append.conjunction :=
1198 institution "institution" append.check
1200 format.date "year" append.check
1201 parenthesize no.comma output
1202 format.language output
1208 FUNCTION {unpublished}
1210 format.authors "author" output.check
1211 format.btitle "title" output.check
1212 format.date parenthesize no.comma output
1213 format.language output
1215 format.note "note" output.check
1219 FUNCTION {default.type} { misc }
1221 MACRO {jan} {"Jan."}
1223 MACRO {feb} {"Feb."}
1225 MACRO {mar} {"Mar."}
1227 MACRO {apr} {"Apr."}
1231 MACRO {jun} {"Jun."}
1233 MACRO {jul} {"Jul."}
1235 MACRO {aug} {"Aug."}
1237 MACRO {sep} {"Sep."}
1239 MACRO {oct} {"Oct."}
1241 MACRO {nov} {"Nov."}
1243 MACRO {dec} {"Dec."}
1254 FUNCTION {chop.word}
1257 s #1 len substring$ =
1258 { s len #1 + global.max$ substring$ }
1263 FUNCTION {sort.format.names}
1267 s num.names$ 'numnames :=
1268 numnames 'namesleft :=
1274 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1275 nameptr numnames = t "others" = and
1279 nameptr #1 + 'nameptr :=
1280 namesleft #1 - 'namesleft :=
1285 FUNCTION {sort.format.title}
1289 "The " #4 t chop.word
1293 #1 global.max$ substring$
1296 FUNCTION {author.sort}
1299 { "to sort, need author or key in " cite$ * warning$
1305 { author sort.format.names }
1309 FUNCTION {author.editor.sort}
1313 { "to sort, need author, editor, or key in " cite$ * warning$
1319 { editor sort.format.names }
1322 { author sort.format.names }
1326 FUNCTION {author.organization.sort}
1328 { organization empty$
1330 { "to sort, need author, organization, or key in " cite$ * warning$
1336 { "The " #4 organization chop.word sortify }
1339 { author sort.format.names }
1343 FUNCTION {editor.organization.sort}
1345 { organization empty$
1347 { "to sort, need editor, organization, or key in " cite$ * warning$
1353 { "The " #4 organization chop.word sortify }
1356 { editor sort.format.names }
1365 { type$ "proceedings" =
1366 'editor.organization.sort
1368 'author.organization.sort
1377 year field.or.null sortify
1384 #1 entry.max$ substring$
1392 STRINGS { longest.label prev.author this.author }
1394 INTEGERS { number.label longest.label.width }
1396 FUNCTION {initialize.longest.label}
1397 { "" 'longest.label :=
1399 #0 'longest.label.width :=
1400 "abcxyz" 'prev.author :=
1404 FUNCTION {longest.label.pass}
1405 { number.label int.to.str$ 'label :=
1406 number.label #1 + 'number.label :=
1407 label width$ longest.label.width >
1408 { label 'longest.label :=
1409 label width$ 'longest.label.width :=
1422 this.author prev.author =
1423 { "\bysame" 'extra.label := }
1424 { "" 'extra.label :=
1434 EXECUTE {initialize.longest.label}
1436 ITERATE {longest.label.pass}
1438 FUNCTION {begin.bib}
1441 { preamble$ write$ newline$ }
1443 "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
1445 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1450 EXECUTE {init.state.consts}
1452 ITERATE {call.type$}
1456 "\end{thebibliography}" write$ newline$
1461 %% {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
1462 %% 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
1463 %% Digits \0\1\2\3\4\5\6\7\8\9
1464 %% Exclamation \! Double quote \" Hash (number) \#
1465 %% Dollar \$ Percent \% Ampersand \&
1466 %% Acute accent \' Left paren \( Right paren \)
1467 %% Asterisk \* Plus \+ Comma \,
1468 %% Minus \- Point \. Solidus \/
1469 %% Colon \: Semicolon \; Less than \<
1470 %% Equals \= Greater than \> Question mark \?
1471 %% Commercial at \@ Left bracket \[ Backslash \\
1472 %% Right bracket \] Circumflex \^ Underscore \_
1473 %% Grave accent \` Left brace \{ Vertical bar \|
1474 %% Right brace \} Tilde \~}