Debian Codegraph @

texmf-dist/bibtex/bst/oup-authoring-template/oup-abbrvnat.bst

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