Debian Codegraph @

texmf-dist/bibtex/bst/babelbib/bababbr3.bst

raw
1 %%
2 %% This is file `bababbr3.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% babelbib.dtx (with options: `bst,bststd,bstshort,bstthree')
8 %%
9 %% babelbib package
10 %%
11 %% Copyright 2003--2021 Harald Harders
12 %% Copyright 2019--2021 Norbert Preining
13 %%
14 %% This program can be redistributed and/or modified under the terms
15 %% of the LaTeX Project Public License Distributed from CTAN
16 %% archives in directory macros/latex/base/lppl.txt; either
17 %% version 1 of the License, or any later version.
18 %%
19 %% [email protected]
20 %% [email protected]
21 %%
22 %% 2021/01/06 v1.34 babelbib: multilingual bibliographies
23 ENTRY
24 { address
25 annote
26 annotelanguage
27 author
28 booktitle
29 chapter
30 edition
31 editor
32 howpublished
33 institution
34 isbn
35 issn
36 journal
37 key
38 language
39 month
40 note
41 number
42 organization
43 pages
44 publisher
45 school
46 series
47 title
48 type
49 url
50 urldate
51 volume
52 year
53 }
54 {}
55 { label }
56
57 INTEGERS
58 { output.state
59 before.all
60 mid.sentence
61 after.sentence
62 after.block
63 before.title
64 }
65
66 STRINGS
67 { s
68 t
69 language.state
70 change.temp
71 isbn.command
72 }
73
74 FUNCTION {init.state.consts}
75 { #0 'before.all :=
76 #1 'mid.sentence :=
77 #2 'after.sentence :=
78 #3 'after.block :=
79 #4 'before.title :=
80 "nostate" 'language.state :=
81 }
82
83 FUNCTION {not}
84 { { #0 }
85 { #1 }
86 if$
87 }
88
89 FUNCTION {and}
90 { 'skip$
91 { pop$ #0 }
92 if$
93 }
94
95 FUNCTION {or}
96 { { pop$ #1 }
97 'skip$
98 if$
99 }
100
101 FUNCTION {language.change.case}
102 {
103 'change.temp :=
104 't :=
105 "\btxifchangecase {"
106 t change.temp change.case$ *
107 "}{" *
108 t *
109 "}" *
110 }
111
112 FUNCTION {output.nonnull}
113 { 's :=
114 output.state mid.sentence =
115 { ", " * write$ }
116 { output.state after.block =
117 { add.period$ write$
118 newline$
119 "\newblock " write$
120 }
121 { output.state before.all =
122 'write$
123 {
124 output.state before.title =
125 { "\btxauthorcolon\ " * write$ }
126 { add.period$ " " * write$ }
127 if$
128 }
129 if$
130 }
131 if$
132 mid.sentence 'output.state :=
133 }
134 if$
135 s
136 }
137
138 FUNCTION {output}
139 { duplicate$ empty$
140 'pop$
141 'output.nonnull
142 if$
143 }
144
145 FUNCTION {output.check}
146 { 't :=
147 duplicate$ empty$
148 { pop$ "empty " t * " in " * cite$ * warning$ }
149 'output.nonnull
150 if$
151 }
152
153 FUNCTION {output.bibitem}
154 { newline$
155 language empty$
156 {
157 language.state "nolanguage" =
158 'skip$
159 {
160 "empty language in " cite$ * warning$
161 "\expandafter\btxselectlanguage\expandafter {"
162 "\btxfallbacklanguage}" *
163 write$ newline$
164 }
165 if$
166 "nolanguage" 'language.state :=
167 }
168 {
169 language.state language =
170 'skip$
171 {
172 "\btxselectlanguage {" language * "}" *
173 write$ newline$
174 }
175 if$
176 language 'language.state :=
177 }
178 if$
179 "\bibitem {" write$
180 cite$ write$
181 "}" write$
182 newline$
183 ""
184 before.all 'output.state :=
185 }
186
187 FUNCTION {output.isbn}
188 {
189 'isbn.command :=
190 duplicate$
191 empty$
192 'pop$
193 {
194 's :=
195 output.state mid.sentence =
196 {
197 isbn.command * " {, " * write$
198 s "}" *
199 }
200 { output.state after.block =
201 {
202 add.period$
203 write$
204 newline$
205 "\newblock " write$
206 isbn.command " {" * s * ".}" *
207 }
208 { output.state before.all =
209 {
210 write$
211 isbn.command " {" * write$
212 s "}" *
213 }
214 {
215 output.state before.title =
216 {
217 "\btxauthorcolon\ " * write$
218 isbn.command " {" * write$
219 s "}" *
220 }
221 {
222 add.period$ " " * write$
223 isbn.command " {" * write$
224 s ".}" *
225 }
226 if$
227 }
228 if$
229 }
230 if$
231 mid.sentence 'output.state :=
232 }
233 if$
234 }
235 if$
236 }
237
238 FUNCTION {fin.entry}
239 { add.period$
240 write$
241 newline$
242 }
243
244 FUNCTION {new.block}
245 { output.state before.all =
246 'skip$
247 { after.block 'output.state := }
248 if$
249 }
250
251 FUNCTION {new.sentence}
252 { output.state after.block =
253 'skip$
254 { output.state before.all =
255 'skip$
256 { after.sentence 'output.state := }
257 if$
258 }
259 if$
260 }
261
262 FUNCTION {after.authors}
263 { output.state before.all =
264 'skip$
265 { before.title 'output.state := }
266 if$
267 }
268
269 FUNCTION {new.block.checka}
270 { empty$
271 'skip$
272 'new.block
273 if$
274 }
275
276 FUNCTION {new.block.checkb}
277 { empty$
278 swap$ empty$
279 and
280 'skip$
281 'new.block
282 if$
283 }
284
285 FUNCTION {new.block.checkc}
286 { empty$
287 swap$ empty$
288 and
289 'skip$
290 'after.authors
291 if$
292 }
293
294 FUNCTION {new.sentence.checka}
295 { empty$
296 'skip$
297 'new.sentence
298 if$
299 }
300
301 FUNCTION {new.sentence.checkb}
302 { empty$
303 swap$ empty$
304 and
305 'skip$
306 'new.sentence
307 if$
308 }
309
310 FUNCTION {field.or.null}
311 { duplicate$ empty$
312 { pop$ "" }
313 'skip$
314 if$
315 }
316
317 FUNCTION {namefont}
318 { duplicate$ empty$
319 { pop$ "" }
320 { "\btxnamefont {" swap$ * "}" * }
321 if$
322 }
323
324 FUNCTION {lastnamefont}
325 { duplicate$ empty$
326 { pop$ "" }
327 { "\btxlastnamefont {" swap$ * "}" * }
328 if$
329 }
330 FUNCTION {titlefont}
331 { duplicate$ empty$
332 { pop$ "" }
333 { "\btxtitlefont {" swap$ * "}" * }
334 if$
335 }
336 FUNCTION {jtitlefont}
337 { duplicate$ empty$
338 { pop$ "" }
339 { "\btxjtitlefont {" swap$ * "}" * }
340 if$
341 }
342 FUNCTION {journalfont}
343 { duplicate$ empty$
344 { pop$ "" }
345 { "\btxjournalfont {" swap$ * "}" * }
346 if$
347 }
348 FUNCTION {publisherfont}
349 { duplicate$ empty$
350 { pop$ "" }
351 { "\btxpublisherfont {" swap$ * "}" * }
352 if$
353 }
354 FUNCTION {volumefont}
355 { duplicate$ empty$
356 { pop$ "" }
357 { "\btxvolumefont {" swap$ * "}" * }
358 if$
359 }
360
361 FUNCTION {etalfont}
362 { duplicate$ empty$
363 { pop$ "" }
364 { "\btxetalfont {" swap$ * "}" * }
365 if$
366 }
367
368 INTEGERS { nameptr namesleft numnames }
369
370 FUNCTION {format.names}
371 { 's :=
372 #1 'nameptr :=
373 s num.names$ 'numnames :=
374 numnames 'namesleft :=
375 { namesleft #0 > }
376 { nameptr #1 >
377 {
378 s nameptr
379 "{f{.\btxfnamespaceshort }.~}{vv~}" format.name$
380 s nameptr "{ll}" format.name$ lastnamefont *
381 s nameptr "{,~jj}" format.name$ *
382 't :=
383 namesleft #2 >
384 { " " "\btxetalshort {.}" etalfont * *
385 #1 'namesleft := }
386 {
387 namesleft #1 >
388 { ", " * t namefont * }
389 { numnames #2 >
390 { "\btxandcomma {}" * }
391 'skip$
392 if$
393 s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" =
394 { " " "\btxetalshort {.}" etalfont * * }
395 { " \btxandshort {.}\ " * t namefont * }
396 if$
397 }
398 if$
399 }
400 if$
401 }
402 {
403 s nameptr "{ll}" format.name$ lastnamefont
404 s nameptr "{,~jj}{,~f{.\btxfnamespaceshort }.}{~vv}"
405 format.name$ * namefont
406 }
407 if$
408 nameptr #1 + 'nameptr :=
409 namesleft #1 - 'namesleft :=
410 }
411 while$
412 }
413
414 FUNCTION {format.authors}
415 { author empty$
416 { "" }
417 { author format.names }
418 if$
419 }
420
421 FUNCTION {format.editors}
422 { editor empty$
423 { "" }
424 { editor format.names
425 editor num.names$ #1 >
426 { "\ (\btxeditorsshort {.})" * }
427 { "\ (\btxeditorshort {.})" * }
428 if$
429 }
430 if$
431 }
432 FUNCTION {format.title}
433 { title empty$
434 { "" }
435 { title "t" language.change.case titlefont }
436 if$
437 }
438 FUNCTION {format.jtitle}
439 { title empty$
440 { "" }
441 { title "t" language.change.case jtitlefont }
442 if$
443 }
444 FUNCTION {n.dashify}
445 { 't :=
446 ""
447 { t empty$ not }
448 { t #1 #1 substring$ "-" =
449 { t #1 #2 substring$ "--" = not
450 { "--" *
451 t #2 global.max$ substring$ 't :=
452 }
453 { { t #1 #1 substring$ "-" = }
454 { "-" *
455 t #2 global.max$ substring$ 't :=
456 }
457 while$
458 }
459 if$
460 }
461 { t #1 #1 substring$ *
462 t #2 global.max$ substring$ 't :=
463 }
464 if$
465 }
466 while$
467 }
468
469 FUNCTION {format.date}
470 { year empty$
471 { month empty$
472 { "" }
473 { "there's a month but no year in " cite$ * warning$
474 month
475 }
476 if$
477 }
478 { month empty$
479 'year
480 { "\btxprintmonthyear{.}{"
481 month * "}{" * year * "}{short}" *
482 }
483 if$
484 }
485 if$
486 }
487
488 FUNCTION {format.btitle}
489 { title titlefont
490 }
491
492 FUNCTION {tie.or.space.connect}
493 { duplicate$ text.length$ #3 <
494 { "~" }
495 { "\ " }
496 if$
497 swap$ * *
498 }
499
500 FUNCTION {volume.tie.or.space.connect}
501 { duplicate$ text.length$ #3 <
502 { "~" }
503 { "\ " }
504 if$
505 swap$ volumefont * *
506 }
507
508 FUNCTION {either.or.check}
509 { empty$
510 'pop$
511 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
512 if$
513 }
514
515 FUNCTION {format.bvolume}
516 { volume empty$
517 { "" }
518 { output.state after.block =
519 { "\Btxvolumeshort {.}" }
520 { "\btxvolumeshort {.}" }
521 if$
522 volume volume.tie.or.space.connect
523 series empty$
524 'skip$
525 { " \btxofseriesshort {.}\ " * series titlefont * }
526 if$
527 "volume and number" number either.or.check
528 }
529 if$
530 }
531
532 FUNCTION {format.number.series}
533 { volume empty$
534 { number empty$
535 { series field.or.null }
536 { output.state mid.sentence =
537 { "\btxnumbershort {.}" }
538 { "\Btxnumbershort {.}" }
539 if$
540 number tie.or.space.connect
541 series empty$
542 { "there's a number but no series in " cite$ * warning$ }
543 { " \btxinseriesshort {.}\ " * series titlefont * }
544 if$
545 }
546 if$
547 }
548 { "" }
549 if$
550 }
551
552 FUNCTION {format.edition}
553 { edition empty$
554 { "" }
555 {
556 output.state mid.sentence =
557 { edition "l" change.case$ }
558 { edition "t" change.case$ }
559 if$
560 "\btxeditionnumshort {" swap$ *
561 "}{.}" *
562 }
563 if$
564 }
565
566 FUNCTION {format.isbn}
567 { isbn empty$
568 { "" }
569 { "\mbox{\btxISBN~\btxISBNfont {" isbn * "}}" * }
570 if$
571 }
572
573 FUNCTION {format.issn}
574 { issn empty$
575 { "" }
576 { "\mbox{\btxISSN~\btxISSNfont {" issn * "}}" * }
577 if$
578 }
579 FUNCTION {format.url}
580 { url empty$
581 { "" }
582 {
583 urldate empty$
584 { "{\latintext \btxurlfont{" url * "}}" * }
585 {
586 "{\latintext \btxurlfont{" url * "}}\empty " *
587 "\btxurldatecomment {\btxkeywordlanguage {\btxurldatefont{" *
588 urldate * "}}}" *
589 }
590 if$
591 }
592 if$
593 }
594 FUNCTION {write.annote}
595 { annote empty$
596 'skip$
597 {
598 annotelanguage empty$
599 { "\btxkeywordlanguage {" }
600 { "{\selectlanguage {" annotelanguage * "}" * }
601 if$
602 "\btxannotation {" * annote * "}}" *
603 write$ newline$
604 }
605 if$
606 }
607 INTEGERS { multiresult }
608
609 FUNCTION {multi.page.check}
610 { 't :=
611 #0 'multiresult :=
612 { multiresult not
613 t empty$ not
614 and
615 }
616 { t #1 #1 substring$
617 duplicate$ "-" =
618 swap$ duplicate$ "," =
619 swap$ "+" =
620 or or
621 { #1 'multiresult := }
622 { t #2 global.max$ substring$ 't := }
623 if$
624 }
625 while$
626 multiresult
627 }
628
629 FUNCTION {format.pages}
630 { pages empty$
631 { "" }
632 { pages multi.page.check
633 { "\btxpagesshort {.}" pages n.dashify tie.or.space.connect }
634 { "\btxpageshort {.}" pages tie.or.space.connect }
635 if$
636 }
637 if$
638 }
639
640 FUNCTION {format.vol.num.pages}
641 { volume field.or.null
642 number empty$
643 'skip$
644 { "(" number * ")" * *
645 volume empty$
646 { "there's a number but no volume in " cite$ * warning$ }
647 'skip$
648 if$
649 }
650 if$
651 pages empty$
652 'skip$
653 { duplicate$ empty$
654 { pop$ format.pages }
655 { ":" * pages n.dashify * }
656 if$
657 }
658 if$
659 }
660
661 FUNCTION {format.chapter.pages}
662 { chapter empty$
663 'format.pages
664 { type empty$
665 { "\btxchaptershort {.}" }
666 { type "l" language.change.case }
667 if$
668 chapter tie.or.space.connect
669 pages empty$
670 'skip$
671 { ", " * format.pages * }
672 if$
673 }
674 if$
675 }
676
677 FUNCTION {format.in.ed.booktitle}
678 { booktitle empty$
679 { "" }
680 { editor empty$
681 { "\Btxinshort {.}\ " booktitle titlefont * }
682 { "\Btxinshort {.}\ " format.editors * ": " * booktitle titlefont * }
683 if$
684 }
685 if$
686 }
687
688 FUNCTION {empty.misc.check}
689 { author empty$ title empty$ howpublished empty$
690 month empty$ year empty$ note empty$
691 and and and and and
692 key empty$ not and
693 { "all relevant fields are empty in " cite$ * warning$ }
694 'skip$
695 if$
696 }
697
698 FUNCTION {format.thesis.type}
699 { type empty$
700 'skip$
701 { pop$
702 type "t" language.change.case
703 }
704 if$
705 }
706
707 FUNCTION {format.tr.number}
708 {
709 number empty$
710 {
711 type empty$
712 { "\btxtechrepshort {.}" }
713 { type "t" language.change.case }
714 if$
715 }
716 {
717 type empty$
718 { "\Btxtechrepshort {.}" }
719 { type "t" language.change.case }
720 if$
721 number tie.or.space.connect
722 }
723 if$
724 }
725
726 FUNCTION {format.article.crossref}
727 { key empty$
728 { journal empty$
729 { "need key or journal for " cite$ * " to crossref " * crossref *
730 warning$
731 ""
732 }
733 { "\Btxinshort {.}\ " journal titlefont * }
734 if$
735 }
736 { "\Btxinshort {.}\ " key titlefont * }
737 if$
738 " \cite{" * crossref * "}" *
739 }
740
741 FUNCTION {format.crossref.editor}
742 {
743 editor #1 "{ll}{,~jj}{,~f.}{~vv}" format.name$ namefont
744 editor num.names$ duplicate$
745 #2 >
746 { pop$ " " "\btxetalshort {.}" etalfont * * }
747 { #2 <
748 'skip$
749 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
750 { " " "\btxetalshort {.}" etalfont * * }
751 { " \btxandshort {.}\ " * editor #2 "{vv~}{ll}"
752 format.name$ namefont * }
753 if$
754 }
755 if$
756 }
757 if$
758 }
759
760 FUNCTION {format.book.crossref}
761 { volume empty$
762 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
763 "\Btxinshort {.}\ "
764 }
765 { "\Btxvolumeshort {.}" volume volume.tie.or.space.connect
766 " \btxofseriesshort {.}\ " *
767 }
768 if$
769 editor empty$
770 editor field.or.null author field.or.null =
771 or
772 { key empty$
773 { series empty$
774 { "need editor, key, or series for " cite$ * " to crossref " *
775 crossref * warning$
776 "" *
777 }
778 { series titlefont * }
779 if$
780 }
781 { key titlefont * }
782 if$
783 }
784 { format.crossref.editor * }
785 if$
786 " \cite{" * crossref * "}" *
787 }
788
789 FUNCTION {format.incoll.inproc.crossref}
790 { editor empty$
791 editor field.or.null author field.or.null =
792 or
793 { key empty$
794 { booktitle empty$
795 { "need editor, key, or booktitle for " cite$ * " to crossref " *
796 crossref * warning$
797 ""
798 }
799 { "\Btxinshort {.}\ " booktitle titlefont * }
800 if$
801 }
802 { "\Btxinshort {.}\ " key titlefont * }
803 if$
804 }
805 { "\Btxinshort {.}\ " format.crossref.editor * }
806 if$
807 " \cite{" * crossref * "}" *
808 }
809
810 FUNCTION {article}
811 { output.bibitem
812 format.authors "author" output.check
813 after.authors
814 format.jtitle "title" output.check
815 new.block
816 crossref missing$
817 { journal
818 title missing$
819 { titlefont }
820 { journalfont }
821 if$
822 "journal" output.check
823 format.vol.num.pages output
824 format.date "year" output.check
825 }
826 { format.article.crossref output.nonnull
827 format.pages output
828 }
829 if$
830 format.issn "\ifbtxprintISSN" output.isbn
831 new.block
832 format.url output
833 note output
834 fin.entry
835 write.annote
836 }
837
838 FUNCTION {book}
839 { output.bibitem
840 author empty$
841 { format.editors "author and editor" output.check }
842 { format.authors output.nonnull
843 crossref missing$
844 { "author and editor" editor either.or.check }
845 'skip$
846 if$
847 }
848 if$
849 after.authors
850 format.btitle "title" output.check
851 crossref missing$
852 { format.bvolume output
853 new.block
854 format.number.series output
855 new.sentence
856 publisher "publisher" output.check publisherfont
857 address output
858 }
859 { new.block
860 format.book.crossref output.nonnull
861 }
862 if$
863 format.edition output
864 format.date "year" output.check
865 format.isbn "\ifbtxprintISBN" output.isbn
866 new.block
867 format.url output
868 note output
869 fin.entry
870 write.annote
871 }
872
873 FUNCTION {booklet}
874 { output.bibitem
875 format.authors output
876 after.authors
877 format.title "title" output.check
878 howpublished address new.block.checkb
879 howpublished output
880 address output
881 format.date output
882 new.block
883 format.url output
884 note output
885 fin.entry
886 write.annote
887 }
888
889 FUNCTION {inbook}
890 { output.bibitem
891 author empty$
892 { format.editors "author and editor" output.check }
893 { format.authors output.nonnull
894 crossref missing$
895 { "author and editor" editor either.or.check }
896 'skip$
897 if$
898 }
899 if$
900 after.authors
901 format.btitle "title" output.check
902 crossref missing$
903 { format.bvolume output
904 format.chapter.pages "chapter and pages" output.check
905 new.block
906 format.number.series output
907 new.sentence
908 publisher "publisher" output.check publisherfont
909 address output
910 }
911 { format.chapter.pages "chapter and pages" output.check
912 new.block
913 format.book.crossref output.nonnull
914 }
915 if$
916 format.edition output
917 format.date "year" output.check
918 format.isbn "\ifbtxprintISBN" output.isbn
919 new.block
920 format.url output
921 note output
922 fin.entry
923 write.annote
924 }
925
926 FUNCTION {incollection}
927 { output.bibitem
928 format.authors "author" output.check
929 after.authors
930 format.title "title" output.check
931 new.block
932 crossref missing$
933 { format.in.ed.booktitle "booktitle" output.check
934 format.bvolume output
935 format.number.series output
936 format.chapter.pages output
937 new.sentence
938 publisher "publisher" output.check publisherfont
939 address output
940 format.edition output
941 format.date "year" output.check
942 }
943 { format.incoll.inproc.crossref output.nonnull
944 format.chapter.pages output
945 }
946 if$
947 format.isbn "\ifbtxprintISBN" output.isbn
948 new.block
949 format.url output
950 note output
951 fin.entry
952 write.annote
953 }
954
955 FUNCTION {inproceedings}
956 { output.bibitem
957 format.authors "author" output.check
958 after.authors
959 format.title "title" output.check
960 new.block
961 crossref missing$
962 { format.in.ed.booktitle "booktitle" output.check
963 format.bvolume output
964 format.number.series output
965 format.pages output
966 address empty$
967 { organization publisher new.sentence.checkb
968 organization output
969 publisher publisherfont output
970 format.date "year" output.check
971 }
972 { address output.nonnull
973 format.date "year" output.check
974 new.sentence
975 organization output
976 publisher publisherfont output
977 }
978 if$
979 }
980 { format.incoll.inproc.crossref output.nonnull
981 format.pages output
982 }
983 if$
984 format.isbn "\ifbtxprintISBN" output.isbn
985 new.block
986 format.url output
987 note output
988 fin.entry
989 write.annote
990 }
991
992 FUNCTION {conference} { inproceedings }
993
994 FUNCTION {manual}
995 { output.bibitem
996 author empty$
997 { organization empty$
998 'skip$
999 { organization output.nonnull
1000 address output
1001 }
1002 if$
1003 }
1004 { format.authors output.nonnull }
1005 if$
1006 after.authors
1007 format.btitle "title" output.check
1008 author empty$
1009 { organization empty$
1010 { address new.block.checka
1011 address output
1012 }
1013 'skip$
1014 if$
1015 }
1016 { organization address new.block.checkb
1017 organization output
1018 address output
1019 }
1020 if$
1021 format.edition output
1022 format.date output
1023 format.isbn "\ifbtxprintISBN" output.isbn
1024 new.block
1025 format.url output
1026 note output
1027 fin.entry
1028 write.annote
1029 }
1030
1031 FUNCTION {mastersthesis}
1032 { output.bibitem
1033 format.authors "author" output.check
1034 after.authors
1035 format.title "title" output.check
1036 new.block
1037 "\btxmastthesis {}" format.thesis.type output.nonnull
1038 school "school" output.check
1039 address output
1040 format.date "year" output.check
1041 new.block
1042 format.url output
1043 note output
1044 fin.entry
1045 write.annote
1046 }
1047
1048 FUNCTION {misc}
1049 { output.bibitem
1050 format.authors output
1051 title howpublished new.block.checkc
1052 format.title output
1053 howpublished new.block.checka
1054 howpublished output
1055 format.date output
1056 format.isbn "\ifbtxprintISBN" output.isbn
1057 new.block
1058 format.issn "\ifbtxprintISSN" output.isbn
1059 new.block
1060 format.url output
1061 note output
1062 fin.entry
1063 write.annote
1064 empty.misc.check
1065 }
1066
1067 FUNCTION {phdthesis}
1068 { output.bibitem
1069 format.authors "author" output.check
1070 after.authors
1071 format.btitle "title" output.check
1072 new.block
1073 "\btxphdthesis {}" format.thesis.type output.nonnull
1074 school "school" output.check
1075 address output
1076 format.date "year" output.check
1077 format.isbn "\ifbtxprintISBN" output.isbn
1078 new.block
1079 format.url output
1080 note output
1081 fin.entry
1082 write.annote
1083 }
1084
1085 FUNCTION {proceedings}
1086 { output.bibitem
1087 editor empty$
1088 { organization output }
1089 { format.editors output.nonnull }
1090 if$
1091 after.authors
1092 format.btitle "title" output.check
1093 format.bvolume output
1094 format.number.series output
1095 address empty$
1096 { editor empty$
1097 { publisher new.sentence.checka }
1098 { organization publisher new.sentence.checkb
1099 organization output
1100 }
1101 if$
1102 publisher publisherfont output
1103 format.date "year" output.check
1104 }
1105 { address output.nonnull
1106 format.date "year" output.check
1107 new.sentence
1108 editor empty$
1109 'skip$
1110 { organization output }
1111 if$
1112 publisher publisherfont output
1113 }
1114 if$
1115 format.isbn "\ifbtxprintISBN" output.isbn
1116 new.block
1117 format.url output
1118 note output
1119 fin.entry
1120 write.annote
1121 }
1122
1123 FUNCTION {techreport}
1124 { output.bibitem
1125 format.authors "author" output.check
1126 after.authors
1127 format.title "title" output.check
1128 new.block
1129 format.tr.number output.nonnull
1130 institution "institution" output.check
1131 address output
1132 format.date "year" output.check
1133 format.isbn "\ifbtxprintISBN" output.isbn
1134 new.block
1135 format.url output
1136 note output
1137 fin.entry
1138 write.annote
1139 }
1140
1141 FUNCTION {unpublished}
1142 { output.bibitem
1143 format.authors "author" output.check
1144 after.authors
1145 format.title "title" output.check
1146 new.block
1147 format.url output
1148 note "note" output.check
1149 format.date output
1150 fin.entry
1151 write.annote
1152 }
1153
1154 FUNCTION {default.type} { misc }
1155
1156 MACRO {jan} {"1"}
1157 MACRO {feb} {"2"}
1158 MACRO {mar} {"3"}
1159 MACRO {apr} {"4"}
1160 MACRO {may} {"5"}
1161 MACRO {jun} {"6"}
1162 MACRO {jul} {"7"}
1163 MACRO {aug} {"8"}
1164 MACRO {sep} {"9"}
1165 MACRO {oct} {"10"}
1166 MACRO {nov} {"11"}
1167 MACRO {dec} {"12"}
1168 MACRO {acmcs} {"ACM Comput.\ Surv.{}"}
1169 MACRO {acta} {"Acta Inf.{}"}
1170 MACRO {cacm} {"Commun. ACM"}
1171 MACRO {ibmjrd} {"IBM J.~Res.\ Dev.{}"}
1172 MACRO {ibmsj} {"IBM Syst.~J.{}"}
1173 MACRO {ieeese} {"IEEE Trans.\ Softw.\ Eng.{}"}
1174 MACRO {ieeetc} {"IEEE Trans.\ Comput.{}"}
1175 MACRO {ieeetcad}
1176 {"IEEE Trans.\ Comput.-Aided Design Integrated Circuits"}
1177 MACRO {ipl} {"Inf.\ Process.\ Lett.{}"}
1178 MACRO {jacm} {"J.~ACM"}
1179 MACRO {jcss} {"J.~Comput.\ Syst.\ Sci.{}"}
1180 MACRO {scp} {"Sci.\ Comput.\ Programming"}
1181 MACRO {sicomp} {"SIAM J.~Comput.{}"}
1182 MACRO {tocs} {"ACM Trans.\ Comput.\ Syst.{}"}
1183 MACRO {tods} {"ACM Trans.\ Database Syst.{}"}
1184 MACRO {tog} {"ACM Trans.\ Gr.{}"}
1185 MACRO {toms} {"ACM Trans.\ Math.\ Softw.{}"}
1186 MACRO {toois} {"ACM Trans.\ Office Inf.\ Syst.{}"}
1187 MACRO {toplas} {"ACM Trans.\ Prog.\ Lang.\ Syst.{}"}
1188 MACRO {tcs} {"Theoretical Comput.\ Sci.{}"}
1189
1190 READ
1191
1192 FUNCTION {sortify}
1193 { purify$
1194 "l" change.case$
1195 }
1196
1197 INTEGERS { len }
1198
1199 FUNCTION {chop.word}
1200 { 's :=
1201 'len :=
1202 s #1 len substring$ =
1203 { s len #1 + global.max$ substring$ }
1204 's
1205 if$
1206 }
1207
1208 FUNCTION {sort.format.names}
1209 { 's :=
1210 #1 'nameptr :=
1211 ""
1212 s num.names$ 'numnames :=
1213 numnames 'namesleft :=
1214 { namesleft #0 > }
1215 { nameptr #1 >
1216 { " " * }
1217 'skip$
1218 if$
1219 s nameptr "{ll{ }}{ f{ }}{vv{ } }{ jj{ }}" format.name$ 't :=
1220 nameptr numnames = t "others" = and
1221 { "et al" * }
1222 { t sortify * }
1223 if$
1224 nameptr #1 + 'nameptr :=
1225 namesleft #1 - 'namesleft :=
1226 }
1227 while$
1228 }
1229
1230 FUNCTION {sort.format.title}
1231 { 't :=
1232 "A " #2
1233 "An " #3
1234 "The " #4 t chop.word
1235 chop.word
1236 chop.word
1237 sortify
1238 #1 global.max$ substring$
1239 }
1240
1241 FUNCTION {author.sort}
1242 { author empty$
1243 { key empty$
1244 { "to sort, need author or key in " cite$ * warning$
1245 ""
1246 }
1247 { key sortify }
1248 if$
1249 }
1250 { author sort.format.names }
1251 if$
1252 }
1253
1254 FUNCTION {author.editor.sort}
1255 { author empty$
1256 { editor empty$
1257 { key empty$
1258 { "to sort, need author, editor, or key in " cite$ * warning$
1259 ""
1260 }
1261 { key sortify }
1262 if$
1263 }
1264 { editor sort.format.names }
1265 if$
1266 }
1267 { author sort.format.names }
1268 if$
1269 }
1270
1271 FUNCTION {author.organization.sort}
1272 { author empty$
1273 { organization empty$
1274 { key empty$
1275 { "to sort, need author, organization, or key in " cite$ * warning$
1276 ""
1277 }
1278 { key sortify }
1279 if$
1280 }
1281 { "The " #4 organization chop.word sortify }
1282 if$
1283 }
1284 { author sort.format.names }
1285 if$
1286 }
1287
1288 FUNCTION {editor.organization.sort}
1289 { editor empty$
1290 { organization empty$
1291 { key empty$
1292 { "to sort, need editor, organization, or key in " cite$ * warning$
1293 ""
1294 }
1295 { key sortify }
1296 if$
1297 }
1298 { "The " #4 organization chop.word sortify }
1299 if$
1300 }
1301 { editor sort.format.names }
1302 if$
1303 }
1304
1305 FUNCTION {presort}
1306 {
1307 type$ "book" =
1308 type$ "inbook" =
1309 or
1310 'author.editor.sort
1311 { type$ "proceedings" =
1312 'editor.organization.sort
1313 { type$ "manual" =
1314 'author.organization.sort
1315 'author.sort
1316 if$
1317 }
1318 if$
1319 }
1320 if$
1321 " "
1322 *
1323 year field.or.null sortify
1324 *
1325 " "
1326 *
1327 title field.or.null
1328 sort.format.title
1329 *
1330 #1 entry.max$ substring$
1331 'sort.key$ :=
1332 }
1333
1334 ITERATE {presort}
1335
1336 SORT
1337
1338 STRINGS { longest.label }
1339
1340 INTEGERS { number.label longest.label.width }
1341
1342 FUNCTION {initialize.longest.label}
1343 { "" 'longest.label :=
1344 #1 'number.label :=
1345 #0 'longest.label.width :=
1346 }
1347
1348 FUNCTION {longest.label.pass}
1349 { number.label int.to.str$ 'label :=
1350 number.label #1 + 'number.label :=
1351 label width$ longest.label.width >
1352 { label 'longest.label :=
1353 label width$ 'longest.label.width :=
1354 }
1355 'skip$
1356 if$
1357 }
1358
1359 EXECUTE {initialize.longest.label}
1360
1361 ITERATE {longest.label.pass}
1362
1363 FUNCTION {begin.bib}
1364 {
1365 preamble$ empty$
1366 'skip$
1367 { preamble$ write$ newline$ }
1368 if$
1369 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1370 " \providebibliographyfont{name}{}%" write$ newline$
1371 " \providebibliographyfont{lastname}{}%" write$ newline$
1372 " \providebibliographyfont{title}{\emph}%" write$ newline$
1373 " \providebibliographyfont{jtitle}{\btxtitlefont}%" write$ newline$
1374 " \providebibliographyfont{etal}{\emph}%" write$ newline$
1375 " \providebibliographyfont{journal}{}%" write$ newline$
1376 " \providebibliographyfont{volume}{}%" write$ newline$
1377 " \providebibliographyfont{ISBN}{\MakeUppercase}%" write$ newline$
1378 " \providebibliographyfont{ISSN}{\MakeUppercase}%" write$ newline$
1379 " \providebibliographyfont{url}{\url}%" write$ newline$
1380 " \providebibliographyfont{numeral}{}%" write$ newline$
1381 " \expandafter\btxselectlanguage\expandafter {\btxfallbacklanguage}"
1382 write$ newline$
1383 }
1384
1385 EXECUTE {begin.bib}
1386
1387 EXECUTE {init.state.consts}
1388
1389 ITERATE {call.type$}
1390
1391 FUNCTION {end.bib}
1392 { newline$
1393 "\end{thebibliography}" write$ newline$
1394 }
1395
1396 EXECUTE {end.bib}
1397