Debian Codegraph @

texmf-dist/bibtex/bst/biblatex/biblatex.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: 3.21 $"
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:field} {
1134 duplicate$ empty$
1135 { pop$ pop$ }
1136 { output:write:field:maybeempty }
1137 if$
1138 }
1139
1140 FUNCTION {output:write:year} {
1141 duplicate$ empty$
1142 { pop$ pop$ }
1143 { duplicate$ open.ended =
1144 { pop$ "" }
1145 'skip$
1146 if$
1147 swap$ "\field" swap$ wrap:braces *
1148 swap$ wrap:braces * output:indent:field
1149 }
1150 if$
1151 }
1152
1153 FUNCTION {output:write:multi} {
1154 duplicate$ empty$
1155 { pop$ pop$ }
1156 { swap$ "\field" swap$ wrap:braces * "{%" * output:indent:field
1157 "%" * output:indent:field
1158 "}" output:indent:field
1159 }
1160 if$
1161 }
1162
1163 FUNCTION {output:write:bool} {
1164 #0 >
1165 { "\true" }
1166 { "\false" }
1167 if$
1168 swap$ wrap:braces * output:indent:field
1169 }
1170
1171 FUNCTION {output:write:count} {
1172 int.to.str$ swap$ "\count" swap$ wrap:braces *
1173 swap$ wrap:braces * output:indent:field
1174 }
1175
1176 FUNCTION {output:write:string} {
1177 duplicate$ empty$
1178 { pop$ pop$ }
1179 { swap$ "\strng" swap$ wrap:braces *
1180 swap$ wrap:braces * output:indent:field }
1181 if$
1182 }
1183
1184 FUNCTION {output:write:range} {
1185 duplicate$ empty$
1186 { pop$ pop$ }
1187 { format.range output:write:field }
1188 if$
1189 }
1190
1191 FUNCTION {output:write:number} {
1192 duplicate$ empty$
1193 { pop$ pop$ }
1194 { duplicate$ is.number
1195 'skip$
1196 { swap$ warning:invalid "" }
1197 if$
1198 output:write:field
1199 }
1200 if$
1201 }
1202
1203 FUNCTION {output:write:gender} {
1204 duplicate$ empty$
1205 { pop$ pop$ }
1206 { 'tempstrga :=
1207 tempstrga "sf" =
1208 tempstrga "sm" = or
1209 tempstrga "sn" = or
1210 tempstrga "pf" = or
1211 tempstrga "pm" = or
1212 tempstrga "pn" = or
1213 tempstrga "pp" = or
1214 { tempstrga output:write:field }
1215 { warning:invalid }
1216 if$
1217 }
1218 if$
1219 }
1220
1221 FUNCTION {output:write:verb} {
1222 duplicate$ empty$
1223 { pop$ pop$ }
1224 { 'tempstrga :=
1225 "\verb" swap$ wrap:braces * output:indent:field
1226 { tempstrga empty$ not }
1227 { "\verb " tempstrga #1 ctrl.maxline #10 - substring$ *
1228 output:indent:field
1229 tempstrga ctrl.maxline #9 - global.max$ substring$ 'tempstrga :=
1230 }
1231 while$
1232 "\endverb" output:indent:field }
1233 if$
1234 }
1235
1236 FUNCTION {output:write:name:hash} {
1237 templist tempctra "{v{}}{l{}}{f{}}{j{}}" format.name$ purify$
1238 }
1239
1240 FUNCTION {output:write:name:last} {
1241 templist tempctra "{ll}" format.name$
1242 duplicate$ 'tempstrga :=
1243 duplicate$ empty$
1244 'pop$
1245 { format:name:part
1246 "family" combine:key:value output:indent:subfield:keyval
1247 templist tempctra "{l.}" format.name$
1248 duplicate$ tempstrga "." * =
1249 { duplicate$ text.length$ #1 - text.prefix$ }
1250 'skip$
1251 if$
1252 format:name:initials
1253 "familyi" combine:key:value output:indent:subfield:keyval
1254 }
1255 if$
1256 }
1257
1258 FUNCTION {output:write:name:first} {
1259 templist tempctra "{ff}" format.name$
1260 duplicate$ 'tempstrga :=
1261 duplicate$ empty$
1262 'pop$
1263 { format:name:part
1264 "given" combine:key:value output:indent:subfield:keyval
1265 templist tempctra "{f.}" format.name$
1266 duplicate$ tempstrga "." * =
1267 { duplicate$ text.length$ #1 - text.prefix$ }
1268 'skip$
1269 if$
1270 format:name:initials
1271 "giveni" combine:key:value output:indent:subfield:keyval
1272 }
1273 if$
1274 }
1275
1276 FUNCTION {output:write:name:prefix} {
1277 templist tempctra "{vv}" format.name$
1278 duplicate$ 'tempstrga :=
1279 duplicate$ duplicate$ text.length$ duplicate$ substring$ "'" =
1280 { #1 'tempctrc := }
1281 { #0 'tempctrc := }
1282 if$
1283 duplicate$ empty$
1284 'pop$
1285 { format:name:part
1286 "prefix" combine:key:value output:indent:subfield:keyval
1287 templist tempctra "{v.}" format.name$
1288 tempctrc
1289 { duplicate$ text.length$ #1 - text.prefix$ "'" * }
1290 { duplicate$ tempstrga "." * =
1291 { duplicate$ text.length$ #1 - text.prefix$ }
1292 'skip$
1293 if$
1294 }
1295 if$
1296 format:name:initials
1297 "prefixi" combine:key:value output:indent:subfield:keyval
1298 }
1299 if$
1300 }
1301
1302 FUNCTION {output:write:name:suffix} {
1303 templist tempctra "{jj}" format.name$
1304 duplicate$ 'tempstrga :=
1305 duplicate$ empty$
1306 'pop$
1307 { format:name:part
1308 "suffix" combine:key:value output:indent:subfield:keyval
1309 templist tempctra "{j.}" format.name$
1310 duplicate$ tempstrga "." * =
1311 { duplicate$ text.length$ #1 - text.prefix$ }
1312 'skip$
1313 if$
1314 format:name:initials
1315 "suffixi" combine:key:value output:indent:subfield:keyval
1316 }
1317 if$
1318 }
1319
1320 FUNCTION {output:write:name} {
1321 duplicate$ empty$
1322 { pop$ pop$ }
1323 { 'templist :=
1324 'tempstrga :=
1325 #1 'tempctra :=
1326 templist num.names$ 'tempctrb :=
1327 templist andothers
1328 { tempctrb #1 - 'tempctrb :=
1329 "more" tempstrga * #1 output:write:bool
1330 % not actually required, biblatex should resolve this
1331 tempstrga push:labelname =
1332 { "morelabelname" #1 output:write:bool }
1333 'skip$
1334 if$
1335 }
1336 'skip$
1337 if$
1338 "\name" tempstrga wrap:braces *
1339 tempctrb int.to.str$ wrap:braces *
1340 "" wrap:braces *
1341 "{%" * output:indent:field
1342 { tempctrb #0 > }
1343 { "{{hash=" output:write:name:hash * "}{%" * output:indent:subfield
1344 output:write:name:prefix
1345 output:write:name:last
1346 output:write:name:suffix
1347 output:write:name:first
1348 "}}%" output:indent:subfield
1349 tempctra #1 + 'tempctra :=
1350 tempctrb #1 - 'tempctrb :=
1351 }
1352 while$
1353 "}" output:indent:field
1354 }
1355 if$
1356 }
1357
1358 FUNCTION {output:write:list} {
1359 duplicate$ empty$
1360 { pop$ pop$ }
1361 { 'templist :=
1362 'tempstrga :=
1363 templist num.names$ 'tempctra :=
1364 templist andothers
1365 { tempctra #1 - 'tempctra :=
1366 "more" tempstrga * #1 output:write:bool
1367 }
1368 'skip$
1369 if$
1370 "\list" tempstrga wrap:braces *
1371 tempctra int.to.str$ wrap:braces *
1372 "{%" * output:indent:field
1373 #1 'tempctra :=
1374 #1 'tempctrb :=
1375 #0 'tempctrc :=
1376 { templist purify tempctrb global.max$ substring$ num.names$ #0 > }
1377 { templist tempctrb #1 substring$ "{" =
1378 { tempctrc #1 + 'tempctrc :=
1379 tempctrb #1 + 'tempctrb := }
1380 { templist tempctrb #1 substring$ "}" =
1381 { tempctrc #1 - 'tempctrc :=
1382 tempctrb #1 + 'tempctrb := }
1383 { templist tempctrb #5 substring$
1384 duplicate$ " AND " =
1385 swap$ " and " =
1386 or
1387 tempctrc #1 <
1388 and
1389 { templist tempctra tempctrb tempctra - substring$
1390 wrap:braces "%" * output:indent:subfield
1391 tempctrb #5 + duplicate$
1392 'tempctra :=
1393 'tempctrb :=
1394 }
1395 { tempctrb #1 + 'tempctrb := }
1396 if$
1397 }
1398 if$
1399 }
1400 if$
1401 }
1402 while$
1403 templist tempctra global.max$ substring$
1404 duplicate$ "others" =
1405 { pop$ }
1406 { wrap:braces "%" * output:indent:subfield }
1407 if$
1408 "}" output:indent:field
1409 }
1410 if$
1411 }
1412
1413 FUNCTION {output:specials} {
1414 fakeset empty$
1415 'skip$
1416 { ctrl:set
1417 { "\fakeset" fakeset wrap:braces * output:indent:field }
1418 { "fakeset can only be used for @set entries" warning * }
1419 if$
1420 }
1421 if$
1422 entryset empty$
1423 'skip$
1424 { ctrl:set
1425 { "\set" }
1426 { "\inset" }
1427 if$
1428 entryset wrap:braces * output:indent:field
1429 }
1430 if$
1431 xref empty$
1432 'skip$
1433 { "\xref" xref wrap:braces * output:indent:field }
1434 if$
1435 keywords empty$
1436 'skip$
1437 { "\keyw" keywords wrap:braces * output:indent:field }
1438 if$
1439 "entrysubtype" entrysubtype output:write:field
1440 "crossref" crossref output:write:string
1441 "execute" execute output:write:field
1442 "namehash" namehash output:write:string
1443 "fullhash" fullhash output:write:string
1444 "gender" gender output:write:gender
1445 "shorthand" shorthand output:write:field
1446 shorthand empty$
1447 { label }
1448 { shorthand }
1449 if$
1450 "label" swap$ output:write:field
1451 "labelnamesource" push:labelname output:write:field
1452 shorttitle empty$
1453 { title empty$
1454 { "" }
1455 { "title" }
1456 if$
1457 }
1458 { "shorttitle" }
1459 if$
1460 "labeltitlesource" swap$ output:write:field
1461 ctrl.labelalpha
1462 { "labelalpha" labelalpha output:write:field
1463 "extraalpha" extraalpha output:write:field
1464 }
1465 'skip$
1466 if$
1467 ctrl:labeldate
1468 { dateyear empty$ not
1469 { "labelyear" dateyear output:write:field
1470 dateendyear empty$
1471 'skip$
1472 { dateyear dateendyear =
1473 'skip$
1474 { dateendyear open.ended =
1475 'skip$
1476 { "labelendyear" dateendyear output:write:field }
1477 if$
1478 }
1479 if$
1480 }
1481 if$
1482 "extradate" extradate output:write:field
1483 "labeldatesource" "" output:write:field:maybeempty
1484 }
1485 { "extradate" extradate output:write:field
1486 "labeldatesource" "nodate" output:write:field
1487 }
1488 if$
1489 }
1490 'skip$
1491 if$
1492 "sortinit" sortinit output:write:field
1493 "sortinithash" sortinit output:write:field
1494 singletitle
1495 { "singletitle" #1 output:write:bool }
1496 'skip$
1497 if$
1498 }
1499
1500 FUNCTION {output:names} {
1501 "author" author output:write:name
1502 "authortype" authortype output:write:field
1503 "shortauthor" shortauthor output:write:name
1504 "bookauthor" bookauthor output:write:name
1505 "editor" editor output:write:name
1506 "editortype" editortype output:write:field
1507 "editora" editora output:write:name
1508 "editoratype" editoratype output:write:field
1509 "editorb" editorb output:write:name
1510 "editorbtype" editorbtype output:write:field
1511 "editorc" editorc output:write:name
1512 "editorctype" editorctype output:write:field
1513 "shorteditor" shorteditor output:write:name
1514 "translator" translator output:write:name
1515 "annotator" annotator output:write:name
1516 "commentator" commentator output:write:name
1517 "introduction" introduction output:write:name
1518 "foreword" foreword output:write:name
1519 "afterword" afterword output:write:name
1520 "holder" holder output:write:name
1521 }
1522
1523 FUNCTION {output:lists} {
1524 "language" language output:write:list
1525 "organization" organization output:write:list
1526 "origlanguage" origlanguage output:write:list
1527 "origlocation" origlocation output:write:list
1528 "origpublisher" origpublisher output:write:list
1529 "publisher" publisher output:write:list
1530 }
1531
1532 FUNCTION {output:fields.1} {
1533 "abstract" abstract output:write:multi
1534 "addendum" addendum output:write:field
1535 "bookpagination" bookpagination output:write:field
1536 "booksubtitle" booksubtitle output:write:field
1537 "booktitleaddon" booktitleaddon output:write:field
1538 "booktitle" booktitle output:write:field
1539 "chapter" chapter output:write:field
1540 "doi" doi output:write:verb
1541 "edition" edition output:write:field
1542 "eid" eid output:write:field
1543 "eprint" eprint output:write:verb
1544 "eventtitle" eventtitle output:write:field
1545 "eventtitleaddon" eventtitleaddon output:write:field
1546 "howpublished" howpublished output:write:field
1547 "indexsorttitle" indexsorttitle output:write:field
1548 "indextitle" indextitle output:write:field
1549 "isan" isan output:write:field
1550 "isbn" isbn output:write:field
1551 "ismn" ismn output:write:field
1552 }
1553
1554 FUNCTION {output:fields.2} {
1555 "isrn" isrn output:write:field
1556 "issn" issn output:write:field
1557 "issue" issue output:write:field
1558 "issuesubtitle" issuesubtitle output:write:field
1559 "issuetitle" issuetitle output:write:field
1560 "iswc" iswc output:write:field
1561 "journalsubtitle" journalsubtitle output:write:field
1562 "langidopts" langidopts output:write:field
1563 "library" library output:write:field
1564 "mainsubtitle" mainsubtitle output:write:field
1565 "maintitleaddon" maintitleaddon output:write:field
1566 "maintitle" maintitle output:write:field
1567 "nameaddon" nameaddon output:write:field
1568 "note" note output:write:field
1569 "number" number output:write:field
1570 "origtitle" origtitle output:write:field
1571 "pages" pages output:write:range
1572 "pagetotal" pagetotal output:write:range
1573 "pagination" pagination output:write:field
1574 "part" part output:write:range
1575 }
1576
1577 FUNCTION {output:fields.3} {
1578 "pubstate" pubstate output:write:field
1579 "reprinttitle" reprinttitle output:write:field
1580 "series" series output:write:field
1581 "shorthandintro" shorthandintro output:write:field
1582 "shortjournal" shortjournal output:write:field
1583 "shortseries" shortseries output:write:field
1584 "shorttitle" shorttitle output:write:field
1585 "subtitle" subtitle output:write:field
1586 "titleaddon" titleaddon output:write:field
1587 "title" title output:write:field
1588 "url" url output:write:verb
1589 "venue" venue output:write:field
1590 "version" version output:write:field
1591 "volumes" volumes output:write:field
1592 "volume" volume output:write:field
1593 }
1594
1595 FUNCTION {output:dates.1} {
1596 "date" date split.date
1597 "day" swap$ output:write:field
1598 duplicate$ empty$
1599 { month empty$
1600 'skip$
1601 { month is.number
1602 { month str.to.int
1603 duplicate$ #0 >
1604 swap$ #13 <
1605 and
1606 { pop$ month #2 pad.number }
1607 { "month" warning:invalid }
1608 if$
1609 }
1610 { "month" warning:invalid }
1611 if$
1612 }
1613 if$
1614 }
1615 { month empty$
1616 'skip$
1617 { "month" "date" warning:duplicate }
1618 if$
1619 }
1620 if$
1621 "month" swap$ output:write:field
1622 duplicate$ empty$
1623 { year empty$
1624 'skip$
1625 { pop$ year }
1626 if$
1627 }
1628 { year empty$
1629 'skip$
1630 { "year" "date" warning:duplicate }
1631 if$
1632 }
1633 if$
1634 "year" swap$ output:write:field
1635 "endday" swap$ output:write:field
1636 "endmonth" swap$ output:write:field
1637 "endyear" swap$ output:write:year
1638 }
1639
1640 FUNCTION {output:dates.2} {
1641 "origdate" origdate split.date
1642 "origday" swap$ output:write:field
1643 "origmonth" swap$ output:write:field
1644 "origyear" swap$ output:write:field
1645 "origendday" swap$ output:write:field
1646 "origendmonth" swap$ output:write:field
1647 "origendyear" swap$ output:write:year
1648 "eventdate" eventdate split.date
1649 "eventday" swap$ output:write:field
1650 "eventmonth" swap$ output:write:field
1651 "eventyear" swap$ output:write:field
1652 "eventendday" swap$ output:write:field
1653 "eventendmonth" swap$ output:write:field
1654 "eventendyear" swap$ output:write:year
1655 "urldate" urldate split.date
1656 "urlday" swap$ output:write:field
1657 "urlmonth" swap$ output:write:field
1658 "urlyear" swap$ output:write:field
1659 "urlendday" swap$ output:write:field
1660 "urlendmonth" swap$ output:write:field
1661 "urlendyear" swap$ output:write:year
1662 }
1663
1664 FUNCTION {output:user} {
1665 "namea" namea output:write:name
1666 "nameatype" nameatype output:write:field
1667 "nameb" nameb output:write:name
1668 "namebtype" namebtype output:write:field
1669 "namec" namec output:write:name
1670 "namectype" namectype output:write:field
1671 "lista" lista output:write:list
1672 "listb" listb output:write:list
1673 "listc" listc output:write:list
1674 "listd" listd output:write:list
1675 "liste" liste output:write:list
1676 "listf" listf output:write:list
1677 "usera" usera output:write:field
1678 "userb" userb output:write:field
1679 "userc" userc output:write:field
1680 "userd" userd output:write:field
1681 "usere" usere output:write:field
1682 "userf" userf output:write:field
1683 "verba" verba output:write:verb
1684 "verbb" verbb output:write:verb
1685 "verbc" verbc output:write:verb
1686 }
1687
1688 FUNCTION {output:warning} {
1689 warningmsg empty$
1690 'skip$
1691 { "\warn" warningmsg wrap:braces * output:indent:field }
1692 if$
1693 }
1694
1695 FUNCTION {output:compat.1} {
1696 "langid" langid
1697 duplicate$ empty$
1698 { pop$ hyphenation }
1699 { hyphenation empty$
1700 'skip$
1701 { "hyphenation" "langid" warning:duplicate }
1702 if$
1703 }
1704 if$
1705 output:write:field
1706 "location" location
1707 duplicate$ empty$
1708 { pop$ address }
1709 { address empty$
1710 'skip$
1711 { "address" "location" warning:duplicate }
1712 if$
1713 }
1714 if$
1715 output:write:list
1716 "institution" institution
1717 duplicate$ empty$
1718 { pop$ school }
1719 { school empty$
1720 'skip$
1721 { "school" "institution" warning:duplicate }
1722 if$
1723 }
1724 if$
1725 output:write:list
1726 "file" file
1727 duplicate$ empty$
1728 { pop$ pdf }
1729 { pdf empty$
1730 'skip$
1731 { "pdf" "file" warning:duplicate }
1732 if$
1733 }
1734 if$
1735 output:write:verb
1736 }
1737
1738 FUNCTION {output:compat.2} {
1739 "type" type
1740 duplicate$ empty$
1741 { type$ "patent" =
1742 type$ "techreport" = or
1743 type$ "phdthesis" = or
1744 { pop$ type$ }
1745 { type$ "mastersthesis" =
1746 { pop$ "mathesis" }
1747 'skip$
1748 if$
1749 }
1750 if$
1751 }
1752 'skip$
1753 if$
1754 output:write:field
1755 "journaltitle" journaltitle
1756 duplicate$ empty$
1757 { pop$ journal }
1758 { journal empty$
1759 'skip$
1760 { "journal" "journaltitle" warning:duplicate }
1761 if$
1762 }
1763 if$
1764 output:write:field
1765 "annotation" annotation
1766 duplicate$ empty$
1767 { pop$ annote }
1768 { annote empty$
1769 'skip$
1770 { "annote" "annotation" warning:duplicate }
1771 if$
1772 }
1773 if$
1774 output:write:multi
1775 }
1776
1777 FUNCTION {output:compat.3} {
1778 "eprinttype" eprinttype
1779 duplicate$ empty$
1780 { pop$ archiveprefix }
1781 { archiveprefix empty$
1782 'skip$
1783 { "archiveprefix" "eprinttype" warning:duplicate }
1784 if$
1785 }
1786 if$
1787 output:write:field
1788 "eprintclass" eprintclass
1789 duplicate$ empty$
1790 { pop$ primaryclass }
1791 { primaryclass empty$
1792 'skip$
1793 { "primaryclass" "eprintclass" warning:duplicate }
1794 if$
1795 }
1796 if$
1797 output:write:field
1798 }
1799
1800 FUNCTION {output:debug} {
1801 "% sort.key$ = " sort.key$ * maxline write$ newline$
1802 sort.year empty$
1803 'skip$
1804 { "% sort.year = " sort.year * maxline write$ newline$ }
1805 if$
1806 sort.alph empty$
1807 'skip$
1808 { "% sort.alph = " sort.alph * maxline write$ newline$ }
1809 if$
1810 }
1811
1812 FUNCTION {output:entry} {
1813 'tempstrga :=
1814 newline$
1815 ctrl.debug
1816 { output:debug }
1817 'skip$
1818 if$
1819 " \entry"
1820 push:cite wrap:braces *
1821 tempstrga wrap:braces *
1822 entryoptions wrap:braces *
1823 "" wrap:braces *
1824 write$ newline$
1825 output:names
1826 output:lists
1827 output:specials
1828 output:fields.1
1829 output:fields.2
1830 output:fields.3
1831 output:compat.1
1832 output:compat.2
1833 output:compat.3
1834 output:dates.1
1835 output:dates.2
1836 output:user
1837 output:warning
1838 " \endentry" write$ newline$
1839 }
1840
1841 FUNCTION {control} { skip$ }
1842 FUNCTION {set} { type$ output:entry }
1843
1844 FUNCTION {article} { type$ output:entry }
1845 FUNCTION {bibnote} { type$ output:entry }
1846 FUNCTION {book} { type$ output:entry }
1847 FUNCTION {mvbook} { type$ output:entry }
1848 FUNCTION {inbook} { type$ output:entry }
1849 FUNCTION {bookinbook} { type$ output:entry }
1850 FUNCTION {booklet} { type$ output:entry }
1851 FUNCTION {collection} { type$ output:entry }
1852 FUNCTION {mvcollection} { type$ output:entry }
1853 FUNCTION {incollection} { type$ output:entry }
1854 FUNCTION {manual} { type$ output:entry }
1855 FUNCTION {misc} { type$ output:entry }
1856 FUNCTION {online} { type$ output:entry }
1857 FUNCTION {patent} { type$ output:entry }
1858 FUNCTION {periodical} { type$ output:entry }
1859 FUNCTION {proceedings} { type$ output:entry }
1860 FUNCTION {mvproceedings} { type$ output:entry }
1861 FUNCTION {inproceedings} { type$ output:entry }
1862 FUNCTION {reference} { type$ output:entry }
1863 FUNCTION {mvreference} { type$ output:entry }
1864 FUNCTION {inreference} { type$ output:entry }
1865 FUNCTION {report} { type$ output:entry }
1866 FUNCTION {suppbook} { type$ output:entry }
1867 FUNCTION {suppcollection} { type$ output:entry }
1868 FUNCTION {suppperiodical} { type$ output:entry }
1869 FUNCTION {thesis} { type$ output:entry }
1870 FUNCTION {unpublished} { type$ output:entry }
1871
1872 FUNCTION {artwork} { type$ output:entry }
1873 FUNCTION {audio} { type$ output:entry }
1874 FUNCTION {commentary} { type$ output:entry }
1875 FUNCTION {image} { type$ output:entry }
1876 FUNCTION {jurisdiction} { type$ output:entry }
1877 FUNCTION {legal} { type$ output:entry }
1878 FUNCTION {legislation} { type$ output:entry }
1879 FUNCTION {letter} { type$ output:entry }
1880 FUNCTION {movie} { type$ output:entry }
1881 FUNCTION {music} { type$ output:entry }
1882 FUNCTION {performance} { type$ output:entry }
1883 FUNCTION {review} { type$ output:entry }
1884 FUNCTION {software} { type$ output:entry }
1885 FUNCTION {standard} { type$ output:entry }
1886 FUNCTION {video} { type$ output:entry }
1887
1888 FUNCTION {customa} { type$ output:entry }
1889 FUNCTION {customb} { type$ output:entry }
1890 FUNCTION {customc} { type$ output:entry }
1891 FUNCTION {customd} { type$ output:entry }
1892 FUNCTION {custome} { type$ output:entry }
1893 FUNCTION {customf} { type$ output:entry }
1894
1895 FUNCTION {conference} { "inproceedings" output:entry }
1896 FUNCTION {electronic} { "online" output:entry }
1897 FUNCTION {mastersthesis} { "thesis" output:entry }
1898 FUNCTION {other} { "misc" output:entry }
1899 FUNCTION {phdthesis} { "thesis" output:entry }
1900 FUNCTION {techreport} { "report" output:entry }
1901 FUNCTION {www} { "online" output:entry }
1902 FUNCTION {default.type} { "misc" output:entry }
1903
1904 % -------------------------------------------------------------------
1905 % Input
1906 % -------------------------------------------------------------------
1907
1908 FUNCTION {input:control:parse} {
1909 'tempstrga :=
1910 "" 'tempstrgb :=
1911 #1 'tempctra :=
1912 { tempstrga empty$ not
1913 tempctra and }
1914 { tempstrga #1 #1 substring$ ":" =
1915 { #0 'tempctra := }
1916 { tempstrgb tempstrga #1 #1 substring$ * 'tempstrgb := }
1917 if$
1918 tempstrga #2 global.max$ substring$ 'tempstrga :=
1919 }
1920 while$
1921 tempstrga
1922 tempstrgb
1923 }
1924
1925 FUNCTION {input:control:options} {
1926 input:control:parse str.to.int
1927 }
1928
1929 % This version corresponds to the .bcf version, *not* the biblatex version!
1930 FUNCTION {input:control:version} {
1931 input:control:parse
1932 "$Revision: 3.11 $"
1933 #12 entry.max$ substring$
1934 #-3 entry.max$ substring$
1935 'tempstrga :=
1936 duplicate$ tempstrga =
1937 { pop$ }
1938 { "bcf version mismatch: biblatex.bst has " tempstrga *
1939 ", but biblatex.sty has " * swap$ * warning$
1940 " The bcf version need not be the same as the biblatex version."
1941 top$
1942 pop$ "" }
1943 if$
1944 }
1945
1946 FUNCTION {input:control} {
1947 options empty$
1948 'skip$
1949 { options input:control:version
1950 duplicate$ empty$
1951 { pop$ }
1952 { input:control:options 'ctrl.debug :=
1953 input:control:options 'ctrl.bibtex8 :=
1954 input:control:options 'ctrl.cssort :=
1955 input:control:options 'ctrl.useprefix :=
1956 input:control:options 'ctrl.useauthor :=
1957 input:control:options 'ctrl.useeditor :=
1958 input:control:options 'ctrl.usetranslator :=
1959 input:control:options 'ctrl.labelalpha :=
1960 input:control:options 'ctrl.labeldate :=
1961 input:control:options 'ctrl.singletitle :=
1962 input:control:options 'ctrl.sorting :=
1963 input:control:options 'ctrl.maxcitenames :=
1964 input:control:options 'ctrl.mincitenames :=
1965 input:control:options 'ctrl.maxsortnames :=
1966 input:control:options 'ctrl.minsortnames :=
1967 input:control:options 'ctrl.nohashothers :=
1968 input:control:options 'ctrl.nosortothers :=
1969 input:control:options 'ctrl.maxalphanames :=
1970 input:control:options 'ctrl.minalphanames :=
1971 input:control:options 'ctrl.maxline :=
1972 input:control:parse 'ctrl.alphaothers :=
1973 input:control:parse 'ctrl.sortalphaothers :=
1974 'ctrl.sortstr :=
1975 }
1976 if$
1977 ctrl.maxline #49 <
1978 { #49 'ctrl.maxline := }
1979 { ctrl.maxline #79 >
1980 { #79 'ctrl.maxline := }
1981 'skip$
1982 if$
1983 }
1984 if$
1985 }
1986 if$
1987 }
1988
1989 FUNCTION {input:options:add} {
1990 entryoptions empty$
1991 'skip$
1992 { entryoptions ", " * 'entryoptions := }
1993 if$
1994 entryoptions swap$ * 'entryoptions :=
1995 duplicate$ empty$
1996 { pop$ }
1997 { "=" swap$ * entryoptions swap$ * 'entryoptions := }
1998 if$
1999 }
2000
2001 FUNCTION {input:options:known} {
2002 duplicate$ empty$
2003 { tempstrgb input:options:add
2004 #1 }
2005 { duplicate$ "true" =
2006 { pop$ "" tempstrgb input:options:add
2007 #1 }
2008 { duplicate$ tempstrgb input:options:add
2009 bol.to.int
2010 }
2011 if$
2012 }
2013 if$
2014 }
2015
2016 FUNCTION {input:options:parse} {
2017 'tempstrgb :=
2018 tempstrgb "useprefix" =
2019 { input:options:known 'useprefix := }
2020 { tempstrgb "useauthor" =
2021 { input:options:known 'useauthor := }
2022 { tempstrgb "useeditor" =
2023 { input:options:known 'useeditor := }
2024 { tempstrgb "usetranslator" =
2025 { input:options:known 'usetranslator := }
2026 { tempstrgb "skipbib" =
2027 { input:options:known 'skipbib := }
2028 { tempstrgb "skiplos" =
2029 { input:options:known 'skiplos := }
2030 { tempstrgb "skiplab" =
2031 { input:options:known 'skiplab := }
2032 { tempstrgb "dataonly" =
2033 { input:options:known
2034 duplicate$ 'skipbib :=
2035 duplicate$ 'skiplos :=
2036 'skiplab :=
2037 }
2038 { tempstrgb input:options:add }
2039 if$
2040 }
2041 if$
2042 }
2043 if$
2044 }
2045 if$
2046 }
2047 if$
2048 }
2049 if$
2050 }
2051 if$
2052 }
2053 if$
2054 }
2055
2056 FUNCTION {input:options:extract} {
2057 'tempstrgb :=
2058 #1 'tempctrb :=
2059 { tempstrgb text.length$ #0 > }
2060 { tempstrgb tempctrb #1 substring$ "=" =
2061 { tempstrgb tempctrb #1 + global.max$ substring$
2062 tempstrgb #1 tempctrb #1 - substring$
2063 input:options:parse
2064 "" 'tempstrgb :=
2065 }
2066 { tempstrgb text.length$ tempctrb =
2067 { "" tempstrgb input:options:parse
2068 "" 'tempstrgb :=
2069 }
2070 { tempctrb #1 + 'tempctrb := }
2071 if$
2072 }
2073 if$
2074 }
2075 while$
2076 }
2077
2078 FUNCTION {input:options} {
2079 options 'tempstrga :=
2080 #1 'tempctra :=
2081 { tempstrga text.length$ #0 > }
2082 { tempstrga tempctra #1 substring$ "," =
2083 { tempstrga #1 tempctra #1 - substring$ input:options:extract
2084 tempctra #1 + 'tempctra :=
2085 { tempstrga tempctra #1 substring$ " " =
2086 tempctra tempstrga text.length$ > not
2087 and
2088 }
2089 { tempctra #1 + 'tempctra := }
2090 while$
2091 tempstrga tempctra global.max$ substring$ 'tempstrga :=
2092 #1 'tempctra :=
2093 }
2094 { tempstrga text.length$ tempctra =
2095 { tempstrga input:options:extract
2096 "" 'tempstrga :=
2097 }
2098 { tempctra #1 + 'tempctra := }
2099 if$
2100 }
2101 if$
2102 }
2103 while$
2104 }
2105
2106 FUNCTION {input:iterate} {
2107 ctrl:control
2108 { input:control }
2109 { citecount #1 + 'citecount :=
2110 citecount int.to.str$ #9 pad.number 'sortkey.nosort :=
2111 ctrl.useprefix 'useprefix :=
2112 ctrl.useauthor 'useauthor :=
2113 ctrl.useeditor 'useeditor :=
2114 ctrl.usetranslator 'usetranslator :=
2115 ctrl.singletitle
2116 { #1 'singletitle := }
2117 'skip$
2118 if$
2119 options empty$
2120 'skip$
2121 { input:options }
2122 if$
2123 ctrl:set entryset empty$ or
2124 'skip$
2125 { #1 'skipbib :=
2126 #1 'skiplos :=
2127 #1 'skiplab :=
2128 }
2129 if$
2130 "date" date split.date
2131 pop$ pop$ 'dateyear :=
2132 pop$ pop$ 'dateendyear :=
2133 dateyear empty$
2134 { year empty$
2135 'skip$
2136 { year 'dateyear := }
2137 if$
2138 }
2139 'skip$
2140 if$
2141 }
2142 if$
2143 }
2144
2145 READ
2146
2147 EXECUTE {initialize}
2148
2149 ITERATE {input:iterate}
2150
2151 % -------------------------------------------------------------------
2152 % Generate labels
2153 % -------------------------------------------------------------------
2154
2155 FUNCTION {makelabel:name:format} {
2156 'templist :=
2157 #1 'tempctra :=
2158 templist num.names$ 'tempctrb :=
2159 templist andothers
2160 { tempctrb #1 - 'tempctrb := }
2161 'skip$
2162 if$
2163 tempctrb ctrl.maxcitenames >
2164 { ctrl.mincitenames 'tempctrc := }
2165 { ctrl.maxcitenames 'tempctrc := }
2166 if$
2167 ""
2168 { duplicate$ text.length$ entry.max$ #50 - <
2169 tempctra tempctrc > not and
2170 tempctrb #0 > and
2171 }
2172 { useprefix
2173 { templist tempctra "{vv}" format.name$
2174 duplicate$ empty$
2175 { pop$ "" }
2176 { "u" change.case$ "t" change.case$
2177 delimiter.3 * }
2178 if$
2179 }
2180 { "" }
2181 if$
2182 templist tempctra "{ll}" format.name$ *
2183 tempctra #1 >
2184 { delimiter.2 swap$ * }
2185 'skip$
2186 if$
2187 *
2188 tempctra #1 + 'tempctra :=
2189 tempctrb #1 - 'tempctrb :=
2190 }
2191 while$
2192 templist andothers
2193 tempctrb #0 >
2194 or
2195 ctrl.nohashothers not
2196 and
2197 { delimiter.2 * "zzzz" * }
2198 'skip$
2199 if$
2200 }
2201
2202
2203 FUNCTION {makelabel:name:full} {
2204 duplicate$ num.names$ #1 =
2205 { #1
2206 "{ll}{" delimiter.3 *
2207 "ff}{" delimiter.3 * *
2208 "vv}{" delimiter.3 * *
2209 "jj}" *
2210 format.name$
2211 }
2212 { pop$ "" }
2213 if$
2214 }
2215
2216 FUNCTION {makelabel:alpha:format} {
2217 duplicate$ empty$
2218 { pop$ "" }
2219 { 'templist :=
2220 #1 'tempctra :=
2221 templist andothers
2222 { templist num.names$ #1 - 'tempctrb := }
2223 { templist num.names$ 'tempctrb := }
2224 if$
2225 tempctrb ctrl.maxalphanames >
2226 { ctrl.minalphanames 'tempctrb := }
2227 'skip$
2228 if$
2229 tempctrb #1 >
2230 { ""
2231 { tempctrb #0 > }
2232 { templist tempctra "{l{}}" format.name$ *
2233 tempctra #1 + 'tempctra :=
2234 tempctrb #1 - 'tempctrb :=
2235 }
2236 while$
2237 }
2238 { templist #1 "{l{}}" format.name$ }
2239 if$
2240 duplicate$ text.length$ #2 <
2241 { pop$
2242 useprefix
2243 { templist #1 "{v{}}" format.name$ #2 text.prefix$
2244 templist #1 "{ll}" format.name$ *
2245 }
2246 { templist #1 "{ll}" format.name$ }
2247 if$
2248 #3 text.prefix$
2249 }
2250 'skip$
2251 if$
2252 }
2253 if$
2254 templist num.names$ ctrl.maxalphanames >
2255 templist andothers
2256 or
2257 { ctrl.alphaothers * }
2258 'skip$
2259 if$
2260 }
2261
2262 FUNCTION {makelabel:alpha:year} {
2263 dateyear purify
2264 #1 #4 substring$
2265 #-1 #2 substring$
2266 }
2267
2268 FUNCTION {makelabel:hash:format} {
2269 'templist :=
2270 #1 'tempctra :=
2271 templist num.names$ 'tempctrb :=
2272 templist andothers
2273 { tempctrb #1 - 'tempctrb := }
2274 'skip$
2275 if$
2276 tempctrb ctrl.maxcitenames >
2277 { ctrl.mincitenames 'tempctrc := }
2278 { ctrl.maxcitenames 'tempctrc := }
2279 if$
2280 ""
2281 { tempctra tempctrc > not
2282 tempctrb #0 >
2283 and }
2284 { templist tempctra
2285 useprefix
2286 { "{v{}}{l{}}{j{}}{f{}}" }
2287 { "{l{}}{j{}}{f{}}{v{}}" }
2288 if$
2289 format.name$ purify$ *
2290 tempctra #1 + 'tempctra :=
2291 tempctrb #1 - 'tempctrb :=
2292 }
2293 while$
2294 templist andothers
2295 tempctrb #0 >
2296 or
2297 ctrl.nohashothers not
2298 and
2299 { "+" * }
2300 'skip$
2301 if$
2302 }
2303
2304 FUNCTION {makelabel:hash:format:full} {
2305 'templist :=
2306 #1 'tempctra :=
2307 templist num.names$ 'tempctrb :=
2308 templist andothers
2309 { tempctrb #1 - 'tempctrb := }
2310 'skip$
2311 if$
2312 ""
2313 { tempctrb #0 > }
2314 { templist tempctra
2315 useprefix
2316 { "{v{}}{l{}}{j{}}{f{}}" }
2317 { "{l{}}{j{}}{f{}}{v{}}" }
2318 if$
2319 format.name$ purify$ *
2320 tempctra #1 + 'tempctra :=
2321 tempctrb #1 - 'tempctrb :=
2322 }
2323 while$
2324 templist andothers
2325 ctrl.nohashothers not
2326 and
2327 { "+" * }
2328 'skip$
2329 if$
2330 }
2331
2332 FUNCTION {makelabel:ctrl:alpha} {
2333 ctrl:labelalpha
2334 { shorthand empty$
2335 { label empty$
2336 { push:cite purify #1 #3 substring$
2337 "u" change.case$ "t" change.case$ }
2338 { label makelabel:alpha:year * }
2339 if$
2340 }
2341 { shorthand }
2342 if$
2343 }
2344 { "" }
2345 if$
2346 }
2347
2348 FUNCTION {makelabel:ctrl:alpha:format} {
2349 ctrl:labelalpha
2350 { shorthand empty$
2351 { label empty$
2352 { makelabel:alpha:format }
2353 { pop$ label }
2354 if$
2355 makelabel:alpha:year *
2356 }
2357 { pop$
2358 shorthand
2359 }
2360 if$
2361 }
2362 { pop$
2363 ""
2364 }
2365 if$
2366 }
2367
2368 FUNCTION {makelabel:label} {
2369 push:shortname empty$
2370 { push:sorttitle 'label.name :=
2371 makelabel:ctrl:alpha 'labelalpha :=
2372 }
2373 { push:shortname
2374 duplicate$ makelabel:name:format 'label.name :=
2375 duplicate$ makelabel:hash:format 'namehash :=
2376 makelabel:ctrl:alpha:format 'labelalpha :=
2377 }
2378 if$
2379 push:fullname empty$
2380 'skip$
2381 { push:fullname makelabel:hash:format:full 'fullhash := }
2382 if$
2383 }
2384
2385 % -------------------------------------------------------------------
2386 % Sort labels
2387 % -------------------------------------------------------------------
2388
2389 FUNCTION {labelsort:label} {
2390 sortkey:init:label
2391 makelabel:label
2392 }
2393
2394 FUNCTION {labelsort:main} {
2395 ctrl:skiplab not
2396 ctrl.singletitle ctrl.labeldate or
2397 and
2398 { label.name purify delimiter.1 *
2399 sortkey.year * delimiter.1 *
2400 push:presort * delimiter.1 *
2401 sortkey empty$
2402 { sortkey.name * delimiter.1 * sortkey.title }
2403 { sortkey }
2404 if$
2405 *
2406 truncate
2407 }
2408 { "" }
2409 if$
2410 duplicate$
2411 'sort.key$ :=
2412 'sort.year :=
2413 }
2414
2415 FUNCTION {labelsort:alph} {
2416 ctrl:labelalpha
2417 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2418 purify delimiter.1 *
2419 push:presort * delimiter.1 *
2420 sortkey empty$
2421 { ctrl.sorting #10 >
2422 ctrl.sorting #20 <
2423 and
2424 { ctrl.sorting #10 - }
2425 { #2 }
2426 if$
2427 sortkey:main:string
2428 }
2429 { sortkey }
2430 if$
2431 *
2432 truncate
2433 }
2434 { "" }
2435 if$
2436 duplicate$
2437 'sort.key$ :=
2438 'sort.alph :=
2439 }
2440
2441 FUNCTION {labelsort:hash} {
2442 ctrl:control
2443 namehash empty$
2444 or
2445 { "zzzz" 'sort.key$ := }
2446 { namehash purify delimiter.1 *
2447 push:shortname duplicate$ empty$
2448 { pop$ "zzzz" * }
2449 { sortkey:name:format purify * }
2450 if$
2451 truncate 'sort.key$ :=
2452 }
2453 if$
2454 }
2455
2456 FUNCTION {labelsort:fullhash} {
2457 ctrl:control
2458 fullhash empty$
2459 or
2460 { "zzzz" 'sort.key$ := }
2461 { fullhash purify delimiter.1 *
2462 push:shortname duplicate$ empty$
2463 { pop$ "zzzz" * }
2464 { sortkey:name:format purify * }
2465 if$
2466 truncate 'sort.key$ :=
2467 }
2468 if$
2469 }
2470
2471 % -------------------------------------------------------------------
2472
2473 FUNCTION {labelsort:init} {
2474 "" 'last.name :=
2475 "" 'last.year :=
2476 "" 'last.hash :=
2477 "" 'last.extra :=
2478 #1 'last.extra.num :=
2479 }
2480
2481 FUNCTION {labelsort:main:init} {
2482 "" 'last.name :=
2483 }
2484
2485 FUNCTION {labelsort:hash:init} {
2486 "" 'last.name :=
2487 #1 'last.extra.num :=
2488 }
2489
2490 FUNCTION {labelsort:namehash:iterate} {
2491 ctrl:control
2492 namehash empty$
2493 or
2494 'skip$
2495 { namehash last.hash =
2496 { push:name:namehash last.name =
2497 'skip$
2498 { last.extra.num #1 + 'last.extra.num := }
2499 if$
2500 last.extra.num int.to.str$ 'labelhash :=
2501 }
2502 { #1 'last.extra.num :=
2503 "1" 'labelhash :=
2504 }
2505 if$
2506 namehash 'last.hash :=
2507 push:name:namehash 'last.name :=
2508 }
2509 if$
2510 }
2511
2512 FUNCTION {labelsort:namehash:reverse} {
2513 ctrl:control
2514 namehash empty$
2515 or
2516 'skip$
2517 { push:name:namehash last.name =
2518 { last.extra "1" =
2519 { "1" 'labelhash := }
2520 'skip$
2521 if$
2522 }
2523 { last.extra "2" =
2524 { "1" 'labelhash := }
2525 'skip$
2526 if$
2527 }
2528 if$
2529 labelhash 'last.extra :=
2530 push:name:namehash 'last.name :=
2531 namehash labelhash * 'namehash :=
2532 }
2533 if$
2534 }
2535
2536 FUNCTION {labelsort:fullhash:iterate} {
2537 ctrl:control
2538 fullhash empty$
2539 or
2540 'skip$
2541 { fullhash last.hash =
2542 { push:name:fullhash last.name =
2543 'skip$
2544 { last.extra.num #1 + 'last.extra.num := }
2545 if$
2546 last.extra.num int.to.str$ 'labelhash :=
2547 }
2548 { #1 'last.extra.num :=
2549 "1" 'labelhash :=
2550 }
2551 if$
2552 fullhash 'last.hash :=
2553 push:name:fullhash 'last.name :=
2554 }
2555 if$
2556 }
2557
2558 FUNCTION {labelsort:fullhash:reverse} {
2559 ctrl:control
2560 fullhash empty$
2561 or
2562 'skip$
2563 { push:name:fullhash last.name =
2564 { last.extra "1" =
2565 { "1" 'labelhash := }
2566 'skip$
2567 if$
2568 }
2569 { last.extra "2" =
2570 { "1" 'labelhash := }
2571 'skip$
2572 if$
2573 }
2574 if$
2575 labelhash 'last.extra :=
2576 push:name:fullhash 'last.name :=
2577 fullhash labelhash * 'fullhash :=
2578 }
2579 if$
2580 }
2581
2582 FUNCTION {labelsort:main:singletitle} {
2583 ctrl.singletitle
2584 { label.name last.name =
2585 { #0 'singletitle := }
2586 'skip$
2587 if$
2588 label.name 'last.name :=
2589 }
2590 'skip$
2591 if$
2592 }
2593
2594 FUNCTION {labelsort:main:year:iterate} {
2595 ctrl:labeldate
2596 { label.name
2597 dateyear empty$
2598 'skip$
2599 { " " * dateyear *
2600 dateendyear empty$
2601 'skip$
2602 { dateyear dateendyear =
2603 'skip$
2604 { dateendyear open.ended =
2605 'skip$
2606 { "-" * dateendyear * }
2607 if$
2608 }
2609 if$
2610 }
2611 if$
2612 }
2613 if$
2614 'label.year :=
2615 label.year last.year =
2616 { last.extra.num #1 + 'last.extra.num :=
2617 last.extra.num int.to.str$ 'extradate :=
2618 }
2619 { #1 'last.extra.num :=
2620 "" 'extradate :=
2621 label.year 'last.year :=
2622 }
2623 if$
2624 }
2625 'skip$
2626 if$
2627 }
2628
2629 FUNCTION {labelsort:main:year:reverse} {
2630 ctrl:labeldate
2631 { last.extra "2" =
2632 { "1" 'extradate := }
2633 'skip$
2634 if$
2635 extradate 'last.extra :=
2636 }
2637 'skip$
2638 if$
2639 }
2640
2641 FUNCTION {labelsort:main:iterate} {
2642 ctrl:skiplab
2643 'skip$
2644 { labelsort:main:singletitle
2645 labelsort:main:year:iterate
2646 }
2647 if$
2648 }
2649
2650 FUNCTION {labelsort:main:reverse} {
2651 ctrl:skiplab
2652 'skip$
2653 { labelsort:main:singletitle
2654 labelsort:main:year:reverse
2655 }
2656 if$
2657 }
2658
2659 FUNCTION {labelsort:alph:iterate} {
2660 ctrl:labelalpha
2661 { labelalpha last.year =
2662 { last.extra.num #1 + 'last.extra.num :=
2663 last.extra.num int.to.str$ 'extraalpha :=
2664 }
2665 { #1 'last.extra.num :=
2666 "" 'extraalpha :=
2667 }
2668 if$
2669 labelalpha 'last.year :=
2670 }
2671 'skip$
2672 if$
2673 }
2674
2675 FUNCTION {labelsort:alph:reverse} {
2676 ctrl:labelalpha
2677 { last.extra "2" =
2678 { "1" 'extraalpha := }
2679 'skip$
2680 if$
2681 extraalpha 'last.extra :=
2682 labelalpha empty$
2683 'skip$
2684 { extraalpha empty$
2685 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2686 purify
2687 'sortkey.alpha := }
2688 { labelalpha ctrl.alphaothers ctrl.sortalphaothers str:replace
2689 purify
2690 extraalpha #4 pad.number *
2691 'sortkey.alpha := }
2692 if$
2693 }
2694 if$
2695 }
2696 'skip$
2697 if$
2698 }
2699
2700 ITERATE {labelsort:label}
2701
2702 EXECUTE {labelsort:init}
2703
2704 ITERATE {labelsort:hash}
2705
2706 SORT
2707
2708 EXECUTE {labelsort:hash:init}
2709
2710 ITERATE {labelsort:namehash:iterate}
2711
2712 EXECUTE {labelsort:hash:init}
2713
2714 REVERSE {labelsort:namehash:reverse}
2715
2716 EXECUTE {labelsort:init}
2717
2718 ITERATE {labelsort:fullhash}
2719
2720 SORT
2721
2722 EXECUTE {labelsort:hash:init}
2723
2724 ITERATE {labelsort:fullhash:iterate}
2725
2726 EXECUTE {labelsort:hash:init}
2727
2728 REVERSE {labelsort:fullhash:reverse}
2729
2730 EXECUTE {labelsort:init}
2731
2732 ITERATE {labelsort:main}
2733
2734 SORT
2735
2736 EXECUTE {labelsort:init}
2737
2738 EXECUTE {labelsort:main:init}
2739
2740 ITERATE {labelsort:main:iterate}
2741
2742 EXECUTE {labelsort:main:init}
2743
2744 REVERSE {labelsort:main:reverse}
2745
2746 EXECUTE {labelsort:init}
2747
2748 ITERATE {labelsort:alph}
2749
2750 SORT
2751
2752 ITERATE {labelsort:alph:iterate}
2753
2754 REVERSE {labelsort:alph:reverse}
2755
2756 % -------------------------------------------------------------------
2757 % Sort bibliography, write .bbl file
2758 % -------------------------------------------------------------------
2759
2760 FUNCTION {mainsort} {
2761 ctrl:control
2762 { "" }
2763 { sortkey:main }
2764 if$
2765 'sort.key$ :=
2766 }
2767
2768 ITERATE {mainsort}
2769
2770 SORT
2771
2772 % This version corresponds to the .bbl version, *not* the biblatex version!
2773 FUNCTION {output:main:begin} {
2774 "% $ biblatex auxiliary file $" write$ newline$
2775 "% $ biblatex bbl format version " "$Revision: 3.3 $"
2776 #12 entry.max$ substring$ #-3 entry.max$ substring$ * " $" * write$ newline$
2777 "% Do not modify the above lines!" write$ newline$
2778 "%" write$ newline$
2779 "% This is an auxiliary file used by the 'biblatex' package." write$ newline$
2780 "% This file may safely be deleted. It will be recreated as" write$ newline$
2781 "% required." write$ newline$
2782 "%" write$ newline$
2783 "\begingroup" write$ newline$
2784 "\makeatletter" write$ newline$
2785 "\@ifundefined{[email protected]}" write$ newline$
2786 " {\@latex@error" write$ newline$
2787 " {Missing 'biblatex' package}" write$ newline$
2788 " {The bibliography requires the 'biblatex' package.}" write$ newline$
2789 " \aftergroup\endinput}" write$ newline$
2790 " {}" write$ newline$
2791 "\endgroup" write$ newline$
2792 newline$
2793 "\datalist[entry]{" ctrl.sortstr * "/global//global/global/global}" * write$
2794 }
2795
2796 FUNCTION {output:main:preamble} {
2797 preamble$ empty$
2798 'skip$
2799 { newline$
2800 "\preamble{%" write$ newline$
2801 preamble$ write$ newline$
2802 "}" write$ newline$
2803 }
2804 if$
2805 }
2806
2807 FUNCTION {output:main:end} {
2808 "\enddatalist" write$ newline$
2809 "\endinput" write$ newline$
2810 }
2811
2812 EXECUTE {output:main:begin}
2813
2814 EXECUTE {output:main:preamble}
2815
2816 ITERATE {call.type$}
2817
2818 EXECUTE {output:main:end}
2819
2820 % -------------------------------------------------------------------