Debian Codegraph @

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

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