Debian Codegraph @

texmf-dist/bibtex/bst/tugboat/ltugbib.bst

raw
1 % $Id: ltugbib.bst 66 2010-11-23 16:33:37Z karl $
2 % This is the file `ltugbib.bst', used by the harvardcite option
3 % to the ltug* LaTeX classes.
4 %
5 % \iffalse (this is a meta-comment (so they say))
6 % Copyright 1995,1996,1997,1998,2000,2004,2006,2007,2009 TeX Users Group.
7 %
8 % It may be distributed and/or modified under the
9 % conditions of the LaTeX Project Public License, either version 1.3
10 % of this license or (at your option) any later version.
11 % The latest version of this license is in
12 % http://www.latex-project.org/lppl.txt
13 % and version 1.3 or later is part of all distributions of LaTeX
14 % version 2003/12/01 or later.
15 %
16 % This file has the LPPL maintenance status "maintained".
17 %
18 % The Current Maintainer of this work is the TeX Users Group
19 % (http://tug.org/TUGboat).
20 %
21 % The list of all files belonging to this package is given in the file
22 % `manifest.txt'.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 % \fi
28 %
29 % 7-Jun-04: (all related code marked OP) handle a title ending in, e.g., a
30 % question-mark; otherwise the same as the (CTAN-time) 9-Apr-02 version:
31 %
32 % This file used to be generated from tugboat.dtx, but is now distributed
33 % as a stand-alone file.
34 %
35 ENTRY
36 { address
37 author
38 booktitle
39 chapter
40 edition
41 editor
42 howpublished
43 institution
44 journal
45 key
46 month
47 note
48 number
49 organization
50 pages
51 publisher
52 school
53 series
54 title
55 type
56 volume
57 year
58 }
59 {}
60 { label extra.label sort.label long.label short.label }
61
62 INTEGERS { output.state before.all mid.sentence after.sentence after.block
63 suppress.period } % OP: after quoted title (trivalued)
64
65 FUNCTION {init.state.consts}
66 { #0 'before.all :=
67 #1 'mid.sentence :=
68 #2 'after.sentence :=
69 #3 'after.block :=
70 #0 'suppress.period := % OP: initialize to FALSE
71 }
72
73 STRINGS { s t }
74
75 FUNCTION {output.nonnull}
76 { 's :=
77 output.state mid.sentence =
78 { ", " * write$ }
79 { output.state after.block =
80 { suppress.period #2 = % OP: check for suppression this time
81 { #0 'suppress.period := } % suppress, reset to FALSE
82 'add.period$
83 if$
84 write$
85 newline$
86 "\newblock " write$
87 }
88 { output.state before.all =
89 'write$
90 { add.period$ " " * write$ }
91 if$
92 }
93 if$
94 mid.sentence 'output.state :=
95 }
96 if$
97 s
98 }
99
100 FUNCTION {output}
101 { duplicate$ empty$
102 'pop$
103 'output.nonnull
104 if$
105 }
106
107 FUNCTION {output.check}
108 { 't :=
109 duplicate$ empty$
110 { pop$ "empty " t * " in " * cite$ * warning$ }
111 'output.nonnull
112 if$
113 }
114
115 FUNCTION {output.bibitem}
116 { newline$
117 "\bibitem[" write$
118 "\protect\citeauthoryear{" long.label * "}{" * write$
119 short.label write$
120 "}{" year duplicate$ empty$
121 { pop$ "????" }
122 'skip$
123 if$
124 * extra.label * "}]{" * write$
125 cite$ write$
126 "}" write$
127 newline$
128 ""
129 before.all 'output.state :=
130 }
131
132 FUNCTION {fin.entry}
133 { add.period$
134 write$
135 newline$
136 }
137
138 FUNCTION {new.block}
139 { output.state before.all =
140 'skip$
141 { after.block 'output.state := }
142 if$
143 suppress.period #1 = % OP: check to suppress period
144 { #2 'suppress.period := } % for current (1st) output
145 'skip$
146 if$
147 }
148
149 FUNCTION {new.sentence}
150 { output.state after.block =
151 'skip$
152 { output.state before.all =
153 'skip$
154 { after.sentence 'output.state := }
155 if$
156 }
157 if$
158 }
159
160 FUNCTION {not}
161 { { #0 }
162 { #1 }
163 if$
164 }
165
166 FUNCTION {and}
167 { 'skip$
168 { pop$ #0 }
169 if$
170 }
171
172 FUNCTION {or}
173 { { pop$ #1 }
174 'skip$
175 if$
176 }
177
178 FUNCTION {new.block.checkb}
179 { empty$
180 swap$ empty$
181 and
182 'skip$
183 'new.block
184 if$
185 }
186
187 FUNCTION {field.or.null}
188 { duplicate$ empty$
189 { pop$ "" }
190 'skip$
191 if$
192 }
193
194 FUNCTION {emphasize}
195 { duplicate$ empty$
196 { pop$ "" }
197 { "{\em " swap$ * "}" * }
198 if$
199 }
200
201 FUNCTION {bolden}
202 { duplicate$ empty$
203 { pop$ "" }
204 { "{\bf " swap$ * "}" * }
205 if$
206 }
207 INTEGERS { nameptr namesleft numnames }
208
209 FUNCTION {format.names}
210 { 's :=
211 #1 'nameptr :=
212 s num.names$ 'numnames :=
213 numnames 'namesleft :=
214 { namesleft #0 > }
215 { s nameptr
216 nameptr #1 =
217 { "{vv~}{ll}{, jj}{, ff}" format.name$ }
218 { "{f.~}{vv~}{ll}{, jj}" format.name$ }
219 if$
220 't :=
221 nameptr #1 >
222 {
223 namesleft #1 >
224 { ", " * t * }
225 {
226 numnames #1 >
227 { "," * }
228 'skip$
229 if$
230 t "others" =
231 { " \etal{}" * }
232 { " and " * t * }
233 if$
234 }
235 if$
236 }
237 't
238 if$
239 nameptr #1 + 'nameptr :=
240 namesleft #1 - 'namesleft :=
241 }
242 while$
243 }
244
245 FUNCTION {format.names.ed}
246 { 's :=
247 #1 'nameptr :=
248 s num.names$ 'numnames :=
249 numnames 'namesleft :=
250 { namesleft #0 > }
251 { s nameptr
252 "{f.~}{vv~}{ll}{, jj}"
253 format.name$ 't :=
254 nameptr #1 >
255 {
256 namesleft #1 >
257 { ", " * t * }
258 {
259 numnames #2 >
260 { "," * }
261 'skip$
262 if$
263 t "others" =
264 { " \etal{}" * }
265 { " and " * t * }
266 if$
267 }
268 if$
269 }
270 't
271 if$
272 nameptr #1 + 'nameptr :=
273 namesleft #1 - 'namesleft :=
274 }
275 while$
276 }
277
278 FUNCTION {format.key}
279 { empty$
280 { key field.or.null }
281 { "" }
282 if$
283 }
284
285 FUNCTION {format.authors}
286 { author empty$
287 { "" }
288 { author format.names }
289 if$
290 }
291
292 FUNCTION {format.editors}
293 { editor empty$
294 { "" }
295 { editor format.names
296 editor num.names$ #1 >
297 { ", editors" * }
298 { ", editor" * }
299 if$
300 }
301 if$
302 }
303
304 FUNCTION {format.in.editors}
305 { editor empty$
306 { "" }
307 { editor format.names.ed
308 }
309 if$
310 }
311
312 FUNCTION {quote.period.spacing} % OP: reduce space between quotes and
313 { "\kern -.05em{}" % period; remove negative kern by
314 } % replacing this simply with ""
315
316 FUNCTION {format.title} % OP: a period follows the
317 { title empty$ % quotation marks in this style
318 { "" }
319 { title
320 "``" swap$ *
321 duplicate$ "''" * swap$ % OP: create the quoted title
322 duplicate$ add.period$ = % see if title needs period
323 { #1 'suppress.period := } % no: suppress next (2nd) output
324 { quote.period.spacing * } % yes: add desired spacing
325 if$
326 }
327 if$
328 }
329
330 FUNCTION {n.dashify}
331 { 't :=
332 ""
333 { t empty$ not }
334 { t #1 #1 substring$ "-" =
335 { t #1 #2 substring$ "--" = not
336 { "--" *
337 t #2 global.max$ substring$ 't :=
338 }
339 { { t #1 #1 substring$ "-" = }
340 { "-" *
341 t #2 global.max$ substring$ 't :=
342 }
343 while$
344 }
345 if$
346 }
347 { t #1 #1 substring$ *
348 t #2 global.max$ substring$ 't :=
349 }
350 if$
351 }
352 while$
353 }
354
355 FUNCTION {word.in}
356 { "In " }
357
358 FUNCTION {format.date}
359 { year duplicate$ empty$
360 { "empty year in " cite$ * "; set to ????" * warning$
361 pop$ "????" }
362 'skip$
363 if$
364 "\UseExtraLabel{" * extra.label * "}" *
365 }
366
367 FUNCTION {format.btitle}
368 { title emphasize
369 }
370
371 FUNCTION {tie.or.space.connect}
372 { duplicate$ text.length$ #3 <
373 { "~" }
374 { " " }
375 if$
376 swap$ * *
377 }
378
379 FUNCTION {either.or.check}
380 { empty$
381 'pop$
382 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
383 if$
384 }
385
386 FUNCTION {format.bvolume}
387 { volume empty$
388 { "" }
389 { "volume" volume tie.or.space.connect
390 series empty$
391 'skip$
392 { " of " * series emphasize * }
393 if$
394 "volume and number" number either.or.check
395 }
396 if$
397 }
398
399 FUNCTION {format.number.series}
400 { volume empty$
401 { number empty$
402 { series field.or.null }
403 { output.state mid.sentence =
404 { "number" }
405 { "Number" }
406 if$
407 number tie.or.space.connect
408 series empty$
409 { "there's a number but no series in " cite$ * warning$ }
410 { " in " * series * }
411 if$
412 }
413 if$
414 }
415 { "" }
416 if$
417 }
418
419 FUNCTION {format.edition}
420 { edition empty$
421 { "" }
422 { output.state mid.sentence =
423 { edition "l" change.case$ " edition" * }
424 { edition "t" change.case$ " edition" * }
425 if$
426 }
427 if$
428 }
429
430 INTEGERS { multiresult }
431
432 FUNCTION {multi.page.check}
433 { 't :=
434 #0 'multiresult :=
435 { multiresult not
436 t empty$ not
437 and
438 }
439 { t #1 #1 substring$
440 duplicate$ "-" =
441 swap$ duplicate$ "," =
442 swap$ "+" =
443 or or
444 { #1 'multiresult := }
445 { t #2 global.max$ substring$ 't := }
446 if$
447 }
448 while$
449 multiresult
450 }
451
452 FUNCTION {format.pages}
453 { pages empty$
454 { "" }
455 { pages multi.page.check
456 { "pages" pages n.dashify tie.or.space.connect }
457 { "page" pages tie.or.space.connect }
458 if$
459 }
460 if$
461 }
462
463 FUNCTION {format.vol.num.pages}
464 { volume field.or.null
465 bolden
466 number empty$
467 'skip$
468 { "(" number * ")" * *
469 volume empty$
470 { "there's a number but no volume in " cite$ * warning$ }
471 'skip$
472 if$
473 }
474 if$
475 pages empty$
476 'skip$
477 { duplicate$ empty$
478 { pop$ format.pages }
479 { ", " * pages n.dashify * }
480 if$
481 }
482 if$
483 }
484
485 FUNCTION {format.chapter.pages}
486 { chapter empty$
487 'format.pages
488 { type empty$
489 { "chapter" }
490 { type "l" change.case$ }
491 if$
492 chapter tie.or.space.connect
493 pages empty$
494 'skip$
495 { ", " * format.pages * }
496 if$
497 }
498 if$
499 }
500
501 FUNCTION {format.in.ed.booktitle}
502 { booktitle empty$
503 { "" }
504 { editor empty$
505 { word.in booktitle emphasize * }
506 { word.in booktitle emphasize * ", edited by " *
507 format.in.editors * }
508 if$
509 }
510 if$
511 }
512
513 FUNCTION {format.thesis.type}
514 { type empty$
515 'skip$
516 { pop$
517 type "t" change.case$
518 }
519 if$
520 }
521
522 FUNCTION {format.tr.number}
523 { type empty$
524 { "Technical Report" }
525 'type
526 if$
527 number empty$
528 { "t" change.case$ }
529 { number tie.or.space.connect }
530 if$
531 }
532
533 FUNCTION {format.article.crossref}
534 {
535 word.in
536 "\cite{" * crossref * "}" *
537 }
538
539 FUNCTION {format.book.crossref}
540 { volume empty$
541 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
542 word.in
543 }
544 { "Volume" volume tie.or.space.connect
545 " of " *
546 }
547 if$
548 "\cite{" * crossref * "}" *
549 }
550
551 FUNCTION {format.incoll.inproc.crossref}
552 {
553 word.in
554 "\cite{" * crossref * "}" *
555 }
556
557 FUNCTION {article}
558 { output.bibitem
559 format.authors "author" output.check
560 author format.key output
561 new.block
562 format.title "title" output.check
563 new.block
564 crossref missing$
565 { journal emphasize "journal" output.check
566 " " * before.all 'output.state := % OP: sic (preexisting kludge)
567 format.vol.num.pages output
568 format.date "year" output.check
569 }
570 { format.article.crossref output.nonnull
571 format.pages output
572 }
573 if$
574 new.block
575 note output
576 fin.entry
577 }
578
579 FUNCTION {book}
580 { output.bibitem
581 author empty$
582 { format.editors "author and editor" output.check
583 editor format.key output
584 }
585 { format.authors output.nonnull
586 crossref missing$
587 { "author and editor" editor either.or.check }
588 'skip$
589 if$
590 }
591 if$
592 new.block
593 format.btitle "title" output.check
594 crossref missing$
595 { format.bvolume output
596 new.block
597 format.number.series output
598 new.sentence
599 publisher "publisher" output.check
600 address output
601 }
602 {
603 new.block
604 format.book.crossref output.nonnull
605 }
606 if$
607 format.edition output
608 format.date "year" output.check
609 new.block
610 note output
611 fin.entry
612 }
613
614 FUNCTION {booklet}
615 { output.bibitem
616 format.authors output
617 author format.key output
618 new.block
619 format.title "title" output.check
620 new.block
621 howpublished output
622 address output
623 format.date "year" output.check
624 new.block
625 note output
626 fin.entry
627 }
628
629 FUNCTION {inbook}
630 { output.bibitem
631 author empty$
632 { format.editors "author and editor" output.check
633 editor format.key output
634 }
635 { format.authors output.nonnull
636 crossref missing$
637 { "author and editor" editor either.or.check }
638 'skip$
639 if$
640 }
641 if$
642 new.block
643 format.btitle "title" output.check
644 crossref missing$
645 { format.bvolume output
646 format.chapter.pages "chapter and pages" output.check
647 new.block
648 format.number.series output
649 new.sentence
650 publisher "publisher" output.check
651 address output
652 }
653 { format.chapter.pages "chapter and pages" output.check
654 new.block
655 format.book.crossref output.nonnull
656 }
657 if$
658 format.edition output
659 format.date "year" output.check
660 new.block
661 note output
662 fin.entry
663 }
664
665 FUNCTION {incollection}
666 { output.bibitem
667 format.authors "author" output.check
668 author format.key output
669 new.block
670 format.title "title" output.check
671 new.block
672 crossref missing$
673 { format.in.ed.booktitle "booktitle" output.check
674 format.bvolume output
675 format.number.series output
676 format.chapter.pages output
677 new.sentence
678 publisher "publisher" output.check
679 address output
680 format.edition output
681 format.date "year" output.check
682 }
683 { format.incoll.inproc.crossref output.nonnull
684 format.chapter.pages output
685 }
686 if$
687 new.block
688 note output
689 fin.entry
690 }
691
692 FUNCTION {inproceedings}
693 { output.bibitem
694 format.authors "author" output.check
695 author format.key output
696 new.block
697 format.title "title" output.check
698 new.block
699 crossref missing$
700 { format.in.ed.booktitle "booktitle" output.check
701 format.bvolume output
702 format.number.series output
703 format.pages output
704 address output
705 new.sentence
706 organization output
707 publisher output
708 format.date "year" output.check
709 }
710 { format.incoll.inproc.crossref output.nonnull
711 format.pages output
712 }
713 if$
714 new.block
715 note output
716 fin.entry
717 }
718
719 FUNCTION {conference} { inproceedings }
720
721 FUNCTION {manual}
722 { output.bibitem
723 format.authors output
724 author format.key output
725 new.block
726 format.btitle "title" output.check
727 organization address new.block.checkb
728 organization output
729 address output
730 format.edition output
731 format.date "year" output.check
732 new.block
733 note output
734 fin.entry
735 }
736
737 FUNCTION {mastersthesis}
738 { output.bibitem
739 format.authors "author" output.check
740 author format.key output
741 new.block
742 format.btitle "title" output.check
743 new.block
744 "Master's thesis" format.thesis.type output.nonnull
745 school "school" output.check
746 address output
747 format.date "year" output.check
748 new.block
749 note output
750 fin.entry
751 }
752
753 FUNCTION {misc}
754 { output.bibitem
755 format.authors output
756 author format.key output
757 new.block
758 format.title output
759 new.block
760 howpublished output
761 format.date "year" output.check
762 new.block
763 note output
764 fin.entry
765 }
766
767 FUNCTION {phdthesis}
768 { output.bibitem
769 format.authors "author" output.check
770 author format.key output
771 new.block
772 format.btitle "title" output.check
773 new.block
774 "Ph.D.\ thesis" format.thesis.type output.nonnull
775 school "school" output.check
776 address output
777 format.date "year" output.check
778 new.block
779 note output
780 fin.entry
781 }
782
783 FUNCTION {proceedings}
784 { output.bibitem
785 format.editors output
786 editor format.key output
787 new.block
788 format.btitle "title" output.check
789 format.bvolume output
790 format.number.series output
791 address output
792 new.sentence
793 organization output
794 publisher output
795 format.date "year" output.check
796 new.block
797 note output
798 fin.entry
799 }
800
801 FUNCTION {techreport}
802 { output.bibitem
803 format.authors "author" output.check
804 author format.key output
805 new.block
806 format.title "title" output.check
807 new.block
808 format.tr.number output.nonnull
809 institution "institution" output.check
810 address output
811 format.date "year" output.check
812 new.block
813 note output
814 fin.entry
815 }
816
817 FUNCTION {unpublished}
818 { output.bibitem
819 format.authors "author" output.check
820 author format.key output
821 new.block
822 format.title "title" output.check
823 new.block
824 note "note" output.check
825 fin.entry
826 }
827
828 FUNCTION {default.type} { misc }
829
830 MACRO {jan} {"January"}
831
832 MACRO {feb} {"February"}
833
834 MACRO {mar} {"March"}
835
836 MACRO {apr} {"April"}
837
838 MACRO {may} {"May"}
839
840 MACRO {jun} {"June"}
841
842 MACRO {jul} {"July"}
843
844 MACRO {aug} {"August"}
845
846 MACRO {sep} {"September"}
847
848 MACRO {oct} {"October"}
849
850 MACRO {nov} {"November"}
851
852 MACRO {dec} {"December"}
853
854 READ
855
856 FUNCTION {sortify}
857 { purify$
858 "l" change.case$
859 }
860
861 INTEGERS { len }
862
863 FUNCTION {chop.word}
864 { 's :=
865 'len :=
866 s #1 len substring$ =
867 { s len #1 + global.max$ substring$ }
868 's
869 if$
870 }
871
872 FUNCTION {format.lab.names}
873 { 's :=
874 s #1 "{vv~}{ll}" format.name$
875 s num.names$ duplicate$
876 #2 >
877 { pop$ % 2nd number of names
878 " \etal{}" *
879 }
880 { #2 <
881 'skip$
882 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
883 { " \etal{}" * }
884 { " and " * s #2 "{vv~}{ll}" format.name$ * }
885 if$
886 }
887 if$
888 }
889 if$
890 }
891
892 FUNCTION {format.long.lab.names}
893 { 's :=
894 #1 'nameptr :=
895 s num.names$ 'numnames :=
896 numnames 'namesleft :=
897 { namesleft #0 > }
898 { s nameptr
899 "{vv~}{ll}" format.name$ 't :=
900 nameptr #1 >
901 {
902 namesleft #1 >
903 { ", " * t * }
904 {
905 numnames #2 >
906 { "," * }
907 'skip$
908 if$
909 t "others" =
910 { " \etal{}" * }
911 { " and " * t * }
912 if$
913 }
914 if$
915 }
916 't
917 if$
918 nameptr #1 + 'nameptr :=
919 namesleft #1 - 'namesleft :=
920 }
921 while$
922 }
923
924 FUNCTION {author.key}
925 { author empty$
926 { "{"
927 key empty$
928 { cite$ #1 #3 substring$ }
929 'key
930 if$ *
931 "}" *
932 }
933 'author
934 if$
935 }
936
937 FUNCTION {author.editor.key}
938 { author empty$
939 { editor empty$
940 { "{"
941 key empty$
942 { cite$ #1 #3 substring$ }
943 'key
944 if$ *
945 "}" *
946 }
947 'editor
948 if$
949 }
950 'author
951 if$
952 }
953
954 FUNCTION {editor.key}
955 { editor empty$
956 { "{"
957 key empty$
958 { cite$ #1 #3 substring$ }
959 'key
960 if$ *
961 "}" *
962 }
963 'editor
964 if$
965 }
966
967 FUNCTION {maybe.other.name.field}
968 { swap$ % [stack: other.field name]
969 duplicate$ empty$ % is the name empty?
970 { pop$ % discard it [stack: other.field]
971 #1 swap$ 'skip$ if$ % try the other one
972 }
973 { swap$ pop$ % discard other.field
974 }
975 if$
976 }
977
978 FUNCTION {calc.label.names}
979 { type$ "proceedings" =
980 'editor
981 'author
982 if$
983 'editor maybe.other.name.field
984 'organization maybe.other.name.field
985 'key maybe.other.name.field
986 { "Cannot create a label name in " cite$ * warning$
987 cite$ #1 #3 substring$ } maybe.other.name.field
988 }
989
990 FUNCTION {calc.short.label}
991 { calc.label.names format.lab.names
992 'short.label :=
993 }
994
995 FUNCTION {calc.label}
996 { calc.short.label
997 short.label ", " *
998 year duplicate$ empty$
999 { pop$ "????" }
1000 { purify$ #-1 #4 substring$ }
1001 if$
1002 *
1003 'label :=
1004 }
1005
1006 FUNCTION {calc.long.label}
1007 { calc.label.names format.long.lab.names
1008 'long.label :=
1009 }
1010
1011 FUNCTION {sort.format.names}
1012 { 's :=
1013 #1 'nameptr :=
1014 ""
1015 s num.names$ 'numnames :=
1016 numnames 'namesleft :=
1017 { namesleft #0 > }
1018 { nameptr #1 >
1019 { " " * }
1020 'skip$
1021 if$
1022 s nameptr
1023 "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1024 format.name$ 't :=
1025 nameptr numnames = t "others" = and
1026 { "et al" * }
1027 { t sortify * }
1028 if$
1029 nameptr #1 + 'nameptr :=
1030 namesleft #1 - 'namesleft :=
1031 }
1032 while$
1033 }
1034
1035 FUNCTION {sort.format.title}
1036 { 't :=
1037 "A " #2
1038 "An " #3
1039 "The " #4 t chop.word
1040 chop.word
1041 chop.word
1042 sortify
1043 #1 global.max$ substring$
1044 }
1045
1046 FUNCTION {author.sort}
1047 { author empty$
1048 { key empty$
1049 { "to sort, need author or key in " cite$ * warning$
1050 ""
1051 }
1052 { key sortify }
1053 if$
1054 }
1055 { author sort.format.names }
1056 if$
1057 }
1058
1059 FUNCTION {author.editor.sort}
1060 { author empty$
1061 { editor empty$
1062 { key empty$
1063 { "to sort, need author, editor, or key in " cite$ * warning$
1064 ""
1065 }
1066 { key sortify }
1067 if$
1068 }
1069 { editor sort.format.names }
1070 if$
1071 }
1072 { author sort.format.names }
1073 if$
1074 }
1075
1076 FUNCTION {editor.sort}
1077 { editor empty$
1078 { key empty$
1079 { "to sort, need editor or key in " cite$ * warning$
1080 ""
1081 }
1082 { key sortify }
1083 if$
1084 }
1085 { editor sort.format.names }
1086 if$
1087 }
1088
1089 FUNCTION {presort}
1090 { calc.label
1091 label sortify
1092 " "
1093 *
1094 type$ "book" =
1095 type$ "inbook" =
1096 or
1097 'author.editor.sort
1098 { type$ "proceedings" =
1099 'editor.sort
1100 'author.sort
1101 if$
1102 }
1103 if$
1104 #1 entry.max$ substring$
1105 'sort.label :=
1106 sort.label
1107 *
1108 " "
1109 *
1110 title field.or.null
1111 sort.format.title
1112 *
1113 #1 entry.max$ substring$
1114 'sort.key$ :=
1115 }
1116
1117 ITERATE {presort}
1118
1119 SORT
1120
1121 STRINGS { last.label next.extra }
1122
1123 INTEGERS { last.extra.num }
1124
1125 FUNCTION {initialize.extra.label.stuff}
1126 { #0 int.to.chr$ 'last.label :=
1127 "" 'next.extra :=
1128 #0 'last.extra.num :=
1129 }
1130
1131 FUNCTION {forward.pass}
1132 { last.label label =
1133 { last.extra.num #1 + 'last.extra.num :=
1134 last.extra.num int.to.chr$ 'extra.label :=
1135 }
1136 { "a" chr.to.int$ 'last.extra.num :=
1137 "" 'extra.label :=
1138 label 'last.label :=
1139 }
1140 if$
1141 }
1142
1143 FUNCTION {reverse.pass}
1144 { next.extra "b" =
1145 { "a" 'extra.label := }
1146 'skip$
1147 if$
1148 extra.label 'next.extra :=
1149 }
1150
1151 EXECUTE {initialize.extra.label.stuff}
1152
1153 ITERATE {forward.pass}
1154
1155 REVERSE {reverse.pass}
1156
1157 FUNCTION {bib.sort.order}
1158 { sort.label
1159 " "
1160 *
1161 year field.or.null sortify
1162 *
1163 " "
1164 *
1165 title field.or.null
1166 sort.format.title
1167 *
1168 #1 entry.max$ substring$
1169 'sort.key$ :=
1170 calc.long.label
1171 }
1172
1173 ITERATE {bib.sort.order}
1174
1175 SORT
1176
1177 FUNCTION {begin.bib}
1178 { preamble$ empty$
1179 'skip$
1180 { preamble$ write$ newline$ }
1181 if$
1182 "\begin{thebibliography}{}" write$ newline$
1183 }
1184
1185 EXECUTE {begin.bib}
1186
1187 EXECUTE {init.state.consts}
1188
1189 ITERATE {call.type$}
1190
1191 FUNCTION {end.bib}
1192 { newline$
1193 "\end{thebibliography}" write$ newline$
1194 }
1195
1196 EXECUTE {end.bib}
1197 %%
1198 %%
1199 %% End of file `ltugbib.bst'.