Debian Codegraph @

texmf-dist/bibtex/bst/biblatex-ms/biblatex-ms.bst

raw
1 % Copyright (c) 2006-2011 Philipp Lehman.
2 % 2012-2018 Philip Kime, Audrey Boruvka, Joseph Wright
3 %
4 % Permission is granted to copy, distribute and/or modify this
5 % software under the terms of the LaTeX Project Public License
6 % (LPPL), version 1.3c.
7 %
8 % This software is provided 'as is', without warranty of any kind,
9 % either expressed or implied, including, but not limited to, the
10 % implied warranties of merchantability and fitness for a
11 % particular purpose.
12
13 % -------------------------------------------------------------------
14 % Initialization
15 % -------------------------------------------------------------------
16
17 ENTRY {
18 % special fields
19 fakeset
20 entryset
21 entrysubtype
22 execute
23 hyphenation
24 keywords
25 label
26 langid
27 langidopts
28 options
29 presort
30 shorthand
31 sortkey
32 sortname
33 sorttitle
34 sortyear
35 xref
36 % data fields
37 abstract
38 addendum
39 address
40 afterword
41 annotation
42 annote
43 annotator
44 author
45 authortype
46 bookauthor
47 booksubtitle
48 booktitle
49 booktitleaddon
50 chapter
51 commentator
52 date
53 doi
54 edition
55 editor
56 editora
57 editorb
58 editorc
59 editortype
60 editoratype
61 editorbtype
62 editorctype
63 eid
64 eprint
65 eprintclass
66 eprinttype
67 eventdate
68 eventtitle
69 eventtitleaddon
70 file
71 foreword
72 gender
73 howpublished
74 indexsorttitle
75 indextitle
76 institution
77 introduction
78 isan
79 isbn
80 ismn
81 isrn
82 issn
83 issue
84 issuetitle
85 issuesubtitle
86 iswc
87 journal
88 journaltitle
89 journalsubtitle
90 language
91 library
92 location
93 bookpagination
94 mainsubtitle
95 maintitle
96 maintitleaddon
97 month
98 nameaddon
99 note
100 number
101 organization
102 origlanguage
103 origlocation
104 origpublisher
105 origtitle
106 origdate
107 pages
108 pagetotal
109 pagination
110 part
111 pdf
112 pubstate
113 reprinttitle
114 holder
115 publisher
116 school
117 series
118 shortauthor
119 shorteditor
120 shorthandintro
121 shortjournal
122 shortseries
123 shorttitle
124 subtitle
125 title
126 titleaddon
127 translator
128 type
129 url
130 urldate
131 venue
132 version
133 volume
134 volumes
135 year
136 % aliases
137 archiveprefix
138 primaryclass
139 % custom fields
140 namea
141 nameb
142 namec
143 nameatype
144 namebtype
145 namectype
146 lista
147 listb
148 listc
149 listd
150 liste
151 listf
152 usera
153 userb
154 userc
155 userd
156 usere
157 userf
158 verba
159 verbb
160 verbc
161 }
162 { skipbib skiplos skiplab
163 useauthor useeditor usetranslator useprefix
164 singletitle }
165 { entryoptions labelhash namehash fullhash
166 dateyear dateendyear extradate labelalpha extraalpha label.name label.year
167 sortinit sortkey.nosort sortkey.name sortkey.year
168 sortkey.title sortkey.alpha sort.year sort.alph
169 warningmsg }
170
171 INTEGERS { ctrl.debug ctrl.bibtex8 ctrl.maxline ctrl.sorting ctrl.cssort
172 ctrl.maxcitenames ctrl.mincitenames
173 ctrl.maxsortnames ctrl.minsortnames
174 ctrl.nohashothers ctrl.nosortothers
175 ctrl.maxalphanames ctrl.minalphanames
176 ctrl.useauthor ctrl.useeditor ctrl.usetranslator
177 ctrl.useprefix ctrl.labelalpha ctrl.singletitle
178 ctrl.labeldate citecount
179 tempctra tempctrb tempctrc resvctra resvctrb resvctrc
180 last.extra.num }
181
182 STRINGS { ctrl.alphaothers ctrl.sortalphaothers ctrl.sortstr
183 templist tempstrga tempstrgb resvstrga resvstrgb resvstrgc
184 last.name last.hash last.year last.extra }
185
186 FUNCTION {initialize} {
187 "$Revision: 4.0 $"
188 #12 entry.max$ substring$
189 #-3 entry.max$ substring$
190 "Biblatex version: " swap$ * top$
191 #0 'ctrl.debug :=
192 #0 'ctrl.labelalpha :=
193 #0 'ctrl.labeldate :=
194 #0 'ctrl.singletitle :=
195 #0 'ctrl.sorting :=
196 #1 'ctrl.useauthor :=
197 #1 'ctrl.useeditor :=
198 #0 'ctrl.usetranslator :=
199 #0 'ctrl.useprefix :=
200 #99 'ctrl.maxcitenames :=
201 #1 'ctrl.mincitenames :=
202 #99 'ctrl.maxsortnames :=
203 #1 'ctrl.minsortnames :=
204 #0 'ctrl.nohashothers :=
205 #0 'ctrl.nosortothers :=
206 #1 'ctrl.minalphanames :=
207 #3 'ctrl.maxalphanames :=
208 #79 'ctrl.maxline :=
209 "+" 'ctrl.alphaothers :=
210 " " 'ctrl.sortalphaothers :=
211 "nty" 'ctrl.sortstr :=
212 }
213
214 % -------------------------------------------------------------------
215 % Strings
216 % -------------------------------------------------------------------
217
218 MACRO {jan} { "01" }
219 MACRO {feb} { "02" }
220 MACRO {mar} { "03" }
221 MACRO {apr} { "04" }
222 MACRO {may} { "05" }
223 MACRO {jun} { "06" }
224 MACRO {jul} { "07" }
225 MACRO {aug} { "08" }
226 MACRO {sep} { "09" }
227 MACRO {oct} { "10" }
228 MACRO {nov} { "11" }
229 MACRO {dec} { "12" }
230
231 % -------------------------------------------------------------------
232 % Generic functions
233 % -------------------------------------------------------------------
234
235 FUNCTION {and} {
236 'skip$
237 { pop$ #0 }
238 if$
239 }
240
241 FUNCTION {or} {
242 { pop$ #1 }
243 'skip$
244 if$
245 }
246
247 FUNCTION {not} {
248 { #0 }
249 { #1 }
250 if$
251 }
252
253 FUNCTION {ctrl:control} {
254 type$ "control" =
255 }
256
257 FUNCTION {ctrl:set} {
258 type$ "set" =
259 }
260
261
262 FUNCTION {ctrl:skiplab} {
263 ctrl:control skiplab or
264 ctrl:set % fakeset empty$ and
265 or
266 }
267
268 FUNCTION {ctrl:labelalpha} {
269 ctrl.labelalpha
270 ctrl:skiplab not
271 and
272 }
273
274 FUNCTION {ctrl:labeldate} {
275 ctrl.labeldate
276 ctrl:skiplab not
277 and
278 }
279
280 FUNCTION {wrap:braces} {
281 duplicate$ empty$
282 { pop$ "{}" }
283 { "{" swap$ * "}" * }
284 if$
285 }
286
287 FUNCTION {combine:key:value} {
288 "=" *
289 swap$
290 wrap:braces *
291 "," *
292 }
293
294 FUNCTION {delimiter.1} {
295 ctrl.bibtex8
296 { "0" }
297 { " " }
298 if$
299 }
300
301 FUNCTION {delimiter.2} {
302 ctrl.bibtex8
303 { "1" }
304 { " " }
305 if$
306 }
307
308 FUNCTION {delimiter.3} {
309 ctrl.bibtex8
310 { "2" }
311 { " " }
312 if$
313 }
314
315 FUNCTION {open.ended} {
316 "9999"
317 }
318
319 FUNCTION {maxline} {
320 duplicate$ empty$
321 'skip$
322 { #1 ctrl.maxline substring$ }
323 if$
324 }
325
326 FUNCTION {truncate} {
327 duplicate$ empty$
328 { pop$ "" }
329 { #1 entry.max$ substring$ }
330 if$
331 }
332
333 FUNCTION {purify} {
334 duplicate$ empty$
335 { pop$ "" }
336 { purify$
337 ctrl.bibtex8
338 ctrl.cssort
339 and
340 'skip$
341 { "l" change.case$ }
342 if$
343 truncate
344 }
345 if$
346 }
347
348 FUNCTION {normalize} {
349 duplicate$ empty$
350 { pop$ "" }
351 { ctrl.bibtex8
352 ctrl.cssort
353 and
354 'skip$
355 { "l" change.case$ }
356 if$
357 truncate
358 }
359 if$
360 }
361
362 FUNCTION {enquote} {
363 "'" swap$ * "'" *
364 }
365
366 FUNCTION {str:length} {
367 #1 'resvctra :=
368 { duplicate$ duplicate$ #1 resvctra substring$ = not }
369 { resvctra #1 + 'resvctra := }
370 while$
371 pop$
372 resvctra
373 }
374
375 FUNCTION {str:replace} {
376 'resvstrga :=
377 'resvstrgb :=
378 'resvstrgc :=
379 resvstrgb str:length 'resvctra :=
380 ""
381 { resvstrgc empty$ not }
382 { resvstrgc #1 resvctra substring$ resvstrgb =
383 { resvstrga *
384 resvstrgc #1 resvctra + global.max$ substring$ 'resvstrgc :=
385 }
386 { resvstrgc #1 #1 substring$ *
387 resvstrgc #2 global.max$ substring$ 'resvstrgc :=
388 }
389 if$
390 }
391 while$
392 }
393
394 FUNCTION {bol.to.int} {
395 "true" =
396 { #1 }
397 { #0 }
398 if$
399 }
400
401 FUNCTION {str.to.int} {
402 'resvstrga :=
403 resvstrga text.length$ 'resvctra :=
404 #1 'resvctrb :=
405 #0
406 { resvctrb resvctra > not }
407 { 'resvctrc :=
408 resvstrga resvctrb #1 substring$
409 chr.to.int$ "0" chr.to.int$ -
410 #0
411 { resvctrc #0 > }
412 { resvctrc #1 - 'resvctrc :=
413 #10 +
414 }
415 while$
416 +
417 resvctrb #1 + 'resvctrb :=
418 }
419 while$
420 }
421
422 FUNCTION {andothers} {
423 duplicate$ num.names$ "{ff}{vv}{ll}{jj}" format.name$ "others" =
424 }
425
426 FUNCTION {push} {
427 duplicate$ empty$
428 { pop$ "" }
429 { truncate }
430 if$
431 }
432
433 FUNCTION {push:cite} {
434 cite$ empty$
435 { "Missing citation key" warning$ "" }
436 { cite$ }
437 if$
438 }
439
440 FUNCTION {push:presort} {
441 presort empty$
442 { "mm" }
443 { presort purify
444 #1 #2 substring$
445 "l" change.case$ }
446 if$
447 }
448
449 FUNCTION {push:fullname} {
450 author empty$ not
451 useauthor
452 and
453 { author }
454 { editor empty$ not
455 useeditor
456 and
457 { editor }
458 { translator empty$ not
459 usetranslator
460 and
461 { translator }
462 { "" }
463 if$
464 }
465 if$
466 }
467 if$
468 }
469
470 FUNCTION {push:labelname:translator} {
471 translator empty$ not
472 usetranslator
473 and
474 { "translator" }
475 { "" }
476 if$
477 }
478
479 FUNCTION {push:labelname:editor} {
480 useeditor
481 { shorteditor empty$
482 { editor empty$
483 { push:labelname:translator }
484 { "editor" }
485 if$
486 }
487 { "shorteditor" }
488 if$
489 }
490 { push:labelname:translator }
491 if$
492 }
493
494 FUNCTION {push:shortname:translator} {
495 translator empty$ not
496 usetranslator
497 and
498 { translator }
499 { "" }
500 if$
501 }
502
503 FUNCTION {push:shortname:editor} {
504 useeditor
505 { shorteditor empty$
506 { editor empty$
507 { push:shortname:translator }
508 { editor }
509 if$
510 }
511 { shorteditor }
512 if$
513 }
514 { push:shortname:translator }
515 if$
516 }
517
518 FUNCTION {push:shortname} {
519 useauthor
520 { shortauthor empty$
521 { author empty$
522 { push:shortname:editor }
523 { author }
524 if$
525 }
526 { shortauthor }
527 if$
528 }
529 { push:shortname:editor }
530 if$
531 }
532
533 FUNCTION {push:sorttitle} {
534 sorttitle empty$
535 { title empty$
536 { "" }
537 { title }
538 if$
539 }
540 { sorttitle }
541 if$
542 push
543 }
544
545 FUNCTION {shortname:hash} {
546 'tempctrc :=
547 'templist :=
548 #1 'tempctra :=
549 templist num.names$ 'tempctrb :=
550 templist andothers
551 { tempctrb #1 - 'tempctrb := }
552 'skip$
553 if$
554 tempctrc #0 =
555 { tempctrb 'tempctrc := }
556 { tempctrb tempctrc >
557 { ctrl.mincitenames 'tempctrc := }
558 { ctrl.maxcitenames 'tempctrc := }
559 if$
560 }
561 if$
562 ""
563 { tempctra tempctrc > not
564 tempctrb #0 >
565 and }
566 { templist tempctra "{vv{}}{ll{}}{ff{}}{jj{}}" format.name$ *
567 tempctra #1 + 'tempctra :=
568 tempctrb #1 - 'tempctrb :=
569 }
570 while$
571 templist andothers
572 tempctrb #0 >
573 or
574 ctrl.nohashothers not
575 and
576 { "+" * }
577 'skip$
578 if$
579 }
580
581 FUNCTION {push:name:namehash} {
582 push:shortname duplicate$ empty$
583 { pop$ push:sorttitle duplicate$ empty$
584 { pop$ push:cite purify }
585 'skip$
586 if$
587 }
588 { ctrl.maxcitenames shortname:hash }
589 if$
590 }
591
592 FUNCTION {push:name:fullhash} {
593 push:fullname duplicate$ empty$
594 { pop$ push:sorttitle duplicate$ empty$
595 { pop$ push:cite purify }
596 'skip$
597 if$
598 }
599 { #0 shortname:hash }
600 if$
601 }
602
603 FUNCTION {push:labelname} {
604 useauthor
605 { shortauthor empty$
606 { author empty$
607 { push:labelname:editor }
608 { "author" }
609 if$
610 }
611 { "shortauthor" }
612 if$
613 }
614 { push:labelname:editor }
615 if$
616 }
617
618 FUNCTION {check:sortname} {
619 sortname empty$
620 'skip$
621 { pop$ sortname }
622 if$
623 }
624
625 FUNCTION {warning} {
626 "\item " swap$ *
627 warningmsg empty$
628 'skip$
629 { warningmsg " " * swap$ * }
630 if$
631 'warningmsg :=
632 }
633
634 FUNCTION {warning:invalid} {
635 "Invalid format of field " swap$ enquote * warning
636 }
637
638 FUNCTION {warning:duplicate} {
639 "Can't use " swap$ enquote * " + " * swap$ enquote * warning
640 }
641
642 FUNCTION {pad.number} {
643 'tempctra :=
644 duplicate$ empty$
645 { pop$ "" }
646 'skip$
647 if$
648 { duplicate$ text.length$ tempctra < }
649 { "0" swap$ * }
650 while$
651 }
652
653 FUNCTION {extract.number} {
654 purify$ 'tempstrga :=
655 ""
656 { tempstrga empty$ not }
657 { tempstrga #1 #1 substring$ chr.to.int$ duplicate$
658 #47 > swap$
659 #58 < and
660 { tempstrga #1 #1 substring$ * }
661 'skip$
662 if$
663 tempstrga #2 global.max$ substring$ 'tempstrga :=
664 }
665 while$
666 #1 #9 substring$
667 }
668
669 FUNCTION {format.range}
670 { 'tempstrga :=
671 ""
672 { tempstrga empty$ not }
673 { tempstrga #1 #1 substring$ "-" =
674 { "\bibrangedash " *
675 tempstrga #2 global.max$ substring$ 'tempstrga :=
676 { tempstrga #1 #1 substring$ "-" = }
677 { tempstrga #2 global.max$ substring$ 'tempstrga := }
678 while$
679 }
680 { tempstrga #1 #1 substring$ *
681 tempstrga #2 global.max$ substring$ 'tempstrga :=
682 }
683 if$
684 }
685 while$
686 }
687
688 FUNCTION {format:name:part} {
689 "\~" "[[[TILDE ACCENT]]]" str:replace
690 "~" "\bibnamedelima " str:replace
691 "[[[TILDE ACCENT]]]" "\~" str:replace
692 }
693
694 FUNCTION {format:name:initials} {
695 "\." "[[[DOT ACCENT]]]" str:replace
696 ".-" "\bibinithyphendelim " str:replace
697 ".~" "\bibinitperiod\bibinitdelim " str:replace
698 ". " "\bibinitperiod\bibinitdelim " str:replace
699 "." "\bibinitperiod" str:replace
700 "[[[DOT ACCENT]]]" "\." str:replace
701 }
702
703 FUNCTION {is.number} {
704 #1
705 { #0 > }
706 { duplicate$ #1 #1 substring$ chr.to.int$
707 duplicate$ #47 >
708 swap$ #58 <
709 and
710 { #2 global.max$ substring$
711 duplicate$ empty$
712 { #0 }
713 { #1 }
714 if$
715 }
716 { #0 }
717 if$
718 }
719 while$
720 empty$
721 }
722
723 FUNCTION {split.date:invalid} {
724 #0 'tempctra :=
725 }
726
727 FUNCTION {split.date:check.day} {
728 duplicate$ empty$
729 'skip$
730 { duplicate$ is.number
731 { duplicate$ str.to.int
732 duplicate$ #0 >
733 swap$ #32 <
734 and
735 { duplicate$ text.length$ #2 <
736 { "0" swap$ * }
737 'skip$
738 if$
739 }
740 { pop$ "" split.date:invalid }
741 if$
742 }
743 { pop$ "" split.date:invalid }
744 if$
745 }
746 if$
747 }
748
749 FUNCTION {split.date:check.month} {
750 duplicate$ empty$
751 'skip$
752 { duplicate$ is.number
753 { duplicate$ str.to.int
754 duplicate$ #0 >
755 swap$ #13 <
756 and
757 { duplicate$ text.length$ #2 <
758 { "0" swap$ * }
759 'skip$
760 if$
761 }
762 { pop$ "" split.date:invalid }
763 if$
764 }
765 { pop$ "" split.date:invalid }
766 if$
767 }
768 if$
769 }
770
771 FUNCTION {split.date:check.year} {
772 duplicate$ empty$
773 'skip$
774 { duplicate$ is.number
775 { duplicate$ "0" =
776 'skip$
777 { duplicate$
778 duplicate$ str.to.int #0 >
779 swap$ text.length$ #5 <
780 and
781 'skip$
782 { pop$ "" split.date:invalid }
783 if$
784 }
785 if$
786 }
787 { pop$ "" split.date:invalid }
788 if$
789 }
790 if$
791 }
792
793 FUNCTION {split.date:check.date} {
794 duplicate$ empty$
795 'skip$
796 { duplicate$
797 duplicate$ text.length$ #0 >
798 swap$ text.length$ #11 <
799 and
800 'skip$
801 { pop$ "" split.date:invalid }
802 if$
803 }
804 if$
805 }
806
807 FUNCTION {split.date:check.range} {
808 duplicate$ empty$
809 'skip$
810 { duplicate$
811 duplicate$ text.length$ #0 >
812 swap$ text.length$ #22 <
813 and
814 'skip$
815 { pop$ "" split.date:invalid }
816 if$
817 }
818 if$
819 }
820
821 FUNCTION {split.date:date:part} {
822 'tempstrgb :=
823 ""
824 { tempstrgb #1 #1 substring$
825 duplicate$ empty$
826 { pop$ #0 }
827 { "-" = not }
828 if$
829 }
830 { tempstrgb #1 #1 substring$ *
831 tempstrgb #2 global.max$ substring$ 'tempstrgb :=
832 }
833 while$
834 tempstrgb #2 global.max$ substring$
835 }
836
837 FUNCTION {split.date:date} {
838 duplicate$ empty$
839 { pop$ "" "" "" }
840 { split.date:date:part swap$ split.date:check.year swap$
841 split.date:date:part swap$ split.date:check.month swap$
842 split.date:date:part pop$ split.date:check.day
843 }
844 if$
845 }
846
847 FUNCTION {split.date:range} {
848 duplicate$ empty$
849 { pop$ "" "" }
850 { 'tempstrgb :=
851 ""
852 #0 'tempctrb :=
853 { tempstrgb #1 #1 substring$
854 duplicate$ empty$
855 { pop$ #0 }
856 { "/" =
857 { #1 'tempctrb :=
858 #0
859 }
860 { #1 }
861 if$
862 }
863 if$
864 }
865 { tempstrgb #1 #1 substring$ *
866 tempstrgb #2 global.max$ substring$ 'tempstrgb :=
867 }
868 while$
869 split.date:check.date
870 tempstrgb #2 global.max$ substring$
871 duplicate$ empty$
872 tempctrb #1 =
873 and
874 { pop$ open.ended }
875 'skip$
876 if$
877 split.date:check.date
878 }
879 if$
880 }
881
882 FUNCTION {split.date} {
883 duplicate$ empty$
884 { pop$ pop$ "" "" "" "" "" "" }
885 { swap$ 'templist :=
886 #1 'tempctra :=
887 split.date:check.range
888 split.date:range swap$ 'tempstrga :=
889 split.date:date tempstrga
890 split.date:date
891 tempctra
892 'skip$
893 { pop$ pop$ pop$ pop$ pop$ pop$ "" "" "" "" "" ""
894 templist warning:invalid
895 }
896 if$
897 }
898 if$
899 }
900
901 % -------------------------------------------------------------------
902 % Sorting
903 % -------------------------------------------------------------------
904
905 FUNCTION {sortkey:name:format} {
906 'templist :=
907 #1 'tempctra :=
908 templist num.names$ 'tempctrb :=
909 templist andothers
910 { tempctrb #1 - 'tempctrb := }
911 'skip$
912 if$
913 tempctrb ctrl.maxsortnames >
914 { ctrl.minsortnames 'tempctrc := }
915 { ctrl.maxsortnames 'tempctrc := }
916 if$
917 ""
918 { duplicate$ text.length$ entry.max$ #50 - <
919 tempctra tempctrc > not and
920 tempctrb #0 > and
921 }
922 { useprefix
923 { templist tempctra "{vv}" format.name$
924 duplicate$ empty$
925 { pop$ "" }
926 { "u" change.case$ "t" change.case$
927 delimiter.3 * }
928 if$
929 templist tempctra
930 "{ll}{" delimiter.3 *
931 "ff}{" delimiter.3 * *
932 "jj}" *
933 format.name$ *
934 }
935 { templist tempctra
936 "{ll}{" delimiter.3 *
937 "ff}{" delimiter.3 * *
938 "vv}{" delimiter.3 * *
939 "jj}" *
940 format.name$ }
941 if$
942 tempctra #1 >
943 { delimiter.2 swap$ * }
944 'skip$
945 if$
946 *
947 tempctra #1 + 'tempctra :=
948 tempctrb #1 - 'tempctrb :=
949 }
950 while$
951 templist andothers
952 tempctrb #0 >
953 or
954 ctrl.nosortothers not
955 and
956 { delimiter.2 * "zzzz" * }
957 'skip$
958 if$
959 }
960
961 FUNCTION {sortkey:init:label} {
962 push:shortname duplicate$ empty$
963 { pop$ push:sorttitle }
964 { check:sortname sortkey:name:format }
965 if$
966 purify 'sortkey.name :=
967 sortyear empty$
968 { dateyear
969 dateendyear empty$
970 'skip$
971 { dateyear dateendyear =
972 'skip$
973 { dateendyear open.ended =
974 'skip$
975 { "-" * dateendyear * }
976 if$
977 }
978 if$
979 }
980 if$
981 }
982 { sortyear }
983 if$
984 purify 'sortkey.year :=
985 push:sorttitle purify 'sortkey.title :=
986 }
987
988 FUNCTION {sortkey:init:main} {
989 push:fullname duplicate$ empty$
990 { pop$ push:sorttitle }
991 { check:sortname sortkey:name:format }
992 if$
993 purify 'sortkey.name :=
994 }
995
996 FUNCTION {sortkey:main:string} {
997 duplicate$ #1 =
998 { pop$
999 sortkey.name delimiter.1 *
1000 sortkey.title * delimiter.1 *
1001 sortkey.year * delimiter.1 *
1002 volume purify #4 pad.number * delimiter.1 *
1003 }
1004 { duplicate$ #2 =
1005 { pop$
1006 sortkey.name delimiter.1 *
1007 sortkey.year * delimiter.1 *
1008 sortkey.title * delimiter.1 *
1009 volume purify #4 pad.number * delimiter.1 *
1010 }
1011 { #3 =
1012 { sortkey.name delimiter.1 *
1013 sortkey.year * delimiter.1 *
1014 volume purify #4 pad.number * delimiter.1 *
1015 sortkey.title *
1016 }
1017 { "" }
1018 if$
1019 }
1020 if$
1021 }
1022 if$
1023 }
1024
1025 FUNCTION {sortkey:main:date:year} {
1026 duplicate$ empty$
1027 { pop$ }
1028 { extract.number #1 #4 substring$
1029 duplicate$ empty$
1030 { pop$ }
1031 { swap$ pop$ }
1032 if$
1033 }
1034 if$
1035 }
1036
1037 FUNCTION {sortkey:main:date} {
1038 duplicate$ #1 =
1039 { pop$
1040 sortyear empty$
1041 { "9999" dateyear sortkey:main:date:year }
1042 { sortyear purify }
1043 if$
1044 }
1045 { #2 =
1046 { sortyear empty$
1047 { "0" dateyear sortkey:main:date:year }
1048 { sortyear purify }
1049 if$
1050 str.to.int #9999 swap$ - int.to.str$
1051 }
1052 { "" }
1053 if$
1054 }
1055 if$
1056 sortkey.name * delimiter.1 *
1057 sortkey.title * delimiter.1 *
1058 volume purify #4 pad.number * delimiter.1 *
1059 }
1060
1061 FUNCTION {sortkey:main} {
1062 ctrl.sorting #0 =
1063 { sortkey.nosort }
1064 { sortkey:init:main
1065 ""
1066 ctrl.sorting #10 <
1067 { sortkey empty$
1068 { ctrl.sorting sortkey:main:string }
1069 { sortkey }
1070 if$
1071 }
1072 { ctrl.sorting #20 <
1073 { shorthand empty$
1074 { sortkey.alpha * }
1075 { shorthand purify * }
1076 if$
1077 duplicate$ empty$
1078 'skip$
1079 { delimiter.1 * }
1080 if$
1081 ctrl.sorting #10 - sortkey:main:string
1082 }
1083 { ctrl.sorting #30 <
1084 { sortkey empty$
1085 { ctrl.sorting #20 - sortkey:main:date }
1086 { sortkey }
1087 if$
1088 }
1089 { push:cite purify }
1090 if$
1091 }
1092 if$
1093 }
1094 if$
1095 *
1096 duplicate$ #1 text.prefix$ "u" change.case$ 'sortinit :=
1097 push:presort delimiter.1 * swap$ *
1098 }
1099 if$
1100 truncate
1101 }
1102
1103 % -------------------------------------------------------------------
1104 % Output
1105 % -------------------------------------------------------------------
1106
1107 FUNCTION {output:indent:field} {
1108 duplicate$ empty$
1109 'skip$
1110 { " " swap$ * write$ newline$ }
1111 if$
1112 }
1113
1114 FUNCTION {output:indent:subfield} {
1115 duplicate$ empty$
1116 'skip$
1117 { " " swap$ * write$ newline$ }
1118 if$
1119 }
1120
1121 FUNCTION {output:indent:subfield:keyval} {
1122 duplicate$ empty$
1123 'skip$
1124 { " " swap$ * write$ newline$ }
1125 if$
1126 }
1127
1128 FUNCTION {output:write:field:maybeempty} {
1129 swap$ "\field" swap$ wrap:braces *
1130 swap$ wrap:braces * output:indent:field
1131 }
1132
1133 FUNCTION {output:write:fieldsource:maybeempty} {
1134 swap$ "\fieldmssource" swap$ wrap:braces *
1135 swap$ wrap:braces * "{}{}" * output:indent:field
1136 }
1137
1138 FUNCTION {output:write:field} {
1139 duplicate$ empty$
1140 { pop$ pop$ }
1141 { output:write:field:maybeempty }
1142 if$
1143 }
1144
1145 FUNCTION {output:write:fieldsource} {
1146 duplicate$ empty$
1147 { pop$ pop$ }
1148 { output:write:fieldsource:maybeempty }
1149 if$
1150 }
1151
1152 FUNCTION {output:write:year} {
1153 duplicate$ empty$
1154 { pop$ pop$ }
1155 { duplicate$ open.ended =
1156 { pop$ "" }
1157 'skip$
1158 if$
1159 swap$ "\field" swap$ wrap:braces *
1160 swap$ wrap:braces * output:indent:field
1161 }
1162 if$
1163 }
1164
1165 FUNCTION {output:write:multi} {
1166 duplicate$ empty$
1167 { pop$ pop$ }
1168 { swap$ "\field" swap$ wrap:braces * "{%" * output:indent:field
1169 "%" * output:indent:field
1170 "}" output:indent:field
1171 }
1172 if$
1173 }
1174
1175 FUNCTION {output:write:bool} {
1176 #0 >
1177 { "\true" }
1178 { "\false" }
1179 if$
1180 swap$ wrap:braces * output:indent:field
1181 }
1182
1183 FUNCTION {output:write:count} {
1184 int.to.str$ swap$ "\count" swap$ wrap:braces *
1185 swap$ wrap:braces * output:indent:field
1186 }
1187
1188 FUNCTION {output:write:string} {
1189 duplicate$ empty$
1190 { pop$ pop$ }
1191 { swap$ "\strng" swap$ wrap:braces *
1192 swap$ wrap:braces * output:indent:field }
1193 if$
1194 }
1195
1196 FUNCTION {output:write:range} {
1197 duplicate$ empty$
1198 { pop$ pop$ }
1199 { format.range output:write:field }
1200 if$
1201 }
1202
1203 FUNCTION {output:write:number} {
1204 duplicate$ empty$
1205 { pop$ pop$ }
1206 { duplicate$ is.number
1207 'skip$
1208 { swap$ warning:invalid "" }
1209 if$
1210 output:write:field
1211 }
1212 if$
1213 }
1214
1215 FUNCTION {output:write:gender} {
1216 duplicate$ empty$
1217 { pop$ pop$ }
1218 { 'tempstrga :=
1219 tempstrga "sf" =
1220 tempstrga "sm" = or
1221 tempstrga "sn" = or
1222 tempstrga "pf" = or
1223 tempstrga "pm" = or
1224 tempstrga "pn" = or
1225 tempstrga "pp" = or
1226 { tempstrga output:write:field }
1227 { warning:invalid }
1228 if$
1229 }
1230 if$
1231 }
1232
1233 FUNCTION {output:write:verb} {
1234 duplicate$ empty$
1235 { pop$ pop$ }
1236 { 'tempstrga :=
1237 "\verb" swap$ wrap:braces * output:indent:field
1238 { tempstrga empty$ not }
1239 { "\verb " tempstrga #1 ctrl.maxline #10 - substring$ *
1240 output:indent:field
1241 tempstrga ctrl.maxline #9 - global.max$ substring$ 'tempstrga :=
1242 }
1243 while$
1244 "\endverb" output:indent:field }
1245 if$
1246 }
1247
1248 FUNCTION {output:write:name:hash} {
1249 templist tempctra "{v{}}{l{}}{f{}}{j{}}" format.name$ purify$
1250 }
1251
1252 FUNCTION {output:write:name:last} {
1253 templist tempctra "{ll}" format.name$
1254 duplicate$ 'tempstrga :=
1255 duplicate$ empty$
1256 'pop$
1257 { format:name:part
1258 "family" combine:key:value output:indent:subfield:keyval
1259 templist tempctra "{l.}" format.name$
1260 duplicate$ tempstrga "." * =
1261 { duplicate$ text.length$ #1 - text.prefix$ }
1262 'skip$
1263 if$
1264 format:name:initials
1265 "familyi" combine:key:value output:indent:subfield:keyval
1266 }
1267 if$
1268 }
1269
1270 FUNCTION {output:write:name:first} {
1271 templist tempctra "{ff}" format.name$
1272 duplicate$ 'tempstrga :=
1273 duplicate$ empty$
1274 'pop$
1275 { format:name:part
1276 "given" combine:key:value output:indent:subfield:keyval
1277 templist tempctra "{f.}" format.name$
1278 duplicate$ tempstrga "." * =
1279 { duplicate$ text.length$ #1 - text.prefix$ }
1280 'skip$
1281 if$
1282 format:name:initials
1283 "giveni" combine:key:value output:indent:subfield:keyval
1284 }
1285 if$
1286 }
1287
1288 FUNCTION {output:write:name:prefix} {
1289 templist tempctra "{vv}" format.name$
1290 duplicate$ 'tempstrga :=
1291 duplicate$ duplicate$ text.length$ duplicate$ substring$ "'" =
1292 { #1 'tempctrc := }
1293 { #0 'tempctrc := }
1294 if$
1295 duplicate$ empty$
1296 'pop$
1297 { format:name:part
1298 "prefix" combine:key:value output:indent:subfield:keyval
1299 templist tempctra "{v.}" format.name$
1300 tempctrc
1301 { duplicate$ text.length$ #1 - text.prefix$ "'" * }
1302 { duplicate$ tempstrga "." * =
1303 { duplicate$ text.length$ #1 - text.prefix$ }
1304 'skip$
1305 if$
1306 }
1307 if$
1308 format:name:initials
1309 "prefixi" combine:key:value output:indent:subfield:keyval
1310 }
1311 if$
1312 }
1313
1314 FUNCTION {output:write:name:suffix} {
1315 templist tempctra "{jj}" format.name$
1316 duplicate$ 'tempstrga :=
1317 duplicate$ empty$
1318 'pop$
1319 { format:name:part
1320 "suffix" combine:key:value output:indent:subfield:keyval
1321 templist tempctra "{j.}" format.name$
1322 duplicate$ tempstrga "." * =
1323 { duplicate$ text.length$ #1 - text.prefix$ }
1324 'skip$
1325 if$
1326 format:name:initials
1327 "suffixi" combine:key:value output:indent:subfield:keyval
1328 }
1329 if$
1330 }
1331
1332 FUNCTION {output:write:name} {
1333 duplicate$ empty$
1334 { pop$ pop$ }
1335 { 'templist :=
1336 'tempstrga :=
1337 #1 'tempctra :=
1338 templist num.names$ 'tempctrb :=
1339 templist andothers
1340 { tempctrb #1 - 'tempctrb :=
1341 "more" tempstrga * #1 output:write:bool
1342 % not actually required, biblatex should resolve this
1343 tempstrga push:labelname =
1344 { "morelabelname" #1 output:write:bool }
1345 'skip$
1346 if$
1347 }
1348 'skip$
1349 if$
1350 "\name" tempstrga wrap:braces *
1351 tempctrb int.to.str$ wrap:braces *
1352 "" wrap:braces *
1353 "{%" * output:indent:field
1354 { tempctrb #0 > }
1355 { "{{hash=" output:write:name:hash * "}{%" * output:indent:subfield
1356 output:write:name:prefix
1357 output:write:name:last
1358 output:write:name:suffix
1359 output:write:name:first
1360 "}}%" output:indent:subfield
1361 tempctra #1 + 'tempctra :=
1362 tempctrb #1 - 'tempctrb :=
1363 }
1364 while$
1365 "}" output:indent:field
1366 }
1367 if$
1368 }
1369
1370 FUNCTION {output:write:list} {
1371 duplicate$ empty$
1372 { pop$ pop$ }
1373 { 'templist :=
1374 'tempstrga :=
1375 templist num.names$ 'tempctra :=
1376 templist andothers
1377 { tempctra #1 - 'tempctra :=
1378 "more" tempstrga * #1 output:write:bool
1379 }
1380 'skip$
1381 if$
1382 "\list" tempstrga wrap:braces *
1383 tempctra int.to.str$ wrap:braces *
1384 "{%" * output:indent:field
1385 #1 'tempctra :=
1386 #1 'tempctrb :=
1387 #0 'tempctrc :=
1388 { templist purify tempctrb global.max$ substring$ num.names$ #0 > }
1389 { templist tempctrb #1 substring$ "{" =
1390 { tempctrc #1 + 'tempctrc :=
1391 tempctrb #1 + 'tempctrb := }
1392 { templist tempctrb #1 substring$ "}" =
1393 { tempctrc #1 - 'tempctrc :=
1394 tempctrb #1 + 'tempctrb := }
1395 { templist tempctrb #5 substring$
1396 duplicate$ " AND " =
1397 swap$ " and " =
1398 or
1399 tempctrc #1 <
1400 and
1401 { templist tempctra tempctrb tempctra - substring$
1402 wrap:braces "%" * output:indent:subfield
1403 tempctrb #5 + duplicate$
1404 'tempctra :=
1405 'tempctrb :=
1406 }
1407 { tempctrb #1 + 'tempctrb := }
1408 if$
1409 }
1410 if$
1411 }
1412 if$
1413 }
1414 while$
1415 templist tempctra global.max$ substring$
1416 duplicate$ "others" =
1417 { pop$ }
1418 { wrap:braces "%" * output:indent:subfield }
1419 if$
1420 "}" output:indent:field
1421 }
1422 if$
1423 }
1424
1425 FUNCTION {output:specials} {
1426 fakeset empty$
1427 'skip$
1428 { ctrl:set
1429 { "\fakeset" fakeset wrap:braces * output:indent:field }
1430 { "fakeset can only be used for @set entries" warning * }
1431 if$
1432 }
1433 if$
1434 entryset empty$
1435 'skip$
1436 { ctrl:set
1437 { "\set" }
1438 { "\inset" }
1439 if$
1440 entryset wrap:braces * output:indent:field
1441 }
1442 if$
1443 xref empty$
1444 'skip$
1445 { "\xref" xref wrap:braces * output:indent:field }
1446 if$
1447 keywords empty$
1448 'skip$
1449 { "\keyw" keywords wrap:braces * output:indent:field }
1450 if$
1451 "entrysubtype" entrysubtype output:write:field
1452 "crossref" crossref output:write:string
1453 "execute" execute output:write:field
1454 "namehash" namehash output:write:string
1455 "fullhash" fullhash output:write:string
1456 "gender" gender output:write:gender
1457 "shorthand" shorthand output:write:field
1458 shorthand empty$
1459 { label }
1460 { shorthand }
1461 if$
1462 "label" swap$ output:write:field
1463 "labelname" push:labelname output:write:fieldsource
1464 shorttitle empty$
1465 { title empty$
1466 { "" }
1467 { "title" }
1468 if$
1469 }
1470 { "shorttitle" }
1471 if$
1472 "labeltitle" swap$ output:write:fieldsource
1473 ctrl.labelalpha
1474 { "labelalpha" labelalpha output:write:field
1475 "extraalpha" extraalpha output:write:field
1476 }
1477 'skip$
1478 if$
1479 ctrl:labeldate
1480 { dateyear empty$ not
1481 { "labelyear" dateyear output:write:field
1482 dateendyear empty$
1483 'skip$
1484 { dateyear dateendyear =
1485 'skip$
1486 { dateendyear open.ended =
1487 'skip$
1488 { "labelendyear" dateendyear output:write:field }
1489 if$
1490 }
1491 if$
1492 }
1493 if$
1494 "extradate" extradate output:write:field
1495 "labeldatesource" "" output:write:field:maybeempty
1496 }
1497 { "extradate" extradate output:write:field
1498 "labeldatesource" "nodate" output:write:field
1499 }
1500 if$
1501 }
1502 'skip$
1503 if$
1504 "sortinit" sortinit output:write:field
1505 "sortinithash" sortinit output:write:field
1506 singletitle
1507 { "singletitle" #1 output:write:bool }
1508 'skip$
1509 if$
1510 }
1511
1512 FUNCTION {output:names} {
1513 "author" author output:write:name
1514 "authortype" authortype output:write:field
1515 "shortauthor" shortauthor output:write:name
1516 "bookauthor" bookauthor output:write:name
1517 "editor" editor output:write:name
1518 "editortype" editortype output:write:field
1519 "editora" editora output:write:name
1520 "editoratype" editoratype output:write:field
1521 "editorb" editorb output:write:name
1522 "editorbtype" editorbtype output:write:field
1523 "editorc" editorc output:write:name
1524 "editorctype" editorctype output:write:field
1525 "shorteditor" shorteditor output:write:name
1526 "translator" translator output:write:name
1527 "annotator" annotator output:write:name
1528 "commentator" commentator output:write:name
1529 "introduction" introduction output:write:name
1530 "foreword" foreword output:write:name
1531 "afterword" afterword output:write:name
1532 "holder" holder output:write:name
1533 }
1534
1535 FUNCTION {output:lists} {
1536 "language" language output:write:list
1537 "organization" organization output:write:list
1538 "origlanguage" origlanguage output:write:list
1539 "origlocation" origlocation output:write:list
1540 "origpublisher" origpublisher output:write:list
1541 "publisher" publisher output:write:list
1542 }
1543
1544 FUNCTION {output:fields.1} {
1545 "abstract" abstract output:write:multi
1546 "addendum" addendum output:write:field
1547 "bookpagination" bookpagination output:write:field
1548 "booksubtitle" booksubtitle output:write:field
1549 "booktitleaddon" booktitleaddon output:write:field
1550 "booktitle" booktitle output:write:field
1551 "chapter" chapter output:write:field
1552 "doi" doi output:write:verb
1553 "edition" edition output:write:field
1554 "eid" eid output:write:field
1555 "eprint" eprint output:write:verb
1556 "eventtitle" eventtitle output:write:field
1557 "eventtitleaddon" eventtitleaddon output:write:field
1558 "howpublished" howpublished output:write:field
1559 "indexsorttitle" indexsorttitle output:write:field
1560 "indextitle" indextitle output:write:field
1561 "isan" isan output:write:field
1562 "isbn" isbn output:write:field
1563 "ismn" ismn output:write:field
1564 }
1565
1566 FUNCTION {output:fields.2} {
1567 "isrn" isrn output:write:field
1568 "issn" issn output:write:field
1569 "issue" issue output:write:field
1570 "issuesubtitle" issuesubtitle output:write:field
1571 "issuetitle" issuetitle output:write:field
1572 "iswc" iswc output:write:field
1573 "journalsubtitle" journalsubtitle output:write:field
1574 "langidopts" langidopts output:write:field
1575 "library" library output:write:field
1576 "mainsubtitle" mainsubtitle output:write:field
1577 "maintitleaddon" maintitleaddon output:write:field
1578 "maintitle" maintitle output:write:field
1579 "nameaddon" nameaddon output:write:field
1580 "note" note output:write:field
1581 "number" number output:write:field
1582 "origtitle" origtitle output:write:field
1583 "pages" pages output:write:range
1584 "pagetotal" pagetotal output:write:range
1585 "pagination" pagination output:write:field
1586 "part" part output:write:range
1587 }
1588
1589 FUNCTION {output:fields.3} {
1590 "pubstate" pubstate output:write:field
1591 "reprinttitle" reprinttitle output:write:field
1592 "series" series output:write:field
1593 "shorthandintro" shorthandintro output:write:field
1594 "shortjournal" shortjournal output:write:field
1595 "shortseries" shortseries output:write:field
1596 "shorttitle" shorttitle output:write:field
1597 "subtitle" subtitle output:write:field
1598 "titleaddon" titleaddon output:write:field
1599 "title" title output:write:field
1600 "url" url output:write:verb
1601 "venue" venue output:write:field
1602 "version" version output:write:field
1603 "volumes" volumes output:write:field
1604 "volume" volume output:write:field
1605 }
1606
1607 FUNCTION {output:dates.1} {
1608 "date" date split.date
1609 "day" swap$ output:write:field
1610 duplicate$ empty$
1611 { month empty$
1612 'skip$
1613 { month is.number
1614 { month str.to.int
1615 duplicate$ #0 >
1616 swap$ #13 <
1617 and
1618 { pop$ month #2 pad.number }
1619 { "month" warning:invalid }
1620 if$
1621 }
1622 { "month" warning:invalid }
1623 if$
1624 }
1625 if$
1626 }
1627 { month empty$
1628 'skip$
1629 { "month" "date" warning:duplicate }
1630 if$
1631 }
1632 if$
1633 "month" swap$ output:write:field
1634 duplicate$ empty$
1635 { year empty$
1636 'skip$
1637 { pop$ year }
1638 if$
1639 }
1640 { year empty$
1641 'skip$
1642 { "year" "date" warning:duplicate }
1643 if$
1644 }
1645 if$
1646 "year" swap$ output:write:field
1647 "endday" swap$ output:write:field
1648 "endmonth" swap$ output:write:field
1649 "endyear" swap$ output:write:year
1650 }
1651
1652 FUNCTION {output:dates.2} {
1653 "origdate" origdate split.date
1654 "origday" swap$ output:write:field
1655 "origmonth" swap$ output:write:field
1656 "origyear" swap$ output:write:field
1657 "origendday" swap$ output:write:field
1658 "origendmonth" swap$ output:write:field
1659 "origendyear" swap$ output:write:year
1660 "eventdate" eventdate split.date
1661 "eventday" swap$ output:write:field
1662 "eventmonth" swap$ output:write:field
1663 "eventyear" swap$ output:write:field
1664 "eventendday" swap$ output:write:field
1665 "eventendmonth" swap$ output:write:field
1666 "eventendyear" swap$ output:write:year
1667 "urldate" urldate split.date
1668 "urlday" swap$ output:write:field
1669 "urlmonth" swap$ output:write:field
1670 "urlyear" swap$ output:write:field
1671 "urlendday" swap$ output:write:field
1672 "urlendmonth" swap$ output:write:field
1673 "urlendyear" swap$ output:write:year
1674 }
1675
1676 FUNCTION {output:user} {
1677 "namea" namea output:write:name
1678 "nameatype" nameatype output:write:field
1679 "nameb" nameb output:write:name
1680 "namebtype" namebtype output:write:field
1681 "namec" namec output:write:name
1682 "namectype" namectype output:write:field
1683 "lista" lista output:write:list
1684 "listb" listb output:write:list
1685 "listc" listc output:write:list
1686 "listd" listd output:write:list
1687 "liste" liste output:write:list
1688 "listf" listf output:write:list
1689 "usera" usera output:write:field
1690 "userb" userb output:write:field
1691 "userc" userc output:write:field
1692 "userd" userd output:write:field
1693 "usere" usere output:write:field
1694 "userf" userf output:write:field
1695 "verba" verba output:write:verb
1696 "verbb" verbb output:write:verb
1697 "verbc" verbc output:write:verb
1698 }
1699
1700 FUNCTION {output:warning} {
1701 warningmsg empty$
1702 'skip$
1703 { "\warn" warningmsg wrap:braces * output:indent:field }
1704 if$
1705 }
1706
1707 FUNCTION {output:compat.1} {
1708 "langid" langid
1709 duplicate$ empty$
1710 { pop$ hyphenation }
1711 { hyphenation empty$
1712 'skip$
1713 { "hyphenation" "langid" warning:duplicate }
1714 if$
1715 }
1716 if$
1717 output:write:field
1718 "location" location
1719 duplicate$ empty$
1720 { pop$ address }
1721 { address empty$
1722 'skip$
1723 { "address" "location" warning:duplicate }
1724 if$
1725 }
1726 if$
1727 output:write:list
1728 "institution" institution
1729 duplicate$ empty$
1730 { pop$ school }
1731 { school empty$
1732 'skip$
1733 { "school" "institution" warning:duplicate }
1734 if$
1735 }
1736 if$
1737 output:write:list
1738 "file" file
1739 duplicate$ empty$
1740 { pop$ pdf }
1741 { pdf empty$
1742 'skip$
1743 { "pdf" "file" warning:duplicate }
1744 if$
1745 }
1746 if$
1747 output:write:verb
1748 }
1749
1750 FUNCTION {output:compat.2} {
1751 "type" type
1752 duplicate$ empty$
1753 { type$ "patent" =
1754 type$ "techreport" = or
1755 type$ "phdthesis" = or
1756 { pop$ type$ }
1757 { type$ "mastersthesis" =
1758 { pop$ "mathesis" }
1759 'skip$
1760 if$
1761 }
1762 if$
1763 }
1764 'skip$
1765 if$
1766 output:write:field
1767 "journaltitle" journaltitle
1768 duplicate$ empty$
1769 { pop$ journal }
1770 { journal empty$
1771 'skip$
1772 { "journal" "journaltitle" warning:duplicate }
1773 if$
1774 }
1775 if$
1776 output:write:field
1777 "annotation" annotation
1778 duplicate$ empty$
1779 { pop$ annote }
1780 { annote empty$
1781 'skip$
1782 { "annote" "annotation" warning:duplicate }
1783 if$
1784 }
1785 if$
1786 output:write:multi
1787 }
1788
1789 FUNCTION {output:compat.3} {
1790 "eprinttype" eprinttype
1791 duplicate$ empty$
1792 { pop$ archiveprefix }
1793 { archiveprefix empty$
1794 'skip$
1795 { "archiveprefix" "eprinttype" warning:duplicate }
1796 if$
1797 }
1798 if$
1799 output:write:field
1800 "eprintclass" eprintclass
1801 duplicate$ empty$
1802 { pop$ primaryclass }
1803 { primaryclass empty$
1804 'skip$
1805 { "primaryclass" "eprintclass" warning:duplicate }
1806 if$
1807 }
1808 if$
1809 output:write:field
1810 }
1811
1812 FUNCTION {output:debug} {
1813 "% sort.key$ = " sort.key$ * maxline write$ newline$
1814 sort.year empty$
1815 'skip$
1816 { "% sort.year = " sort.year * maxline write$ newline$ }
1817 if$
1818 sort.alph empty$
1819 'skip$
1820 { "% sort.alph = " sort.alph * maxline write$ newline$ }
1821 if$
1822 }
1823
1824 FUNCTION {output:entry} {
1825 'tempstrga :=
1826 newline$
1827 ctrl.debug
1828 { output:debug }
1829 'skip$
1830 if$
1831 " \entry"
1832 push:cite wrap:braces *
1833 tempstrga wrap:braces *
1834 entryoptions wrap:braces *
1835 write$ newline$
1836 output:names
1837 output:lists
1838 output:specials
1839 output:fields.1
1840 output:fields.2
1841 output:fields.3
1842 output:compat.1
1843 output:compat.2
1844 output:compat.3
1845 output:dates.1
1846 output:dates.2
1847 output:user
1848 output:warning
1849 " \endentry" write$ newline$
1850 }
1851
1852 FUNCTION {control} { skip$ }
1853 FUNCTION {set} { type$ output:entry }
1854
1855 FUNCTION {article} { type$ output:entry }
1856 FUNCTION {bibnote} { type$ output:entry }
1857 FUNCTION {book} { type$ output:entry }
1858 FUNCTION {mvbook} { type$ output:entry }
1859 FUNCTION {inbook} { type$ output:entry }
1860 FUNCTION {bookinbook} { type$ output:entry }
1861 FUNCTION {booklet} { type$ output:entry }
1862 FUNCTION {collection} { type$ output:entry }
1863 FUNCTION {mvcollection} { type$ output:entry }
1864 FUNCTION {incollection} { type$ output:entry }
1865 FUNCTION {manual} { type$ output:entry }
1866 FUNCTION {misc} { type$ output:entry }
1867 FUNCTION {online} { type$ output:entry }
1868 FUNCTION {patent} { type$ output:entry }
1869 FUNCTION {periodical} { type$ output:entry }
1870 FUNCTION {proceedings} { type$ output:entry }
1871 FUNCTION {mvproceedings} { type$ output:entry }
1872 FUNCTION {inproceedings} { type$ output:entry }
1873 FUNCTION {reference} { type$ output:entry }
1874 FUNCTION {mvreference} { type$ output:entry }
1875 FUNCTION {inreference} { type$ output:entry }
1876 FUNCTION {report} { type$ output:entry }
1877 FUNCTION {suppbook} { type$ output:entry }
1878 FUNCTION {suppcollection} { type$ output:entry }
1879 FUNCTION {suppperiodical} { type$ output:entry }
1880 FUNCTION {thesis} { type$ output:entry }
1881 FUNCTION {unpublished} { type$ output:entry }
1882
1883 FUNCTION {artwork} { type$ output:entry }
1884 FUNCTION {audio} { type$ output:entry }
1885 FUNCTION {commentary} { type$ output:entry }
1886 FUNCTION {image} { type$ output:entry }
1887 FUNCTION {jurisdiction} { type$ output:entry }
1888 FUNCTION {legal} { type$ output:entry }
1889 FUNCTION {legislation} { type$ output:entry }
1890 FUNCTION {letter} { type$ output:entry }
1891 FUNCTION {movie} { type$ output:entry }
1892 FUNCTION {music} { type$ output:entry }
1893 FUNCTION {performance} { type$ output:entry }
1894 FUNCTION {review} { type$ output:entry }
1895 FUNCTION {software} { type$ output:entry }
1896 FUNCTION {standard} { type$ output:entry }
1897 FUNCTION {video} { type$ output:entry }
1898
1899 FUNCTION {customa} { type$ output:entry }
1900 FUNCTION {customb} { type$ output:entry }
1901 FUNCTION {customc} { type$ output:entry }
1902 FUNCTION {customd} { type$ output:entry }
1903 FUNCTION {custome} { type$ output:entry }
1904 FUNCTION {customf} { type$ output:entry }
1905
1906 FUNCTION {conference} { "inproceedings" output:entry }
1907 FUNCTION {electronic} { "online" output:entry }
1908 FUNCTION {mastersthesis} { "thesis" output:entry }
1909 FUNCTION {other} { "misc" output:entry }
1910 FUNCTION {phdthesis} { "thesis" output:entry }
1911 FUNCTION {techreport} { "report" output:entry }
1912 FUNCTION {www} { "online" output:entry }
1913 FUNCTION {default.type} { "misc" output:entry }
1914
1915 % -------------------------------------------------------------------
1916 % Input
1917 % -------------------------------------------------------------------
1918
1919 FUNCTION {input:control:parse} {
1920 'tempstrga :=
1921 "" 'tempstrgb :=
1922 #1 'tempctra :=
1923 { tempstrga empty$ not
1924 tempctra and }
1925 { tempstrga #1 #1 substring$ ":" =
1926 { #0 'tempctra := }
1927 { tempstrgb tempstrga #1 #1 substring$ * 'tempstrgb := }
1928 if$
1929 tempstrga #2 global.max$ substring$ 'tempstrga :=
1930 }
1931 while$
1932 tempstrga
1933 tempstrgb
1934 }
1935
1936 FUNCTION {input:control:options} {
1937 input:control:parse str.to.int
1938 }
1939
1940 % This version corresponds to the .bcf version, *not* the biblatex version!
1941 FUNCTION {input:control:version} {
1942 input:control:parse
1943 "$Revision: 4.0 $"
1944 #12 entry.max$ substring$
1945 #-3 entry.max$ substring$
1946 'tempstrga :=
1947 duplicate$ tempstrga =
1948 { pop$ }
1949 { "bcf version mismatch: biblatex.bst has " tempstrga *
1950 ", but biblatex.sty has " * swap$ * warning$
1951 " The bcf version need not be the same as the biblatex version."
1952 top$
1953 pop$ "" }
1954 if$
1955 }
1956
1957 FUNCTION {input:control} {
1958 options empty$
1959 'skip$
1960 { options input:control:version
1961 duplicate$ empty$
1962 { pop$ }
1963 { input:control:options 'ctrl.debug :=
1964 input:control:options 'ctrl.bibtex8 :=
1965 input:control:options 'ctrl.cssort :=
1966 input:control:options 'ctrl.useprefix :=
1967 input:control:options 'ctrl.useauthor :=
1968 input:control:options 'ctrl.useeditor :=
1969 input:control:options 'ctrl.usetranslator :=
1970 input:control:options 'ctrl.labelalpha :=
1971 input:control:options 'ctrl.labeldate :=
1972 input:control:options 'ctrl.singletitle :=
1973 input:control:options 'ctrl.sorting :=
1974 input:control:options 'ctrl.maxcitenames :=
1975 input:control:options 'ctrl.mincitenames :=
1976 input:control:options 'ctrl.maxsortnames :=
1977 input:control:options 'ctrl.minsortnames :=
1978 input:control:options 'ctrl.nohashothers :=
1979 input:control:options 'ctrl.nosortothers :=
1980 input:control:options 'ctrl.maxalphanames :=
1981 input:control:options 'ctrl.minalphanames :=
1982 input:control:options 'ctrl.maxline :=
1983 input:control:parse 'ctrl.alphaothers :=
1984 input:control:parse 'ctrl.sortalphaothers :=
1985 'ctrl.sortstr :=
1986 }
1987 if$
1988 ctrl.maxline #49 <
1989 { #49 'ctrl.maxline := }
1990 { ctrl.maxline #79 >
1991 { #79 'ctrl.maxline := }
1992 'skip$
1993 if$
1994 }
1995 if$
1996 }
1997 if$
1998 }
1999
2000 FUNCTION {input:options:add} {
2001 entryoptions empty$
2002 'skip$
2003 { entryoptions ", " * 'entryoptions := }
2004 if$
2005 entryoptions swap$ * 'entryoptions :=
2006 duplicate$ empty$
2007 { pop$ }
2008 { "=" swap$ * entryoptions swap$ * 'entryoptions := }
2009 if$
2010 }
2011
2012 FUNCTION {input:options:known} {
2013 duplicate$ empty$
2014 { tempstrgb input:options:add
2015 #1 }
2016 { duplicate$ "true" =
2017 { pop$ "" tempstrgb input:options:add
2018 #1 }
2019 { duplicate$ tempstrgb input:options:add
2020 bol.to.int
2021 }
2022 if$
2023 }
2024 if$
2025 }
2026
2027 FUNCTION {input:options:parse} {
2028 'tempstrgb :=
2029 tempstrgb "useprefix" =
2030 { input:options:known 'useprefix := }
2031 { tempstrgb "useauthor" =
2032 { input:options:known 'useauthor := }
2033 { tempstrgb "useeditor" =
2034 { input:options:known 'useeditor := }
2035 { tempstrgb "usetranslator" =
2036 { input:options:known 'usetranslator := }
2037 { tempstrgb "skipbib" =
2038 { input:options:known 'skipbib := }
2039 { tempstrgb "skiplos" =
2040 { input:options:known 'skiplos := }
2041 { tempstrgb "skiplab" =
2042 { input:options:known 'skiplab := }
2043 { tempstrgb "dataonly" =
2044 { input:options:known
2045 duplicate$ 'skipbib :=
2046 duplicate$ 'skiplos :=
2047 'skiplab :=
2048 }
2049 { tempstrgb input:options:add }
2050 if$
2051 }
2052 if$
2053 }
2054 if$
2055 }
2056 if$
2057 }
2058 if$
2059 }
2060 if$
2061 }
2062 if$
2063 }
2064 if$
2065 }
2066
2067 FUNCTION {input:options:extract} {
2068 'tempstrgb :=
2069 #1 'tempctrb :=
2070 { tempstrgb text.length$ #0 > }
2071 { tempstrgb tempctrb #1 substring$ "=" =
2072 { tempstrgb tempctrb #1 + global.max$ substring$
2073 tempstrgb #1 tempctrb #1 - substring$
2074 input:options:parse
2075 "" 'tempstrgb :=
2076 }
2077 { tempstrgb text.length$ tempctrb =
2078 { "" tempstrgb input:options:parse
2079 "" 'tempstrgb :=
2080 }
2081 { tempctrb #1 + 'tempctrb := }
2082 if$
2083 }
2084 if$
2085 }
2086 while$
2087 }
2088
2089 FUNCTION {input:options} {
2090 options 'tempstrga :=
2091 #1 'tempctra :=
2092 { tempstrga text.length$ #0 > }
2093 { tempstrga tempctra #1 substring$ "," =
2094 { tempstrga #1 tempctra #1 - substring$ input:options:extract
2095 tempctra #1 + 'tempctra :=
2096 { tempstrga tempctra #1 substring$ " " =
2097 tempctra tempstrga text.length$ > not
2098 and
2099 }
2100 { tempctra #1 + 'tempctra := }
2101 while$
2102 tempstrga tempctra global.max$ substring$ 'tempstrga :=
2103 #1 'tempctra :=
2104 }
2105 { tempstrga text.length$ tempctra =
2106 { tempstrga input:options:extract
2107 "" 'tempstrga :=
2108 }
2109 { tempctra #1 + 'tempctra := }
2110 if$
2111 }
2112 if$
2113 }
2114 while$
2115 }
2116
2117 FUNCTION {input:iterate} {
2118 ctrl:control
2119 { input:control }
2120 { citecount #1 + 'citecount :=
2121 citecount int.to.str$ #9 pad.number 'sortkey.nosort :=
2122 ctrl.useprefix 'useprefix :=
2123 ctrl.useauthor 'useauthor :=
2124 ctrl.useeditor 'useeditor :=
2125 ctrl.usetranslator 'usetranslator :=
2126 ctrl.singletitle
2127 { #1 'singletitle := }
2128 'skip$
2129 if$
2130 options empty$
2131 'skip$
2132 { input:options }
2133 if$
2134 ctrl:set entryset empty$ or
2135 'skip$
2136 { #1 'skipbib :=
2137 #1 'skiplos :=
2138 #1 'skiplab :=
2139 }
2140 if$
2141 "date" date split.date
2142 pop$ pop$ 'dateyear :=
2143 pop$ pop$ 'dateendyear :=
2144 dateyear empty$
2145 { year empty$
2146 'skip$
2147 { year 'dateyear := }
2148 if$
2149 }
2150 'skip$
2151 if$
2152 }
2153 if$
2154 }
2155
2156 READ
2157
2158 EXECUTE {initialize}
2159
2160 ITERATE {input:iterate}
2161
2162 % -------------------------------------------------------------------
2163 % Generate labels
2164 % -------------------------------------------------------------------
2165
2166 FUNCTION {makelabel:name:format} {
2167 'templist :=
2168 #1 'tempctra :=
2169 templist num.names$ 'tempctrb :=
2170 templist andothers
2171 { tempctrb #1 - 'tempctrb := }
2172 'skip$
2173 if$
2174 tempctrb ctrl.maxcitenames >
2175 { ctrl.mincitenames 'tempctrc := }
2176 { ctrl.maxcitenames 'tempctrc := }
2177 if$
2178 ""
2179 { duplicate$ text.length$ entry.max$ #50 - <
2180 tempctra tempctrc > not and
2181 tempctrb #0 > and
2182 }
2183 { useprefix
2184 { templist tempctra "{vv}" format.name$
2185 duplicate$ empty$
2186 { pop$ "" }
2187 { "u" change.case$ "t" change.case$
2188 delimiter.3 * }
2189 if$
2190 }
2191 { "" }
2192 if$
2193 templist tempctra "{ll}" format.name$ *
2194 tempctra #1 >
2195 { delimiter.2 swap$ * }
2196 'skip$
2197 if$
2198 *
2199 tempctra #1 + 'tempctra :=
2200 tempctrb #1 - 'tempctrb :=
2201 }
2202 while$
2203 templist andothers
2204 tempctrb #0 >
2205 or
2206 ctrl.nohashothers not
2207 and
2208 { delimiter.2 * "zzzz" * }
2209 'skip$
2210 if$
2211 }
2212
2213
2214 FUNCTION {makelabel:name:full} {
2215 duplicate$ num.names$ #1 =
2216 { #1
2217 "{ll}{" delimiter.3 *
2218 "ff}{" delimiter.3 * *
2219 "vv}{" delimiter.3 * *
2220 "jj}" *
2221 format.name$
2222 }
2223 { pop$ "" }
2224 if$
2225 }
2226
2227 FUNCTION {makelabel:alpha:format} {
2228 duplicate$ empty$
2229 { pop$ "" }
2230 { 'templist :=
2231 #1 'tempctra :=
2232 templist andothers
2233 { templist num.names$ #1 - 'tempctrb := }
2234 { templist num.names$ 'tempctrb := }
2235 if$
2236 tempctrb ctrl.maxalphanames >
2237 { ctrl.minalphanames 'tempctrb := }
2238 'skip$
2239 if$
2240 tempctrb #1 >
2241 { ""
2242 { tempctrb #0 > }
2243 { templist tempctra "{l{}}" format.name$ *
2244 tempctra #1 + 'tempctra :=
2245 tempctrb #1 - 'tempctrb :=
2246 }
2247 while$
2248 }
2249 { templist #1 "{l{}}" format.name$ }
2250 if$
2251 duplicate$ text.length$ #2 <
2252 { pop$
2253 useprefix
2254 { templist #1 "{v{}}" format.name$ #2 text.prefix$
2255 templist #1 "{ll}" format.name$ *
2256 }
2257 { templist #1 "{ll}" format.name$ }
2258 if$
2259 #3 text.prefix$
2260 }
2261 'skip$
2262 if$
2263 }
2264 if$
2265 templist num.names$ ctrl.maxalphanames >
2266 templist andothers
2267 or
2268 { ctrl.alphaothers * }
2269 'skip$
2270 if$
2271 }
2272
2273 FUNCTION {makelabel:alpha:year} {
2274 dateyear purify
2275 #1 #4 substring$
2276 #-1 #2 substring$
2277 }
2278
2279 FUNCTION {makelabel:hash:format} {
2280 'templist :=
2281 #1 'tempctra :=
2282 templist num.names$ 'tempctrb :=
2283 templist andothers
2284 { tempctrb #1 - 'tempctrb := }
2285 'skip$
2286 if$
2287 tempctrb ctrl.maxcitenames >
2288 { ctrl.mincitenames 'tempctrc := }
2289 { ctrl.maxcitenames 'tempctrc := }
2290 if$
2291 ""
2292 { tempctra tempctrc > not
2293 tempctrb #0 >
2294 and }
2295 { templist tempctra
2296 useprefix
2297 { "{v{}}{l{}}{j{}}{f{}}" }
2298 { "{l{}}{j{}}{f{}}{v{}}" }
2299 if$
2300 format.name$ purify$ *
2301 tempctra #1 + 'tempctra :=
2302 tempctrb #1 - 'tempctrb :=
2303 }
2304 while$
2305 templist andothers
2306 tempctrb #0 >
2307 or
2308 ctrl.nohashothers not
2309 and
2310 { "+" * }
2311 'skip$
2312 if$
2313 }
2314
2315 FUNCTION {makelabel:hash:format:full} {
2316 'templist :=
2317 #1 'tempctra :=
2318 templist num.names$ 'tempctrb :=
2319 templist andothers
2320 { tempctrb #1 - 'tempctrb := }
2321 'skip$
2322 if$
2323 ""
2324 { tempctrb #0 > }
2325 { templist tempctra
2326 useprefix
2327 { "{v{}}{l{}}{j{}}{f{}}" }
2328 { "{l{}}{j{}}{f{}}{v{}}" }
2329 if$
2330 format.name$ purify$ *
2331 tempctra #1 + 'tempctra :=
2332 tempctrb #1 - 'tempctrb :=
2333 }
2334 while$
2335 templist andothers
2336 ctrl.nohashothers not
2337 and
2338 { "+" * }
2339 'skip$
2340 if$
2341 }
2342
2343 FUNCTION {makelabel:ctrl:alpha} {
2344 ctrl:labelalpha
2345 { shorthand empty$
2346 { label empty$
2347 { push:cite purify #1 #3 substring$
2348 "u" change.case$ "t" change.case$ }
2349 { label makelabel:alpha:year * }
2350 if$
2351 }
2352 { shorthand }
2353 if$
2354 }
2355 { "" }
2356 if$
2357 }
2358
2359 FUNCTION {makelabel:ctrl:alpha:format} {
2360 ctrl:labelalpha
2361 { shorthand empty$
2362 { label empty$
2363 { makelabel:alpha:format }
2364 { pop$ label }
2365 if$
2366 makelabel:alpha:year *
2367 }
2368 { pop$
2369 shorthand
2370 }
2371 if$
2372 }
2373 { pop$
2374 ""
2375 }
2376 if$
2377 }
2378
2379 FUNCTION {makelabel:label} {
2380 push:shortname empty$
2381 { push:sorttitle 'label.name :=
2382 makelabel:ctrl:alpha 'labelalpha :=
2383 }
2384 { push:shortname
2385 duplicate$ makelabel:name:format 'label.name :=
2386 duplicate$ makelabel:hash:format 'namehash :=
2387 makelabel:ctrl:alpha:format 'labelalpha :=
2388 }
2389 if$
2390 push:fullname empty$
2391 'skip$
2392 { push:fullname makelabel:hash:format:full 'fullhash := }
2393 if$
2394 }
2395
2396 % -------------------------------------------------------------------
2397 % Sort labels
2398 % -------------------------------------------------------------------
2399
2400 FUNCTION {labelsort:label} {
2401 sortkey:init:label
2402 makelabel:label
2403 }
2404
2405 FUNCTION {labelsort:main} {
2406 ctrl:skiplab not
2407 ctrl.singletitle ctrl.labeldate or
2408 and
2409 { label.name purify delimiter.1 *
2410 sortkey.year * delimiter.1 *
2411 push:presort * delimiter.1 *
2412 sortkey empty$
2413 { sortkey.name * delimiter.1 * sortkey.title }
2414 { sortkey }
2415 if$
2416 *
2417 truncate
2418 }
2419 { "" }
2420 if$
2421 duplicate$
2422 'sort.key$ :=
2423 'sort.year :=
2424 }
2425
2426 FUNCTION {labelsort:alph} {
2427 ctrl:labelalpha
2428 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2429 purify delimiter.1 *
2430 push:presort * delimiter.1 *
2431 sortkey empty$
2432 { ctrl.sorting #10 >
2433 ctrl.sorting #20 <
2434 and
2435 { ctrl.sorting #10 - }
2436 { #2 }
2437 if$
2438 sortkey:main:string
2439 }
2440 { sortkey }
2441 if$
2442 *
2443 truncate
2444 }
2445 { "" }
2446 if$
2447 duplicate$
2448 'sort.key$ :=
2449 'sort.alph :=
2450 }
2451
2452 FUNCTION {labelsort:hash} {
2453 ctrl:control
2454 namehash empty$
2455 or
2456 { "zzzz" 'sort.key$ := }
2457 { namehash purify delimiter.1 *
2458 push:shortname duplicate$ empty$
2459 { pop$ "zzzz" * }
2460 { sortkey:name:format purify * }
2461 if$
2462 truncate 'sort.key$ :=
2463 }
2464 if$
2465 }
2466
2467 FUNCTION {labelsort:fullhash} {
2468 ctrl:control
2469 fullhash empty$
2470 or
2471 { "zzzz" 'sort.key$ := }
2472 { fullhash purify delimiter.1 *
2473 push:shortname duplicate$ empty$
2474 { pop$ "zzzz" * }
2475 { sortkey:name:format purify * }
2476 if$
2477 truncate 'sort.key$ :=
2478 }
2479 if$
2480 }
2481
2482 % -------------------------------------------------------------------
2483
2484 FUNCTION {labelsort:init} {
2485 "" 'last.name :=
2486 "" 'last.year :=
2487 "" 'last.hash :=
2488 "" 'last.extra :=
2489 #1 'last.extra.num :=
2490 }
2491
2492 FUNCTION {labelsort:main:init} {
2493 "" 'last.name :=
2494 }
2495
2496 FUNCTION {labelsort:hash:init} {
2497 "" 'last.name :=
2498 #1 'last.extra.num :=
2499 }
2500
2501 FUNCTION {labelsort:namehash:iterate} {
2502 ctrl:control
2503 namehash empty$
2504 or
2505 'skip$
2506 { namehash last.hash =
2507 { push:name:namehash last.name =
2508 'skip$
2509 { last.extra.num #1 + 'last.extra.num := }
2510 if$
2511 last.extra.num int.to.str$ 'labelhash :=
2512 }
2513 { #1 'last.extra.num :=
2514 "1" 'labelhash :=
2515 }
2516 if$
2517 namehash 'last.hash :=
2518 push:name:namehash 'last.name :=
2519 }
2520 if$
2521 }
2522
2523 FUNCTION {labelsort:namehash:reverse} {
2524 ctrl:control
2525 namehash empty$
2526 or
2527 'skip$
2528 { push:name:namehash last.name =
2529 { last.extra "1" =
2530 { "1" 'labelhash := }
2531 'skip$
2532 if$
2533 }
2534 { last.extra "2" =
2535 { "1" 'labelhash := }
2536 'skip$
2537 if$
2538 }
2539 if$
2540 labelhash 'last.extra :=
2541 push:name:namehash 'last.name :=
2542 namehash labelhash * 'namehash :=
2543 }
2544 if$
2545 }
2546
2547 FUNCTION {labelsort:fullhash:iterate} {
2548 ctrl:control
2549 fullhash empty$
2550 or
2551 'skip$
2552 { fullhash last.hash =
2553 { push:name:fullhash last.name =
2554 'skip$
2555 { last.extra.num #1 + 'last.extra.num := }
2556 if$
2557 last.extra.num int.to.str$ 'labelhash :=
2558 }
2559 { #1 'last.extra.num :=
2560 "1" 'labelhash :=
2561 }
2562 if$
2563 fullhash 'last.hash :=
2564 push:name:fullhash 'last.name :=
2565 }
2566 if$
2567 }
2568
2569 FUNCTION {labelsort:fullhash:reverse} {
2570 ctrl:control
2571 fullhash empty$
2572 or
2573 'skip$
2574 { push:name:fullhash last.name =
2575 { last.extra "1" =
2576 { "1" 'labelhash := }
2577 'skip$
2578 if$
2579 }
2580 { last.extra "2" =
2581 { "1" 'labelhash := }
2582 'skip$
2583 if$
2584 }
2585 if$
2586 labelhash 'last.extra :=
2587 push:name:fullhash 'last.name :=
2588 fullhash labelhash * 'fullhash :=
2589 }
2590 if$
2591 }
2592
2593 FUNCTION {labelsort:main:singletitle} {
2594 ctrl.singletitle
2595 { label.name last.name =
2596 { #0 'singletitle := }
2597 'skip$
2598 if$
2599 label.name 'last.name :=
2600 }
2601 'skip$
2602 if$
2603 }
2604
2605 FUNCTION {labelsort:main:year:iterate} {
2606 ctrl:labeldate
2607 { label.name
2608 dateyear empty$
2609 'skip$
2610 { " " * dateyear *
2611 dateendyear empty$
2612 'skip$
2613 { dateyear dateendyear =
2614 'skip$
2615 { dateendyear open.ended =
2616 'skip$
2617 { "-" * dateendyear * }
2618 if$
2619 }
2620 if$
2621 }
2622 if$
2623 }
2624 if$
2625 'label.year :=
2626 label.year last.year =
2627 { last.extra.num #1 + 'last.extra.num :=
2628 last.extra.num int.to.str$ 'extradate :=
2629 }
2630 { #1 'last.extra.num :=
2631 "" 'extradate :=
2632 label.year 'last.year :=
2633 }
2634 if$
2635 }
2636 'skip$
2637 if$
2638 }
2639
2640 FUNCTION {labelsort:main:year:reverse} {
2641 ctrl:labeldate
2642 { last.extra "2" =
2643 { "1" 'extradate := }
2644 'skip$
2645 if$
2646 extradate 'last.extra :=
2647 }
2648 'skip$
2649 if$
2650 }
2651
2652 FUNCTION {labelsort:main:iterate} {
2653 ctrl:skiplab
2654 'skip$
2655 { labelsort:main:singletitle
2656 labelsort:main:year:iterate
2657 }
2658 if$
2659 }
2660
2661 FUNCTION {labelsort:main:reverse} {
2662 ctrl:skiplab
2663 'skip$
2664 { labelsort:main:singletitle
2665 labelsort:main:year:reverse
2666 }
2667 if$
2668 }
2669
2670 FUNCTION {labelsort:alph:iterate} {
2671 ctrl:labelalpha
2672 { labelalpha last.year =
2673 { last.extra.num #1 + 'last.extra.num :=
2674 last.extra.num int.to.str$ 'extraalpha :=
2675 }
2676 { #1 'last.extra.num :=
2677 "" 'extraalpha :=
2678 }
2679 if$
2680 labelalpha 'last.year :=
2681 }
2682 'skip$
2683 if$
2684 }
2685
2686 FUNCTION {labelsort:alph:reverse} {
2687 ctrl:labelalpha
2688 { last.extra "2" =
2689 { "1" 'extraalpha := }
2690 'skip$
2691 if$
2692 extraalpha 'last.extra :=
2693 labelalpha empty$
2694 'skip$
2695 { extraalpha empty$
2696 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2697 purify
2698 'sortkey.alpha := }
2699 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2700 purify
2701 extraalpha #4 pad.number *
2702 'sortkey.alpha := }
2703 if$
2704 }
2705 if$
2706 }
2707 'skip$
2708 if$
2709 }
2710
2711 ITERATE {labelsort:label}
2712
2713 EXECUTE {labelsort:init}
2714
2715 ITERATE {labelsort:hash}
2716
2717 SORT
2718
2719 EXECUTE {labelsort:hash:init}
2720
2721 ITERATE {labelsort:namehash:iterate}
2722
2723 EXECUTE {labelsort:hash:init}
2724
2725 REVERSE {labelsort:namehash:reverse}
2726
2727 EXECUTE {labelsort:init}
2728
2729 ITERATE {labelsort:fullhash}
2730
2731 SORT
2732
2733 EXECUTE {labelsort:hash:init}
2734
2735 ITERATE {labelsort:fullhash:iterate}
2736
2737 EXECUTE {labelsort:hash:init}
2738
2739 REVERSE {labelsort:fullhash:reverse}
2740
2741 EXECUTE {labelsort:init}
2742
2743 ITERATE {labelsort:main}
2744
2745 SORT
2746
2747 EXECUTE {labelsort:init}
2748
2749 EXECUTE {labelsort:main:init}
2750
2751 ITERATE {labelsort:main:iterate}
2752
2753 EXECUTE {labelsort:main:init}
2754
2755 REVERSE {labelsort:main:reverse}
2756
2757 EXECUTE {labelsort:init}
2758
2759 ITERATE {labelsort:alph}
2760
2761 SORT
2762
2763 ITERATE {labelsort:alph:iterate}
2764
2765 REVERSE {labelsort:alph:reverse}
2766
2767 % -------------------------------------------------------------------
2768 % Sort bibliography, write .bbl file
2769 % -------------------------------------------------------------------
2770
2771 FUNCTION {mainsort} {
2772 ctrl:control
2773 { "" }
2774 { sortkey:main }
2775 if$
2776 'sort.key$ :=
2777 }
2778
2779 ITERATE {mainsort}
2780
2781 SORT
2782
2783 % This version corresponds to the .bbl version, *not* the biblatex version!
2784 FUNCTION {output:main:begin} {
2785 "% $ biblatex auxiliary file $" write$ newline$
2786 "% $ biblatex bbl format version " "$Revision: 4.0 $"
2787 #12 entry.max$ substring$ #-3 entry.max$ substring$ * " $" * write$ newline$
2788 "% Do not modify the above lines!" write$ newline$
2789 "%" write$ newline$
2790 "% This is an auxiliary file used by the 'biblatex-ms' package." write$ newline$
2791 "% This file may safely be deleted. It will be recreated as" write$ newline$
2792 "% required." write$ newline$
2793 "%" write$ newline$
2794 "\begingroup" write$ newline$
2795 "\makeatletter" write$ newline$
2796 "\@ifundefined{[email protected]}" write$ newline$
2797 " {\@latex@error" write$ newline$
2798 " {Missing 'biblatex-ms' package}" write$ newline$
2799 " {The bibliography requires the 'biblatex-ms' package.}" write$ newline$
2800 " \aftergroup\endinput}" write$ newline$
2801 " {}" write$ newline$
2802 "\endgroup" write$ newline$
2803 newline$
2804 "\datalist[entry]{" ctrl.sortstr * "/global//global/global}" * write$
2805 }
2806
2807 FUNCTION {output:main:preamble} {
2808 preamble$ empty$
2809 'skip$
2810 { newline$
2811 "\preamble{%" write$ newline$
2812 preamble$ write$ newline$
2813 "}" write$ newline$
2814 }
2815 if$
2816 }
2817
2818 FUNCTION {output:main:end} {
2819 "\enddatalist" write$ newline$
2820 "\endinput" write$ newline$
2821 }
2822
2823 EXECUTE {output:main:begin}
2824
2825 EXECUTE {output:main:preamble}
2826
2827 ITERATE {call.type$}
2828
2829 EXECUTE {output:main:end}
2830
2831 % -------------------------------------------------------------------