Debian Codegraph @

hmmer/documentation/userguide/unsrtnat-brief.bst

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