Debian Codegraph @

texmf-dist/bibtex/bst/adfathesis/adfathesis.bst

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