Debian Codegraph @

texmf-dist/bibtex/bst/base/ieeetr.bst

raw
1 % Copyright (C) 1985, 1988, 2010 Howard Trickey and Oren Patashnik.
2 % Unlimited copying and redistribution of this file are permitted as long as
3 % it is unmodified. Modifications (and redistribution of modified versions)
4 % are also permitted, but only if the resulting file is renamed.
5 %
6 % IEEE Transactions bibliography style (8-Dec-10 version)
7 % numeric labels, order-of-reference, IEEE abbreviations,
8 % quotes around article titles, commas separate all fields
9 % except after book titles and before "notes". Otherwise,
10 % much like the "plain" family, from which this is adapted.
11 %
12 % History
13 % 9/30/85 (HWT) Original version, by Howard Trickey.
14 % 1/29/88 (OP&HWT) Updated for BibTeX version 0.99a, Oren Patashnik;
15 % THIS `ieeetr' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
16 % 12/ 8/10 (OP&HWT) Clarify license.
17
18 ENTRY
19 { address
20 author
21 booktitle
22 chapter
23 edition
24 editor
25 howpublished
26 institution
27 journal
28 key
29 month
30 note
31 number
32 organization
33 pages
34 publisher
35 school
36 series
37 title
38 type
39 volume
40 year
41 }
42 {}
43 { label }
44
45 INTEGERS { output.state before.all mid.sentence after.quote after.sentence
46 after.quoted.block after.block }
47
48 FUNCTION {init.state.consts}
49 { #0 'before.all :=
50 #1 'mid.sentence :=
51 #2 'after.quote :=
52 #3 'after.sentence :=
53 #4 'after.quoted.block :=
54 #5 'after.block :=
55 }
56
57 STRINGS { s t }
58
59 FUNCTION {output.nonnull}
60 { 's :=
61 output.state mid.sentence =
62 { ", " * write$ }
63 { output.state after.quote =
64 { " " * write$ }
65 { output.state after.block =
66 { add.period$ write$
67 newline$
68 "\newblock " write$
69 }
70 { output.state before.all =
71 'write$
72 { output.state after.quoted.block =
73 { write$
74 newline$
75 "\newblock " write$
76 }
77 { add.period$ " " * write$ }
78 if$
79 }
80 if$
81 }
82 if$
83 }
84 if$
85 mid.sentence 'output.state :=
86 }
87 if$
88 s
89 }
90
91 FUNCTION {output}
92 { duplicate$ empty$
93 'pop$
94 'output.nonnull
95 if$
96 }
97
98 FUNCTION {output.check}
99 { 't :=
100 duplicate$ empty$
101 { pop$ "empty " t * " in " * cite$ * warning$ }
102 'output.nonnull
103 if$
104 }
105
106 FUNCTION {output.bibitem}
107 { newline$
108 "\bibitem{" write$
109 cite$ write$
110 "}" write$
111 newline$
112 ""
113 before.all 'output.state :=
114 }
115
116 FUNCTION {blank.sep}
117 { after.quote 'output.state :=
118 }
119
120 FUNCTION {fin.entry}
121 { output.state after.quoted.block =
122 'skip$
123 'add.period$
124 if$
125 write$
126 newline$
127 }
128
129 FUNCTION {new.block}
130 { output.state before.all =
131 'skip$
132 { output.state after.quote =
133 { after.quoted.block 'output.state := }
134 { after.block 'output.state := }
135 if$
136 }
137 if$
138 }
139
140 FUNCTION {new.sentence}
141 { output.state after.block =
142 'skip$
143 { output.state before.all =
144 'skip$
145 { after.sentence 'output.state := }
146 if$
147 }
148 if$
149 }
150
151 FUNCTION {not}
152 { { #0 }
153 { #1 }
154 if$
155 }
156
157 FUNCTION {and}
158 { 'skip$
159 { pop$ #0 }
160 if$
161 }
162
163 FUNCTION {or}
164 { { pop$ #1 }
165 'skip$
166 if$
167 }
168
169 FUNCTION {new.block.checka}
170 { empty$
171 'skip$
172 'new.block
173 if$
174 }
175
176 FUNCTION {new.block.checkb}
177 { empty$
178 swap$ empty$
179 and
180 'skip$
181 'new.block
182 if$
183 }
184
185 FUNCTION {new.sentence.checka}
186 { empty$
187 'skip$
188 'new.sentence
189 if$
190 }
191
192 FUNCTION {field.or.null}
193 { duplicate$ empty$
194 { pop$ "" }
195 'skip$
196 if$
197 }
198
199 FUNCTION {emphasize}
200 { duplicate$ empty$
201 { pop$ "" }
202 { "{\em " swap$ * "}" * }
203 if$
204 }
205
206 INTEGERS { nameptr namesleft numnames }
207
208 FUNCTION {format.names}
209 { 's :=
210 #1 'nameptr :=
211 s num.names$ 'numnames :=
212 numnames 'namesleft :=
213 { namesleft #0 > }
214 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
215 nameptr #1 >
216 { namesleft #1 >
217 { ", " * t * }
218 { numnames #2 >
219 { "," * }
220 'skip$
221 if$
222 t "others" =
223 { " {\em et~al.}" * }
224 { " and " * t * }
225 if$
226 }
227 if$
228 }
229 't
230 if$
231 nameptr #1 + 'nameptr :=
232 namesleft #1 - 'namesleft :=
233 }
234 while$
235 }
236
237 FUNCTION {format.authors}
238 { author empty$
239 { "" }
240 { author format.names }
241 if$
242 }
243
244 FUNCTION {format.editors}
245 { editor empty$
246 { "" }
247 { editor format.names
248 editor num.names$ #1 >
249 { ", eds." * }
250 { ", ed." * }
251 if$
252 }
253 if$
254 }
255
256 FUNCTION {format.title}
257 { title empty$
258 { "" }
259 { "``" title "t" change.case$ * ",''" * }
260 if$
261 }
262
263 FUNCTION {format.title.p}
264 { title empty$
265 { "" }
266 { "``" title "t" change.case$ * ".''" * }
267 if$
268 }
269
270 FUNCTION {n.dashify}
271 { 't :=
272 ""
273 { t empty$ not }
274 { t #1 #1 substring$ "-" =
275 { t #1 #2 substring$ "--" = not
276 { "--" *
277 t #2 global.max$ substring$ 't :=
278 }
279 { { t #1 #1 substring$ "-" = }
280 { "-" *
281 t #2 global.max$ substring$ 't :=
282 }
283 while$
284 }
285 if$
286 }
287 { t #1 #1 substring$ *
288 t #2 global.max$ substring$ 't :=
289 }
290 if$
291 }
292 while$
293 }
294
295 FUNCTION {format.date}
296 { year empty$
297 { month empty$
298 { "" }
299 { "there's a month but no year in " cite$ * warning$
300 month
301 }
302 if$
303 }
304 { month empty$
305 'year
306 { month " " * year * }
307 if$
308 }
309 if$
310 }
311
312 FUNCTION {format.btitle}
313 { title emphasize
314 }
315
316 FUNCTION {tie.or.space.connect}
317 { duplicate$ text.length$ #3 <
318 { "~" }
319 { " " }
320 if$
321 swap$ * *
322 }
323
324 FUNCTION {either.or.check}
325 { empty$
326 'pop$
327 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
328 if$
329 }
330
331 FUNCTION {format.bvolume}
332 { volume empty$
333 { "" }
334 { "vol.~" volume *
335 series empty$
336 'skip$
337 { " of " * series emphasize * }
338 if$
339 "volume and number" number either.or.check
340 }
341 if$
342 }
343
344 FUNCTION {format.number.series}
345 { volume empty$
346 { number empty$
347 { series field.or.null }
348 { output.state mid.sentence =
349 { "no.~" }
350 { "No.~" }
351 if$
352 number *
353 series empty$
354 { "there's a number but no series in " cite$ * warning$ }
355 { " in " * series * }
356 if$
357 }
358 if$
359 }
360 { "" }
361 if$
362 }
363
364 FUNCTION {format.edition}
365 { edition empty$
366 { "" }
367 { edition "l" change.case$ "~ed." * }
368 if$
369 }
370
371 INTEGERS { multiresult }
372
373 FUNCTION {multi.page.check}
374 { 't :=
375 #0 'multiresult :=
376 { multiresult not
377 t empty$ not
378 and
379 }
380 { t #1 #1 substring$
381 duplicate$ "-" =
382 swap$ duplicate$ "," =
383 swap$ "+" =
384 or or
385 { #1 'multiresult := }
386 { t #2 global.max$ substring$ 't := }
387 if$
388 }
389 while$
390 multiresult
391 }
392
393 FUNCTION {format.pages}
394 { pages empty$
395 { "" }
396 { pages multi.page.check
397 { "pp.~" pages n.dashify * }
398 { "p.~" pages * }
399 if$
400 }
401 if$
402 }
403
404 FUNCTION {format.volume}
405 { volume empty$
406 { "" }
407 { "vol.~" volume * }
408 if$
409 }
410
411 FUNCTION {format.number}
412 { number empty$
413 { "" }
414 { "no.~" number * }
415 if$
416 }
417
418 FUNCTION {format.chapter.pages}
419 { chapter empty$
420 'format.pages
421 { type empty$
422 { "ch.~" chapter * }
423 { type "l" change.case$ chapter tie.or.space.connect }
424 if$
425 pages empty$
426 'skip$
427 { ", " * format.pages * }
428 if$
429 }
430 if$
431 }
432
433 FUNCTION {format.in.ed.booktitle}
434 { booktitle empty$
435 { "" }
436 { "in " booktitle emphasize *
437 editor empty$
438 'skip$
439 { " (" * format.editors * ")" * }
440 if$
441 }
442 if$
443 }
444
445 FUNCTION {format.thesis.type}
446 { type empty$
447 'skip$
448 { pop$
449 output.state after.block =
450 { type "t" change.case$ }
451 { type "l" change.case$ }
452 if$
453 }
454 if$
455 }
456
457 FUNCTION {empty.misc.check}
458 { author empty$ title empty$ howpublished empty$
459 month empty$ year empty$ note empty$
460 and and and and and
461 { "all relevant fields are empty in " cite$ * warning$ }
462 'skip$
463 if$
464 }
465
466 FUNCTION {format.tr.number}
467 { type empty$
468 { "Tech. Rep." }
469 'type
470 if$
471 number empty$
472 { "l" change.case$ }
473 { number tie.or.space.connect }
474 if$
475 }
476
477 FUNCTION {format.addr.pub}
478 { publisher empty$
479 { "" }
480 { address empty$
481 { "" }
482 { address ": " * }
483 if$
484 publisher *
485 }
486 if$
487 }
488
489 FUNCTION {format.paddress}
490 { address empty$
491 { "" }
492 { "(" address * ")" * }
493 if$
494 }
495
496 FUNCTION {format.article.crossref}
497 { key empty$
498 { journal empty$
499 { "need key or journal for " cite$ * " to crossref " * crossref *
500 warning$
501 ""
502 }
503 { "in {\em " journal * "\/}" * }
504 if$
505 }
506 { "in " key * }
507 if$
508 " \cite{" * crossref * "}" *
509 }
510
511 FUNCTION {format.crossref.editor}
512 { editor #1 "{vv~}{ll}" format.name$
513 editor num.names$ duplicate$
514 #2 >
515 { pop$ " {\em et~al.}" * }
516 { #2 <
517 'skip$
518 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
519 { " {\em et~al.}" * }
520 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
521 if$
522 }
523 if$
524 }
525 if$
526 }
527
528 FUNCTION {format.book.crossref}
529 { volume empty$
530 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
531 "In "
532 }
533 { "Vol.~" volume *
534 " of " *
535 }
536 if$
537 editor empty$
538 editor field.or.null author field.or.null =
539 or
540 { key empty$
541 { series empty$
542 { "need editor, key, or series for " cite$ * " to crossref " *
543 crossref * warning$
544 "" *
545 }
546 { "{\em " * series * "\/}" * }
547 if$
548 }
549 { key * }
550 if$
551 }
552 { format.crossref.editor * }
553 if$
554 " \cite{" * crossref * "}" *
555 }
556
557 FUNCTION {format.incoll.inproc.crossref}
558 { editor empty$
559 editor field.or.null author field.or.null =
560 or
561 { key empty$
562 { booktitle empty$
563 { "need editor, key, or booktitle for " cite$ * " to crossref " *
564 crossref * warning$
565 ""
566 }
567 { "in {\em " booktitle * "\/}" * }
568 if$
569 }
570 { "in " key * }
571 if$
572 }
573 { "in " format.crossref.editor * }
574 if$
575 " \cite{" * crossref * "}" *
576 }
577
578 FUNCTION {article}
579 { output.bibitem
580 format.authors "author" output.check
581 format.title "title" output.check
582 blank.sep
583 crossref missing$
584 { journal emphasize "journal" output.check
585 format.volume output
586 month empty$
587 { format.number output }
588 'skip$
589 if$
590 format.pages output
591 format.date "year" output.check
592 }
593 { format.article.crossref output.nonnull
594 format.pages output
595 }
596 if$
597 new.block
598 note output
599 fin.entry
600 }
601
602 FUNCTION {book}
603 { output.bibitem
604 author empty$
605 { format.editors "author and editor" output.check }
606 { format.authors output.nonnull
607 crossref missing$
608 { "author and editor" editor either.or.check }
609 'skip$
610 if$
611 }
612 if$
613 format.btitle "title" output.check
614 crossref missing$
615 { format.bvolume output
616 new.block
617 format.number.series output
618 format.addr.pub "publisher" output.check
619 }
620 { new.block
621 format.book.crossref output.nonnull
622 }
623 if$
624 format.edition output
625 format.date "year" output.check
626 new.block
627 note output
628 fin.entry
629 }
630
631 FUNCTION {booklet}
632 { output.bibitem
633 format.authors output
634 title empty$
635 { "empty title in " cite$ * warning$
636 howpublished new.sentence.checka
637 }
638 { howpublished empty$ not
639 address empty$ month empty$ year empty$ and and
640 or
641 { format.title.p output.nonnull }
642 { format.title output.nonnull }
643 if$
644 blank.sep
645 }
646 if$
647 howpublished output
648 address output
649 format.date output
650 new.block
651 note output
652 fin.entry
653 }
654
655 FUNCTION {inbook}
656 { output.bibitem
657 author empty$
658 { format.editors "author and editor" output.check }
659 { format.authors output.nonnull
660 crossref missing$
661 { "author and editor" editor either.or.check }
662 'skip$
663 if$
664 }
665 if$
666 format.btitle "title" output.check
667 crossref missing$
668 { format.bvolume output
669 format.chapter.pages "chapter and pages" output.check
670 new.block
671 format.number.series output
672 format.addr.pub "publisher" output.check
673 }
674 { format.chapter.pages "chapter and pages" output.check
675 new.block
676 format.book.crossref output.nonnull
677 }
678 if$
679 format.edition output
680 format.date "year" output.check
681 new.block
682 note output
683 fin.entry
684 }
685
686 FUNCTION {incollection}
687 { output.bibitem
688 format.authors "author" output.check
689 format.title "title" output.check
690 blank.sep
691 crossref missing$
692 { format.in.ed.booktitle "booktitle" output.check
693 format.bvolume output
694 format.number.series output
695 format.chapter.pages output
696 format.addr.pub "publisher" output.check
697 format.edition output
698 format.date "year" output.check
699 }
700 { format.incoll.inproc.crossref output.nonnull
701 format.chapter.pages output
702 }
703 if$
704 new.block
705 note output
706 fin.entry
707 }
708
709 FUNCTION {inproceedings}
710 { output.bibitem
711 format.authors "author" output.check
712 format.title "title" output.check
713 blank.sep
714 crossref missing$
715 { format.in.ed.booktitle "booktitle" output.check
716 format.bvolume output
717 format.number.series output
718 format.paddress output
719 format.pages output
720 organization output
721 publisher output
722 format.date "year" output.check
723 }
724 { format.incoll.inproc.crossref output.nonnull
725 format.pages output
726 }
727 if$
728 new.block
729 note output
730 fin.entry
731 }
732
733 FUNCTION {conference} { inproceedings }
734
735 FUNCTION {manual}
736 { output.bibitem
737 author empty$
738 { organization empty$
739 'skip$
740 { organization output.nonnull
741 address output
742 }
743 if$
744 }
745 { format.authors output.nonnull }
746 if$
747 format.btitle "title" output.check
748 author empty$
749 { organization empty$
750 { address new.block.checka
751 address output
752 }
753 'skip$
754 if$
755 }
756 { organization address new.block.checkb
757 organization output
758 address output
759 }
760 if$
761 format.edition output
762 format.date output
763 new.block
764 note output
765 fin.entry
766 }
767
768 FUNCTION {mastersthesis}
769 { output.bibitem
770 format.authors "author" output.check
771 format.title "title" output.check
772 blank.sep
773 "Master's thesis" format.thesis.type output.nonnull
774 school "school" output.check
775 address output
776 format.date "year" output.check
777 new.block
778 note output
779 fin.entry
780 }
781
782 FUNCTION {misc}
783 { output.bibitem
784 format.authors output
785 title empty$
786 { howpublished new.sentence.checka }
787 { howpublished empty$ not
788 month empty$ year empty$ and
789 or
790 { format.title.p output.nonnull }
791 { format.title output.nonnull }
792 if$
793 blank.sep
794 }
795 if$
796 howpublished output
797 format.date output
798 new.block
799 note output
800 fin.entry
801 empty.misc.check
802 }
803
804 FUNCTION {phdthesis}
805 { output.bibitem
806 format.authors "author" output.check
807 format.btitle "title" output.check
808 new.block
809 "PhD thesis" format.thesis.type output.nonnull
810 school "school" output.check
811 address output
812 format.date "year" output.check
813 new.block
814 note output
815 fin.entry
816 }
817
818 FUNCTION {proceedings}
819 { output.bibitem
820 editor empty$
821 { organization output }
822 { format.editors output.nonnull }
823 if$
824 format.btitle "title" output.check
825 format.bvolume output
826 format.number.series output
827 format.paddress output
828 editor empty$
829 'skip$
830 { organization output }
831 if$
832 publisher output
833 format.date "year" output.check
834 new.block
835 note output
836 fin.entry
837 }
838
839 FUNCTION {techreport}
840 { output.bibitem
841 format.authors "author" output.check
842 format.title "title" output.check
843 blank.sep
844 format.tr.number output.nonnull
845 institution "institution" output.check
846 address output
847 format.date "year" output.check
848 new.block
849 note output
850 fin.entry
851 }
852
853 FUNCTION {unpublished}
854 { output.bibitem
855 format.authors "author" output.check
856 format.title.p "title" output.check
857 blank.sep
858 note "note" output.check
859 format.date output
860 fin.entry
861 }
862
863 FUNCTION {default.type} { misc }
864
865 MACRO {jan} {"Jan."}
866
867 MACRO {feb} {"Feb."}
868
869 MACRO {mar} {"Mar."}
870
871 MACRO {apr} {"Apr."}
872
873 MACRO {may} {"May"}
874
875 MACRO {jun} {"June"}
876
877 MACRO {jul} {"July"}
878
879 MACRO {aug} {"Aug."}
880
881 MACRO {sep} {"Sept."}
882
883 MACRO {oct} {"Oct."}
884
885 MACRO {nov} {"Nov."}
886
887 MACRO {dec} {"Dec."}
888
889 MACRO {acmcs} {"ACM Computing Surveys"}
890
891 MACRO {acta} {"Acta Informatica"}
892
893 MACRO {cacm} {"Communications ACM"}
894
895 MACRO {ibmjrd} {"IBM J. Research and Development"}
896
897 MACRO {ibmsj} {"IBM Systems~J."}
898
899 MACRO {ieeese} {"IEEE Trans. Software Engineering"}
900
901 MACRO {ieeetc} {"IEEE Trans. Computers"}
902
903 MACRO {ieeetcad}
904 {"IEEE Trans. Computer-Aided Design"}
905
906 MACRO {ipl} {"Information Processing Letters"}
907
908 MACRO {jacm} {"J.~ACM"}
909
910 MACRO {jcss} {"J.~Computer and System Sciences"}
911
912 MACRO {scp} {"Science of Computer Programming"}
913
914 MACRO {sicomp} {"SIAM J. Computing"}
915
916 MACRO {tocs} {"ACM Trans. Computer Systems"}
917
918 MACRO {tods} {"ACM Trans. Database Systems"}
919
920 MACRO {tog} {"ACM Trans. Graphics"}
921
922 MACRO {toms} {"ACM Trans. Mathematical Software"}
923
924 MACRO {toois} {"ACM Trans. Office Information Systems"}
925
926 MACRO {toplas} {"ACM Trans. Programming Languages and Systems"}
927
928 MACRO {tcs} {"Theoretical Computer Science"}
929
930 READ
931
932 STRINGS { longest.label }
933
934 INTEGERS { number.label longest.label.width }
935
936 FUNCTION {initialize.longest.label}
937 { "" 'longest.label :=
938 #1 'number.label :=
939 #0 'longest.label.width :=
940 }
941
942 FUNCTION {longest.label.pass}
943 { number.label int.to.str$ 'label :=
944 number.label #1 + 'number.label :=
945 label width$ longest.label.width >
946 { label 'longest.label :=
947 label width$ 'longest.label.width :=
948 }
949 'skip$
950 if$
951 }
952
953 EXECUTE {initialize.longest.label}
954
955 ITERATE {longest.label.pass}
956
957 FUNCTION {begin.bib}
958 { preamble$ empty$
959 'skip$
960 { preamble$ write$ newline$ }
961 if$
962 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
963 }
964
965 EXECUTE {begin.bib}
966
967 EXECUTE {init.state.consts}
968
969 ITERATE {call.type$}
970
971 FUNCTION {end.bib}
972 { newline$
973 "\end{thebibliography}" write$ newline$
974 }
975
976 EXECUTE {end.bib}