Debian Codegraph @

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

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