Debian Codegraph @

texmf-dist/bibtex/bst/nmbib/plainnm.bst

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