Debian Codegraph @

texmf-dist/bibtex/bst/chscite/chscite.bst

raw
1 %%
2 %% This is file `chscite.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% chscite.dtx (with options: `bibstyle')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2012 by Simon Sigurdhsson <[email protected]>
12 %%
13 %% This work may be distributed and/or modified under the
14 %% conditions of the LaTeX Project Public License, either version 1.3
15 %% of this license or (at your option) any later version.
16 %% The latest version of this license is in
17 %% http://www.latex-project.org/lppl.txt
18 %% and version 1.3 or later is part of all distributions of LaTeX
19 %% version 2005/12/01 or later.
20 %%
21 %% This work has the LPPL maintenance status `unmaintained'.
22 %%
23 %% This work consists of the files chscite.dtx and chscite.ins
24 %% and the derived filebase chscite.sty.
25 %%
26 %%
27 %% Copyright (C) 2012 by Simon Sigurdhsson <[email protected]>
28 %%
29 %% This work may be distributed and/or modified under the
30 %% conditions of the LaTeX Project Public License, either version 1.3
31 %% of this license or (at your option) any later version.
32 %% The latest version of this license is in
33 %% http://www.latex-project.org/lppl.txt
34 %% and version 1.3 or later is part of all distributions of LaTeX
35 %% version 2005/12/01 or later.
36 %%
37 %% This work has the LPPL maintenance status `unmaintained'.
38 %%
39 %% This work consists of the files chscite.dtx and chscite.ins
40 %% and the derived filebase chscite.sty.
41 %%
42 ENTRY
43 {
44 address
45 author
46 booktitle
47 chapter
48 edition
49 editor
50 howpublished
51 institution
52 journal
53 key
54 month
55 note
56 number
57 organization
58 pages
59 publisher
60 school
61 series
62 title
63 type
64 URL
65 volume
66 year
67 }
68 { field.used }
69 { extra.label sort.label list.year }
70
71 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
72
73 FUNCTION {init.state.consts}
74 {
75 #0 'before.all :=
76 #1 'mid.sentence :=
77 #2 'after.sentence :=
78 #3 'after.block :=
79 }
80
81 STRINGS { s t f }
82
83 FUNCTION {item.check}
84 {
85 't :=
86 empty$
87 { "empty " t * " in " * cite$ * warning$ }
88 { skip$ }
89 if$
90 }
91
92 FUNCTION {new.block}
93 {
94 output.state before.all =
95 'skip$
96 { after.block 'output.state := }
97 if$
98 }
99
100 FUNCTION {lastint}
101 {
102 #-1 #1 substring$ chr.to.int$ "0" chr.to.int$ -
103 }
104
105 FUNCTION {format.number.th}
106 {
107 duplicate$ duplicate$
108 #1 =
109 { pop$ pop$ "\chsWst{}" }
110 {
111 #2 =
112 { pop$ "\chsWnd{}" }
113 {
114 #3 =
115 { "\chsWrd{}" }
116 { "\chsWth{}" }
117 if$
118 }
119 if$
120 }
121 if$
122 }
123
124 FUNCTION {not}
125 {
126 { #0 }
127 { #1 }
128 if$
129 }
130
131 FUNCTION {and}
132 {
133 'skip$
134 { pop$ #0 }
135 if$
136 }
137
138 FUNCTION {or}
139 {
140 { pop$ #1 }
141 'skip$
142 if$
143 }
144
145 FUNCTION {field.or.null}
146 {
147 duplicate$ empty$
148 { pop$ "" }
149 'skip$
150 if$
151 }
152
153 FUNCTION {emphasize}
154 {
155 duplicate$ empty$
156 { pop$ "" }
157 { "\emph{" swap$ * "}" * }
158 if$
159 }
160
161 FUNCTION {write.url}
162 {
163 URL empty$
164 'skip$
165 { " \chsurl{" URL * "}" add.period$ * write$ newline$ }
166 if$
167 }
168
169 FUNCTION {fin.entry}
170 {
171 add.period$
172 write$
173 type$ "misc" =
174 'skip$
175 'write.url
176 if$
177 newline$
178 }
179
180 INTEGERS { nameptr namesleft numnames }
181
182 FUNCTION {format.names}
183 {
184 's :=
185 'f :=
186 #1 'nameptr :=
187 s num.names$ 'numnames :=
188 numnames 'namesleft :=
189 #3 numnames >
190 {
191 { namesleft #0 > }
192 {
193 s nameptr f format.name$ 't :=
194 nameptr #1 >
195 {
196 namesleft #1 >
197 { ", " * t * }
198 {
199 t "others" =
200 { " et~al." * }
201 { " \chsWand{}\ " * t * }
202 if$
203 }
204 if$
205 }
206 't
207 if$
208 nameptr #1 + 'nameptr :=
209 namesleft #1 - 'namesleft :=
210 }
211 while$
212 }
213 { s nameptr f format.name$ " et~al." * }
214 if$
215 }
216
217 FUNCTION {format.authors}
218 {
219 author empty$
220 { "" }
221 { "{vv~}{ll}{, jj}{, f.}" author format.names }
222 if$
223 }
224
225 FUNCTION {n.dashify}
226 {
227 't :=
228 ""
229 { t empty$ not }
230 {
231 t #1 #1 substring$ "-" =
232 {
233 t #1 #2 substring$ "--" = not
234 {
235 "--" *
236 t #2 global.max$ substring$ 't :=
237 }
238 {
239 { t #1 #1 substring$ "-" = }
240 {
241 "-" *
242 t #2 global.max$ substring$ 't :=
243 }
244 while$
245 }
246 if$
247 }
248 {
249 t #1 #1 substring$ *
250 t #2 global.max$ substring$ 't :=
251 }
252 if$
253 }
254 while$
255 }
256
257 FUNCTION {format.btitle}
258 {
259 title "." * emphasize
260 }
261
262 FUNCTION {tie.or.space.connect}
263 {
264 duplicate$ text.length$ #3 <
265 { "~" }
266 { " " }
267 if$
268 swap$ * *
269 }
270
271 FUNCTION {either.or.check}
272 {
273 empty$
274 'pop$
275 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
276 if$
277 }
278
279 FUNCTION {format.editors}
280 {
281 editor empty$
282 { "" }
283 { "\chsWeditor{}" "{vv~}{ll}{, jj}{, f.}" editor format.names tie.or.space.connect }
284 if$
285 }
286
287 FUNCTION {format.book.editors}
288 {
289 editor empty$
290 { "" }
291 { "\chsWeditor{}" "{vv~}{ll}{, jj}{, f.}" editor format.names tie.or.space.connect }
292 if$
293 }
294
295 FUNCTION {format.edition}
296 {
297 edition edition lastint format.number.th *
298 }
299
300 INTEGERS { multiresult }
301
302 FUNCTION {multi.page.check}
303 {
304 't :=
305 #0 'multiresult :=
306 {
307 multiresult not
308 t empty$ not
309 and
310 }
311 {
312 t #1 #1 substring$
313 duplicate$ "-" =
314 swap$ duplicate$ "," =
315 swap$ "+" =
316 or or
317 { #1 'multiresult := }
318 { t #2 global.max$ substring$ 't := }
319 if$
320 }
321 while$
322 multiresult
323 }
324
325 FUNCTION {format.pages}
326 {
327 pages empty$
328 { "" }
329 {
330 ","
331 pages multi.page.check
332 { "\chsPages{}" pages n.dashify tie.or.space.connect }
333 { "\chsPage{}" pages tie.or.space.connect }
334 if$
335 tie.or.space.connect
336 }
337 if$
338 }
339
340 INTEGERS { len }
341
342 FUNCTION {chop.word}
343 {
344 's :=
345 'len :=
346 s #1 len substring$ =
347 { s len #1 + global.max$ substring$ }
348 's
349 if$
350 }
351
352 INTEGERS { ind tsslen }
353
354 STRINGS { tss ret rss istr }
355
356 FUNCTION {replace.substring}
357 {
358 'rss :=
359 'tss :=
360 'istr :=
361 "" 'ret :=
362 tss text.length$ 'tsslen :=
363 #1 'ind :=
364 { istr ind tsslen substring$ "" = not }
365 {
366 istr ind tsslen substring$ tss =
367 {
368 ret rss * 'ret :=
369 ind tsslen + 'ind :=
370 }
371 {
372 ret istr ind #1 substring$ * 'ret :=
373 ind #1 + 'ind :=
374 }
375 if$
376 }
377 while$
378 ret
379 }
380
381 FUNCTION {format.lab.names.abbr}
382 {
383 's :=
384 s num.names$ 'numnames :=
385 numnames #1 >
386 {
387 numnames #3 >
388 { s #1 "{vv~}{ll}" format.name$ " et~al." * }
389 {
390 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
391 { s #1 "{vv~}{ll}" format.name$ " et~al." * }
392 {
393 s #1 "{vv~}{ll}" format.name$ " \chsWand{}\ " *
394 s #2 "{vv~}{ll}" format.name$ *
395 }
396 if$
397 }
398 if$
399 }
400 { s #1 "{vv~}{ll}" format.name$ }
401 if$
402 }
403
404 FUNCTION {format.lab.names.full}
405 {
406 's :=
407 #1 'nameptr :=
408 s num.names$ 'numnames :=
409 numnames 'namesleft :=
410 { namesleft #0 > }
411 {
412 s nameptr "{vv~}{ll}" format.name$ 't :=
413 nameptr #1 >
414 {
415 namesleft #1 >
416 { ", " * t * }
417 {
418 t "others" =
419 { " et~al." * }
420 { " \chsWand{}\ " * t * }
421 if$
422 }
423 if$
424 }
425 't
426 if$
427 nameptr #1 + 'nameptr :=
428 namesleft #1 - 'namesleft :=
429 }
430 while$
431 }
432
433 INTEGERS { author.field editor.field organization.field title.field key.field }
434
435 FUNCTION {init.field.constants}
436 {
437 #0 'author.field :=
438 #1 'editor.field :=
439 #2 'organization.field :=
440 #3 'title.field :=
441 #4 'key.field :=
442 }
443
444 FUNCTION {make.list.label}
445 {
446 author.field field.used =
447 { format.authors }
448 {
449 editor.field field.used =
450 { format.editors }
451 {
452 organization.field field.used =
453 { "The " #4 organization chop.word #3 text.prefix$ }
454 {
455 title.field field.used =
456 { format.btitle }
457 {
458 key.field field.used =
459 { key #3 text.prefix$ }
460 { "Internal error :001 on " cite$ * " label" * warning$ }
461 if$
462 }
463 if$
464 }
465 if$
466 }
467 if$
468 }
469 if$
470 }
471
472 FUNCTION {make.full.label}
473 {
474 author.field field.used =
475 { author format.lab.names.full }
476 {
477 editor.field field.used =
478 { editor format.lab.names.full }
479 {
480 organization.field field.used =
481 { "The " #4 organization chop.word #3 text.prefix$ }
482 {
483 title.field field.used =
484 { format.btitle }
485 {
486 key.field field.used =
487 { key #3 text.prefix$ }
488 { "Internal error :001 on " cite$ * " label" * warning$ }
489 if$
490 }
491 if$
492 }
493 if$
494 }
495 if$
496 }
497 if$
498 }
499
500 FUNCTION {make.abbr.label}
501 {
502 author.field field.used =
503 { author format.lab.names.abbr }
504 {
505 editor.field field.used =
506 { editor format.lab.names.abbr }
507 {
508 organization.field field.used =
509 { "The " #4 organization chop.word #3 text.prefix$ }
510 {
511 title.field field.used =
512 { format.btitle }
513 {
514 key.field field.used =
515 { key #3 text.prefix$ }
516 { "Internal error :001 on " cite$ * " label" * warning$ }
517 if$
518 }
519 if$
520 }
521 if$
522 }
523 if$
524 }
525 if$
526 }
527
528 FUNCTION {output.bibitem}
529 {
530 newline$
531 "\chsitem{" write$
532 make.abbr.label write$
533 "}{" write$
534 list.year write$
535 "}{" write$
536 cite$ write$
537 "}" write$
538 newline$
539 ""
540 before.all 'output.state :=
541 }
542
543 FUNCTION {journal.or.series}
544 {
545 journal missing$
546 { series }
547 { journal }
548 if$
549 }
550
551 FUNCTION {publisher.or.school}
552 {
553 publisher missing$
554 { school }
555 { publisher }
556 if$
557 }
558
559 %% STYLES
560 FUNCTION {article}
561 { output.bibitem
562 make.list.label "(" tie.or.space.connect list.year * ")" *
563 author "author" item.check
564 title missing$
565 'skip$
566 { title tie.or.space.connect }
567 if$
568 type$ "inproceedings" =
569 type$ "conference" =
570 or not
571 month missing$
572 or
573 'skip$
574 { ";" month year tie.or.space.connect tie.or.space.connect }
575 if$
576 journal missing$
577 'skip$
578 { add.period$ journal.or.series emphasize tie.or.space.connect
579 volume missing$
580 { cite$ " has journal/series with no volume!" * warning$ }
581 { "," "\chsVolume{}" tie.or.space.connect volume tie.or.space.connect * }
582 if$
583 number missing$
584 'skip$
585 { "," "\chsNumero{}" number tie.or.space.connect tie.or.space.connect * }
586 if$
587 }
588 if$
589 pages missing$
590 'skip$
591 { format.pages * }
592 if$
593 add.period$ *
594
595 fin.entry
596 }
597
598 FUNCTION {book}
599 { output.bibitem
600 make.list.label "(" tie.or.space.connect list.year * ")" *
601 author "author" item.check
602 chapter missing$
603 'skip$
604 { chapter add.period$ "\chsWin{}" tie.or.space.connect tie.or.space.connect }
605 if$
606 title missing$
607 'skip$
608 { title emphasize tie.or.space.connect }
609 if$
610 editor missing$
611 'skip$
612 { "," format.book.editors tie.or.space.connect }
613 if$
614 pages missing$
615 journal missing$
616 not or
617 'skip$
618 { format.pages * }
619 if$
620 add.period$
621 edition missing$
622 'skip$
623 { edition empty$
624 'skip$
625 { format.edition "\chsEdition{}" add.period$ tie.or.space.connect tie.or.space.connect }
626 if$
627 }
628 if$
629 URL missing$
630 'skip$
631 { "[\chsWelectronic]" tie.or.space.connect }
632 if$
633 publisher missing$
634 school missing$
635 and
636 'skip$
637 { address missing$
638 { cite$ " has publisher with no address!" * warning$ }
639 { address ":" * publisher.or.school tie.or.space.connect add.period$ tie.or.space.connect }
640 if$
641 }
642 if$
643 series missing$
644 journal missing$
645 and
646 'skip$
647 { volume missing$
648 { cite$ " has journal/series with no volume!" * warning$ }
649 { "(" journal.or.series ":" * * volume tie.or.space.connect
650 series missing$
651 'skip$
652 { format.pages * }
653 if$
654 ")" add.period$ * tie.or.space.connect * }
655 if$
656 }
657 if$
658
659 type$ "mastersthesis" =
660 type$ "phdthesis" =
661 or
662 'skip$
663 { write$ fin.entry }
664 if$
665 }
666
667 FUNCTION {booklet} { book }
668
669 FUNCTION {inbook} { book }
670
671 FUNCTION {incollection} { book }
672
673 FUNCTION {inproceedings}
674 { output.bibitem
675 make.list.label "(" tie.or.space.connect list.year * ")" *
676 author "author" item.check
677 booktitle missing$
678 { title emphasize tie.or.space.connect }
679 { title add.period$ "\chsWin{}" tie.or.space.connect booktitle emphasize tie.or.space.connect tie.or.space.connect }
680 if$
681 month missing$
682 'skip$
683 { booktitle missing$
684 { add.period$ }
685 { ";" * }
686 if$
687 month "~" year * * tie.or.space.connect
688 }
689 if$
690 address missing$
691 'skip$
692 { "," address tie.or.space.connect add.period$ * }
693 if$
694 pages missing$
695 'skip$
696 { format.pages add.period$ tie.or.space.connect }
697 if$
698 write$
699
700 fin.entry
701 }
702
703 FUNCTION {conference} { inproceedings }
704
705 FUNCTION {manual}
706 { cite$ ": @manual cite style not implemented!" * warning$ }
707
708 FUNCTION {mastersthesis}
709 { book
710 "(\chsWmscthesis{}" tie.or.space.connect
711 note missing$
712 'skip$
713 { "\chsWinstitution{}" note tie.or.space.connect tie.or.space.connect }
714 if$
715 ")" add.period$ * write$
716 fin.entry
717 }
718
719 FUNCTION {phdthesis}
720 { book
721 "(\chsWphdthesis{}" tie.or.space.connect
722 note missing$
723 'skip$
724 { "\chsWinstitution{}" note tie.or.space.connect tie.or.space.connect }
725 if$
726 ")" add.period$ * write$
727 fin.entry
728 }
729
730 FUNCTION {proceedings} { inproceedings }
731
732 FUNCTION {unpublished}
733 { output.bibitem
734 make.list.label "(" tie.or.space.connect list.year * ")" *
735 author "author" item.check
736 chapter missing$
737 'skip$
738 { chapter add.period$ "\chsWin{}" tie.or.space.connect tie.or.space.connect tie.or.space.connect }
739 if$
740 title missing$
741 'skip$
742 { title emphasize tie.or.space.connect }
743 if$
744 editor missing$
745 'skip$
746 { "," format.book.editors tie.or.space.connect * }
747 if$
748 pages missing$
749 journal missing$
750 not or
751 'skip$
752 { format.pages * }
753 if$
754 add.period$
755 URL missing$
756 { "\chsWprinting{}" tie.or.space.connect add.period$ }
757 { "[\chsWelectronic]" tie.or.space.connect }
758 if$
759 publisher missing$
760 'skip$
761 { address missing$
762 { cite$ " has publisher with no address!" * warning$ }
763 { address ":" * publisher.or.school tie.or.space.connect add.period$ tie.or.space.connect }
764 if$
765 }
766 if$
767 write$
768
769 fin.entry
770 }
771
772 FUNCTION {misc}
773 { output.bibitem
774 make.list.label "(" tie.or.space.connect list.year * ")" *
775 author "author" item.check
776 title missing$
777 'skip$
778 { title tie.or.space.connect add.period$ }
779 if$
780 howpublished missing$
781 'skip$
782 { howpublished emphasize tie.or.space.connect add.period$ }
783 if$
784 URL missing$
785 'skip$
786 { " \chsurl{" URL "}" * * tie.or.space.connect add.period$ }
787 if$
788 note missing$
789 'skip$
790 { "(" note ")" * * tie.or.space.connect add.period$ }
791 if$
792 write$
793 fin.entry
794 }
795
796 FUNCTION {techreport}
797 { output.bibitem
798 make.list.label "(" tie.or.space.connect list.year * ")" *
799 author "author" item.check
800 title missing$
801 { cite$ " has no title!" * warning$ }
802 { title emphasize tie.or.space.connect add.period$ }
803 if$
804 URL missing$
805 'skip$
806 { "[\chsWelectronic]" tie.or.space.connect }
807 if$
808 institution missing$
809 { cite$ " has no institution!" * warning$ }
810 { address missing$
811 { cite$ " has institution with no address!" * warning$ }
812 { address ":" * tie.or.space.connect }
813 if$
814 institution tie.or.space.connect add.period$
815 number missing$
816 { cite$ " has institution with no number!" * warning$ }
817 { "(\chsWtechreport{}:" number tie.or.space.connect ")" * tie.or.space.connect }
818 if$
819 }
820 if$
821 add.period$
822 write$
823 fin.entry
824 }
825
826 FUNCTION {patent}
827 { output.bibitem
828 make.list.label "(" tie.or.space.connect list.year * ")" *
829 author "author" item.check
830 title missing$
831 'skip$
832 { title emphasize tie.or.space.connect add.period$ }
833 if$
834 number missing$
835 'skip$
836 { number tie.or.space.connect add.period$ }
837 if$
838 write$
839 fin.entry
840 }
841
842 FUNCTION {default.type} { misc }
843
844 MACRO {jan} {"\chsWjanuary{}"}
845 MACRO {feb} {"\chsWfebruary{}"}
846 MACRO {mar} {"\chsWmarch{}"}
847 MACRO {apr} {"\chsWapril{}"}
848 MACRO {may} {"\chsWmay{}"}
849 MACRO {jun} {"\chsWjune{}"}
850 MACRO {jul} {"\chsWjuly{}"}
851 MACRO {aug} {"\chsWaugust{}"}
852 MACRO {sep} {"\chsWseptember{}"}
853 MACRO {oct} {"\chsWoctober{}"}
854 MACRO {nov} {"\chsWnovember{}"}
855 MACRO {dec} {"\chsWdecember{}"}
856
857 MACRO {acmcs} {"ACM Computing Surveys"}
858 MACRO {acta} {"Acta Informatica"}
859 MACRO {cacm} {"Communications of the ACM"}
860 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
861 MACRO {ibmsj} {"IBM Systems Journal"}
862 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
863 MACRO {ieeetc} {"IEEE Transactions on Computers"}
864 MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
865 MACRO {ipl} {"Information Processing Letters"}
866 MACRO {jacm} {"Journal of the ACM"}
867 MACRO {jcss} {"Journal of Computer and System Sciences"}
868 MACRO {scp} {"Science of Computer Programming"}
869 MACRO {sicomp} {"SIAM Journal on Computing"}
870 MACRO {tocs} {"ACM Transactions on Computer Systems"}
871 MACRO {tods} {"ACM Transactions on Database Systems"}
872 MACRO {tog} {"ACM Transactions on Graphics"}
873 MACRO {toms} {"ACM Transactions on Mathematical Software"}
874 MACRO {toois} {"ACM Transactions on Office Information Systems"}
875 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
876 MACRO {tcs} {"Theoretical Computer Science"}
877
878 READ
879
880 EXECUTE {init.field.constants}
881
882 FUNCTION {sortify}
883 {
884 purify$
885 "l" change.case$
886 }
887
888 FUNCTION {sortify.names}
889 {
890 " \chsWand{}\ " " " replace.substring
891 " et~al." " zzz" replace.substring
892 sortify
893 }
894
895 FUNCTION {author.key.label}
896 {
897 author empty$
898 {
899 key empty$
900 { title.field 'field.used := }
901 { key.field 'field.used := }
902 if$
903 }
904 { author.field 'field.used := }
905 if$
906 }
907
908 FUNCTION {author.editor.key.label}
909 {
910 author empty$
911 {
912 editor empty$
913 {
914 key empty$
915 { title.field 'field.used := }
916 { key.field 'field.used := }
917 if$
918 }
919 { editor.field 'field.used := }
920 if$
921 }
922 { author.field 'field.used := }
923 if$
924 }
925
926 FUNCTION {author.key.organization.label}
927 {
928 author empty$
929 {
930 key empty$
931 {
932 organization empty$
933 { title.field 'field.used := }
934 { organization.field 'field.used := }
935 if$
936 }
937 { key.field 'field.used := }
938 if$
939 }
940 { author.field 'field.used := }
941 if$
942 }
943
944 FUNCTION {editor.key.organization.label}
945 {
946 editor empty$
947 {
948 key empty$
949 {
950 organization empty$
951 { title.field 'field.used := }
952 { organization.field 'field.used := }
953 if$
954 }
955 { key.field 'field.used := }
956 if$
957 }
958 { editor.field 'field.used := }
959 if$
960 }
961
962 FUNCTION {sort.format.title}
963 {
964 't :=
965 "A " #2
966 "An " #3
967 "The " #4 t chop.word
968 chop.word
969 chop.word
970 sortify
971 #1 global.max$ substring$
972 }
973
974 FUNCTION {calc.label}
975 {
976 make.abbr.label
977 title.field field.used =
978 { sort.format.title }
979 { sortify.names }
980 if$
981 year field.or.null purify$ #-1 #4 substring$ sortify *
982 'sort.label :=
983 }
984
985 FUNCTION {preliminaries}
986 {
987 type$ "book" =
988 type$ "inbook" =
989 or
990 'author.editor.key.label
991 {
992 type$ "proceedings" =
993 'editor.key.organization.label
994 {
995 type$ "manual" =
996 'author.key.organization.label
997 'author.key.label
998 if$
999 }
1000 if$
1001 }
1002 if$
1003 }
1004
1005 FUNCTION {first.presort}
1006 {
1007 calc.label
1008 sort.label
1009 title.field field.used =
1010 { skip$ }
1011 { " " * make.list.label sortify.names * " " * title field.or.null sort.format.title * }
1012 if$
1013 #1 entry.max$ substring$
1014 'sort.key$ :=
1015 }
1016
1017 ITERATE {preliminaries}
1018
1019 ITERATE {first.presort}
1020
1021 SORT
1022
1023 STRINGS { last.sort.label next.extra last.full.label }
1024
1025 INTEGERS { last.extra.num }
1026
1027 FUNCTION {initialize.confusion}
1028 {
1029 #0 int.to.chr$ 'last.sort.label :=
1030 #0 int.to.chr$ 'last.full.label :=
1031 }
1032
1033 FUNCTION {confusion.pass}
1034 {
1035 last.sort.label sort.label =
1036 'skip$
1037 {
1038 sort.label 'last.sort.label :=
1039 make.full.label sortify.names 'last.full.label :=
1040 }
1041 if$
1042 }
1043
1044 EXECUTE {initialize.confusion}
1045
1046 ITERATE {confusion.pass}
1047
1048 EXECUTE {initialize.confusion}
1049
1050 REVERSE {confusion.pass}
1051
1052 FUNCTION {initialize.last.extra.num}
1053 {
1054 #0 int.to.chr$ 'last.sort.label :=
1055 "" 'next.extra :=
1056 #0 'last.extra.num :=
1057 }
1058
1059 FUNCTION {forward.pass}
1060 {
1061 last.sort.label sort.label =
1062 {
1063 last.extra.num #1 + 'last.extra.num :=
1064 last.extra.num int.to.chr$ 'extra.label :=
1065 }
1066 {
1067 "a" chr.to.int$ 'last.extra.num :=
1068 "" 'extra.label :=
1069 sort.label 'last.sort.label :=
1070 }
1071 if$
1072 }
1073
1074 FUNCTION {reverse.pass}
1075 {
1076 next.extra "b" =
1077 { "a" 'extra.label := }
1078 'skip$
1079 if$
1080 year empty$
1081 { "n.d." extra.label * 'list.year := }
1082 { year extra.label * 'list.year := }
1083 if$
1084 extra.label 'next.extra :=
1085 }
1086
1087 ITERATE {first.presort}
1088
1089 SORT
1090
1091 EXECUTE {initialize.last.extra.num}
1092
1093 ITERATE {forward.pass}
1094
1095 REVERSE {reverse.pass}
1096
1097 FUNCTION {second.presort}
1098 {
1099 make.list.label
1100 title.field field.used =
1101 { sort.format.title }
1102 { sortify.names }
1103 if$
1104 " " * list.year field.or.null sortify * " " *
1105 title.field field.used =
1106 'skip$
1107 { title field.or.null sort.format.title * }
1108 if$
1109 #1 entry.max$ substring$
1110 'sort.key$ :=
1111 }
1112
1113 ITERATE {second.presort}
1114
1115 SORT
1116
1117 FUNCTION {begin.bib}
1118 {
1119 preamble$ empty$
1120 'skip$
1121 {
1122 "\chspreambledefs{%" write$ newline$
1123 preamble$ write$ "}" write$ newline$
1124 "\chspreambletext{%" write$ newline$
1125 preamble$ write$ "}" write$ newline$
1126 }
1127 if$
1128 "\begin{thebibliography}{xx}" write$ newline$
1129 }
1130
1131 EXECUTE {begin.bib}
1132
1133 EXECUTE {init.state.consts}
1134
1135 ITERATE {call.type$}
1136
1137 FUNCTION {end.bib}
1138 {
1139 newline$
1140 "\end{thebibliography}" write$ newline$
1141 }
1142
1143 EXECUTE {end.bib}