Debian Codegraph @

texmf-dist/doc/latex/minitoc/en-mtc.bst

raw
1 %%% Modification of BibTeX style file /usr/share/texmf/bibtex/bst/base/plain.bst
2 %%% ... by urlbst, version 0.5 (marked with "% urlbst")
3 %%% See <http://www.astro.gla.ac.uk/users/norman/distrib/urlbst/>
4 %%% Added webpage entry type, and url and lastchecked fields.
5 %%% Further modified into en-mtc.bst by Jean-Pierre Drucbert for minitoc;
6 %%% released under the original license(s).
7 %%% Original headers follow...
8
9
10 ENTRY
11 { address
12 author
13 booktitle
14 chapter
15 edition
16 editor
17 howpublished
18 institution
19 journal
20 key
21 month
22 note
23 number
24 organization
25 pages
26 publisher
27 school
28 series
29 title
30 type
31 volume
32 year
33 eprint % urlbst
34 doi % urlbst
35 url % urlbst
36 lastchecked % urlbst
37 }
38 {}
39 { label }
40
41 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
42
43 STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl } % urlbst...
44 INTEGERS { hrefform addeprints adddoiresolver }
45 % Following constants may be adjusted by hand, if desired
46 FUNCTION {init.config.constants}
47 {
48 "Available from: " 'urlintro := % prefix before URL
49 "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
50 "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
51 "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
52 "doi:" 'doiprefix := % text prefix printed before DOI ref
53 #0 'addeprints := % 0=no eprints; 1=include eprints
54 #0 'adddoiresolver := % 0=no DOI resolver; 1=include it
55 #0 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
56 }
57 INTEGERS {
58 bracket.state
59 outside.brackets
60 open.brackets
61 within.brackets
62 close.brackets
63 }
64 % ...urlbst to here
65 FUNCTION {init.state.consts}
66 { #0 'outside.brackets := % urlbst
67 #1 'open.brackets :=
68 #2 'within.brackets :=
69 #3 'close.brackets :=
70
71 #0 'before.all :=
72 #1 'mid.sentence :=
73 #2 'after.sentence :=
74 #3 'after.block :=
75 }
76
77 STRINGS { s t }
78
79 % urlbst
80 FUNCTION {output.nonnull.original}
81 { 's :=
82 output.state mid.sentence =
83 { ", " * write$ }
84 { output.state after.block =
85 { add.period$ write$
86 newline$
87 "\newblock " write$
88 }
89 { output.state before.all =
90 'write$
91 { add.period$ " " * write$ }
92 if$
93 }
94 if$
95 mid.sentence 'output.state :=
96 }
97 if$
98 s
99 }
100
101 % urlbst...
102 FUNCTION {output.nonnull}
103 { % Save the thing we've been asked to output
104 's :=
105 % If the bracket-state is close.brackets, then add a close-bracket to
106 % what is currently at the top of the stack, and set bracket.state
107 % to outside.brackets
108 bracket.state close.brackets =
109 { "]" *
110 outside.brackets 'bracket.state :=
111 }
112 'skip$
113 if$
114 bracket.state outside.brackets =
115 { % We're outside all brackets -- this is the normal situation.
116 % Write out what's currently at the top of the stack, using the
117 % original output.nonnull function.
118 s
119 output.nonnull.original
120 }
121 { % Still in brackets. Add open-bracket or (continuation) comma, add the
122 % new text (in s) to the top of the stack, and move to the close-brackets
123 % state, ready for next time (unless inbrackets resets it). If we come
124 % into this branch, then output.state is carefully undisturbed.
125 bracket.state open.brackets =
126 { " [" * }
127 { ", " * } % bracket.state will be within.brackets
128 if$
129 s *
130 close.brackets 'bracket.state :=
131 }
132 if$
133 }
134
135 % Call this function just before adding something which should be presented in
136 % brackets. bracket.state is handled specially within output.nonnull.
137 FUNCTION {inbrackets}
138 { bracket.state close.brackets =
139 { within.brackets 'bracket.state := } % reset the state: not open nor closed
140 { open.brackets 'bracket.state := }
141 if$
142 }
143
144 FUNCTION {format.lastchecked}
145 { lastchecked empty$
146 { "" }
147 { inbrackets "cited " lastchecked * }
148 if$
149 }
150 % ...urlbst to here
151
152 FUNCTION {output}
153 { duplicate$ empty$
154 'pop$
155 'output.nonnull
156 if$
157 }
158
159 FUNCTION {output.check}
160 { 't :=
161 duplicate$ empty$
162 { pop$ "empty " t * " in " * cite$ * warning$ }
163 'output.nonnull
164 if$
165 }
166
167 FUNCTION {output.bibitem}
168 { outside.brackets 'bracket.state := % urlbst
169 newline$
170 "\bibitem{" write$
171 cite$ write$
172 "}" write$
173 newline$
174 ""
175 before.all 'output.state :=
176 }
177
178 FUNCTION {fin.entry}
179 {
180 bracket.state close.brackets = % urlbst
181 { "]" * }
182 'skip$
183 if$
184 add.period$
185 write$
186 newline$
187 }
188
189 FUNCTION {new.block}
190 { output.state before.all =
191 'skip$
192 { after.block 'output.state := }
193 if$
194 }
195
196 FUNCTION {new.sentence}
197 { output.state after.block =
198 'skip$
199 { output.state before.all =
200 'skip$
201 { after.sentence 'output.state := }
202 if$
203 }
204 if$
205 }
206
207 FUNCTION {not}
208 { { #0 }
209 { #1 }
210 if$
211 }
212
213 FUNCTION {and}
214 { 'skip$
215 { pop$ #0 }
216 if$
217 }
218
219 FUNCTION {or}
220 { { pop$ #1 }
221 'skip$
222 if$
223 }
224
225 FUNCTION {new.block.checka}
226 { empty$
227 'skip$
228 'new.block
229 if$
230 }
231
232 FUNCTION {new.block.checkb}
233 { empty$
234 swap$ empty$
235 and
236 'skip$
237 'new.block
238 if$
239 }
240
241 FUNCTION {new.sentence.checka}
242 { empty$
243 'skip$
244 'new.sentence
245 if$
246 }
247
248 FUNCTION {new.sentence.checkb}
249 { empty$
250 swap$ empty$
251 and
252 'skip$
253 'new.sentence
254 if$
255 }
256
257 FUNCTION {field.or.null}
258 { duplicate$ empty$
259 { pop$ "" }
260 'skip$
261 if$
262 }
263
264 FUNCTION {emphasize}
265 { duplicate$ empty$
266 { pop$ "" }
267 { "\emph{" swap$ * "}" * }
268 if$
269 }
270
271 FUNCTION {slant}
272 { duplicate$ empty$
273 { pop$ "" }
274 { "\emph{\sffamily " swap$ * "}" * }
275 if$
276 }
277
278 INTEGERS { nameptr namesleft numnames }
279
280 FUNCTION {format.names}
281 { 's :=
282 #1 'nameptr :=
283 s num.names$ 'numnames :=
284 numnames 'namesleft :=
285 { namesleft #0 > }
286 { s nameptr "{ff~}\bgroup\scshape {vv~}{ll}\egroup{{}}{, jj}" format.name$ 't :=
287 nameptr #1 >
288 { namesleft #1 >
289 { ", " * t * }
290 { numnames #2 >
291 { "," * }
292 'skip$
293 if$
294 t "others" =
295 { " \upshape\rmfamily et~al." * }
296 { " and " * t * }
297 if$
298 }
299 if$
300 }
301 't
302 if$
303 nameptr #1 + 'nameptr :=
304 namesleft #1 - 'namesleft :=
305 }
306 while$
307 }
308
309 FUNCTION {format.authors}
310 { author empty$
311 { "" }
312 { author format.names }
313 if$
314 }
315
316 FUNCTION {format.editors}
317 { editor empty$
318 { "" }
319 { editor format.names
320 editor num.names$ #1 >
321 { ", editors" * }
322 { ", editor" * }
323 if$
324 }
325 if$
326 }
327
328 FUNCTION {format.title}
329 { title empty$
330 { "" }
331 %{ title "t" change.case$ } On laisse le titre tel quel.
332 { title }
333 if$
334 }
335
336 FUNCTION {n.dashify}
337 { 't :=
338 ""
339 { t empty$ not }
340 { t #1 #1 substring$ "-" =
341 { t #1 #2 substring$ "--" = not
342 { "--" *
343 t #2 global.max$ substring$ 't :=
344 }
345 { { t #1 #1 substring$ "-" = }
346 { "-" *
347 t #2 global.max$ substring$ 't :=
348 }
349 while$
350 }
351 if$
352 }
353 { t #1 #1 substring$ *
354 t #2 global.max$ substring$ 't :=
355 }
356 if$
357 }
358 while$
359 }
360
361 FUNCTION {format.date}
362 { year empty$
363 { month empty$
364 { "" }
365 { "there's a month but no year in " cite$ * warning$
366 month
367 }
368 if$
369 }
370 { month empty$
371 { "\oldstylenums{" year * "}" * }
372 { month " " * "\oldstylenums{" * year * "}" * }
373 if$
374 }
375 if$
376 }
377
378 FUNCTION {format.btitle}
379 { title emphasize
380 }
381
382 FUNCTION {tie.or.space.connect}
383 { duplicate$ text.length$ #3 <
384 { "~" }
385 { " " }
386 if$
387 swap$ * *
388 }
389
390 FUNCTION {either.or.check}
391 { empty$
392 'pop$
393 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
394 if$
395 }
396
397 FUNCTION {format.bvolume}
398 { volume empty$
399 { "" }
400 { "volume" volume tie.or.space.connect
401 series empty$
402 'skip$
403 { " of " * series emphasize * }
404 if$
405 "volume and number" number either.or.check
406 }
407 if$
408 }
409
410 FUNCTION {format.number.series}
411 { volume empty$
412 { number empty$
413 { series field.or.null }
414 { output.state mid.sentence =
415 { "number" }
416 { "Number" }
417 if$
418 number tie.or.space.connect
419 series empty$
420 { "there's a number but no series in " cite$ * warning$ }
421 { " in " * series * }
422 if$
423 }
424 if$
425 }
426 { "" }
427 if$
428 }
429
430 FUNCTION {format.edition}
431 { edition empty$
432 { "" }
433 { output.state mid.sentence =
434 { edition "l" change.case$ " edition" * }
435 { edition "t" change.case$ " edition" * }
436 if$
437 }
438 if$
439 }
440
441 INTEGERS { multiresult }
442
443 FUNCTION {multi.page.check}
444 { 't :=
445 #0 'multiresult :=
446 { multiresult not
447 t empty$ not
448 and
449 }
450 { t #1 #1 substring$
451 duplicate$ "-" =
452 swap$ duplicate$ "," =
453 swap$ "+" =
454 or or
455 { #1 'multiresult := }
456 { t #2 global.max$ substring$ 't := }
457 if$
458 }
459 while$
460 multiresult
461 }
462
463 FUNCTION {format.pages}
464 { pages empty$
465 { "" }
466 { pages multi.page.check
467 { "pages" pages n.dashify tie.or.space.connect }
468 { "page" pages tie.or.space.connect }
469 if$
470 }
471 if$
472 }
473
474 FUNCTION {format.vol.num.pages}
475 { volume field.or.null
476 number empty$
477 'skip$
478 { "(" number * ")" * *
479 volume empty$
480 { "there's a number but no volume in " cite$ * warning$ }
481 'skip$
482 if$
483 }
484 if$
485 pages empty$
486 'skip$
487 { duplicate$ empty$
488 { pop$ format.pages }
489 { ":" * pages n.dashify * }
490 if$
491 }
492 if$
493 }
494
495 FUNCTION {format.chapter.pages}
496 { chapter empty$
497 'format.pages
498 { type empty$
499 { "chapter" }
500 { type "l" change.case$ }
501 if$
502 chapter tie.or.space.connect
503 pages empty$
504 'skip$
505 { ", " * format.pages * }
506 if$
507 }
508 if$
509 }
510
511 FUNCTION {format.in.ed.booktitle}
512 { booktitle empty$
513 { "" }
514 { editor empty$
515 { "In " booktitle slant * }
516 { "In " format.editors * ", " * booktitle slant * }
517 if$
518 }
519 if$
520 }
521
522 FUNCTION {empty.misc.check}
523 { author empty$ title empty$ howpublished empty$
524 month empty$ year empty$ note empty$
525 and and and and and
526 key empty$ not and
527 { "all relevant fields are empty in " cite$ * warning$ }
528 'skip$
529 if$
530 }
531
532 FUNCTION {format.thesis.type}
533 { type empty$
534 'skip$
535 { pop$
536 type "t" change.case$
537 }
538 if$
539 }
540
541 FUNCTION {format.tr.number}
542 { type empty$
543 { "Technical Report" }
544 'type
545 if$
546 number empty$
547 { "t" change.case$ }
548 { number tie.or.space.connect }
549 if$
550 }
551
552 FUNCTION {format.article.crossref}
553 { key empty$
554 { journal empty$
555 { "need key or journal for " cite$ * " to crossref " * crossref *
556 warning$
557 ""
558 }
559 { "In \emph{\sffamily " journal * "}" * }
560 if$
561 }
562 { "In " key * }
563 if$
564 " \cite{" * crossref * "}" *
565 }
566
567 FUNCTION {format.crossref.editor}
568 { editor #1 "{vv~}{ll}" format.name$
569 editor num.names$ duplicate$
570 #2 >
571 { pop$ " et~al." * }
572 { #2 <
573 'skip$
574 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
575 { " \upshape\rmfamily et~al." * }
576 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
577 if$
578 }
579 if$
580 }
581 if$
582 }
583
584 FUNCTION {format.book.crossref}
585 { volume empty$
586 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
587 "In "
588 }
589 { "Volume" volume tie.or.space.connect
590 " of " *
591 }
592 if$
593 editor empty$
594 editor field.or.null author field.or.null =
595 or
596 { key empty$
597 { series empty$
598 { "need editor, key, or series for " cite$ * " to crossref " *
599 crossref * warning$
600 "" *
601 }
602 { "\emph{\sffamily " * series * "}" * }
603 if$
604 }
605 { key * }
606 if$
607 }
608 { format.crossref.editor * }
609 if$
610 " \cite{" * crossref * "}" *
611 }
612
613 FUNCTION {format.incoll.inproc.crossref}
614 { editor empty$
615 editor field.or.null author field.or.null =
616 or
617 { key empty$
618 { booktitle empty$
619 { "need editor, key, or booktitle for " cite$ * " to crossref " *
620 crossref * warning$
621 ""
622 }
623 { "In \emph{\sffamily " booktitle * "}" * }
624 if$
625 }
626 { "In " key * }
627 if$
628 }
629 { "In " format.crossref.editor * }
630 if$
631 " \cite{" * crossref * "}" *
632 }
633
634 % urlbst...
635 % Functions for making hypertext links.
636 % In all cases, the stack has (link-text href-url)
637 %
638 % make 'null' specials
639 FUNCTION {make.href.null}
640 {
641 pop$
642 }
643 % make hypertex specials
644 FUNCTION {make.href.hypertex}
645 {
646 "\special {html:<a href=" quote$ *
647 swap$ * quote$ * "> }" * swap$ *
648 "\special {html:</a>}" *
649 }
650 % make hyperref specials
651 FUNCTION {make.href.hyperref}
652 {
653 "\href {" swap$ * "} {" * swap$ * "}" *
654 }
655 FUNCTION {make.href}
656 { hrefform #2 =
657 'make.href.hyperref % hrefform = 2
658 { hrefform #1 =
659 'make.href.hypertex % hrefform = 1
660 'make.href.null % hrefform = 0 (or anything else)
661 if$
662 }
663 if$
664 }
665
666 FUNCTION {format.url}
667 { url empty$
668 { "" }
669 { hrefform #1 =
670 { % special case -- add HyperTeX specials
671 urlintro "\url{" url * "}" * url make.href.hypertex * }
672 { urlintro "\url{" * url * "}" * }
673 if$
674 }
675 if$
676 }
677
678 FUNCTION {format.eprint}
679 { eprint empty$
680 { "" }
681 { eprintprefix eprint * eprinturl eprint * make.href }
682 if$
683 }
684
685 FUNCTION {format.doi}
686 { doi empty$
687 { "" }
688 { doiprefix doi * doiurl doi * make.href }
689 if$
690 }
691
692 % Output a URL. We can't use the more normal idiom (something like
693 % `format.url output'), because the `inbrackets' within
694 % format.lastchecked applies to everything between calls to `output',
695 % so that `format.url format.lastchecked * output' ends up with both
696 % the URL and the lastchecked in brackets.
697 FUNCTION {output.url}
698 { url empty$
699 'skip$
700 { new.block
701 format.url output
702 format.lastchecked output
703 }
704 if$
705 }
706
707 FUNCTION {output.web.refs}
708 {
709 new.block
710 output.url
711 addeprints eprint empty$ not and
712 { format.eprint output.nonnull }
713 'skip$
714 if$
715 adddoiresolver doi empty$ not and
716 { format.doi output.nonnull }
717 'skip$
718 if$
719 % addeprints
720 % { eprint empty$
721 % 'skip$
722 % { format.eprint output.nonnull }
723 % if$
724 % }
725 % 'skip$
726 % if$
727 }
728
729 % Webpage entry type.
730 % Title and url fields required;
731 % author, note, year, month, and lastchecked fields optional
732 % See references
733 % ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm
734 % http://www.classroom.net/classroom/CitingNetResources.html
735 % http://neal.ctstateu.edu/history/cite.html
736 % http://www.cas.usf.edu/english/walker/mla.html
737 % for citation formats for web pages.
738 FUNCTION {webpage}
739 { output.bibitem
740 author empty$
741 { editor empty$
742 'skip$ % author and editor both optional
743 { format.editors output.nonnull }
744 if$
745 }
746 { editor empty$
747 { format.authors output.nonnull }
748 { "can't use both author and editor fields in " cite$ * warning$ }
749 if$
750 }
751 if$
752 % author empty$
753 % 'skip$
754 % { format.authors output.nonnull }
755 % if$
756 new.block
757 format.btitle "title" output.check
758 inbrackets "online" output
759 % new.block % NO PERIOD
760 year empty$
761 'skip$
762 { format.date "year" output.check }
763 if$
764 lastchecked empty$
765 'skip$
766 { format.lastchecked output }
767 if$
768 new.block
769 format.url "url" output.check
770 new.block
771 note output
772 fin.entry
773 }
774 % ...urlbst to here
775
776
777 FUNCTION {article}
778 { output.bibitem
779 format.authors "author" output.check
780 new.block
781 format.btitle "title" output.check
782 new.block
783 crossref missing$
784 { journal slant "journal" output.check
785 format.vol.num.pages output
786 format.date "year" output.check
787 }
788 { format.article.crossref output.nonnull
789 format.pages output
790 }
791 if$
792 new.block
793 note output
794 output.web.refs % urlbst
795 fin.entry
796 }
797
798 FUNCTION {book}
799 { output.bibitem
800 author empty$
801 { format.editors "author and editor" output.check }
802 { format.authors output.nonnull
803 crossref missing$
804 { "author and editor" editor either.or.check }
805 'skip$
806 if$
807 }
808 if$
809 new.block
810 format.btitle "title" output.check
811 crossref missing$
812 { format.bvolume output
813 new.block
814 format.number.series output
815 new.sentence
816 publisher "publisher" output.check
817 address output
818 }
819 { new.block
820 format.book.crossref output.nonnull
821 }
822 if$
823 format.edition output
824 format.date "year" output.check
825 new.block
826 note output
827 output.web.refs % urlbst
828 fin.entry
829 }
830
831 FUNCTION {booklet}
832 { output.bibitem
833 format.authors output
834 new.block
835 format.btitle "title" output.check
836 howpublished address new.block.checkb
837 howpublished output
838 address output
839 format.date output
840 new.block
841 note output
842 output.web.refs % urlbst
843 fin.entry
844 }
845
846 FUNCTION {inbook}
847 { output.bibitem
848 author empty$
849 { format.editors "author and editor" output.check }
850 { format.authors output.nonnull
851 crossref missing$
852 { "author and editor" editor either.or.check }
853 'skip$
854 if$
855 }
856 if$
857 new.block
858 format.btitle "title" output.check
859 crossref missing$
860 { format.bvolume output
861 format.chapter.pages "chapter and pages" output.check
862 new.block
863 format.number.series output
864 new.sentence
865 publisher "publisher" output.check
866 address output
867 }
868 { format.chapter.pages "chapter and pages" output.check
869 new.block
870 format.book.crossref output.nonnull
871 }
872 if$
873 format.edition output
874 format.date "year" output.check
875 new.block
876 note output
877 output.web.refs % urlbst
878 fin.entry
879 }
880
881 FUNCTION {incollection}
882 { output.bibitem
883 format.authors "author" output.check
884 new.block
885 format.btitle "title" output.check
886 new.block
887 crossref missing$
888 { format.in.ed.booktitle "booktitle" output.check
889 format.bvolume output
890 format.number.series output
891 format.chapter.pages output
892 new.sentence
893 publisher "publisher" output.check
894 address output
895 format.edition output
896 format.date "year" output.check
897 }
898 { format.incoll.inproc.crossref output.nonnull
899 format.chapter.pages output
900 }
901 if$
902 new.block
903 note output
904 output.web.refs % urlbst
905 fin.entry
906 }
907
908 FUNCTION {inproceedings}
909 { output.bibitem
910 format.authors "author" output.check
911 new.block
912 format.btitle "title" output.check
913 new.block
914 crossref missing$
915 { format.in.ed.booktitle "booktitle" output.check
916 format.bvolume output
917 format.number.series output
918 format.pages output
919 address empty$
920 { organization publisher new.sentence.checkb
921 organization output
922 publisher output
923 format.date "year" output.check
924 }
925 { address output.nonnull
926 format.date "year" output.check
927 new.sentence
928 organization output
929 publisher output
930 }
931 if$
932 }
933 { format.incoll.inproc.crossref output.nonnull
934 format.pages output
935 }
936 if$
937 new.block
938 note output
939 output.web.refs % urlbst
940 fin.entry
941 }
942
943 FUNCTION {conference} { inproceedings }
944
945 FUNCTION {manual}
946 { output.bibitem
947 author empty$
948 { organization empty$
949 'skip$
950 { organization output.nonnull
951 address output
952 }
953 if$
954 }
955 { format.authors output.nonnull }
956 if$
957 new.block
958 format.btitle "title" output.check
959 author empty$
960 { organization empty$
961 { address new.block.checka
962 address output
963 }
964 'skip$
965 if$
966 }
967 { organization address new.block.checkb
968 organization output
969 address output
970 }
971 if$
972 format.edition output
973 format.date output
974 new.block
975 note output
976 output.web.refs % urlbst
977 fin.entry
978 }
979
980 FUNCTION {mastersthesis}
981 { output.bibitem
982 format.authors "author" output.check
983 new.block
984 format.btitle "title" output.check
985 new.block
986 "Master's thesis" format.thesis.type output.nonnull
987 school "school" output.check
988 address output
989 format.date "year" output.check
990 new.block
991 note output
992 output.web.refs % urlbst
993 fin.entry
994 }
995
996 FUNCTION {misc}
997 { output.bibitem
998 format.authors output
999 title howpublished new.block.checkb
1000 format.btitle output
1001 howpublished new.block.checka
1002 howpublished output
1003 format.date output
1004 new.block
1005 note output
1006 address output
1007 output.web.refs % urlbst
1008 fin.entry
1009 empty.misc.check
1010 }
1011
1012 FUNCTION {phdthesis}
1013 { output.bibitem
1014 format.authors "author" output.check
1015 new.block
1016 format.btitle "title" output.check
1017 new.block
1018 "PhD thesis" format.thesis.type output.nonnull
1019 school "school" output.check
1020 address output
1021 format.date "year" output.check
1022 new.block
1023 note output
1024 output.web.refs % urlbst
1025 fin.entry
1026 }
1027
1028 FUNCTION {proceedings}
1029 { output.bibitem
1030 editor empty$
1031 { organization output }
1032 { format.editors output.nonnull }
1033 if$
1034 new.block
1035 format.btitle "title" output.check
1036 format.bvolume output
1037 format.number.series output
1038 address empty$
1039 { editor empty$
1040 { publisher new.sentence.checka }
1041 { organization publisher new.sentence.checkb
1042 organization output
1043 }
1044 if$
1045 publisher output
1046 format.date "year" output.check
1047 }
1048 { address output.nonnull
1049 format.date "year" output.check
1050 new.sentence
1051 editor empty$
1052 'skip$
1053 { organization output }
1054 if$
1055 publisher output
1056 }
1057 if$
1058 new.block
1059 note output
1060 output.web.refs % urlbst
1061 fin.entry
1062 }
1063
1064 FUNCTION {techreport}
1065 { output.bibitem
1066 format.authors "author" output.check
1067 new.block
1068 format.btitle "title" output.check
1069 new.block
1070 format.tr.number output.nonnull
1071 institution "institution" output.check
1072 address output
1073 format.date "year" output.check
1074 new.block
1075 note output
1076 output.web.refs % urlbst
1077 fin.entry
1078 }
1079
1080 FUNCTION {unpublished}
1081 { output.bibitem
1082 format.authors "author" output.check
1083 new.block
1084 format.btitle "title" output.check
1085 new.block
1086 note "note" output.check
1087 format.date output
1088 output.web.refs % urlbst
1089 fin.entry
1090 }
1091
1092 FUNCTION {default.type} { misc }
1093
1094 MACRO {jan} {"January"}
1095
1096 MACRO {feb} {"February"}
1097
1098 MACRO {mar} {"March"}
1099
1100 MACRO {apr} {"April"}
1101
1102 MACRO {may} {"May"}
1103
1104 MACRO {jun} {"June"}
1105
1106 MACRO {jul} {"July"}
1107
1108 MACRO {aug} {"August"}
1109
1110 MACRO {sep} {"September"}
1111
1112 MACRO {oct} {"October"}
1113
1114 MACRO {nov} {"November"}
1115
1116 MACRO {dec} {"December"}
1117
1118 MACRO {acmcs} {"ACM Computing Surveys"}
1119
1120 MACRO {acta} {"Acta Informatica"}
1121
1122 MACRO {cacm} {"Communications of the ACM"}
1123
1124 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1125
1126 MACRO {ibmsj} {"IBM Systems Journal"}
1127
1128 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1129
1130 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1131
1132 MACRO {ieeetcad}
1133 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1134
1135 MACRO {ipl} {"Information Processing Letters"}
1136
1137 MACRO {jacm} {"Journal of the ACM"}
1138
1139 MACRO {jcss} {"Journal of Computer and System Sciences"}
1140
1141 MACRO {scp} {"Science of Computer Programming"}
1142
1143 MACRO {sicomp} {"SIAM Journal on Computing"}
1144
1145 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1146
1147 MACRO {tods} {"ACM Transactions on Database Systems"}
1148
1149 MACRO {tog} {"ACM Transactions on Graphics"}
1150
1151 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1152
1153 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1154
1155 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1156
1157 MACRO {tcs} {"Theoretical Computer Science"}
1158
1159 READ
1160
1161 FUNCTION {sortify}
1162 { purify$
1163 "l" change.case$
1164 }
1165
1166 INTEGERS { len }
1167
1168 FUNCTION {chop.word}
1169 { 's :=
1170 'len :=
1171 s #1 len substring$ =
1172 { s len #1 + global.max$ substring$ }
1173 's
1174 if$
1175 }
1176
1177 FUNCTION {sort.format.names}
1178 { 's :=
1179 #1 'nameptr :=
1180 ""
1181 s num.names$ 'numnames :=
1182 numnames 'namesleft :=
1183 { namesleft #0 > }
1184 { nameptr #1 >
1185 { " " * }
1186 'skip$
1187 if$
1188 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1189 nameptr numnames = t "others" = and
1190 { " \upshape\rmfamily et al." * }
1191 { t sortify * }
1192 if$
1193 nameptr #1 + 'nameptr :=
1194 namesleft #1 - 'namesleft :=
1195 }
1196 while$
1197 }
1198
1199 FUNCTION {sort.format.title}
1200 { 't :=
1201 "A " #2
1202 "An " #3
1203 "The " #4 t chop.word
1204 chop.word
1205 chop.word
1206 sortify
1207 #1 global.max$ substring$
1208 }
1209
1210 FUNCTION {author.sort}
1211 { author empty$
1212 { key empty$
1213 { "to sort, need author or key in " cite$ * warning$
1214 ""
1215 }
1216 { key sortify }
1217 if$
1218 }
1219 { author sort.format.names }
1220 if$
1221 }
1222
1223 FUNCTION {author.editor.sort}
1224 { author empty$
1225 { editor empty$
1226 { key empty$
1227 { "to sort, need author, editor, or key in " cite$ * warning$
1228 ""
1229 }
1230 { key sortify }
1231 if$
1232 }
1233 { editor sort.format.names }
1234 if$
1235 }
1236 { author sort.format.names }
1237 if$
1238 }
1239
1240 FUNCTION {author.organization.sort}
1241 { author empty$
1242 { organization empty$
1243 { key empty$
1244 { "to sort, need author, organization, or key in " cite$ * warning$
1245 ""
1246 }
1247 { key sortify }
1248 if$
1249 }
1250 { "The " #4 organization chop.word sortify }
1251 if$
1252 }
1253 { author sort.format.names }
1254 if$
1255 }
1256
1257 FUNCTION {editor.organization.sort}
1258 { editor empty$
1259 { organization empty$
1260 { key empty$
1261 { "to sort, need editor, organization, or key in " cite$ * warning$
1262 ""
1263 }
1264 { key sortify }
1265 if$
1266 }
1267 { "The " #4 organization chop.word sortify }
1268 if$
1269 }
1270 { editor sort.format.names }
1271 if$
1272 }
1273
1274 FUNCTION {presort}
1275 { type$ "book" =
1276 type$ "inbook" =
1277 or
1278 'author.editor.sort
1279 { type$ "proceedings" =
1280 'editor.organization.sort
1281 { type$ "manual" =
1282 'author.organization.sort
1283 'author.sort
1284 if$
1285 }
1286 if$
1287 }
1288 if$
1289 " "
1290 *
1291 year field.or.null sortify
1292 *
1293 " "
1294 *
1295 title field.or.null
1296 sort.format.title
1297 *
1298 #1 entry.max$ substring$
1299 'sort.key$ :=
1300 }
1301
1302 ITERATE {presort}
1303
1304 SORT
1305
1306 STRINGS { longest.label }
1307
1308 INTEGERS { number.label longest.label.width }
1309
1310 FUNCTION {initialize.longest.label}
1311 { "" 'longest.label :=
1312 #1 'number.label :=
1313 #0 'longest.label.width :=
1314 }
1315
1316 FUNCTION {longest.label.pass}
1317 { number.label int.to.str$ 'label :=
1318 number.label #1 + 'number.label :=
1319 label width$ longest.label.width >
1320 { label 'longest.label :=
1321 label width$ 'longest.label.width :=
1322 }
1323 'skip$
1324 if$
1325 }
1326
1327 EXECUTE {initialize.longest.label}
1328
1329 ITERATE {longest.label.pass}
1330
1331 FUNCTION {begin.bib}
1332 { preamble$ empty$
1333 'skip$
1334 { preamble$ write$ newline$ }
1335 if$
1336 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1337 }
1338
1339 EXECUTE {begin.bib}
1340
1341 EXECUTE {init.config.constants}
1342 EXECUTE {init.state.consts}
1343
1344 ITERATE {call.type$}
1345
1346 FUNCTION {end.bib}
1347 { newline$
1348 "\end{thebibliography}" write$ newline$
1349 }
1350
1351 EXECUTE {end.bib}