1 %%% ====================================================================
2 %%% @BibTeX-style-file{
3 %%% author = "Glenn Paulley",
5 %%% date = "28 August 1992",
6 %%% time = "10:23:39 199",
7 %%% filename = "chicago.bst",
8 %%% address = "Data Structuring Group
9 %%% Department of Computer Science
10 %%% University of Waterloo
11 %%% Waterloo, Ontario, Canada
13 %%% telephone = "(519) 885-1211",
14 %%% FAX = "(519) 885-1208",
15 %%% checksum = "26323 1654 5143 37417",
16 %%% email = "gnpaulle@bluebox.uwaterloo.ca",
17 %%% codetable = "ISO/ASCII",
19 %%% supported = "yes",
20 %%% abstract = "A BibTeX bibliography style that follows the
21 %%% `B' reference style of the 13th Edition of
22 %%% the Chicago Manual of Style. A detailed
23 %%% feature list is given below.",
24 %%% docstring = "The checksum field above contains a CRC-16
25 %%% checksum as the first value, followed by the
26 %%% equivalent of the standard UNIX wc (word
27 %%% count) utility output of lines, words, and
28 %%% characters. This is produced by Robert
29 %%% Solovay's checksum utility.",
31 %%% ====================================================================
33 % "Chicago" BibTeX style, chicago.bst
34 % ===================================
36 % BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09
37 % Place it in a file called chicago.bst in the BibTeX search path.
38 % You need to include chicago.sty as a \documentstyle option.
39 % (Placing it in the same directory as the LaTeX document should also work.)
40 % This "chicago" style is based on newapa.bst (American Psych. Assoc.)
41 % found at ymir.claremont.edu.
43 % Citation format: (author-last-name year)
44 % (author-last-name and author-last-name year)
45 % (author-last-name, author-last-name, and author-last-name year)
46 % (author-last-name et al. year)
48 % author-last-name (year)
49 % (author-last-name and author-last-name)
50 % (author-last-name et al.)
51 % (year) or (year,year)
54 % Reference list ordering: alphabetical by author or whatever passes
55 % for author in the absence of one.
57 % This BibTeX style has support for abbreviated author lists and for
58 % year-only citations. This is done by having the citations
61 % \citeauthoryear{full-author-info}{abbrev-author-info}{year}
63 % The LaTeX style has to have the following (or similar)
65 % \let\@internalcite\cite
66 % \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
67 % \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
68 % \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
69 % \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
70 % \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
72 % These TeX macro definitions are found in chicago.sty. Additional
73 % commands to manipulate different components of a citation can be defined
74 % so that, for example, you can list author's names without parentheses
75 % if using a citation as a noun or object in a sentence.
77 % This file was originally copied from newapa.bst at ymir.claremont.edu.
79 % Features of chicago.bst:
80 % =======================
82 % - full names used in citations, but abbreviated citations are available
84 % - if an entry has a "month", then the month and year are also printed
85 % as part of that bibitem.
86 % - all conjunctions use "and" instead of "\&"
87 % - major modification from Chicago Manual of Style (13th ed.) is that
88 % only the first author in a reference appears last name first-
89 % additional authors appear as J. Q. Public.
90 % - pages are listed as "pp. xx-xx" in all entry types except
92 % - book, inbook, and manual use "location: publisher" (or organization)
93 % for address and publisher. All other types list publishers separately.
94 % - "pp." are used to identify page numbers for all entry types except
96 % - organization is used as a citation label if neither author nor editor
97 % is present (for manuals).
98 % - "et al." is used for long author and editor lists, or when "others"
101 % Modifications and bug fixes from newapa.bst:
102 % ===========================================
104 % - added month, year to bib entries if month is present
105 % - fixed bug with In proceedings, added necessary comma after title
106 % - all conjunctions changed to "and" from "\&"
107 % - fixed bug with author labels in my.full.label: "et al." now is
108 % generated when "others" is an author name
109 % - major modification from Chicago Manual of Style (13th ed.) is that
110 % only the first author in a reference appears last name first-
111 % additional authors appear as J. Q. Public.
112 % - pages are listed as "pp. xx-xx" in all entry types except
113 % article entries. Unnecessary (IMHO) "()" around page numbers
114 % were removed, and page numbers now don't end with a period.
115 % - created chicago.sty for use with this bibstyle (required).
116 % - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume,
117 % number, and /or pages. Renamed to format.jour.vol.
118 % - fixed bug in formatting booktitles: additional period an error if
120 % - fixed bug: editors usually given redundant period before next clause
121 % (format.editors.dot) removed.
122 % - added label support for organizations, if both author and editor
123 % are missing (from alpha.bst). If organization is too long, then
124 % the key field is used for abbreviated citations.
125 % - In proceedings or books of several volumes, no comma was written
126 % between the "Volume x" and the page numbers (this was intentional
127 % in newapa.bst). Fixed.
128 % - Some journals may not have volumes/numbers, only month/year (eg.
129 % IEEE Computer). Fixed bug in article style that assumed volume/number
130 % was always present.
132 % Original documentation for newapa.sty:
133 % =====================================
135 % This version was made by modifying the master file made by
136 % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX
137 % style of Peter F. Patel-Schneider.
139 % Copyright (C) 1985, all rights reserved.
140 % Copying of this file is authorized only if either
141 % (1) you make absolutely no changes to your copy, including name, or
142 % (2) if you do make changes, you name it something other than 'newapa.bst'.
143 % There are undoubtably bugs in this style. If you make bug fixes,
144 % improvements, etc. please let me know. My e-mail address is:
145 % spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com
147 % This style was made from 'plain.bst', 'named.bst', and 'apalike.bst',
148 % with lots of tweaking to make it look like APA style, along with tips
149 % from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
177 { label.year extra.label sort.year sort.label }
179 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
181 FUNCTION {init.state.consts}
184 #2 'after.sentence :=
190 FUNCTION {output.nonnull}
192 output.state mid.sentence =
194 { output.state after.block =
199 { output.state before.all =
201 { add.period$ " " * write$ }
205 mid.sentence 'output.state :=
211 % Use a colon to separate output. Used only for address/publisher
212 % combination in book/inbook types, address/institution for manuals,
213 % and organization:publisher for proceedings (inproceedings).
215 FUNCTION {output.nonnull.colon}
217 output.state mid.sentence =
219 { output.state after.block =
224 { output.state before.all =
226 { add.period$ " " * write$ }
230 mid.sentence 'output.state :=
243 FUNCTION {output.colon}
246 'output.nonnull.colon
250 FUNCTION {output.check}
253 { pop$ "empty " t * " in " * cite$ * warning$ }
258 FUNCTION {output.check.colon}
261 { pop$ "empty " t * " in " * cite$ * warning$ }
262 'output.nonnull.colon
266 FUNCTION {output.year.check}
268 { "empty year in " cite$ * warning$ }
270 " (" year * extra.label *
273 { ", " * month * ")" * }
275 mid.sentence 'output.state :=
288 { output.state before.all =
290 { after.block 'output.state := }
294 FUNCTION {new.sentence}
295 { output.state after.block =
297 { output.state before.all =
299 { after.sentence 'output.state := }
323 FUNCTION {new.block.checka}
330 FUNCTION {new.block.checkb}
339 FUNCTION {new.sentence.checka}
346 FUNCTION {new.sentence.checkb}
355 FUNCTION {field.or.null}
363 % Emphasize the top string on the stack.
368 { "{\em " swap$ * "}" * }
373 % Emphasize the top string on the stack, but add a trailing space.
375 FUNCTION {emphasize.space}
378 { "{\em " swap$ * "\/}" * }
382 INTEGERS { nameptr namesleft numnames }
384 % Format bibliographical entries with the first author last name first,
385 % and subsequent authors with initials followed by last name.
386 % All names are formatted in this routine.
388 FUNCTION {format.names}
390 #1 'nameptr := % nameptr = 1;
391 s num.names$ 'numnames := % numnames = num.name$(s);
392 numnames 'namesleft :=
396 {s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
397 {s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
408 { " and " * t * } % from Chicago Manual of Style
415 s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
416 "\protect \index {" * t * "|hyperemph}" *
417 nameptr #1 + 'nameptr := % nameptr += 1;
418 namesleft #1 - 'namesleft := % namesleft =- 1;
423 FUNCTION {my.full.label}
425 #1 'nameptr := % nameptr = 1;
426 s num.names$ 'numnames := % numnames = num.name$(s);
427 numnames 'namesleft :=
430 { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name
440 { " and " * t * } % from Chicago Manual of Style
447 s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
448 "\protect \index {" * t * "|bold}" *
449 nameptr #1 + 'nameptr := % nameptr += 1;
450 namesleft #1 - 'namesleft := % namesleft =- 1;
456 FUNCTION {format.names.fml}
458 % Format names in "familiar" format, with first initial followed by
459 % last name. Like format.names, ALL names are formatted.
462 #1 'nameptr := % nameptr = 1;
463 s num.names$ 'numnames := % numnames = num.name$(s);
464 numnames 'namesleft :=
467 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
486 nameptr #1 + 'nameptr := % nameptr += 1;
487 namesleft #1 - 'namesleft := % namesleft =- 1;
492 FUNCTION {format.authors}
495 { author format.names }
499 FUNCTION {format.key}
501 { key field.or.null }
507 % Format editor names for use in the "in" types: inbook, incollection,
508 % inproceedings: first initial, then last names. When editors are the
509 % LABEL for an entry, then format.editor is used which lists editors
510 % by last name first.
512 FUNCTION {format.editors.fml}
515 { editor format.names.fml
516 editor num.names$ #1 >
525 % Format editor names for use in labels, last names first.
527 FUNCTION {format.editors}
530 { editor format.names
531 editor num.names$ #1 >
539 FUNCTION {format.title}
542 { title "t" change.case$ }
546 % Note that the APA style requres case changes
547 % in article titles. The following does not
548 % change cases. If you perfer it, uncomment the
549 % following and comment out the above.
551 %FUNCTION {format.title}
562 { t #1 #1 substring$ "-" =
563 { t #1 #2 substring$ "--" = not
565 t #2 global.max$ substring$ 't :=
567 { { t #1 #1 substring$ "-" = }
569 t #2 global.max$ substring$ 't :=
575 { t #1 #1 substring$ *
576 t #2 global.max$ substring$ 't :=
583 FUNCTION {format.btitle}
588 { volume empty$ % gnp - check for volume, then don't need period
589 { "{\em " title * "\/} (" * edition * " ed.)" * "." * }
590 { "{\em " title * "\/} (" * edition * " ed.)" * }
598 FUNCTION {format.emphasize.booktitle}
600 { booktitle emphasize }
602 { booktitle emphasize }
603 { volume empty$ % gnp - extra period an error if book has a volume
604 { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *}
605 { "{\em " booktitle * "\/} (" * edition * " ed.)" * }
614 FUNCTION {tie.or.space.connect}
615 { duplicate$ text.length$ #3 <
622 FUNCTION {either.or.check}
625 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
629 FUNCTION {format.bvolume}
632 { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
635 { " of " * series emphasize * }
637 "volume and number" number either.or.check
642 FUNCTION {format.number.series}
645 { series field.or.null }
646 { output.state mid.sentence =
647 { "Number" } % gnp - changed to mixed case always
650 number tie.or.space.connect
652 { "there's a number but no series in " cite$ * warning$ }
653 { " in " * series * }
662 INTEGERS { multiresult }
664 FUNCTION {multi.page.check}
673 swap$ duplicate$ "," =
676 { #1 'multiresult := }
677 { t #2 global.max$ substring$ 't := }
684 FUNCTION {format.pages}
687 { pages multi.page.check
688 { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed ()
689 { "pp.\ " pages tie.or.space.connect }
695 % By Young (and Spencer)
696 % GNP - fixed bugs with missing volume, number, and/or pages
698 % Format journal, volume, number, pages for article types.
700 FUNCTION {format.jour.vol}
703 { "no journal in " cite$ * warning$
705 { journal emphasize.space }
708 { fjournal emphasize.space }
712 { "no number and no volume in " cite$ * warning$
714 { "~{\em " * Volume * "}" * }
718 {"no volume for " cite$ * warning$
719 "~(" * number * ")" * }
721 volume emphasize.space
722 "(" * number * ")" * * }
727 {"page numbers missing in " cite$ * warning$
728 "" * } % gnp - place a null string on the stack for output
730 { pop$ format.pages }
731 { ", " * pages n.dashify * } % gnp - removed pp. for articles
737 FUNCTION {format.chapter.pages}
741 { "Chapter" } % gnp - changed to mixed case
742 { type "t" change.case$ }
744 chapter tie.or.space.connect
746 {"page numbers missing in " cite$ * warning$} % gnp - added check
747 { ", " * format.pages * }
753 FUNCTION {format.in.ed.booktitle}
757 { "In " format.emphasize.booktitle * }
758 { "In " format.editors.fml * ", " * format.emphasize.booktitle * }
764 FUNCTION {format.thesis.type}
768 type "t" change.case$
773 FUNCTION {format.tr.number}
775 { "Technical Report" }
780 { number tie.or.space.connect }
784 FUNCTION {format.article.crossref}
786 "\citeN{" * crossref * "}" *
789 FUNCTION {format.crossref.editor}
790 { editor #1 "{vv~}{ll}" format.name$
791 editor num.names$ duplicate$
796 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
798 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
806 FUNCTION {format.book.crossref}
808 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
811 { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
816 editor field.or.null author field.or.null =
820 { "need editor, key, or series for " cite$ * " to crossref " *
824 { "{\em " * series * "\/}" * }
830 { format.crossref.editor * }
832 " \citeN{" * crossref * "}" *
835 FUNCTION {format.incoll.inproc.crossref}
837 " \citeN{" * crossref * "}" *
842 % determines "short" names for the abbreviated author information.
843 % "Long" labels are created in calc.label, using the routine my.full.label
844 % to format author and editor fields.
846 % There are 4 cases for labels. (n=3 in the example)
848 % b) one to n Foo, Bar and Baz
849 % c) use of "and others" Foo, Bar et al.
850 % d) more than n Foo et al.
852 FUNCTION {format.lab.names}
854 s num.names$ 'numnames :=
855 numnames #2 > % change number to number of others allowed before
857 { s #1 "{vv~}{ll}" format.name$
858 "\protect \index {" *
859 s #1 "{vv~}{ll}{, jj}{, f.}" format.name$ *
861 "\protect\chicagoetal/" * }
863 numnames #1 - 'namesleft :=
865 s #1 "{vv~}{ll}" format.name$
866 "\protect \index {" *
867 s #1 "{vv~}{ll}{, jj}{, f.}" format.name$ *
871 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
872 { "\protect\chicagoetal/" * }
873 { "\protect\chicagoand/" * s nameptr "{vv~}{ll}" format.name$ *
874 "\protect \index {" *
875 s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ *
880 { ", " * s nameptr "{vv~}{ll}" format.name$ * }
882 nameptr #1 + 'nameptr :=
883 namesleft #1 - 'namesleft :=
890 FUNCTION {author.key.label}
893 { "no key, author in " cite$ * warning$
894 cite$ #1 #3 substring$ }
898 { author format.lab.names }
902 FUNCTION {editor.key.label}
905 { "no key, editor in " cite$ * warning$
906 cite$ #1 #3 substring$ }
910 { editor format.lab.names }
914 FUNCTION {author.key.organization.label}
916 % added - gnp. Provide label formatting by organization if author is null.
919 { organization empty$
921 { "no key, author or organization in " cite$ * warning$
922 cite$ #1 #3 substring$ }
929 { author format.lab.names }
933 FUNCTION {editor.key.organization.label}
935 % added - gnp. Provide label formatting by organization if editor is null.
938 { organization empty$
940 { "no key, editor or organization in " cite$ * warning$
941 cite$ #1 #3 substring$ }
948 { editor format.lab.names }
952 FUNCTION {author.editor.key.label}
956 { "no key, author, or editor in " cite$ * warning$
957 cite$ #1 #3 substring$ }
961 { editor format.lab.names }
964 { author format.lab.names }
968 FUNCTION {calc.label.orig}
970 % Changed - GNP. See also author.organization.sort, editor.organization.sort
971 % Form label for BibTeX entry. The classification of which fields are used
972 % for which type of entry (book, inbook, etc.) are taken from alpha.bst.
973 % The change here from newapa is to also include organization as a
974 % citation label if author or editor is missing.
979 'author.editor.key.label
980 { type$ "proceedings" =
981 'editor.key.organization.label
983 'author.key.organization.label
991 author empty$ % generate the full label citation information.
993 { organization empty$
994 { "no author, editor, or organization in " cite$ * warning$
999 { editor my.full.label }
1002 { author.key.label }
1005 % leave label on the stack, to be popped when required.
1008 % year field.or.null purify$ #-1 #4 substring$ *
1010 % save the year for sort processing afterwards (adding a, b, c, etc.)
1012 year field.or.null purify$ #-1 #4 substring$
1016 FUNCTION {calc.label}
1018 % Changed - GNP. See also author.organization.sort, editor.organization.sort
1019 % Form label for BibTeX entry. The classification of which fields are used
1020 % for which type of entry (book, inbook, etc.) are taken from alpha.bst.
1021 % The change here from newapa is to also include organization as a
1022 % citation label if author or editor is missing.
1027 'author.editor.key.label
1028 { type$ "proceedings" =
1029 'editor.key.organization.label
1031 'author.key.organization.label
1039 author empty$ % generate the full label citation information.
1041 { organization empty$
1042 { "no author, editor, or organization in " cite$ * warning$
1047 { editor my.full.label }
1050 { author my.full.label }
1053 % leave label on the stack, to be popped when required.
1055 "}{" * swap$ * "}{" * title * "}{" *
1056 % year field.or.null purify$ #-1 #4 substring$ *
1058 % save the year for sort processing afterwards (adding a, b, c, etc.)
1060 year field.or.null purify$ #-1 #4 substring$
1064 FUNCTION {output.bibitem}
1067 "\bibitem[\protect\citeauthortitleyear{" write$
1076 before.all 'output.state :=
1082 "author" output.check
1083 author format.key output % added
1084 output.year.check % added
1087 "title" output.check
1090 { format.jour.vol output
1092 { format.article.crossref output.nonnull
1105 "author and editor" output.check }
1109 { "author and editor" editor either.or.check }
1114 output.year.check % added
1117 "title" output.check
1119 { format.bvolume output
1121 format.number.series output
1124 publisher "publisher" output.check.colon
1127 format.book.crossref output.nonnull
1137 format.authors output
1138 author format.key output % added
1139 output.year.check % added
1142 "title" output.check
1155 "author and editor" output.check
1157 { format.authors output.nonnull
1159 { "author and editor" editor either.or.check }
1164 output.year.check % added
1167 "title" output.check
1169 { format.bvolume output
1170 format.chapter.pages
1171 "chapter and pages" output.check
1173 format.number.series output
1177 "publisher" output.check.colon
1179 { format.chapter.pages "chapter and pages" output.check
1181 format.book.crossref output.nonnull
1189 FUNCTION {incollection}
1192 "author" output.check
1193 author format.key output % added
1194 output.year.check % added
1197 "title" output.check
1200 { format.in.ed.booktitle
1201 "booktitle" output.check
1202 format.bvolume output
1203 format.number.series output
1204 format.chapter.pages output % gnp - was special.output.nonnull
1205 % left out comma before page numbers
1208 publisher "publisher" output.check.colon
1210 { format.incoll.inproc.crossref
1212 format.chapter.pages output
1220 FUNCTION {inproceedings}
1223 "author" output.check
1224 author format.key output % added
1225 output.year.check % added
1228 "title" output.check
1231 { format.in.ed.booktitle
1232 "booktitle" output.check
1233 format.bvolume output
1234 format.number.series output
1239 publisher output.colon
1241 { format.incoll.inproc.crossref output.nonnull
1250 FUNCTION {conference} { inproceedings }
1256 { organization "organization" output.check
1257 organization format.key output } % if all else fails, use key
1258 { format.editors "author and editor" output.check }
1261 { format.authors output.nonnull }
1263 output.year.check % added
1266 "title" output.check
1267 organization address new.block.checkb
1268 % Reversed the order of "address" and "organization", added the ":".
1270 organization "organization" output.check.colon
1273 % organization output
1279 FUNCTION {mastersthesis}
1282 "author" output.check
1283 author format.key output % added
1284 output.year.check % added
1287 "title" output.check
1289 "Master's thesis" format.thesis.type output.nonnull
1290 school "school" output.check
1299 format.authors output
1300 author format.key output % added
1301 output.year.check % added
1302 title howpublished new.block.checkb
1311 FUNCTION {phdthesis}
1314 "author" output.check
1315 author format.key output % added
1316 output.year.check % added
1319 "title" output.check
1321 "Ph.\ D. thesis" format.thesis.type output.nonnull
1322 school "school" output.check
1329 FUNCTION {proceedings}
1332 { organization output
1333 organization format.key output } % gnp - changed from author format.key
1334 { format.editors output.nonnull }
1336 % author format.key output % gnp - removed (should be either
1337 % editor or organization
1338 output.year.check % added (newapa)
1341 "title" output.check
1342 format.bvolume output
1343 format.number.series output
1347 publisher output.colon
1353 FUNCTION {techreport}
1356 "author" output.check
1357 author format.key output % added
1358 output.year.check % added
1361 "title" output.check
1363 format.tr.number output.nonnull
1365 "institution" output.check
1372 FUNCTION {unpublished}
1375 "author" output.check
1376 author format.key output % added
1377 output.year.check % added
1380 "title" output.check
1382 note "note" output.check
1386 FUNCTION {default.type} { misc }
1388 MACRO {jan} {"January"}
1390 MACRO {feb} {"February"}
1392 MACRO {mar} {"March"}
1394 MACRO {apr} {"April"}
1398 MACRO {jun} {"June"}
1400 MACRO {jul} {"July"}
1402 MACRO {aug} {"August"}
1404 MACRO {sep} {"September"}
1406 MACRO {oct} {"October"}
1408 MACRO {nov} {"November"}
1410 MACRO {dec} {"December"}
1412 MACRO {acmcs} {"ACM Computing Surveys"}
1414 MACRO {acta} {"Acta Informatica"}
1416 MACRO {ai} {"Artificial Intelligence"}
1418 MACRO {cacm} {"Communications of the ACM"}
1420 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1422 MACRO {ibmsj} {"IBM Systems Journal"}
1424 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1426 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1429 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1431 MACRO {ipl} {"Information Processing Letters"}
1433 MACRO {jacm} {"Journal of the ACM"}
1435 MACRO {jcss} {"Journal of Computer and System Sciences"}
1437 MACRO {scp} {"Science of Computer Programming"}
1439 MACRO {sicomp} {"SIAM Journal on Computing"}
1441 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1443 MACRO {tods} {"ACM Transactions on Database Systems"}
1445 MACRO {tog} {"ACM Transactions on Graphics"}
1447 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1449 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1451 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1453 MACRO {tcs} {"Theoretical Computer Science"}
1464 FUNCTION {chop.word}
1467 s #1 len substring$ =
1468 { s len #1 + global.max$ substring$ }
1475 FUNCTION {sort.format.names}
1479 s num.names$ 'numnames :=
1480 numnames 'namesleft :=
1483 { year field.or.null purify$ #-1 #4 substring$ * }
1490 s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
1491 nameptr numnames = t "others" = and
1495 nameptr #1 + 'nameptr :=
1496 namesleft #1 - 'namesleft :=
1501 FUNCTION {sort.format.title}
1505 "The " #4 t chop.word
1509 #1 global.max$ substring$
1512 FUNCTION {author.sort}
1515 { "to sort, need author or key in " cite$ * warning$
1520 { author sort.format.names }
1524 FUNCTION {editor.sort}
1527 { "to sort, need editor or key in " cite$ * warning$
1533 { editor sort.format.names }
1537 FUNCTION {author.editor.sort}
1539 { "missing author in " cite$ * warning$
1542 { "to sort, need author, editor, or key in " cite$ * warning$
1548 { editor sort.format.names }
1551 { author sort.format.names }
1555 FUNCTION {author.organization.sort}
1557 % added - GNP. Stack author or organization for sorting (from alpha.bst).
1558 % Unlike alpha.bst, we need entire names, not abbreviations
1561 { organization empty$
1563 { "to sort, need author, organization, or key in " cite$ * warning$
1569 { organization sortify }
1572 { author sort.format.names }
1576 FUNCTION {editor.organization.sort}
1578 % added - GNP. Stack editor or organization for sorting (from alpha.bst).
1579 % Unlike alpha.bst, we need entire names, not abbreviations
1582 { organization empty$
1584 { "to sort, need editor, organization, or key in " cite$ * warning$
1590 { organization sortify }
1593 { editor sort.format.names }
1599 % Presort creates the bibentry's label via a call to calc.label, and then
1600 % sorts the entries based on entry type. Chicago.bst adds support for
1601 % including organizations as the sort key; the following is stolen from
1604 { %calc.label sortify % recalculate bibitem label
1605 %year field.or.null purify$ #-1 #4 substring$ * % add year
1606 %duplicate$ warning$
1613 { type$ "proceedings" =
1614 'editor.organization.sort
1616 'author.organization.sort
1623 #1 entry.max$ substring$ % added for newapa
1624 'sort.label := % added for newapa
1625 sort.label % added for newapa
1632 #1 entry.max$ substring$
1638 SORT % by label, year, author/editor, title
1640 STRINGS { last.label next.extra }
1642 INTEGERS { last.extra.num }
1644 FUNCTION {initialize.extra.label.stuff}
1645 { #0 int.to.chr$ 'last.label :=
1647 #0 'last.extra.num :=
1650 FUNCTION {forward.pass}
1652 % Pass through all entries, comparing current entry to last one.
1653 % Need to concatenate year to the stack (done by calc.label) to determine
1654 % if two entries are the same (see presort)
1657 calc.label.orig year field.or.null purify$ #-1 #4 substring$ * % add year
1658 #1 entry.max$ substring$ = % are they equal?
1659 { last.extra.num #1 + 'last.extra.num :=
1660 last.extra.num int.to.chr$ 'extra.label :=
1662 { "a" chr.to.int$ 'last.extra.num :=
1664 calc.label.orig year field.or.null purify$ #-1 #4 substring$ * % add year
1665 #1 entry.max$ substring$ 'last.label := % assign to last.label
1670 FUNCTION {reverse.pass}
1672 { "a" 'extra.label := }
1675 label.year extra.label * 'sort.year :=
1676 extra.label 'next.extra :=
1679 EXECUTE {initialize.extra.label.stuff}
1681 ITERATE {forward.pass}
1683 REVERSE {reverse.pass}
1685 FUNCTION {bib.sort.order}
1689 year field.or.null sortify
1696 #1 entry.max$ substring$
1700 ITERATE {bib.sort.order}
1702 SORT % by sort.label, year, title --- giving final bib. order.
1704 FUNCTION {begin.bib}
1708 { preamble$ write$ newline$ }
1710 "\begin{thebibliography}{}" write$ newline$
1716 EXECUTE {init.state.consts}
1718 ITERATE {call.type$}
1722 "\end{thebibliography}" write$ newline$