Debian Codegraph @

texmf-dist/bibtex/bst/nxuthesis/nxuthesis-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,nxu,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 extract.before.slash 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{" 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 output
1529 }
1530 'skip$
1531 if$
1532 }
1533
1534 FUNCTION {check.doi}
1535 { doi empty$ not
1536 { #1 'entry.is.electronic := }
1537 'skip$
1538 if$
1539 }
1540
1541 FUNCTION {is.in.url}
1542 { 's :=
1543 s empty$
1544 { #1 }
1545 { entry.url empty$
1546 { #0 }
1547 { s text.length$ 'len :=
1548 entry.url text.length$ 'charptr :=
1549 { entry.url charptr len substring$ s = not
1550 charptr #0 >
1551 and
1552 }
1553 { charptr #1 - 'charptr := }
1554 while$
1555 charptr
1556 }
1557 if$
1558 }
1559 if$
1560 }
1561
1562 FUNCTION {format.doi}
1563 { ""
1564 doi empty$ not
1565 { "" 's :=
1566 doi 't :=
1567 #0 'numnames :=
1568 { t empty$ not}
1569 { t #1 #1 substring$ 'tmp.str :=
1570 tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or
1571 { t #2 #1 substring$ empty$
1572 { s tmp.str * 's := }
1573 'skip$
1574 if$
1575 s empty$ s is.in.url or
1576 'skip$
1577 { numnames #1 + 'numnames :=
1578 numnames #1 >
1579 { ", " * }
1580 { "DOI: " * }
1581 if$
1582 "\doi{" s * "}" * *
1583 }
1584 if$
1585 "" 's :=
1586 }
1587 { s tmp.str * 's := }
1588 if$
1589 t #2 global.max$ substring$ 't :=
1590 }
1591 while$
1592 }
1593 'skip$
1594 if$
1595 }
1596
1597 FUNCTION {output.doi}
1598 { doi empty$ not show.doi and
1599 show.english.translation entry.lang lang.zh = and not and
1600 { new.block
1601 format.doi output
1602 }
1603 'skip$
1604 if$
1605 }
1606
1607 FUNCTION {check.electronic}
1608 { "" 'entry.url :=
1609 #0 'entry.is.electronic :=
1610 'check.doi
1611 'skip$
1612 if$
1613 'check.url
1614 'skip$
1615 if$
1616 medium empty$ not
1617 { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or
1618 { #1 'entry.is.electronic := }
1619 'skip$
1620 if$
1621 }
1622 'skip$
1623 if$
1624 }
1625
1626 FUNCTION {format.eprint}
1627 { archivePrefix empty$ not
1628 { archivePrefix }
1629 { eprinttype empty$ not
1630 { archivePrefix }
1631 { "" }
1632 if$
1633 }
1634 if$
1635 's :=
1636 s empty$ not
1637 { s ": \eprint{" *
1638 url empty$ not
1639 { url }
1640 { "https://" s "l" change.case$ * ".org/abs/" * eprint * }
1641 if$
1642 * "}{" *
1643 eprint * "}" *
1644 }
1645 { eprint }
1646 if$
1647 }
1648
1649 FUNCTION {output.eprint}
1650 { show.preprint eprint empty$ not and
1651 { new.block
1652 format.eprint output
1653 }
1654 'skip$
1655 if$
1656 }
1657
1658 FUNCTION {format.note}
1659 { note empty$ not show.note and
1660 { note }
1661 { "" }
1662 if$
1663 }
1664
1665 FUNCTION {output.translation}
1666 { show.english.translation entry.lang lang.zh = and
1667 { translation empty$ not
1668 { translation }
1669 { "[English translation missing!]" }
1670 if$
1671 " (in Chinese)" * output
1672 write$
1673 format.doi duplicate$ empty$ not
1674 { newline$
1675 write$
1676 }
1677 'pop$
1678 if$
1679 " \\" write$
1680 newline$
1681 "(" write$
1682 ""
1683 before.all 'output.state :=
1684 }
1685 'skip$
1686 if$
1687 }
1688
1689 FUNCTION {empty.misc.check}
1690 { author empty$ title empty$
1691 year empty$
1692 and and
1693 key empty$ not and
1694 { "all relevant fields are empty in " cite$ * warning$ }
1695 'skip$
1696 if$
1697 }
1698
1699 FUNCTION {monograph}
1700 { output.bibitem
1701 output.translation
1702 author empty$ not
1703 { format.authors }
1704 { editor empty$ not
1705 { format.editors }
1706 { "empty author and editor in " cite$ * warning$
1707 bbl.anonymous
1708 }
1709 if$
1710 }
1711 if$
1712 output
1713 year.after.author
1714 { period.after.author
1715 'new.sentence
1716 'skip$
1717 if$
1718 format.year "year" output.check
1719 }
1720 'skip$
1721 if$
1722 new.block
1723 format.series.vol.num.title "title" output.check
1724 "M" set.entry.mark
1725 format.mark "" output.after
1726 new.block
1727 format.translators output
1728 new.sentence
1729 format.edition output
1730 new.block
1731 format.address.publisher output
1732 year.after.author not
1733 { format.year "year" output.check }
1734 'skip$
1735 if$
1736 format.pages bbl.pages.colon output.after
1737 format.urldate "" output.after
1738 output.url
1739 output.doi
1740 new.block
1741 format.note output
1742 fin.entry
1743 }
1744
1745 FUNCTION {incollection}
1746 { output.bibitem
1747 output.translation
1748 format.authors output
1749 author format.key output
1750 year.after.author
1751 { period.after.author
1752 'new.sentence
1753 'skip$
1754 if$
1755 format.year "year" output.check
1756 }
1757 'skip$
1758 if$
1759 new.block
1760 format.title "title" output.check
1761 "M" set.entry.mark
1762 format.mark "" output.after
1763 new.block
1764 format.translators output
1765 new.slash
1766 format.editors output
1767 new.block
1768 format.series.vol.num.booktitle "booktitle" output.check
1769 new.block
1770 format.edition output
1771 new.block
1772 format.address.publisher output
1773 year.after.author not
1774 { format.year "year" output.check }
1775 'skip$
1776 if$
1777 format.extracted.pages bbl.pages.colon output.after
1778 format.urldate "" output.after
1779 output.url
1780 output.doi
1781 new.block
1782 format.note output
1783 fin.entry
1784 }
1785
1786 FUNCTION {periodical}
1787 { output.bibitem
1788 output.translation
1789 format.authors output
1790 author format.key output
1791 year.after.author
1792 { period.after.author
1793 'new.sentence
1794 'skip$
1795 if$
1796 format.year "year" output.check
1797 }
1798 'skip$
1799 if$
1800 new.block
1801 format.title "title" output.check
1802 "J" set.entry.mark
1803 format.mark "" output.after
1804 new.block
1805 format.periodical.year.volume.number output
1806 new.block
1807 format.address.publisher output
1808 year.after.author not
1809 { format.periodical.year "year" output.check }
1810 'skip$
1811 if$
1812 format.urldate "" output.after
1813 output.url
1814 output.doi
1815 new.block
1816 format.note output
1817 fin.entry
1818 }
1819
1820 FUNCTION {journal.article}
1821 { output.bibitem
1822 output.translation
1823 format.authors output
1824 author format.key output
1825 year.after.author
1826 { period.after.author
1827 'new.sentence
1828 'skip$
1829 if$
1830 format.year "year" output.check
1831 }
1832 'skip$
1833 if$
1834 new.block
1835 title.in.journal
1836 { format.title "title" output.check
1837 entrysubtype empty$ not
1838 {
1839 entrysubtype "newspaper" =
1840 { "N" set.entry.mark }
1841 { "J" set.entry.mark }
1842 if$
1843 }
1844 { "J" set.entry.mark }
1845 if$
1846 format.mark "" output.after
1847 new.block
1848 }
1849 'skip$
1850 if$
1851 format.journal "journal" output.check
1852 year.after.author not
1853 { format.date "year" output.check }
1854 'skip$
1855 if$
1856 format.journal.volume output
1857 format.journal.number "" output.after
1858 format.journal.pages bbl.pages.colon output.after
1859 format.urldate "" output.after
1860 output.url
1861 output.doi
1862 new.block
1863 format.note output
1864 fin.entry
1865 }
1866
1867 FUNCTION {patent}
1868 { output.bibitem
1869 output.translation
1870 format.authors output
1871 author format.key output
1872 year.after.author
1873 { period.after.author
1874 'new.sentence
1875 'skip$
1876 if$
1877 format.year "year" output.check
1878 }
1879 'skip$
1880 if$
1881 new.block
1882 format.title "title" output.check
1883 "P" set.entry.mark
1884 format.mark "" output.after
1885 new.block
1886 format.date "year" output.check
1887 format.urldate "" output.after
1888 output.url
1889 output.doi
1890 new.block
1891 format.note output
1892 fin.entry
1893 }
1894
1895 FUNCTION {electronic}
1896 { #1 #1 check.electronic
1897 #1 'entry.is.electronic :=
1898 #1 'is.pure.electronic :=
1899 output.bibitem
1900 output.translation
1901 format.authors output
1902 author format.key output
1903 year.after.author
1904 { period.after.author
1905 'new.sentence
1906 'skip$
1907 if$
1908 format.year "year" output.check
1909 }
1910 'skip$
1911 if$
1912 new.block
1913 format.series.vol.num.title "title" output.check
1914 "EB" set.entry.mark
1915 format.mark "" output.after
1916 new.block
1917 format.address.publisher output
1918 year.after.author not
1919 { date empty$
1920 { format.date output }
1921 'skip$
1922 if$
1923 }
1924 'skip$
1925 if$
1926 format.pages bbl.pages.colon output.after
1927 format.editdate "" output.after
1928 format.urldate "" output.after
1929 output.url
1930 output.doi
1931 new.block
1932 format.note output
1933 fin.entry
1934 }
1935
1936 FUNCTION {preprint}
1937 { output.bibitem
1938 output.translation
1939 author empty$ not
1940 { format.authors }
1941 { editor empty$ not
1942 { format.editors }
1943 { "empty author and editor in " cite$ * warning$
1944 bbl.anonymous
1945 }
1946 if$
1947 }
1948 if$
1949 output
1950 year.after.author
1951 { period.after.author
1952 'new.sentence
1953 'skip$
1954 if$
1955 format.year "year" output.check
1956 }
1957 'skip$
1958 if$
1959 new.block
1960 title.in.journal
1961 { format.series.vol.num.title "title" output.check
1962 "A" set.entry.mark
1963 format.mark "" output.after
1964 new.block
1965 }
1966 'skip$
1967 if$
1968 format.translators output
1969 new.sentence
1970 format.edition output
1971 new.block
1972 year.after.author not
1973 { date empty$
1974 { format.date output }
1975 'skip$
1976 if$
1977 }
1978 'skip$
1979 if$
1980 format.pages bbl.pages.colon output.after
1981 format.editdate "" output.after
1982 format.urldate "" output.after
1983 output.eprint
1984 output.url
1985 show.preprint not eprint empty$ or
1986 'output.doi
1987 'skip$
1988 if$
1989 new.block
1990 format.note output
1991 fin.entry
1992 }
1993
1994 FUNCTION {misc}
1995 { get.journal.title
1996 duplicate$ empty$ not
1997 { check.arxiv.preprint
1998 'preprint
1999 'journal.article
2000 if$
2001 }
2002 { pop$
2003 booktitle empty$ not
2004 'incollection
2005 { publisher empty$ not
2006 'monograph
2007 { eprint empty$ not archivePrefix empty$ not or
2008 'preprint
2009 { entry.is.electronic
2010 'electronic
2011 {
2012 "Z" set.entry.mark
2013 monograph
2014 }
2015 if$
2016 }
2017 if$
2018 }
2019 if$
2020 }
2021 if$
2022 }
2023 if$
2024 empty.misc.check
2025 }
2026
2027 FUNCTION {archive}
2028 { "A" set.entry.mark
2029 misc
2030 }
2031
2032 FUNCTION {article} { misc }
2033
2034 FUNCTION {book} { monograph }
2035
2036 FUNCTION {booklet} { book }
2037
2038 FUNCTION {collection}
2039 { "G" set.entry.mark
2040 monograph
2041 }
2042
2043 FUNCTION {database}
2044 { "DB" set.entry.mark
2045 electronic
2046 }
2047
2048 FUNCTION {dataset}
2049 { "DS" set.entry.mark
2050 electronic
2051 }
2052
2053 FUNCTION {inbook} {
2054 booktitle empty$
2055 'book
2056 'incollection
2057 if$
2058 }
2059
2060 FUNCTION {inproceedings}
2061 { "C" set.entry.mark
2062 incollection
2063 }
2064
2065 FUNCTION {conference} { inproceedings }
2066
2067 FUNCTION {legislation} { archive }
2068
2069 FUNCTION {map}
2070 { "CM" set.entry.mark
2071 misc
2072 }
2073
2074 FUNCTION {manual} { monograph }
2075
2076 FUNCTION {thesis}
2077 { "D" set.entry.mark
2078 monograph
2079 }
2080
2081 FUNCTION {newspaper}
2082 { "N" set.entry.mark
2083 article
2084 }
2085
2086 FUNCTION {online}
2087 { "EB" set.entry.mark
2088 electronic
2089 }
2090
2091 FUNCTION {mastersthesis} { thesis }
2092
2093 FUNCTION {phdthesis} { thesis }
2094
2095 FUNCTION {proceedings}
2096 { "C" set.entry.mark
2097 monograph
2098 }
2099
2100 FUNCTION {software}
2101 { "CP" set.entry.mark
2102 electronic
2103 }
2104
2105 FUNCTION {standard}
2106 { "S" set.entry.mark
2107 misc
2108 }
2109
2110 FUNCTION {report}
2111 { "R" set.entry.mark
2112 misc
2113 }
2114
2115 FUNCTION {techreport} { report }
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}