Debian Codegraph @

texmf-dist/bibtex/bst/harvard/apsr.bst

raw
1 % BibTeX standard bibliography style `apsr' (one of the harvard family)
2 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
3 % Copyright (C) 1991, all rights reserved.
4 % Copying of this file is authorized only if either
5 % (1) you make absolutely no changes to your copy, including name, or
6 % (2) if you do make changes, you name it something other than
7 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
8 % dcu.bst or kluwer.bst, jmr.bst, apsr.bst.
9 % This restriction helps ensure that all standard styles are identical.
10 % The file harvard.tex has the documentation for this style.
11
12 % ACKNOWLEDGEMENT:
13 % This document is a modified version of alpha.bst to which it owes much of
14 % its functionality.
15
16 % AUTHOR
17 % Peter Williams, Key Centre for Design Quality, Sydney University
18 % e-mail: [email protected]
19
20 ENTRY
21 { address
22 author
23 booktitle
24 chapter
25 edition
26 editor
27 howpublished
28 institution
29 journal
30 key
31 month
32 note
33 number
34 organization
35 pages
36 publisher
37 school
38 series
39 title
40 type
41 URL
42 volume
43 year
44 }
45 { field.used etal.allowed etal.required} %%%XXX change
46 { extra.label sort.label list.year }
47
48 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
49
50 FUNCTION {init.state.consts}
51 { #0 'before.all :=
52 #1 'mid.sentence :=
53 #2 'after.sentence :=
54 #3 'after.block :=
55 }
56
57 STRINGS { s t f }
58
59 FUNCTION {output.nonnull}
60 { 's :=
61 output.state mid.sentence =
62 { " " * write$ }
63 { output.state after.block =
64 { add.period$ write$
65 newline$
66 "\newblock " write$
67 }
68 { output.state before.all =
69 'write$
70 { add.period$ " " * write$ }
71 if$
72 }
73 if$
74 mid.sentence 'output.state :=
75 }
76 if$
77 s
78 }
79
80 FUNCTION {output}
81 { duplicate$ empty$
82 'pop$
83 'output.nonnull
84 if$
85 }
86
87 FUNCTION {output.check}
88 { 't :=
89 duplicate$ empty$
90 { pop$ "empty " t * " in " * cite$ * warning$ }
91 'output.nonnull
92 if$
93 }
94
95 FUNCTION {item.check}
96 { 't :=
97 empty$
98 { "empty " t * " in " * cite$ * warning$ }
99 { skip$ }
100 if$
101 }
102
103 FUNCTION {fin.entry}
104 { add.period$
105 write$
106 newline$
107 }
108
109 FUNCTION {new.block}
110 { output.state before.all =
111 'skip$
112 { after.block 'output.state := }
113 if$
114 }
115
116 FUNCTION {not}
117 { { #0 }
118 { #1 }
119 if$
120 }
121
122 FUNCTION {and}
123 { 'skip$
124 { pop$ #0 }
125 if$
126 }
127
128 FUNCTION {or}
129 { { pop$ #1 }
130 'skip$
131 if$
132 }
133
134 FUNCTION {field.or.null}
135 { duplicate$ empty$
136 { pop$ "" }
137 'skip$
138 if$
139 }
140
141 FUNCTION {emphasize}
142 { duplicate$ empty$
143 { pop$ "" }
144 { "{\em " swap$ * "}" * }
145 if$
146 }
147
148 FUNCTION {embolden}
149 { duplicate$ empty$
150 { pop$ "" }
151 { "{\bf " swap$ * "}" * }
152 if$
153 }
154
155 FUNCTION {quote}
156 { duplicate$ empty$
157 { pop$ "" }
158 { "``" swap$ * "''" * }
159 if$
160 }
161
162 FUNCTION {write.url}
163 { URL empty$
164 { skip$ }
165 { "\newline\harvardurl{" URL * "}" * write$ newline$ }
166 if$
167 }
168
169 INTEGERS { nameptr namesleft numnames }
170
171 FUNCTION {format.rem.names}
172 { 's :=
173 'f :=
174 #2 'nameptr :=
175 s num.names$ 'numnames :=
176 numnames #1 - 'namesleft :=
177 { namesleft #0 > }
178 { s nameptr f format.name$ 't :=
179 nameptr #1 >
180 { namesleft #1 >
181 { ", " * t * }
182 { t "others" =
183 { " et~al." * }
184 { " \harvardand\ " * t * }
185 if$
186 }
187 if$
188 }
189 't
190 if$
191 nameptr #1 + 'nameptr :=
192 namesleft #1 - 'namesleft :=
193 }
194 while$
195 }
196
197 FUNCTION {format.authors}
198 { author empty$
199 { "" }
200 { author #1 "{vv~}{ll}{, jj}{, ff}" format.name$
201 "{ff }{vv~}{ll}{, jj}" author format.rem.names
202 }
203 if$
204 }
205
206 FUNCTION {format.editors}
207 { editor empty$
208 { "" }
209 { editor #1 "{vv~}{ll}{, jj}{, ff}" format.name$
210 "{ff }{vv~}{ll}{, jj}" editor format.rem.names
211 editor num.names$ #1 >
212 { ", eds" * }
213 { ", ed." * }
214 if$
215 }
216 if$
217 }
218
219 FUNCTION {format.editors.reverse}
220 { editor empty$
221 { "" }
222 { ", ed. "
223 editor #1 "{ff }{vv~}{ll}{, jj}" format.name$ *
224 "{ff }{vv~}{ll}{, jj}" editor format.rem.names
225 }
226 if$
227 }
228
229 FUNCTION {format.title}
230 { title empty$
231 { "" }
232 { title add.period$ }
233 if$
234 }
235
236 FUNCTION {n.dashify}
237 { 't :=
238 ""
239 { t empty$ not }
240 { t #1 #1 substring$ "-" =
241 { t #1 #2 substring$ "--" = not
242 { "--" *
243 t #2 global.max$ substring$ 't :=
244 }
245 { { t #1 #1 substring$ "-" = }
246 { "-" *
247 t #2 global.max$ substring$ 't :=
248 }
249 while$
250 }
251 if$
252 }
253 { t #1 #1 substring$ *
254 t #2 global.max$ substring$ 't :=
255 }
256 if$
257 }
258 while$
259 }
260
261 FUNCTION {format.btitle}
262 { title emphasize
263 }
264
265 FUNCTION {tie.or.space.connect}
266 { duplicate$ text.length$ #3 <
267 { "~" }
268 { " " }
269 if$
270 swap$ * *
271 }
272
273 FUNCTION {either.or.check}
274 { empty$
275 'pop$
276 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
277 if$
278 }
279
280 FUNCTION {format.bvolume}
281 { volume empty$
282 { "" }
283 { "Vol." volume tie.or.space.connect
284 series empty$
285 'skip$
286 { " of " * series emphasize * }
287 if$
288 "volume and number" number either.or.check
289 }
290 if$
291 }
292
293 FUNCTION {format.number.series}
294 { volume empty$
295 { number empty$
296 { series field.or.null }
297 { output.state mid.sentence =
298 { "number" }
299 { "Number" }
300 if$
301 number tie.or.space.connect
302 series empty$
303 { "there's a number but no series in " cite$ * warning$ }
304 { " {\em in} " * series quote * }
305 if$
306 }
307 if$
308 }
309 { "" }
310 if$
311 }
312
313 FUNCTION {format.edition}
314 { edition empty$
315 { "" }
316 { output.state mid.sentence =
317 { edition "l" change.case$ " ed." * }
318 { edition "t" change.case$ " ed." * }
319 if$
320 }
321 if$
322 }
323
324 INTEGERS { multiresult }
325
326 FUNCTION {multi.page.check}
327 { 't :=
328 #0 'multiresult :=
329 { multiresult not
330 t empty$ not
331 and
332 }
333 { t #1 #1 substring$
334 duplicate$ "-" =
335 swap$ duplicate$ "," =
336 swap$ "+" =
337 or or
338 { #1 'multiresult := }
339 { t #2 global.max$ substring$ 't := }
340 if$
341 }
342 while$
343 multiresult
344 }
345
346 FUNCTION {format.pages}
347 { pages empty$
348 { "" }
349 { pages multi.page.check
350 { "pp.~" pages n.dashify * }
351 { "p.~" pages * }
352 if$
353 }
354 if$
355 }
356
357 FUNCTION {format.address}
358 { address empty$
359 { "" }
360 { address ": " *
361 }
362 if$
363 }
364
365 FUNCTION {format.vol.num.pages}
366 { volume field.or.null
367 number empty$
368 'skip$
369 { "(" number * ")" * *
370 volume empty$
371 { "there's a number but no volume in " cite$ * warning$ }
372 'skip$
373 if$
374 }
375 if$
376 pages empty$
377 'skip$
378 { duplicate$ empty$
379 { pop$ format.pages }
380 { ":" * pages n.dashify * }
381 if$
382 }
383 if$
384 }
385
386 FUNCTION {format.chapter.pages}
387 { chapter empty$
388 'format.pages
389 { type empty$
390 { "chapter" }
391 { type "l" change.case$ }
392 if$
393 chapter tie.or.space.connect
394 pages empty$
395 'skip$
396 { ", " * format.pages * }
397 if$
398 }
399 if$
400 }
401
402 FUNCTION {format.in.ed.booktitle}
403 { booktitle empty$
404 { "" }
405 { editor empty$
406 { " In " booktitle emphasize * }
407 { " In " booktitle emphasize * format.editors.reverse * }
408 if$
409 }
410 if$
411 }
412
413 FUNCTION {empty.misc.check}
414 { author empty$ title empty$ howpublished empty$
415 month empty$ year empty$ note empty$
416 and and and and and
417 key empty$ not and
418 { "all relevant fields are empty in " cite$ * warning$ }
419 'skip$
420 if$
421 }
422
423 FUNCTION {format.thesis.type}
424 { type empty$
425 'skip$
426 { pop$
427 type "t" change.case$
428 }
429 if$
430 }
431
432 FUNCTION {format.tr.number}
433 { type empty$
434 { "Technical Report" }
435 'type
436 if$
437 number empty$
438 { "t" change.case$ }
439 { number tie.or.space.connect }
440 if$
441 }
442
443 FUNCTION {format.article.crossref}
444 { key empty$
445 { journal empty$
446 { "need key or journal for " cite$ * " to crossref " * crossref *
447 warning$
448 ""
449 }
450 { "in {\em " journal * "\/} \cite{" * crossref * "}" *}
451 if$
452 }
453 { "{\em in} \citeasnoun{" crossref * "}" * }
454 if$
455
456 }
457
458 FUNCTION {format.book.crossref}
459 { volume empty$
460 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
461 "in "
462 }
463 { "Vol." volume tie.or.space.connect
464 " of " *
465 }
466 if$
467 editor empty$
468 editor field.or.null author field.or.null =
469 or
470 { key empty$
471 { series empty$
472 { "need editor, key, or series for " cite$ * " to crossref " *
473 crossref * warning$
474 "" *
475 }
476 { "{\em " * series * "\/} \cite{" * crossref * "}" *}
477 if$
478 }
479 { " \citeasnoun{" * crossref * "}" * }
480 if$
481 }
482 { " \citeasnoun{" * crossref * "}" * }
483 if$
484 }
485
486 FUNCTION {format.incoll.inproc.crossref}
487 { editor empty$
488 editor field.or.null author field.or.null =
489 or
490 { key empty$
491 { booktitle empty$
492 { "need editor, key, or booktitle for " cite$ * " to crossref " *
493 crossref * warning$
494 ""
495 }
496 { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
497 if$
498 }
499 { "{\em in} \citeasnoun{" crossref * "}" * }
500 if$
501 }
502 { "{\em in} \citeasnoun{" crossref * "}" * }
503 if$
504
505 }
506
507 INTEGERS { len }
508
509 FUNCTION {chop.word}
510 { 's :=
511 'len :=
512 s #1 len substring$ =
513 { s len #1 + global.max$ substring$ }
514 's
515 if$
516 }
517
518 INTEGERS { ind tsslen }
519
520 STRINGS { tss ret rss istr }
521
522 FUNCTION {replace.substring}{
523 'rss :=
524 'tss :=
525 'istr :=
526 "" 'ret :=
527 tss text.length$ 'tsslen :=
528 #1 'ind :=
529 { istr ind tsslen substring$ "" = not }
530 { istr ind tsslen substring$ tss =
531 { ret rss * 'ret :=
532 ind tsslen + 'ind :=
533 }
534 { ret istr ind #1 substring$ * 'ret :=
535 ind #1 + 'ind :=
536 }
537 if$
538 }
539 while$
540 ret
541 }
542
543 FUNCTION {format.lab.names.full}
544 { 's :=
545 #1 'nameptr :=
546 s num.names$ 'numnames :=
547 numnames 'namesleft :=
548 { namesleft #0 > }
549 { s nameptr "{vv~}{ll}" format.name$ 't :=
550 nameptr #1 >
551 { namesleft #1 >
552 { ", " * t * }
553 { t "others" =
554 { " et~al." * }
555 { " \harvardand\ " * t * }
556 if$
557 }
558 if$
559 }
560 't
561 if$
562 nameptr #1 + 'nameptr :=
563 namesleft #1 - 'namesleft :=
564 }
565 while$
566 }
567
568 FUNCTION {format.lab.names.abbr}
569 { 's :=
570 s num.names$ 'numnames :=
571 numnames #1 >
572 { numnames #3 >
573 { s #1 "{vv~}{ll}" format.name$ " et~al." * }
574 { s format.lab.names.full }
575 if$
576 }
577 { s #1 "{vv~}{ll}" format.name$ }
578 if$
579 }
580
581 INTEGERS { author.field editor.field organization.field title.field key.field }
582
583 FUNCTION {init.field.constants}
584 { #0 'author.field :=
585 #1 'editor.field :=
586 #2 'organization.field :=
587 #3 'title.field :=
588 #4 'key.field :=
589 }
590
591 FUNCTION {make.list.label}
592 { author.field field.used =
593 { format.authors }
594 { editor.field field.used =
595 { format.editors }
596 { organization.field field.used =
597 { "The " #4 organization chop.word #3 text.prefix$ }
598 { title.field field.used =
599 { format.btitle }
600 { key.field field.used =
601 { key #3 text.prefix$ }
602 { "Internal error :001 on " cite$ * " label" * warning$ }
603 if$
604 }
605 if$
606 }
607 if$
608 }
609 if$
610 }
611 if$
612 }
613
614 FUNCTION {make.full.label}
615 { author.field field.used =
616 { author format.lab.names.full }
617 { editor.field field.used =
618 { editor format.lab.names.full }
619 { organization.field field.used =
620 { "The " #4 organization chop.word #3 text.prefix$ }
621 { title.field field.used =
622 { format.btitle }
623 { key.field field.used =
624 { key #3 text.prefix$ }
625 { "Internal error :001 on " cite$ * " label" * warning$ }
626 if$
627 }
628 if$
629 }
630 if$
631 }
632 if$
633 }
634 if$
635 }
636
637 FUNCTION {make.abbr.label} %%%XXX change
638 {
639 etal.allowed
640 { author.field field.used =
641 { author format.lab.names.abbr }
642 { editor.field field.used =
643 { editor format.lab.names.abbr }
644 { organization.field field.used =
645 { "The " #4 organization chop.word #3 text.prefix$ }
646 { title.field field.used =
647 { format.btitle }
648 { key.field field.used =
649 { key #3 text.prefix$ }
650 {"Internal error :001 on " cite$ * " label" * warning$ }
651 if$
652 }
653 if$
654 }
655 if$
656 }
657 if$
658 }
659 if$
660 }
661 { make.full.label }
662 if$
663 }
664
665 FUNCTION {output.bibitem}
666 { newline$
667 etal.allowed %%%XXX change
668 etal.required
669 and
670 {
671 "\harvarditem[" write$
672 make.abbr.label write$
673 "]{" write$
674 }
675 {
676 "\harvarditem{" write$
677 }
678 if$
679 make.full.label write$
680 "}{" write$
681 list.year write$
682 "}{" write$
683 cite$ write$
684 "}" write$
685 newline$
686 ""
687 before.all 'output.state :=
688 }
689
690 FUNCTION {list.label.output}
691 { make.list.label add.period$ " " * write$
692 }
693
694 FUNCTION {article}
695 { output.bibitem
696 list.label.output
697 list.year output.nonnull
698 new.block
699 author "author" item.check
700 title.field field.used =
701 { skip$ }
702 { format.title quote "title" output.check }
703 if$
704 crossref missing$
705 { journal emphasize "journal" duplicate$ item.check
706 year empty$
707 { ". Forthcoming" * output new.block }
708 { " " * format.vol.num.pages * output }
709 if$
710 }
711 { format.article.crossref output.nonnull
712 format.pages output
713 }
714 if$
715 new.block
716 note output
717 fin.entry
718 write.url
719 }
720
721 FUNCTION {book}
722 { output.bibitem
723 list.label.output
724 list.year output.nonnull
725 new.block
726 author empty$
727 { editor "author and editor" item.check }
728 { crossref missing$
729 { "author and editor" editor either.or.check }
730 'skip$
731 if$
732 }
733 if$
734 title.field field.used =
735 { skip$ }
736 { format.btitle "title" output.check }
737 if$
738 new.block
739 crossref missing$
740 { format.bvolume output
741 format.number.series output
742 format.edition output
743 format.address output
744 publisher "publisher" output.check
745 }
746 { format.book.crossref output.nonnull
747 format.edition output
748 }
749 if$
750 new.block
751 note output
752 fin.entry
753 write.url
754 }
755
756 FUNCTION {booklet}
757 { output.bibitem
758 list.label.output
759 list.year output.nonnull
760 new.block
761 title.field field.used =
762 { skip$ }
763 { format.title quote "title" output.check }
764 if$
765 format.address output
766 howpublished output
767 new.block
768 note output
769 fin.entry
770 write.url
771 }
772
773 FUNCTION {inbook}
774 { output.bibitem
775 list.label.output
776 list.year output.nonnull
777 new.block
778 author empty$
779 { editor "author and editor" item.check }
780 { crossref missing$
781 { "author and editor" editor either.or.check }
782 'skip$
783 if$
784 }
785 if$
786 title.field field.used =
787 { skip$ }
788 { format.btitle "title" output.check }
789 if$
790 new.block
791 crossref missing$
792 { format.bvolume output
793 format.number.series output
794 format.edition output
795 format.address output
796 publisher "publisher" output.check
797 }
798 { format.book.crossref output.nonnull
799 format.edition output
800 }
801 if$
802 format.chapter.pages "chapter and pages" output.check
803 new.block
804 note output
805 fin.entry
806 write.url
807 }
808
809 FUNCTION {incollection}
810 { output.bibitem
811 list.label.output
812 list.year output.nonnull
813 new.block
814 title.field field.used =
815 { skip$ }
816 { format.title "title" output.check }
817 if$
818 author "author" item.check
819 crossref missing$
820 { format.in.ed.booktitle "booktitle" output.check
821 new.block
822 format.edition output
823 format.bvolume output
824 format.number.series output
825 format.address output
826 publisher "publisher" output.check
827 }
828 { format.incoll.inproc.crossref output.nonnull
829 }
830 if$
831 format.chapter.pages output
832 new.block
833 note output
834 fin.entry
835 write.url
836 }
837
838 FUNCTION {inproceedings}
839 { output.bibitem
840 list.label.output
841 list.year output.nonnull
842 new.block
843 title.field field.used =
844 { skip$ }
845 { format.title "title" output.check }
846 if$
847 author "author" item.check
848 crossref missing$
849 { format.in.ed.booktitle "booktitle" output.check
850 new.block
851 format.bvolume output
852 format.number.series output
853 address empty$
854 { organization output
855 publisher output
856 }
857 { organization output
858 format.address output.nonnull
859 publisher output
860 }
861 if$
862 }
863 { format.incoll.inproc.crossref output.nonnull
864 }
865 if$
866 format.pages output
867 new.block
868 note output
869 fin.entry
870 write.url
871 }
872
873 FUNCTION {conference} { inproceedings }
874
875 FUNCTION {manual}
876 { output.bibitem
877 list.label.output
878 list.year output.nonnull
879 new.block
880 title.field field.used =
881 { skip$ }
882 { format.btitle "title" output.check }
883 if$
884 new.block
885 format.edition output
886 new.block
887 author empty$
888 { organization empty$
889 { format.address output }
890 'skip$
891 if$
892 }
893 { format.address output
894 organization output
895 }
896 if$
897 new.block
898 note output
899 fin.entry
900 write.url
901 }
902
903 FUNCTION {mastersthesis}
904 { output.bibitem
905 list.label.output
906 list.year output.nonnull
907 new.block
908 author "author" item.check
909 title.field field.used =
910 { skip$ }
911 { format.title "title" output.check }
912 if$
913 "Master's thesis" format.thesis.type output.nonnull
914 school "school" output.check
915 format.address output
916 new.block
917 note output
918 fin.entry
919 write.url
920 }
921
922 FUNCTION {misc}
923 { output.bibitem
924 list.label.output
925 list.year output.nonnull
926 new.block
927 title.field field.used =
928 { skip$ }
929 { format.title quote output }
930 if$
931 howpublished output
932 new.block
933 note output
934 fin.entry
935 write.url
936 empty.misc.check
937 }
938
939 FUNCTION {phdthesis}
940 { output.bibitem
941 list.label.output
942 list.year output.nonnull
943 new.block
944 author "author" item.check
945 title.field field.used =
946 { skip$ }
947 { title "title" output.check }
948 if$
949 "PhD thesis" format.thesis.type output.nonnull
950 school "school" output.check
951 format.address output
952 new.block
953 note output
954 fin.entry
955 write.url
956 }
957
958 FUNCTION {proceedings}
959 { output.bibitem
960 list.label.output
961 list.year output.nonnull
962 new.block
963 title.field field.used =
964 { skip$ }
965 { format.btitle "title" output.check }
966 if$
967 new.block
968 format.bvolume output
969 format.number.series output
970 address empty$
971 { editor empty$
972 { skip$ }
973 { organization output
974 }
975 if$
976 publisher output
977 }
978 { editor empty$
979 'skip$
980 { organization output }
981 if$
982 format.address output.nonnull
983 publisher output
984 }
985 if$
986 new.block
987 note output
988 fin.entry
989 write.url
990 }
991
992 FUNCTION {techreport}
993 { output.bibitem
994 list.label.output
995 list.year output.nonnull
996 new.block
997 author "author" item.check
998 title.field field.used =
999 { skip$ }
1000 { format.title "title" output.check }
1001 if$
1002 format.tr.number output.nonnull
1003 institution "institution" output.check
1004 format.address output
1005 new.block
1006 note output
1007 fin.entry
1008 write.url
1009 }
1010
1011 FUNCTION {unpublished}
1012 { output.bibitem
1013 list.label.output
1014 list.year output.nonnull
1015 new.block
1016 author "author" item.check
1017 title.field field.used =
1018 { skip$ }
1019 { format.title quote "title" output.check }
1020 if$
1021 note "note" output.check
1022 fin.entry
1023 write.url
1024 }
1025
1026 FUNCTION {default.type} { misc }
1027
1028 MACRO {jan} {"January"}
1029
1030 MACRO {feb} {"February"}
1031
1032 MACRO {mar} {"March"}
1033
1034 MACRO {apr} {"April"}
1035
1036 MACRO {may} {"May"}
1037
1038 MACRO {jun} {"June"}
1039
1040 MACRO {jul} {"July"}
1041
1042 MACRO {aug} {"August"}
1043
1044 MACRO {sep} {"September"}
1045
1046 MACRO {oct} {"October"}
1047
1048 MACRO {nov} {"November"}
1049
1050 MACRO {dec} {"December"}
1051
1052 MACRO {acmcs} {"ACM Computing Surveys"}
1053
1054 MACRO {acta} {"Acta Informatica"}
1055
1056 MACRO {cacm} {"Communications of the ACM"}
1057
1058 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1059
1060 MACRO {ibmsj} {"IBM Systems Journal"}
1061
1062 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1063
1064 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1065
1066 MACRO {ieeetcad}
1067 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1068
1069 MACRO {ipl} {"Information Processing Letters"}
1070
1071 MACRO {jacm} {"Journal of the ACM"}
1072
1073 MACRO {jcss} {"Journal of Computer and System Sciences"}
1074
1075 MACRO {scp} {"Science of Computer Programming"}
1076
1077 MACRO {sicomp} {"SIAM Journal on Computing"}
1078
1079 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1080
1081 MACRO {tods} {"ACM Transactions on Database Systems"}
1082
1083 MACRO {tog} {"ACM Transactions on Graphics"}
1084
1085 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1086
1087 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1088
1089 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1090
1091 MACRO {tcs} {"Theoretical Computer Science"}
1092
1093 READ
1094
1095 EXECUTE {init.field.constants}
1096
1097 FUNCTION {sortify}
1098 { purify$
1099 "l" change.case$
1100 }
1101
1102 FUNCTION {sortify.names}
1103 { " \harvardand\ " " " replace.substring
1104 " et~al." " zzz" replace.substring
1105 sortify
1106 }
1107
1108 FUNCTION {author.key.label}
1109 { author empty$
1110 { key empty$
1111 { title.field 'field.used := }
1112 { key.field 'field.used := }
1113 if$
1114 }
1115 { author.field 'field.used := }
1116 if$
1117 }
1118
1119 FUNCTION {author.editor.key.label}
1120 { author empty$
1121 { editor empty$
1122 { key empty$
1123 { title.field 'field.used := }
1124 { key.field 'field.used := }
1125 if$
1126 }
1127 { editor.field 'field.used := }
1128 if$
1129 }
1130 { author.field 'field.used := }
1131 if$
1132 }
1133
1134 FUNCTION {author.key.organization.label}
1135 { author empty$
1136 { key empty$
1137 { organization empty$
1138 { title.field 'field.used := }
1139 { organization.field 'field.used := }
1140 if$
1141 }
1142 { key.field 'field.used := }
1143 if$
1144 }
1145 { author.field 'field.used := }
1146 if$
1147 }
1148
1149 FUNCTION {editor.key.organization.label}
1150 { editor empty$
1151 { key empty$
1152 { organization empty$
1153 { title.field 'field.used := }
1154 { organization.field 'field.used := }
1155 if$
1156 }
1157 { key.field 'field.used := }
1158 if$
1159 }
1160 { editor.field 'field.used := }
1161 if$
1162 }
1163
1164 FUNCTION {sort.format.title}
1165 { 't :=
1166 "A " #2
1167 "An " #3
1168 "The " #4 t chop.word
1169 chop.word
1170 chop.word
1171 sortify
1172 #1 global.max$ substring$
1173 }
1174
1175 FUNCTION {calc.label} %%%XXX change
1176 { make.abbr.label
1177 title.field field.used =
1178 { sort.format.title }
1179 { sortify.names }
1180 if$
1181 year field.or.null purify$ #-1 #4 substring$ sortify
1182 *
1183 'sort.label :=
1184 }
1185
1186 FUNCTION {preliminaries} %%%XXX change
1187 { type$ "book" =
1188 type$ "inbook" =
1189 or
1190 'author.editor.key.label
1191 { type$ "proceedings" =
1192 'editor.key.organization.label
1193 { type$ "manual" =
1194 'author.key.organization.label
1195 'author.key.label
1196 if$
1197 }
1198 if$
1199 }
1200 if$
1201 author.field field.used = %%%XXX change
1202 {
1203 author num.names$ #2 >
1204 { #1 }
1205 { #0 }
1206 if$
1207 'etal.required :=
1208 }
1209 {
1210 editor.field field.used =
1211 {
1212 editor num.names$ #2 >
1213 { #1 }
1214 { #0 }
1215 if$
1216 }
1217 { #0 }
1218 if$
1219 'etal.required :=
1220 }
1221 if$
1222 #1 'etal.allowed :=
1223 }
1224
1225 FUNCTION {first.presort}
1226 { calc.label
1227 sort.label
1228 title.field field.used =
1229 { skip$ }
1230 { " "
1231 *
1232 make.list.label sortify.names
1233 *
1234 " "
1235 *
1236 title field.or.null
1237 sort.format.title
1238 *
1239 }
1240 if$
1241 #1 entry.max$ substring$
1242 'sort.key$ :=
1243 }
1244
1245 ITERATE {preliminaries}
1246
1247 ITERATE {first.presort}
1248
1249 SORT
1250
1251 STRINGS { last.sort.label next.extra last.full.label}
1252
1253 INTEGERS { last.extra.num last.etal.allowed}
1254
1255 FUNCTION {initialize.confusion}
1256 { #0 int.to.chr$ 'last.sort.label :=
1257 #0 int.to.chr$ 'last.full.label :=
1258 #1 'last.etal.allowed :=
1259 }
1260
1261 FUNCTION {confusion.pass}
1262 { last.sort.label sort.label =
1263 { last.etal.allowed
1264 { last.full.label make.full.label sortify.names =
1265 { skip$ }
1266 { #0 'etal.allowed :=
1267 #0 'last.etal.allowed :=
1268 }
1269 if$
1270 }
1271 { #0 'etal.allowed := }
1272 if$
1273 }
1274 { sort.label 'last.sort.label :=
1275 make.full.label sortify.names 'last.full.label :=
1276 #1 'last.etal.allowed :=
1277 }
1278 if$
1279 }
1280
1281 EXECUTE {initialize.confusion}
1282
1283 ITERATE {confusion.pass}
1284
1285 EXECUTE {initialize.confusion}
1286
1287 REVERSE {confusion.pass}
1288
1289 FUNCTION {initialize.last.extra.num}
1290 { #0 int.to.chr$ 'last.sort.label :=
1291 "" 'next.extra :=
1292 #0 'last.extra.num :=
1293 }
1294
1295 FUNCTION {forward.pass}
1296 { last.sort.label sort.label =
1297 { last.extra.num #1 + 'last.extra.num :=
1298 last.extra.num int.to.chr$ 'extra.label :=
1299 }
1300 { "a" chr.to.int$ 'last.extra.num :=
1301 "" 'extra.label :=
1302 sort.label 'last.sort.label :=
1303 }
1304 if$
1305 }
1306
1307 FUNCTION {reverse.pass}
1308 { next.extra "b" =
1309 { "a" 'extra.label := }
1310 'skip$
1311 if$
1312 year empty$
1313 { "N.d." extra.label emphasize * 'list.year := }
1314 { year extra.label emphasize * 'list.year := }
1315 if$
1316 extra.label 'next.extra :=
1317 }
1318
1319 ITERATE {first.presort}
1320
1321 SORT
1322
1323 EXECUTE {initialize.last.extra.num}
1324
1325 ITERATE {forward.pass}
1326
1327 REVERSE {reverse.pass}
1328
1329 FUNCTION {second.presort}
1330 { make.list.label
1331 title.field field.used =
1332 { sort.format.title }
1333 { sortify.names }
1334 if$
1335 " "
1336 *
1337 list.year field.or.null sortify
1338 *
1339 " "
1340 *
1341 title.field field.used =
1342 { skip$ }
1343 { title field.or.null
1344 sort.format.title
1345 *
1346 }
1347 if$
1348 #1 entry.max$ substring$
1349 'sort.key$ :=
1350 }
1351
1352 ITERATE {second.presort}
1353
1354 SORT
1355
1356 FUNCTION {begin.bib}
1357 { preamble$ empty$
1358 'skip$
1359 { "\harvardpreambledefs{%" write$ newline$
1360 preamble$ write$ "}" write$ newline$
1361 "\harvardpreambletext{%" write$ newline$
1362 preamble$ write$ "}" write$ newline$ }
1363 if$
1364 "\begin{thebibliography}{xx}" write$ newline$
1365 }
1366
1367 EXECUTE {begin.bib}
1368
1369 EXECUTE {init.state.consts}
1370
1371 ITERATE {call.type$}
1372
1373 FUNCTION {end.bib}
1374 { newline$
1375 "\end{thebibliography}" write$ newline$
1376 }
1377
1378 EXECUTE {end.bib}