Debian Codegraph @

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

raw
1 %% File unsrtnm.bst.
2 %% Based on unsrtnat.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: `unsrtnat.bst'
19 %% A modification of `unsrt.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 "\nmbibLink{" cite$ * "}{authors}{" * swap$ * "}" *
234 }
235
236 FUNCTION {format.key}
237 { empty$
238 { key field.or.null }
239 { "" }
240 if$
241 }
242
243 FUNCTION {format.authors}
244 { author empty$
245 { "" }
246 { author format.names }
247 if$
248 }
249
250 FUNCTION {format.editors}
251 { editor empty$
252 { "" }
253 { editor format.names
254 editor num.names$ #1 >
255 { ", editors" * }
256 { ", editor" * }
257 if$
258 }
259 if$
260 }
261
262 FUNCTION {format.isbn}
263 { isbn empty$
264 { "" }
265 { new.block "ISBN " isbn * }
266 if$
267 }
268
269 FUNCTION {format.issn}
270 { issn empty$
271 { "" }
272 { new.block "ISSN " issn * }
273 if$
274 }
275
276 FUNCTION {format.url}
277 { url empty$
278 { "" }
279 { new.block "URL \url{" url * "}" * }
280 if$
281 }
282
283 FUNCTION {format.doi}
284 { doi empty$
285 { "" }
286 { new.block "\doi{" doi * "}" * }
287 if$
288 }
289
290 FUNCTION {format.title}
291 { title empty$
292 { "" }
293 { title "t" change.case$ }
294 if$
295 }
296
297 FUNCTION {format.full.names}
298 {'s :=
299 #1 'nameptr :=
300 s num.names$ 'numnames :=
301 numnames 'namesleft :=
302 { namesleft #0 > }
303 { s nameptr
304 "{vv~}{ll}" format.name$ 't :=
305 nameptr #1 >
306 {
307 namesleft #1 >
308 { ", " * t * }
309 {
310 numnames #2 >
311 { "," * }
312 'skip$
313 if$
314 t "others" =
315 { " et~al." * }
316 { " and " * t * }
317 if$
318 }
319 if$
320 }
321 't
322 if$
323 nameptr #1 + 'nameptr :=
324 namesleft #1 - 'namesleft :=
325 }
326 while$
327 }
328
329 FUNCTION {author.editor.full}
330 { author empty$
331 { editor empty$
332 { "" }
333 { editor format.full.names }
334 if$
335 }
336 { author format.full.names }
337 if$
338 }
339
340 FUNCTION {author.full}
341 { author empty$
342 { "" }
343 { author format.full.names }
344 if$
345 }
346
347 FUNCTION {editor.full}
348 { editor empty$
349 { "" }
350 { editor format.full.names }
351 if$
352 }
353
354 FUNCTION {make.full.names}
355 { type$ "book" =
356 type$ "inbook" =
357 or
358 'author.editor.full
359 { type$ "proceedings" =
360 'editor.full
361 'author.full
362 if$
363 }
364 if$
365 }
366
367 FUNCTION {output.bibitem}
368 { newline$
369 "\bibitem[" write$
370 label write$
371 ")" make.full.names duplicate$ short.list =
372 { pop$ }
373 { * }
374 if$
375 "]{" * write$
376 cite$ write$
377 "}" write$
378 newline$
379 ""
380 before.all 'output.state :=
381 }
382
383 FUNCTION {n.dashify}
384 { 't :=
385 ""
386 { t empty$ not }
387 { t #1 #1 substring$ "-" =
388 { t #1 #2 substring$ "--" = not
389 { "--" *
390 t #2 global.max$ substring$ 't :=
391 }
392 { { t #1 #1 substring$ "-" = }
393 { "-" *
394 t #2 global.max$ substring$ 't :=
395 }
396 while$
397 }
398 if$
399 }
400 { t #1 #1 substring$ *
401 t #2 global.max$ substring$ 't :=
402 }
403 if$
404 }
405 while$
406 }
407
408 FUNCTION {format.date}
409 { year duplicate$ empty$
410 { "empty year in " cite$ * warning$
411 pop$ "" }
412 'skip$
413 if$
414 month empty$
415 'skip$
416 { month
417 " " * swap$ *
418 }
419 if$
420 extra.label *
421 "\nmbibLink{" cite$ * "}{timeline}{" * swap$ * "}" *
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 INTEGERS { seq.num }
1200
1201 FUNCTION {init.seq}
1202 { #0 'seq.num :=}
1203
1204 EXECUTE {init.seq}
1205
1206 FUNCTION {int.to.fix}
1207 { "000000000" swap$ int.to.str$ *
1208 #-1 #10 substring$
1209 }
1210
1211
1212 FUNCTION {presort}
1213 { calc.label
1214 label sortify
1215 " "
1216 *
1217 seq.num #1 + 'seq.num :=
1218 seq.num int.to.fix
1219 'sort.label :=
1220 sort.label *
1221 #1 entry.max$ substring$
1222 'sort.key$ :=
1223 }
1224
1225 ITERATE {presort}
1226
1227 SORT
1228
1229 STRINGS { longest.label last.label next.extra }
1230
1231 INTEGERS { longest.label.width last.extra.num number.label }
1232
1233 FUNCTION {initialize.longest.label}
1234 { "" 'longest.label :=
1235 #0 int.to.chr$ 'last.label :=
1236 "" 'next.extra :=
1237 #0 'longest.label.width :=
1238 #0 'last.extra.num :=
1239 #0 'number.label :=
1240 }
1241
1242 FUNCTION {forward.pass}
1243 { last.label label =
1244 { last.extra.num #1 + 'last.extra.num :=
1245 last.extra.num int.to.chr$ 'extra.label :=
1246 }
1247 { "a" chr.to.int$ 'last.extra.num :=
1248 "" 'extra.label :=
1249 label 'last.label :=
1250 }
1251 if$
1252 number.label #1 + 'number.label :=
1253 }
1254
1255 FUNCTION {reverse.pass}
1256 { next.extra "b" =
1257 { "a" 'extra.label := }
1258 'skip$
1259 if$
1260 extra.label 'next.extra :=
1261 extra.label
1262 duplicate$ empty$
1263 'skip$
1264 { "{\natexlab{" swap$ * "}}" * }
1265 if$
1266 'extra.label :=
1267 label extra.label * 'label :=
1268 }
1269
1270 EXECUTE {initialize.longest.label}
1271
1272 ITERATE {forward.pass}
1273
1274 REVERSE {reverse.pass}
1275
1276 FUNCTION {bib.sort.order}
1277 { sort.label 'sort.key$ :=
1278 }
1279
1280 ITERATE {bib.sort.order}
1281
1282 SORT
1283
1284 FUNCTION {begin.bib}
1285 { preamble$ empty$
1286 'skip$
1287 { preamble$ write$ newline$ }
1288 if$
1289 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1290 write$ newline$
1291 "\providecommand{\natexlab}[1]{#1}"
1292 write$ newline$
1293 "\providecommand{\url}[1]{\texttt{#1}}"
1294 write$ newline$
1295 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1296 write$ newline$
1297 " \providecommand{\doi}[1]{doi: #1}\else"
1298 write$ newline$
1299 " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1300 write$ newline$
1301 " \providecommand{\nmbibLink}[3]{#3}"
1302 write$ newline$
1303 }
1304
1305 EXECUTE {begin.bib}
1306
1307 EXECUTE {init.state.consts}
1308
1309 ITERATE {call.type$}
1310
1311 FUNCTION {end.bib}
1312 { newline$
1313 "\end{thebibliography}" write$ newline$
1314 }
1315
1316 EXECUTE {end.bib}