Debian Codegraph @

texmf-dist/bibtex/bst/thuthesis/thuthesis-author-year.bst

raw
1 %%
2 %% This is file `variants/thu/thuthesis-author-year.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% gbt7714.dtx (with options: `2015,thu,author-year')
8 %% -------------------------------------------------------------------
9 %% GB/T 7714 BibTeX Style
10 %% https://github.com/zepinglee/gbt7714-bibtex-style
11 %% Version: 2024/03/08 v2.1.6
12 %% -------------------------------------------------------------------
13 %% Copyright (C) 2016--2024 by Zeping Lee <zepinglee AT gmail.com>
14 %% -------------------------------------------------------------------
15 %% This file may be distributed and/or modified under the
16 %% conditions of the LaTeX Project Public License, either version 1.3c
17 %% of this license or (at your option) any later version.
18 %% The latest version of this license is in
19 %% https://www.latex-project.org/lppl.txt
20 %% and version 1.3c or later is part of all distributions of LaTeX
21 %% version 2008 or later.
22 %% -------------------------------------------------------------------
23 INTEGERS {
24 citation.et.al.min
25 citation.et.al.use.first
26 bibliography.et.al.min
27 bibliography.et.al.use.first
28 uppercase.name
29 terms.in.macro
30 year.after.author
31 period.after.author
32 italic.book.title
33 sentence.case.title
34 link.title
35 title.in.journal
36 show.patent.country
37 show.mark
38 space.before.mark
39 show.medium.type
40 short.journal
41 italic.journal
42 link.journal
43 bold.journal.volume
44 show.missing.address.publisher
45 space.before.pages
46 only.start.page
47 wave.dash.in.pages
48 show.urldate
49 show.url
50 show.doi
51 show.preprint
52 show.note
53 show.english.translation
54 end.with.period
55 lang.zh.order
56 lang.ja.order
57 lang.en.order
58 lang.ru.order
59 lang.other.order
60 }
61
62 STRINGS {
63 component.part.label
64 }
65
66 FUNCTION {load.config}
67 {
68 #2 'citation.et.al.min :=
69 #1 'citation.et.al.use.first :=
70 #4 'bibliography.et.al.min :=
71 #3 'bibliography.et.al.use.first :=
72 #0 'uppercase.name :=
73 #0 'terms.in.macro :=
74 #1 'year.after.author :=
75 #0 'period.after.author :=
76 #0 'italic.book.title :=
77 #1 'sentence.case.title :=
78 #0 'link.title :=
79 #1 'title.in.journal :=
80 #1 'show.patent.country :=
81 #1 'show.mark :=
82 #0 'space.before.mark :=
83 #1 'show.medium.type :=
84 "slash" 'component.part.label :=
85 #0 'short.journal :=
86 #0 'italic.journal :=
87 #0 'link.journal :=
88 #0 'bold.journal.volume :=
89 #0 'show.missing.address.publisher :=
90 #1 'space.before.pages :=
91 #0 'only.start.page :=
92 #0 'wave.dash.in.pages :=
93 #1 'show.urldate :=
94 #1 'show.url :=
95 #1 'show.doi :=
96 #1 'show.preprint :=
97 #0 'show.note :=
98 #0 'show.english.translation :=
99 #1 'end.with.period :=
100 #1 'lang.zh.order :=
101 #2 'lang.ja.order :=
102 #3 'lang.en.order :=
103 #4 'lang.ru.order :=
104 #5 'lang.other.order :=
105 }
106
107 ENTRY
108 { address
109 archivePrefix
110 author
111 booktitle
112 date
113 doi
114 edition
115 editor
116 eprint
117 eprinttype
118 entrysubtype
119 howpublished
120 institution
121 journal
122 journaltitle
123 key
124 langid
125 language
126 location
127 mark
128 medium
129 note
130 number
131 organization
132 pages
133 publisher
134 school
135 series
136 shortjournal
137 title
138 translation
139 translator
140 url
141 urldate
142 volume
143 year
144 }
145 { entry.lang entry.is.electronic is.pure.electronic entry.numbered }
146 { label extra.label sort.label short.label short.list entry.mark entry.url }
147
148 INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash }
149
150 INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other }
151
152 INTEGERS { charptr len }
153
154 FUNCTION {init.state.consts}
155 { #0 'before.all :=
156 #1 'mid.sentence :=
157 #2 'after.sentence :=
158 #3 'after.block :=
159 #4 'after.slash :=
160 #3 'lang.zh :=
161 #4 'lang.ja :=
162 #1 'lang.en :=
163 #2 'lang.ru :=
164 #0 'lang.other :=
165 }
166
167 FUNCTION {bbl.anonymous}
168 { entry.lang lang.zh =
169 { "佚名" }
170 { "Anon" }
171 if$
172 }
173
174 FUNCTION {bbl.space}
175 { entry.lang lang.zh =
176 { "\ " }
177 { " " }
178 if$
179 }
180
181 FUNCTION {bbl.and}
182 { "" }
183
184 FUNCTION {bbl.et.al}
185 { entry.lang lang.zh =
186 { "等" }
187 { entry.lang lang.ja =
188 { "他" }
189 { entry.lang lang.ru =
190 { "идр" }
191 { "et~al." }
192 if$
193 }
194 if$
195 }
196 if$
197 }
198
199 FUNCTION {citation.and}
200 { terms.in.macro
201 { "{\biband}" }
202 'bbl.and
203 if$
204 }
205
206 FUNCTION {citation.et.al}
207 { terms.in.macro
208 { "{\bibetal}" }
209 'bbl.et.al
210 if$
211 }
212
213 FUNCTION {bbl.colon} { ": " }
214
215 FUNCTION {bbl.pages.colon}
216 { space.before.pages
217 { ": " }
218 { ":\allowbreak " }
219 if$
220 }
221
222 FUNCTION {bbl.wide.space} { "\quad " }
223
224 FUNCTION {bbl.slash} { "//\allowbreak " }
225
226 FUNCTION {bbl.sine.loco}
227 { entry.lang lang.zh =
228 { "[出版地不详]" }
229 { "[S.l.]" }
230 if$
231 }
232
233 FUNCTION {bbl.sine.nomine}
234 { entry.lang lang.zh =
235 { "[出版者不详]" }
236 { "[s.n.]" }
237 if$
238 }
239
240 FUNCTION {bbl.sine.loco.sine.nomine}
241 { entry.lang lang.zh =
242 { "[出版地不详: 出版者不详]" }
243 { "[S.l.: s.n.]" }
244 if$
245 }
246
247 FUNCTION {not}
248 { { #0 }
249 { #1 }
250 if$
251 }
252
253 FUNCTION {and}
254 { 'skip$
255 { pop$ #0 }
256 if$
257 }
258
259 FUNCTION {or}
260 { { pop$ #1 }
261 'skip$
262 if$
263 }
264
265 STRINGS { x y }
266
267 FUNCTION {contains}
268 { 'y :=
269 'x :=
270 y text.length$ 'len :=
271 x text.length$ len - #1 + 'charptr :=
272 { charptr #0 >
273 x charptr len substring$ y = not
274 and
275 }
276 { charptr #1 - 'charptr := }
277 while$
278 charptr #0 >
279 }
280
281 STRINGS { s t }
282
283 FUNCTION {output.nonnull}
284 { 's :=
285 output.state mid.sentence =
286 { ", " * write$ }
287 { output.state after.block =
288 { add.period$ write$
289 newline$
290 "\newblock " write$
291 }
292 { output.state before.all =
293 'write$
294 { output.state after.slash =
295 { bbl.slash * write$
296 newline$
297 }
298 { add.period$ " " * write$ }
299 if$
300 }
301 if$
302 }
303 if$
304 mid.sentence 'output.state :=
305 }
306 if$
307 s
308 }
309
310 FUNCTION {output}
311 { duplicate$ empty$
312 'pop$
313 'output.nonnull
314 if$
315 }
316
317 FUNCTION {output.after}
318 { 't :=
319 duplicate$ empty$
320 'pop$
321 { 's :=
322 output.state mid.sentence =
323 { t * write$ }
324 { output.state after.block =
325 { add.period$ write$
326 newline$
327 "\newblock " write$
328 }
329 { output.state before.all =
330 'write$
331 { output.state after.slash =
332 { bbl.slash * write$ }
333 { add.period$ " " * write$ }
334 if$
335 }
336 if$
337 }
338 if$
339 mid.sentence 'output.state :=
340 }
341 if$
342 s
343 }
344 if$
345 }
346
347 FUNCTION {output.check}
348 { 't :=
349 duplicate$ empty$
350 { pop$ "empty " t * " in " * cite$ * warning$ }
351 'output.nonnull
352 if$
353 }
354
355 FUNCTION {fin.entry}
356 { end.with.period
357 'add.period$
358 'skip$
359 if$
360 write$
361 show.english.translation entry.lang lang.zh = and
362 { ")"
363 write$
364 }
365 'skip$
366 if$
367 newline$
368 }
369
370 FUNCTION {new.block}
371 { output.state before.all =
372 'skip$
373 { output.state after.slash =
374 'skip$
375 { after.block 'output.state := }
376 if$
377 }
378 if$
379 }
380
381 FUNCTION {new.sentence}
382 { output.state after.block =
383 'skip$
384 { output.state before.all =
385 'skip$
386 { output.state after.slash =
387 'skip$
388 { after.sentence 'output.state := }
389 if$
390 }
391 if$
392 }
393 if$
394 }
395
396 FUNCTION {new.slash}
397 { output.state before.all =
398 'skip$
399 { component.part.label "slash" =
400 { after.slash 'output.state := }
401 { new.block
402 component.part.label "in" =
403 { entry.lang lang.en =
404 { "In: " output
405 write$
406 ""
407 before.all 'output.state :=
408 }
409 'skip$
410 if$
411 }
412 'skip$
413 if$
414 }
415 if$
416 }
417 if$
418 }
419
420 FUNCTION {new.block.checka}
421 { empty$
422 'skip$
423 'new.block
424 if$
425 }
426
427 FUNCTION {new.block.checkb}
428 { empty$
429 swap$ empty$
430 and
431 'skip$
432 'new.block
433 if$
434 }
435
436 FUNCTION {new.sentence.checka}
437 { empty$
438 'skip$
439 'new.sentence
440 if$
441 }
442
443 FUNCTION {new.sentence.checkb}
444 { empty$
445 swap$ empty$
446 and
447 'skip$
448 'new.sentence
449 if$
450 }
451
452 FUNCTION {field.or.null}
453 { duplicate$ empty$
454 { pop$ "" }
455 'skip$
456 if$
457 }
458
459 FUNCTION {emphasize}
460 { duplicate$ empty$
461 { pop$ "" }
462 { "\emph{" swap$ * "}" * }
463 if$
464 }
465
466 FUNCTION {format.btitle}
467 { italic.book.title
468 entry.lang lang.en = and
469 'emphasize
470 'skip$
471 if$
472 }
473
474 INTEGERS { byte second.byte }
475
476 INTEGERS { char.lang tmp.lang }
477
478 STRINGS { tmp.str }
479
480 FUNCTION {get.str.lang}
481 { 'tmp.str :=
482 lang.other 'tmp.lang :=
483 #1 'charptr :=
484 tmp.str text.length$ #1 + 'len :=
485 { charptr len < }
486 { tmp.str charptr #1 substring$ chr.to.int$ 'byte :=
487 byte #128 <
488 { charptr #1 + 'charptr :=
489 byte #64 > byte #91 < and byte #96 > byte #123 < and or
490 { lang.en 'char.lang := }
491 { lang.other 'char.lang := }
492 if$
493 }
494 { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte :=
495 byte #224 <
496 { charptr #2 + 'charptr :=
497 byte #207 > byte #212 < and
498 byte #212 = second.byte #176 < and or
499 { lang.ru 'char.lang := }
500 { lang.other 'char.lang := }
501 if$
502 }
503 { byte #240 <
504 { charptr #3 + 'charptr :=
505 byte #227 > byte #234 < and
506 { lang.zh 'char.lang := }
507 { byte #227 =
508 { second.byte #143 >
509 { lang.zh 'char.lang := }
510 { second.byte #128 > second.byte #132 < and
511 { lang.ja 'char.lang := }
512 { lang.other 'char.lang := }
513 if$
514 }
515 if$
516 }
517 { byte #239 =
518 second.byte #163 > second.byte #172 < and and
519 { lang.zh 'char.lang := }
520 { lang.other 'char.lang := }
521 if$
522 }
523 if$
524 }
525 if$
526 }
527 { charptr #4 + 'charptr :=
528 byte #240 = second.byte #159 > and
529 { lang.zh 'char.lang := }
530 { lang.other 'char.lang := }
531 if$
532 }
533 if$
534 }
535 if$
536 }
537 if$
538 char.lang tmp.lang >
539 { char.lang 'tmp.lang := }
540 'skip$
541 if$
542 }
543 while$
544 tmp.lang
545 }
546
547 FUNCTION {check.entry.lang}
548 { author field.or.null
549 title field.or.null *
550 get.str.lang
551 }
552
553 STRINGS { entry.langid }
554
555 FUNCTION {set.entry.lang}
556 { "" 'entry.langid :=
557 language empty$ not
558 { language 'entry.langid := }
559 'skip$
560 if$
561 langid empty$ not
562 { langid 'entry.langid := }
563 'skip$
564 if$
565 entry.langid empty$
566 { check.entry.lang }
567 { entry.langid "english" = entry.langid "american" = or entry.langid "british" = or
568 { lang.en }
569 { entry.langid "chinese" =
570 { lang.zh }
571 { entry.langid "japanese" =
572 { lang.ja }
573 { entry.langid "russian" =
574 { lang.ru }
575 { check.entry.lang }
576 if$
577 }
578 if$
579 }
580 if$
581 }
582 if$
583 }
584 if$
585 'entry.lang :=
586 }
587
588 FUNCTION {set.entry.numbered}
589 { type$ "patent" =
590 type$ "standard" = or
591 type$ "techreport" = or
592 { #1 'entry.numbered := }
593 { #0 'entry.numbered := }
594 if$
595 }
596
597 INTEGERS { nameptr namesleft numnames name.lang }
598
599 FUNCTION {format.name}
600 { "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
601 t "others" =
602 { bbl.et.al }
603 { t get.str.lang 'name.lang :=
604 name.lang lang.en =
605 { t #1 "{vv~}{ll}{ f{~}}" format.name$
606 uppercase.name
607 { "u" change.case$ }
608 'skip$
609 if$
610 t #1 "{, jj}" format.name$ *
611 }
612 { t #1 "{ll}{ff}" format.name$ }
613 if$
614 }
615 if$
616 }
617
618 FUNCTION {format.names}
619 { 's :=
620 #1 'nameptr :=
621 s num.names$ 'numnames :=
622 ""
623 numnames 'namesleft :=
624 { namesleft #0 > }
625 { s nameptr format.name bbl.et.al =
626 numnames bibliography.et.al.min #1 - > nameptr bibliography.et.al.use.first > and or
627 { ", " *
628 bbl.et.al *
629 #1 'namesleft :=
630 }
631 { nameptr #1 >
632 { namesleft #1 = bbl.and "" = not and
633 { bbl.and * }
634 { ", " * }
635 if$
636 }
637 'skip$
638 if$
639 s nameptr format.name *
640 }
641 if$
642 nameptr #1 + 'nameptr :=
643 namesleft #1 - 'namesleft :=
644 }
645 while$
646 }
647
648 FUNCTION {format.key}
649 { empty$
650 { key field.or.null }
651 { "" }
652 if$
653 }
654
655 FUNCTION {format.authors}
656 { author empty$ not
657 { author format.names }
658 { "empty author in " cite$ * warning$
659 bbl.anonymous
660 }
661 if$
662 }
663
664 FUNCTION {format.editors}
665 { editor empty$
666 { "" }
667 { editor format.names }
668 if$
669 }
670
671 FUNCTION {format.translators}
672 { translator empty$
673 { "" }
674 { translator format.names
675 entry.lang lang.zh =
676 { translator num.names$ #3 >
677 { "译" * }
678 { ", 译" * }
679 if$
680 }
681 'skip$
682 if$
683 }
684 if$
685 }
686
687 FUNCTION {format.full.names}
688 {'s :=
689 #1 'nameptr :=
690 s num.names$ 'numnames :=
691 numnames 'namesleft :=
692 { namesleft #0 > }
693 { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
694 t get.str.lang 'name.lang :=
695 name.lang lang.en =
696 { t #1 "{vv~}{ll}" format.name$ 't := }
697 { t #1 "{ll}{ff}" format.name$ 't := }
698 if$
699 nameptr #1 >
700 {
701 namesleft #1 >
702 { ", " * t * }
703 {
704 numnames #2 >
705 { "," * }
706 'skip$
707 if$
708 t "others" =
709 { " et~al." * }
710 { " and " * t * }
711 if$
712 }
713 if$
714 }
715 't
716 if$
717 nameptr #1 + 'nameptr :=
718 namesleft #1 - 'namesleft :=
719 }
720 while$
721 }
722
723 FUNCTION {author.editor.full}
724 { author empty$
725 { editor empty$
726 { "" }
727 { editor format.full.names }
728 if$
729 }
730 { author format.full.names }
731 if$
732 }
733
734 FUNCTION {author.full}
735 { author empty$
736 { "" }
737 { author format.full.names }
738 if$
739 }
740
741 FUNCTION {editor.full}
742 { editor empty$
743 { "" }
744 { editor format.full.names }
745 if$
746 }
747
748 FUNCTION {make.full.names}
749 { type$ "book" =
750 type$ "inbook" = booktitle empty$ not and
751 or
752 'author.editor.full
753 { type$ "collection" =
754 type$ "proceedings" =
755 or
756 'editor.full
757 'author.full
758 if$
759 }
760 if$
761 }
762
763 FUNCTION {output.bibitem}
764 { newline$
765 "\bibitem[" write$
766 label ")" *
767 make.full.names duplicate$ short.list =
768 { pop$ }
769 { duplicate$ "]" contains
770 { "{" swap$ * "}" * }
771 'skip$
772 if$
773 *
774 }
775 if$
776 "]{" * write$
777 cite$ write$
778 "}" write$
779 newline$
780 ""
781 before.all 'output.state :=
782 }
783
784 FUNCTION {change.sentence.case}
785 { entry.lang lang.en =
786 { "t" change.case$ }
787 'skip$
788 if$
789 }
790
791 FUNCTION {add.link}
792 { url empty$ not
793 { "\href{" url * "}{" * swap$ * "}" * }
794 { doi empty$ not
795 { "\href{https://doi.org/" doi * "}{" * swap$ * "}" * }
796 'skip$
797 if$
798 }
799 if$
800 }
801
802 FUNCTION {format.title}
803 { title empty$
804 { "" }
805 { title
806 sentence.case.title
807 'change.sentence.case
808 'skip$
809 if$
810 entry.numbered number empty$ not and
811 { bbl.colon *
812 type$ "patent" = show.patent.country and
813 { address empty$ not
814 { address * ", " * }
815 { location empty$ not
816 { location * ", " * }
817 { entry.lang lang.zh =
818 { "中国" * ", " * }
819 'skip$
820 if$
821 }
822 if$
823 }
824 if$
825 }
826 'skip$
827 if$
828 number *
829 }
830 'skip$
831 if$
832 link.title
833 'add.link
834 'skip$
835 if$
836 }
837 if$
838 }
839
840 FUNCTION {tie.or.space.connect}
841 { duplicate$ text.length$ #3 <
842 { "~" }
843 { " " }
844 if$
845 swap$ * *
846 }
847
848 FUNCTION {either.or.check}
849 { empty$
850 'pop$
851 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
852 if$
853 }
854
855 FUNCTION {is.digit}
856 { duplicate$ empty$
857 { pop$ #0 }
858 { chr.to.int$
859 duplicate$ "0" chr.to.int$ <
860 { pop$ #0 }
861 { "9" chr.to.int$ >
862 { #0 }
863 { #1 }
864 if$
865 }
866 if$
867 }
868 if$
869 }
870
871 FUNCTION {is.number}
872 { 's :=
873 s empty$
874 { #0 }
875 { s text.length$ 'charptr :=
876 { charptr #0 >
877 s charptr #1 substring$ is.digit
878 and
879 }
880 { charptr #1 - 'charptr := }
881 while$
882 charptr not
883 }
884 if$
885 }
886
887 FUNCTION {format.volume}
888 { volume empty$ not
889 { volume is.number
890 { entry.lang lang.zh =
891 { "第 " volume * " 卷" * }
892 { "Vol." volume tie.or.space.connect }
893 if$
894 }
895 { volume }
896 if$
897 }
898 { "" }
899 if$
900 }
901
902 FUNCTION {format.number}
903 { number empty$ not
904 { number is.number
905 { entry.lang lang.zh =
906 { "第 " number * " 册" * }
907 { "No." number tie.or.space.connect }
908 if$
909 }
910 { number }
911 if$
912 }
913 { "" }
914 if$
915 }
916
917 FUNCTION {format.volume.number}
918 { volume empty$ not
919 { format.volume }
920 { format.number }
921 if$
922 }
923
924 FUNCTION {format.title.vol.num}
925 { title
926 sentence.case.title
927 'change.sentence.case
928 'skip$
929 if$
930 entry.numbered
931 { number empty$ not
932 { bbl.colon * number * }
933 'skip$
934 if$
935 }
936 { format.volume.number 's :=
937 s empty$ not
938 { bbl.colon * s * }
939 'skip$
940 if$
941 }
942 if$
943 }
944
945 FUNCTION {format.series.vol.num.title}
946 { format.volume.number 's :=
947 series empty$ not
948 { series
949 sentence.case.title
950 'change.sentence.case
951 'skip$
952 if$
953 entry.numbered
954 { bbl.wide.space * }
955 { bbl.colon *
956 s empty$ not
957 { s * bbl.wide.space * }
958 'skip$
959 if$
960 }
961 if$
962 title *
963 sentence.case.title
964 'change.sentence.case
965 'skip$
966 if$
967 entry.numbered number empty$ not and
968 { bbl.colon * number * }
969 'skip$
970 if$
971 }
972 { format.title.vol.num }
973 if$
974 format.btitle
975 link.title
976 'add.link
977 'skip$
978 if$
979 }
980
981 FUNCTION {format.booktitle.vol.num}
982 { booktitle
983 entry.numbered
984 'skip$
985 { format.volume.number 's :=
986 s empty$ not
987 { bbl.colon * s * }
988 'skip$
989 if$
990 }
991 if$
992 }
993
994 FUNCTION {format.series.vol.num.booktitle}
995 { format.volume.number 's :=
996 series empty$ not
997 { series bbl.colon *
998 entry.numbered not s empty$ not and
999 { s * bbl.wide.space * }
1000 'skip$
1001 if$
1002 booktitle *
1003 }
1004 { format.booktitle.vol.num }
1005 if$
1006 format.btitle
1007 }
1008
1009 FUNCTION {remove.period}
1010 { 't :=
1011 "" 's :=
1012 { t empty$ not }
1013 { t #1 #1 substring$ 'tmp.str :=
1014 tmp.str "." = not
1015 { s tmp.str * 's := }
1016 'skip$
1017 if$
1018 t #2 global.max$ substring$ 't :=
1019 }
1020 while$
1021 s
1022 }
1023
1024 FUNCTION {abbreviate}
1025 { remove.period
1026 't :=
1027 t "l" change.case$ 's :=
1028 ""
1029 s "physical review letters" =
1030 { "Phys Rev Lett" }
1031 'skip$
1032 if$
1033 's :=
1034 s empty$
1035 { t }
1036 { pop$ s }
1037 if$
1038 }
1039
1040 FUNCTION {get.journal.title}
1041 { short.journal
1042 { shortjournal empty$ not
1043 { shortjournal }
1044 { journal empty$ not
1045 { journal abbreviate }
1046 { journaltitle empty$ not
1047 { journaltitle abbreviate }
1048 { "" }
1049 if$
1050 }
1051 if$
1052 }
1053 if$
1054 }
1055 { journal empty$ not
1056 { journal }
1057 { journaltitle empty$ not
1058 { journaltitle }
1059 { shortjournal empty$ not
1060 { shortjournal }
1061 { "" }
1062 if$
1063 }
1064 if$
1065 }
1066 if$
1067 }
1068 if$
1069 }
1070
1071 FUNCTION {check.arxiv.preprint}
1072 { #1 #5 substring$ purify$ "l" change.case$ "arxiv" =
1073 { #1 }
1074 { #0 }
1075 if$
1076 }
1077
1078 FUNCTION {format.journal}
1079 { get.journal.title
1080 duplicate$ empty$ not
1081 { italic.journal entry.lang lang.en = and
1082 'emphasize
1083 'skip$
1084 if$
1085 link.journal
1086 'add.link
1087 'skip$
1088 if$
1089 }
1090 'skip$
1091 if$
1092 }
1093
1094 FUNCTION {set.entry.mark}
1095 { entry.mark empty$ not
1096 'pop$
1097 { mark empty$ not
1098 { pop$ mark 'entry.mark := }
1099 { 'entry.mark := }
1100 if$
1101 }
1102 if$
1103 }
1104
1105 FUNCTION {format.mark}
1106 { show.mark
1107 { entry.mark
1108 show.medium.type
1109 { medium empty$ not
1110 { "/" * medium * }
1111 { entry.is.electronic
1112 { "/OL" * }
1113 'skip$
1114 if$
1115 }
1116 if$
1117 }
1118 'skip$
1119 if$
1120 'entry.mark :=
1121 space.before.mark
1122 { " " }
1123 { "\allowbreak" }
1124 if$
1125 "[" * entry.mark * "]" *
1126 }
1127 { "" }
1128 if$
1129 }
1130
1131 FUNCTION {num.to.ordinal}
1132 { duplicate$ text.length$ 'charptr :=
1133 duplicate$ charptr #1 substring$ 's :=
1134 s "1" =
1135 { "st" * }
1136 { s "2" =
1137 { "nd" * }
1138 { s "3" =
1139 { "rd" * }
1140 { "th" * }
1141 if$
1142 }
1143 if$
1144 }
1145 if$
1146 }
1147
1148 FUNCTION {format.edition}
1149 { edition empty$
1150 { "" }
1151 { edition is.number
1152 { edition "1" = not
1153 { entry.lang lang.zh =
1154 { edition " 版" * }
1155 { edition num.to.ordinal " ed." * }
1156 if$
1157 }
1158 'skip$
1159 if$
1160 }
1161 { entry.lang lang.en =
1162 { edition change.sentence.case 's :=
1163 s "Revised" = s "Revised edition" = or
1164 { "Rev. ed." }
1165 { s " ed." * }
1166 if$
1167 }
1168 { edition }
1169 if$
1170 }
1171 if$
1172 }
1173 if$
1174 }
1175
1176 FUNCTION {format.publisher}
1177 { publisher empty$ not
1178 { publisher }
1179 { school empty$ not
1180 { school }
1181 { organization empty$ not
1182 { organization }
1183 { institution empty$ not
1184 { institution }
1185 { "" }
1186 if$
1187 }
1188 if$
1189 }
1190 if$
1191 }
1192 if$
1193 }
1194
1195 FUNCTION {format.address.publisher}
1196 { address empty$ not
1197 { address }
1198 { location empty$ not
1199 { location }
1200 { "" }
1201 if$
1202 }
1203 if$
1204 duplicate$ empty$ not
1205 { format.publisher empty$ not
1206 { bbl.colon * format.publisher * }
1207 { entry.is.electronic not show.missing.address.publisher and
1208 { bbl.colon * bbl.sine.nomine * }
1209 'skip$
1210 if$
1211 }
1212 if$
1213 }
1214 { pop$
1215 entry.is.electronic not show.missing.address.publisher and
1216 { format.publisher empty$ not
1217 { bbl.sine.loco bbl.colon * format.publisher * }
1218 { bbl.sine.loco.sine.nomine }
1219 if$
1220 }
1221 { format.publisher empty$ not
1222 { format.publisher }
1223 { "" }
1224 if$
1225 }
1226 if$
1227 }
1228 if$
1229 }
1230
1231 FUNCTION {extract.before.dash}
1232 { duplicate$ empty$
1233 { pop$ "" }
1234 { 's :=
1235 #1 'charptr :=
1236 s text.length$ #1 + 'len :=
1237 { charptr len <
1238 s charptr #1 substring$ "-" = not
1239 and
1240 }
1241 { charptr #1 + 'charptr := }
1242 while$
1243 s #1 charptr #1 - substring$
1244 }
1245 if$
1246 }
1247
1248 FUNCTION {extract.after.dash}
1249 { duplicate$ empty$
1250 { pop$ "" }
1251 { 's :=
1252 #1 'charptr :=
1253 s text.length$ #1 + 'len :=
1254 { charptr len <
1255 s charptr #1 substring$ "-" = not
1256 and
1257 }
1258 { charptr #1 + 'charptr := }
1259 while$
1260 { charptr len <
1261 s charptr #1 substring$ "-" =
1262 and
1263 }
1264 { charptr #1 + 'charptr := }
1265 while$
1266 s charptr global.max$ substring$
1267 }
1268 if$
1269 }
1270
1271 FUNCTION {extract.before.slash}
1272 { duplicate$ empty$
1273 { pop$ "" }
1274 { 's :=
1275 #1 'charptr :=
1276 s text.length$ #1 + 'len :=
1277 { charptr len <
1278 s charptr #1 substring$ "/" = not
1279 and
1280 }
1281 { charptr #1 + 'charptr := }
1282 while$
1283 s #1 charptr #1 - substring$
1284 }
1285 if$
1286 }
1287
1288 FUNCTION {extract.after.slash}
1289 { duplicate$ empty$
1290 { pop$ "" }
1291 { 's :=
1292 #1 'charptr :=
1293 s text.length$ #1 + 'len :=
1294 { charptr len <
1295 s charptr #1 substring$ "-" = not
1296 and
1297 s charptr #1 substring$ "/" = not
1298 and
1299 }
1300 { charptr #1 + 'charptr := }
1301 while$
1302 { charptr len <
1303 s charptr #1 substring$ "-" =
1304 s charptr #1 substring$ "/" =
1305 or
1306 and
1307 }
1308 { charptr #1 + 'charptr := }
1309 while$
1310 s charptr global.max$ substring$
1311 }
1312 if$
1313 }
1314
1315 FUNCTION {format.year}
1316 { year empty$ not
1317 { year extra.label * }
1318 { date empty$ not
1319 { date extract.before.dash extra.label * }
1320 { entry.is.electronic not
1321 { "empty year in " cite$ * warning$ }
1322 'skip$
1323 if$
1324 urldate empty$ not
1325 { "[" urldate extract.before.dash * extra.label * "]" * }
1326 { "" }
1327 if$
1328 }
1329 if$
1330 }
1331 if$
1332 }
1333
1334 FUNCTION {format.periodical.year}
1335 { year empty$ not
1336 { year extract.before.slash
1337 "--" *
1338 year extract.after.slash
1339 duplicate$ empty$
1340 'pop$
1341 { * }
1342 if$
1343 }
1344 { date empty$ not
1345 { date extract.before.dash }
1346 { "empty year in " cite$ * warning$
1347 urldate empty$ not
1348 { "[" urldate extract.before.dash * "]" * }
1349 { "" }
1350 if$
1351 }
1352 if$
1353 }
1354 if$
1355 }
1356
1357 FUNCTION {format.date}
1358 { date empty$ not
1359 { type$ "patent" = type$ "newspaper" = or
1360 { date }
1361 { entrysubtype empty$ not
1362 { type$ "article" = entrysubtype "newspaper" = and
1363 { date }
1364 { format.year }
1365 if$
1366 }
1367 { format.year }
1368 if$
1369 }
1370 if$
1371 }
1372 { year empty$ not
1373 { format.year }
1374 { "" }
1375 if$
1376 }
1377 if$
1378 }
1379
1380 FUNCTION {format.editdate}
1381 { date empty$ not
1382 { "\allowbreak(" date * ")" * }
1383 { "" }
1384 if$
1385 }
1386
1387 FUNCTION {format.urldate}
1388 { show.urldate show.url and entry.url empty$ not and
1389 is.pure.electronic or
1390 urldate empty$ not and
1391 { "\allowbreak[" urldate * "]" * }
1392 { "" }
1393 if$
1394 }
1395
1396 FUNCTION {hyphenate}
1397 { 't :=
1398 ""
1399 { t empty$ not }
1400 { t #1 #1 substring$ "-" =
1401 { wave.dash.in.pages
1402 { "~" * }
1403 { "-" * }
1404 if$
1405 { t #1 #1 substring$ "-" = }
1406 { t #2 global.max$ substring$ 't := }
1407 while$
1408 }
1409 { t #1 #1 substring$ *
1410 t #2 global.max$ substring$ 't :=
1411 }
1412 if$
1413 }
1414 while$
1415 }
1416
1417 FUNCTION {format.pages}
1418 { pages empty$
1419 { "" }
1420 { pages hyphenate }
1421 if$
1422 }
1423
1424 FUNCTION {format.extracted.pages}
1425 { pages empty$
1426 { "" }
1427 { pages
1428 only.start.page
1429 'extract.before.dash
1430 'hyphenate
1431 if$
1432 }
1433 if$
1434 }
1435
1436 FUNCTION {format.journal.volume}
1437 { volume empty$ not
1438 { bold.journal.volume
1439 { "\textbf{" volume * "}" * }
1440 { volume }
1441 if$
1442 }
1443 { "" }
1444 if$
1445 }
1446
1447 FUNCTION {format.journal.number}
1448 { number empty$ not
1449 { "\allowbreak (" number * ")" * }
1450 { "" }
1451 if$
1452 }
1453
1454 FUNCTION {format.journal.pages}
1455 { pages empty$
1456 { "" }
1457 { format.extracted.pages }
1458 if$
1459 }
1460
1461 FUNCTION {format.periodical.year.volume.number}
1462 { year empty$ not
1463 { year extract.before.slash }
1464 { "empty year in periodical " cite$ * warning$ }
1465 if$
1466 volume empty$ not
1467 { ", " * volume extract.before.dash * }
1468 'skip$
1469 if$
1470 number empty$ not
1471 { "\allowbreak (" * number extract.before.dash * ")" * }
1472 'skip$
1473 if$
1474 "--" *
1475 year extract.after.slash empty$
1476 volume extract.after.dash empty$ and
1477 number extract.after.dash empty$ and not
1478 { year extract.after.slash empty$ not
1479 { year extract.after.slash * }
1480 { year extract.before.slash * }
1481 if$
1482 volume empty$ not
1483 { ", " * volume extract.after.dash * }
1484 'skip$
1485 if$
1486 number empty$ not
1487 { "\allowbreak (" * number extract.after.dash * ")" * }
1488 'skip$
1489 if$
1490 }
1491 'skip$
1492 if$
1493 }
1494
1495 FUNCTION {check.url}
1496 { url empty$ not
1497 { url 'entry.url :=
1498 #1 'entry.is.electronic :=
1499 }
1500 { howpublished empty$ not
1501 { howpublished #1 #5 substring$ "\url{" =
1502 { howpublished 'entry.url :=
1503 #1 'entry.is.electronic :=
1504 }
1505 'skip$
1506 if$
1507 }
1508 { note empty$ not
1509 { note #1 #5 substring$ "\url{" =
1510 { note 'entry.url :=
1511 #1 'entry.is.electronic :=
1512 }
1513 'skip$
1514 if$
1515 }
1516 'skip$
1517 if$
1518 }
1519 if$
1520 }
1521 if$
1522 }
1523
1524 FUNCTION {output.url}
1525 { show.url is.pure.electronic or
1526 entry.url empty$ not and
1527 { new.block
1528 entry.url #1 #5 substring$ "\url{" =
1529 { entry.url }
1530 { "\url{" entry.url * "}" * }
1531 if$
1532 output
1533 }
1534 'skip$
1535 if$
1536 }
1537
1538 FUNCTION {check.doi}
1539 { doi empty$ not
1540 { #1 'entry.is.electronic := }
1541 'skip$
1542 if$
1543 }
1544
1545 FUNCTION {is.in.url}
1546 { 's :=
1547 s empty$
1548 { #1 }
1549 { entry.url empty$
1550 { #0 }
1551 { s text.length$ 'len :=
1552 entry.url "l" change.case$ text.length$ 'charptr :=
1553 { entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
1554 charptr #0 >
1555 and
1556 }
1557 { charptr #1 - 'charptr := }
1558 while$
1559 charptr
1560 }
1561 if$
1562 }
1563 if$
1564 }
1565
1566 FUNCTION {format.doi}
1567 { ""
1568 doi empty$ not
1569 { "" 's :=
1570 doi 't :=
1571 #0 'numnames :=
1572 { t empty$ not}
1573 { t #1 #1 substring$ 'tmp.str :=
1574 tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or
1575 { t #2 #1 substring$ empty$
1576 { s tmp.str * 's := }
1577 'skip$
1578 if$
1579 s empty$ s is.in.url or
1580 'skip$
1581 { numnames #1 + 'numnames :=
1582 numnames #1 >
1583 { ", " * }
1584 { "DOI: " * }
1585 if$
1586 "\doi{" s * "}" * *
1587 }
1588 if$
1589 "" 's :=
1590 }
1591 { s tmp.str * 's := }
1592 if$
1593 t #2 global.max$ substring$ 't :=
1594 }
1595 while$
1596 }
1597 'skip$
1598 if$
1599 }
1600
1601 FUNCTION {output.doi}
1602 { doi empty$ not show.doi and
1603 show.english.translation entry.lang lang.zh = and not and
1604 { new.block
1605 format.doi output
1606 }
1607 'skip$
1608 if$
1609 }
1610
1611 FUNCTION {check.electronic}
1612 { "" 'entry.url :=
1613 #0 'entry.is.electronic :=
1614 'check.doi
1615 'skip$
1616 if$
1617 'check.url
1618 'skip$
1619 if$
1620 medium empty$ not
1621 { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or
1622 { #1 'entry.is.electronic := }
1623 'skip$
1624 if$
1625 }
1626 'skip$
1627 if$
1628 }
1629
1630 FUNCTION {format.eprint}
1631 { archivePrefix empty$ not
1632 { archivePrefix }
1633 { eprinttype empty$ not
1634 { archivePrefix }
1635 { "" }
1636 if$
1637 }
1638 if$
1639 's :=
1640 s empty$ not
1641 { s ": \eprint{" *
1642 url empty$ not
1643 { url }
1644 { "https://" s "l" change.case$ * ".org/abs/" * eprint * }
1645 if$
1646 * "}{" *
1647 eprint * "}" *
1648 }
1649 { eprint }
1650 if$
1651 }
1652
1653 FUNCTION {output.eprint}
1654 { show.preprint eprint empty$ not and
1655 { new.block
1656 format.eprint output
1657 }
1658 'skip$
1659 if$
1660 }
1661
1662 FUNCTION {format.note}
1663 { note empty$ not show.note and
1664 { note }
1665 { "" }
1666 if$
1667 }
1668
1669 FUNCTION {output.translation}
1670 { show.english.translation entry.lang lang.zh = and
1671 { translation empty$ not
1672 { translation }
1673 { "[English translation missing!]" }
1674 if$
1675 " (in Chinese)" * output
1676 write$
1677 format.doi duplicate$ empty$ not
1678 { newline$
1679 write$
1680 }
1681 'pop$
1682 if$
1683 " \\" write$
1684 newline$
1685 "(" write$
1686 ""
1687 before.all 'output.state :=
1688 }
1689 'skip$
1690 if$
1691 }
1692
1693 FUNCTION {empty.misc.check}
1694 { author empty$ title empty$
1695 year empty$
1696 and and
1697 key empty$ not and
1698 { "all relevant fields are empty in " cite$ * warning$ }
1699 'skip$
1700 if$
1701 }
1702
1703 FUNCTION {monograph}
1704 { output.bibitem
1705 output.translation
1706 author empty$ not
1707 { format.authors }
1708 { editor empty$ not
1709 { format.editors }
1710 { "empty author and editor in " cite$ * warning$
1711 bbl.anonymous
1712 }
1713 if$
1714 }
1715 if$
1716 output
1717 year.after.author
1718 { period.after.author
1719 'new.sentence
1720 'skip$
1721 if$
1722 format.year "year" output.check
1723 }
1724 'skip$
1725 if$
1726 new.block
1727 format.series.vol.num.title "title" output.check
1728 "M" set.entry.mark
1729 format.mark "" output.after
1730 new.block
1731 format.translators output
1732 new.sentence
1733 format.edition output
1734 new.block
1735 format.address.publisher output
1736 year.after.author not
1737 { format.year "year" output.check }
1738 'skip$
1739 if$
1740 format.pages bbl.pages.colon output.after
1741 format.urldate "" output.after
1742 output.url
1743 output.doi
1744 new.block
1745 format.note output
1746 fin.entry
1747 }
1748
1749 FUNCTION {incollection}
1750 { output.bibitem
1751 output.translation
1752 format.authors output
1753 author format.key output
1754 year.after.author
1755 { period.after.author
1756 'new.sentence
1757 'skip$
1758 if$
1759 format.year "year" output.check
1760 }
1761 'skip$
1762 if$
1763 new.block
1764 format.title "title" output.check
1765 "M" set.entry.mark
1766 format.mark "" output.after
1767 new.block
1768 format.translators output
1769 new.slash
1770 format.editors output
1771 new.block
1772 format.series.vol.num.booktitle "booktitle" output.check
1773 new.block
1774 format.edition output
1775 new.block
1776 format.address.publisher output
1777 year.after.author not
1778 { format.year "year" output.check }
1779 'skip$
1780 if$
1781 format.extracted.pages bbl.pages.colon output.after
1782 format.urldate "" output.after
1783 output.url
1784 output.doi
1785 new.block
1786 format.note output
1787 fin.entry
1788 }
1789
1790 FUNCTION {periodical}
1791 { output.bibitem
1792 output.translation
1793 format.authors output
1794 author format.key output
1795 year.after.author
1796 { period.after.author
1797 'new.sentence
1798 'skip$
1799 if$
1800 format.year "year" output.check
1801 }
1802 'skip$
1803 if$
1804 new.block
1805 format.title "title" output.check
1806 "J" set.entry.mark
1807 format.mark "" output.after
1808 new.block
1809 format.periodical.year.volume.number output
1810 new.block
1811 format.address.publisher output
1812 year.after.author not
1813 { format.periodical.year "year" output.check }
1814 'skip$
1815 if$
1816 format.urldate "" output.after
1817 output.url
1818 output.doi
1819 new.block
1820 format.note output
1821 fin.entry
1822 }
1823
1824 FUNCTION {journal.article}
1825 { output.bibitem
1826 output.translation
1827 format.authors output
1828 author format.key output
1829 year.after.author
1830 { period.after.author
1831 'new.sentence
1832 'skip$
1833 if$
1834 format.year "year" output.check
1835 }
1836 'skip$
1837 if$
1838 new.block
1839 title.in.journal
1840 { format.title "title" output.check
1841 entrysubtype empty$ not
1842 {
1843 entrysubtype "newspaper" =
1844 { "N" set.entry.mark }
1845 { "J" set.entry.mark }
1846 if$
1847 }
1848 { "J" set.entry.mark }
1849 if$
1850 format.mark "" output.after
1851 new.block
1852 }
1853 'skip$
1854 if$
1855 format.journal "journal" output.check
1856 year.after.author not
1857 { format.date "year" output.check }
1858 'skip$
1859 if$
1860 format.journal.volume output
1861 format.journal.number "" output.after
1862 format.journal.pages bbl.pages.colon output.after
1863 format.urldate "" output.after
1864 output.url
1865 output.doi
1866 new.block
1867 format.note output
1868 fin.entry
1869 }
1870
1871 FUNCTION {patent}
1872 { output.bibitem
1873 output.translation
1874 format.authors output
1875 author format.key output
1876 year.after.author
1877 { period.after.author
1878 'new.sentence
1879 'skip$
1880 if$
1881 format.year "year" output.check
1882 }
1883 'skip$
1884 if$
1885 new.block
1886 format.title "title" output.check
1887 "P" set.entry.mark
1888 format.mark "" output.after
1889 new.block
1890 format.date "year" output.check
1891 format.urldate "" output.after
1892 output.url
1893 output.doi
1894 new.block
1895 format.note output
1896 fin.entry
1897 }
1898
1899 FUNCTION {electronic}
1900 { #1 #1 check.electronic
1901 #1 'entry.is.electronic :=
1902 #1 'is.pure.electronic :=
1903 output.bibitem
1904 output.translation
1905 format.authors output
1906 author format.key output
1907 year.after.author
1908 { period.after.author
1909 'new.sentence
1910 'skip$
1911 if$
1912 format.year "year" output.check
1913 }
1914 'skip$
1915 if$
1916 new.block
1917 format.series.vol.num.title "title" output.check
1918 "EB" set.entry.mark
1919 format.mark "" output.after
1920 new.block
1921 format.address.publisher output
1922 year.after.author not
1923 { date empty$
1924 { format.date output }
1925 'skip$
1926 if$
1927 }
1928 'skip$
1929 if$
1930 format.pages bbl.pages.colon output.after
1931 format.editdate "" output.after
1932 format.urldate "" output.after
1933 output.url
1934 output.doi
1935 new.block
1936 format.note output
1937 fin.entry
1938 }
1939
1940 FUNCTION {preprint}
1941 { output.bibitem
1942 output.translation
1943 author empty$ not
1944 { format.authors }
1945 { editor empty$ not
1946 { format.editors }
1947 { "empty author and editor in " cite$ * warning$
1948 bbl.anonymous
1949 }
1950 if$
1951 }
1952 if$
1953 output
1954 year.after.author
1955 { period.after.author
1956 'new.sentence
1957 'skip$
1958 if$
1959 format.year "year" output.check
1960 }
1961 'skip$
1962 if$
1963 new.block
1964 title.in.journal
1965 { format.series.vol.num.title "title" output.check
1966 "A" set.entry.mark
1967 format.mark "" output.after
1968 new.block
1969 }
1970 'skip$
1971 if$
1972 format.translators output
1973 new.sentence
1974 format.edition output
1975 new.block
1976 year.after.author not
1977 { date empty$
1978 { format.date output }
1979 'skip$
1980 if$
1981 }
1982 'skip$
1983 if$
1984 format.pages bbl.pages.colon output.after
1985 format.editdate "" output.after
1986 format.urldate "" output.after
1987 output.eprint
1988 output.url
1989 show.preprint not eprint empty$ or
1990 'output.doi
1991 'skip$
1992 if$
1993 new.block
1994 format.note output
1995 fin.entry
1996 }
1997
1998 FUNCTION {misc}
1999 { get.journal.title
2000 duplicate$ empty$ not
2001 { check.arxiv.preprint
2002 'preprint
2003 'journal.article
2004 if$
2005 }
2006 { pop$
2007 booktitle empty$ not
2008 'incollection
2009 { publisher empty$ not
2010 'monograph
2011 { eprint empty$ not archivePrefix empty$ not or
2012 'preprint
2013 { entry.is.electronic
2014 'electronic
2015 {
2016 "Z" set.entry.mark
2017 monograph
2018 }
2019 if$
2020 }
2021 if$
2022 }
2023 if$
2024 }
2025 if$
2026 }
2027 if$
2028 empty.misc.check
2029 }
2030
2031 FUNCTION {archive}
2032 { "A" set.entry.mark
2033 misc
2034 }
2035
2036 FUNCTION {article} { misc }
2037
2038 FUNCTION {book} { monograph }
2039
2040 FUNCTION {booklet} { book }
2041
2042 FUNCTION {collection}
2043 { "G" set.entry.mark
2044 monograph
2045 }
2046
2047 FUNCTION {database}
2048 { "DB" set.entry.mark
2049 electronic
2050 }
2051
2052 FUNCTION {dataset}
2053 { "DS" set.entry.mark
2054 electronic
2055 }
2056
2057 FUNCTION {inbook} {
2058 booktitle empty$
2059 'book
2060 'incollection
2061 if$
2062 }
2063
2064 FUNCTION {inproceedings}
2065 { "C" set.entry.mark
2066 incollection
2067 }
2068
2069 FUNCTION {conference} { inproceedings }
2070
2071 FUNCTION {legislation} { archive }
2072
2073 FUNCTION {map}
2074 { "CM" set.entry.mark
2075 misc
2076 }
2077
2078 FUNCTION {manual} { monograph }
2079
2080 FUNCTION {mastersthesis}
2081 { "D" set.entry.mark
2082 monograph
2083 }
2084
2085 FUNCTION {newspaper}
2086 { "N" set.entry.mark
2087 article
2088 }
2089
2090 FUNCTION {online}
2091 { "EB" set.entry.mark
2092 electronic
2093 }
2094
2095 FUNCTION {phdthesis} { mastersthesis }
2096
2097 FUNCTION {proceedings}
2098 { "C" set.entry.mark
2099 monograph
2100 }
2101
2102 FUNCTION {software}
2103 { "CP" set.entry.mark
2104 electronic
2105 }
2106
2107 FUNCTION {standard}
2108 { "S" set.entry.mark
2109 misc
2110 }
2111
2112 FUNCTION {techreport}
2113 { "R" set.entry.mark
2114 misc
2115 }
2116
2117 FUNCTION {unpublished} { misc }
2118
2119 FUNCTION {default.type} { misc }
2120
2121 MACRO {jan} {"January"}
2122
2123 MACRO {feb} {"February"}
2124
2125 MACRO {mar} {"March"}
2126
2127 MACRO {apr} {"April"}
2128
2129 MACRO {may} {"May"}
2130
2131 MACRO {jun} {"June"}
2132
2133 MACRO {jul} {"July"}
2134
2135 MACRO {aug} {"August"}
2136
2137 MACRO {sep} {"September"}
2138
2139 MACRO {oct} {"October"}
2140
2141 MACRO {nov} {"November"}
2142
2143 MACRO {dec} {"December"}
2144
2145 MACRO {acmcs} {"ACM Computing Surveys"}
2146
2147 MACRO {acta} {"Acta Informatica"}
2148
2149 MACRO {cacm} {"Communications of the ACM"}
2150
2151 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
2152
2153 MACRO {ibmsj} {"IBM Systems Journal"}
2154
2155 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
2156
2157 MACRO {ieeetc} {"IEEE Transactions on Computers"}
2158
2159 MACRO {ieeetcad}
2160 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
2161
2162 MACRO {ipl} {"Information Processing Letters"}
2163
2164 MACRO {jacm} {"Journal of the ACM"}
2165
2166 MACRO {jcss} {"Journal of Computer and System Sciences"}
2167
2168 MACRO {scp} {"Science of Computer Programming"}
2169
2170 MACRO {sicomp} {"SIAM Journal on Computing"}
2171
2172 MACRO {tocs} {"ACM Transactions on Computer Systems"}
2173
2174 MACRO {tods} {"ACM Transactions on Database Systems"}
2175
2176 MACRO {tog} {"ACM Transactions on Graphics"}
2177
2178 MACRO {toms} {"ACM Transactions on Mathematical Software"}
2179
2180 MACRO {toois} {"ACM Transactions on Office Information Systems"}
2181
2182 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
2183
2184 MACRO {tcs} {"Theoretical Computer Science"}
2185
2186 FUNCTION {sortify}
2187 { purify$
2188 "l" change.case$
2189 }
2190
2191 FUNCTION {chop.word}
2192 { 's :=
2193 'len :=
2194 s #1 len substring$ =
2195 { s len #1 + global.max$ substring$ }
2196 's
2197 if$
2198 }
2199
2200 FUNCTION {format.lab.name}
2201 { "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
2202 t "others" =
2203 { citation.et.al }
2204 { t get.str.lang 'name.lang :=
2205 name.lang lang.zh = name.lang lang.ja = or
2206 { t #1 "{ll}{ff}" format.name$ }
2207 { t #1 "{vv~}{ll}" format.name$ }
2208 if$
2209 }
2210 if$
2211 }
2212
2213 FUNCTION {format.lab.names}
2214 { 's :=
2215 s #1 format.lab.name 'short.label :=
2216 #1 'nameptr :=
2217 s num.names$ 'numnames :=
2218 ""
2219 numnames 'namesleft :=
2220 { namesleft #0 > }
2221 { s nameptr format.lab.name citation.et.al =
2222 numnames citation.et.al.min #1 - > nameptr citation.et.al.use.first > and or
2223 { bbl.space *
2224 citation.et.al *
2225 #1 'namesleft :=
2226 }
2227 { nameptr #1 >
2228 { namesleft #1 = citation.and "" = not and
2229 { citation.and * }
2230 { ", " * }
2231 if$
2232 }
2233 'skip$
2234 if$
2235 s nameptr format.lab.name *
2236 }
2237 if$
2238 nameptr #1 + 'nameptr :=
2239 namesleft #1 - 'namesleft :=
2240 }
2241 while$
2242 }
2243
2244 FUNCTION {author.key.label}
2245 { author empty$
2246 { key empty$
2247 { cite$ #1 #3 substring$ }
2248 'key
2249 if$
2250 }
2251 { author format.lab.names }
2252 if$
2253 }
2254
2255 FUNCTION {author.editor.key.label}
2256 { author empty$
2257 { editor empty$
2258 { key empty$
2259 { cite$ #1 #3 substring$ }
2260 'key
2261 if$
2262 }
2263 { editor format.lab.names }
2264 if$
2265 }
2266 { author format.lab.names }
2267 if$
2268 }
2269
2270 FUNCTION {author.key.organization.label}
2271 { author empty$
2272 { key empty$
2273 { organization empty$
2274 { cite$ #1 #3 substring$ }
2275 { "The " #4 organization chop.word #3 text.prefix$ }
2276 if$
2277 }
2278 'key
2279 if$
2280 }
2281 { author format.lab.names }
2282 if$
2283 }
2284
2285 FUNCTION {editor.key.organization.label}
2286 { editor empty$
2287 { key empty$
2288 { organization empty$
2289 { cite$ #1 #3 substring$ }
2290 { "The " #4 organization chop.word #3 text.prefix$ }
2291 if$
2292 }
2293 'key
2294 if$
2295 }
2296 { editor format.lab.names }
2297 if$
2298 }
2299
2300 FUNCTION {calc.short.authors}
2301 { "" 'short.label :=
2302 type$ "book" =
2303 type$ "inbook" = booktitle empty$ not and
2304 or
2305 'author.editor.key.label
2306 { type$ "collection" =
2307 type$ "proceedings" =
2308 or
2309 { editor empty$ not
2310 'editor.key.organization.label
2311 'author.key.organization.label
2312 if$
2313 }
2314 'author.key.label
2315 if$
2316 }
2317 if$
2318 'short.list :=
2319 short.label empty$
2320 { short.list 'short.label := }
2321 'skip$
2322 if$
2323 }
2324
2325 FUNCTION {calc.label}
2326 { calc.short.authors
2327 short.list "]" contains
2328 { "{" short.list * "}" * }
2329 { short.list }
2330 if$
2331 "("
2332 *
2333 format.year duplicate$ empty$
2334 short.list key field.or.null = or
2335 { pop$ "" }
2336 'skip$
2337 if$
2338 duplicate$ "]" contains
2339 { "{" swap$ * "}" * }
2340 'skip$
2341 if$
2342 *
2343 'label :=
2344 short.label
2345 "("
2346 *
2347 format.year duplicate$ empty$
2348 short.list key field.or.null = or
2349 { pop$ "" }
2350 'skip$
2351 if$
2352 *
2353 'short.label :=
2354 }
2355
2356 FUNCTION {sort.language.label}
2357 { entry.lang lang.zh =
2358 { lang.zh.order }
2359 { entry.lang lang.ja =
2360 { lang.ja.order }
2361 { entry.lang lang.en =
2362 { lang.en.order }
2363 { entry.lang lang.ru =
2364 { lang.ru.order }
2365 { lang.other.order }
2366 if$
2367 }
2368 if$
2369 }
2370 if$
2371 }
2372 if$
2373 #64 +
2374 int.to.chr$
2375 }
2376
2377 FUNCTION {sort.format.names}
2378 { 's :=
2379 #1 'nameptr :=
2380 ""
2381 s num.names$ 'numnames :=
2382 numnames 'namesleft :=
2383 { namesleft #0 > }
2384 {
2385 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
2386 nameptr #1 >
2387 {
2388 " " *
2389 namesleft #1 = t "others" = and
2390 { "zzzzz" * }
2391 { numnames #2 > nameptr #2 = and
2392 { "zz" * year field.or.null * " " * }
2393 'skip$
2394 if$
2395 t sortify *
2396 }
2397 if$
2398 }
2399 { t sortify * }
2400 if$
2401 nameptr #1 + 'nameptr :=
2402 namesleft #1 - 'namesleft :=
2403 }
2404 while$
2405 }
2406
2407 FUNCTION {sort.format.title}
2408 { 't :=
2409 "A " #2
2410 "An " #3
2411 "The " #4 t chop.word
2412 chop.word
2413 chop.word
2414 sortify
2415 #1 global.max$ substring$
2416 }
2417
2418 FUNCTION {anonymous.sort}
2419 { entry.lang lang.zh =
2420 { "yi4 ming2" }
2421 { "anon" }
2422 if$
2423 }
2424
2425 FUNCTION {warn.empty.key}
2426 { entry.lang lang.zh =
2427 { "empty key in " cite$ * warning$ }
2428 'skip$
2429 if$
2430 }
2431
2432 FUNCTION {author.sort}
2433 { key empty$
2434 { warn.empty.key
2435 author empty$
2436 { anonymous.sort }
2437 { author sort.format.names }
2438 if$
2439 }
2440 { key }
2441 if$
2442 }
2443
2444 FUNCTION {author.editor.sort}
2445 { key empty$
2446 { warn.empty.key
2447 author empty$
2448 { editor empty$
2449 { anonymous.sort }
2450 { editor sort.format.names }
2451 if$
2452 }
2453 { author sort.format.names }
2454 if$
2455 }
2456 { key }
2457 if$
2458 }
2459
2460 FUNCTION {author.organization.sort}
2461 { key empty$
2462 { warn.empty.key
2463 author empty$
2464 { organization empty$
2465 { anonymous.sort }
2466 { "The " #4 organization chop.word sortify }
2467 if$
2468 }
2469 { author sort.format.names }
2470 if$
2471 }
2472 { key }
2473 if$
2474 }
2475
2476 FUNCTION {editor.organization.sort}
2477 { key empty$
2478 { warn.empty.key
2479 editor empty$
2480 { organization empty$
2481 { anonymous.sort }
2482 { "The " #4 organization chop.word sortify }
2483 if$
2484 }
2485 { editor sort.format.names }
2486 if$
2487 }
2488 { key }
2489 if$
2490 }
2491
2492 FUNCTION {presort}
2493 { set.entry.lang
2494 set.entry.numbered
2495 show.url show.doi check.electronic
2496 #0 'is.pure.electronic :=
2497 calc.label
2498 label sortify
2499 " "
2500 *
2501 sort.language.label
2502 " "
2503 *
2504 type$ "book" =
2505 type$ "inbook" = booktitle empty$ not and
2506 or
2507 'author.editor.sort
2508 { type$ "collection" =
2509 type$ "proceedings" =
2510 or
2511 'editor.organization.sort
2512 'author.sort
2513 if$
2514 }
2515 if$
2516 *
2517 " "
2518 *
2519 year field.or.null sortify
2520 *
2521 " "
2522 *
2523 cite$
2524 *
2525 #1 entry.max$ substring$
2526 'sort.label :=
2527 sort.label *
2528 #1 entry.max$ substring$
2529 'sort.key$ :=
2530 }
2531
2532 STRINGS { longest.label last.label next.extra last.extra.label }
2533
2534 INTEGERS { longest.label.width number.label }
2535
2536 FUNCTION {initialize.longest.label}
2537 { "" 'longest.label :=
2538 #0 int.to.chr$ 'last.label :=
2539 "" 'next.extra :=
2540 #0 'longest.label.width :=
2541 #0 'number.label :=
2542 "" 'last.extra.label :=
2543 }
2544
2545 FUNCTION {forward.pass}
2546 {
2547 last.label short.label =
2548 { "" 'extra.label :=
2549 last.extra.label text.length$ 'charptr :=
2550 { last.extra.label charptr #1 substring$ "z" =
2551 charptr #0 > and
2552 }
2553 { "a" extra.label * 'extra.label :=
2554 charptr #1 - 'charptr :=
2555 }
2556 while$
2557 charptr #0 >
2558 { last.extra.label charptr #1 substring$ chr.to.int$ #1 + int.to.chr$
2559 extra.label * 'extra.label :=
2560 last.extra.label #1 charptr #1 - substring$
2561 extra.label * 'extra.label :=
2562 }
2563 { "a" extra.label * 'extra.label := }
2564 if$
2565 extra.label 'last.extra.label :=
2566 }
2567 { "a" 'last.extra.label :=
2568 "" 'extra.label :=
2569 short.label 'last.label :=
2570 }
2571 if$
2572 number.label #1 + 'number.label :=
2573 }
2574
2575 FUNCTION {reverse.pass}
2576 {
2577 next.extra "b" =
2578 { "a" 'extra.label := }
2579 'skip$
2580 if$
2581 extra.label 'next.extra :=
2582 extra.label
2583 duplicate$ empty$
2584 'skip$
2585 { "{\natexlab{" swap$ * "}}" * }
2586 if$
2587 'extra.label :=
2588 label extra.label * 'label :=
2589 }
2590
2591 FUNCTION {bib.sort.order}
2592 { sort.label 'sort.key$ :=
2593 }
2594
2595 FUNCTION {begin.bib}
2596 { preamble$ empty$
2597 'skip$
2598 { preamble$ write$ newline$ }
2599 if$
2600 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
2601 write$ newline$
2602 terms.in.macro
2603 { "\providecommand{\biband}{和}"
2604 write$ newline$
2605 "\providecommand{\bibetal}{等}"
2606 write$ newline$
2607 }
2608 'skip$
2609 if$
2610 "\providecommand{\natexlab}[1]{#1}"
2611 write$ newline$
2612 "\providecommand{\url}[1]{#1}"
2613 write$ newline$
2614 "\expandafter\ifx\csname urlstyle\endcsname\relax\else"
2615 write$ newline$
2616 " \urlstyle{same}\fi"
2617 write$ newline$
2618 "\expandafter\ifx\csname href\endcsname\relax"
2619 write$ newline$
2620 " \DeclareUrlCommand\doi{\urlstyle{rm}}"
2621 write$ newline$
2622 " \def\eprint#1#2{#2}"
2623 write$ newline$
2624 "\else"
2625 write$ newline$
2626 " \def\doi#1{\href{https://doi.org/#1}{\nolinkurl{#1}}}"
2627 write$ newline$
2628 " \let\eprint\href"
2629 write$ newline$
2630 "\fi"
2631 write$ newline$
2632 }
2633
2634 FUNCTION {end.bib}
2635 { newline$
2636 "\end{thebibliography}" write$ newline$
2637 }
2638
2639 READ
2640
2641 EXECUTE {init.state.consts}
2642
2643 EXECUTE {load.config}
2644
2645 ITERATE {presort}
2646
2647 SORT
2648
2649 EXECUTE {initialize.longest.label}
2650
2651 ITERATE {forward.pass}
2652
2653 REVERSE {reverse.pass}
2654
2655 ITERATE {bib.sort.order}
2656
2657 SORT
2658
2659 EXECUTE {begin.bib}
2660
2661 ITERATE {call.type$}
2662
2663 EXECUTE {end.bib}