29 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
30 FUNCTION {init.state.consts}
37 FUNCTION {output.nonnull}
39 output.state mid.sentence =
41 { output.state after.block =
46 { output.state before.all =
48 { add.period$ " " * write$ }
52 mid.sentence 'output.state :=
63 FUNCTION {output.check}
66 { pop$ "empty " t * " in " * cite$ * warning$ }
70 FUNCTION {output.bibitem}
77 before.all 'output.state :=
85 { output.state before.all =
87 { after.block 'output.state := }
90 FUNCTION {new.sentence}
108 FUNCTION {new.block.checka}
114 FUNCTION {new.block.checkb}
122 FUNCTION {new.sentence.checka}
128 FUNCTION {new.sentence.checkb}
136 FUNCTION {field.or.null}
145 { "{\em " swap$ * "}" * }
151 { "{\bf " swap$ * "}" * }
157 { "(" swap$ * ")" * }
160 INTEGERS { nameptr namesleft numnames }
162 FUNCTION {format.names}
165 s num.names$ 'numnames :=
167 s numnames "{ll}" format.name$ "others" = numnames #1 > and
170 { #1 #1 + 'namesleft := }
171 { numnames 'namesleft := }
174 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
184 { " {\em et~al.}" * }
192 nameptr #1 + 'nameptr :=
193 namesleft #1 - 'namesleft :=
197 FUNCTION {format.authors}
200 { author format.names }
203 FUNCTION {format.editors}
206 { editor format.names
207 editor num.names$ #1 >
214 FUNCTION {format.edited}
217 { "edited by " editor format.names * }
220 FUNCTION {format.title}
223 { title "t" change.case$ }
230 { t #1 #1 substring$ "-" =
231 { t #1 #2 substring$ "--" = not
233 t #2 global.max$ substring$ 't :=
235 { { t #1 #1 substring$ "-" = }
237 t #2 global.max$ substring$ 't :=
243 { t #1 #1 substring$ *
244 t #2 global.max$ substring$ 't :=
250 FUNCTION {first.page}
253 { t empty$ not t #1 #1 substring$ "-" = not and }
254 { t #1 #1 substring$ *
255 t #2 global.max$ substring$ 't :=
259 FUNCTION {format.date}
265 FUNCTION {format.btitle}
268 FUNCTION {tie.or.space.connect}
269 { duplicate$ text.length$ #3 <
275 FUNCTION {either.or.check}
278 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
281 FUNCTION {format.bvolume}
288 " Vol." volume tie.or.space.connect *
289 "volume and number" number either.or.check
293 FUNCTION {format.number.series}
296 { series field.or.null }
298 { "there's a number but no series in " cite$ * warning$ }
301 " No. " number tie.or.space.connect *
308 FUNCTION {format.edition}
311 { output.state mid.sentence =
312 { ", " edition "l" change.case$ * }
313 { ", " edition "t" change.case$ * }
319 INTEGERS { multiresult }
320 FUNCTION {multi.page.check}
329 swap$ duplicate$ "," =
332 { #1 'multiresult := }
333 { t #2 global.max$ substring$ 't := }
339 FUNCTION {format.pages}
342 { pages multi.page.check
343 { "pp." pages n.dashify tie.or.space.connect }
344 { "p." pages tie.or.space.connect }
349 FUNCTION {format.pages.a}
352 { "p." pages first.page tie.or.space.connect }
355 FUNCTION {format.vol.num.pages}
356 { volume field.or.null embolden
361 { pop$ format.pages.a }
362 { ", " * pages first.page * }
367 FUNCTION {format.chapter.pages}
372 { type "l" change.case$ }
374 chapter tie.or.space.connect
377 { ", " * format.pages * }
382 FUNCTION {format.pub.addr.date}
384 { "" "empty publisher in " cite$ * warning$ }
393 { "empty year in " cite$ * warning$ }
398 FUNCTION {format.book.entry}
401 format.number.series *
403 format.pub.addr.date *
405 FUNCTION {format.inbook.entry}
408 format.chapter.pages *
410 FUNCTION {format.in.ed.booktitle}
414 { "in " booktitle emphasize * }
415 { "in " booktitle emphasize * ", " * format.edited * }
420 FUNCTION {empty.misc.check}
421 { author empty$ title empty$ howpublished empty$
422 month empty$ year empty$ note empty$
424 { "all relevant fields are empty in " cite$ * warning$ }
428 FUNCTION {format.thesis.type}
432 type "t" change.case$
436 FUNCTION {format.inst.tr.num.date}
438 { "" "empty institution in " cite$ * warning$ }
444 { number tie.or.space.connect }
447 { "empty year in " cite$ * warning$ }
448 { ", " * year * " (unpublished)" * }
451 FUNCTION {format.article.crossref}
454 { "need key or journal for " cite$ * " to crossref " * crossref *
463 " \cite{" * crossref * "}" *
465 FUNCTION {format.crossref.editor}
466 { editor #1 "{vv~}{ll}" format.name$
467 editor num.names$ duplicate$
469 { pop$ " {\em et~al.}" * }
472 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
473 { " {\em et~al.}" * }
474 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
481 FUNCTION {format.book.crossref}
483 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
486 { "Volume" volume tie.or.space.connect
491 editor field.or.null author field.or.null =
495 { "need editor, key, or series for " cite$ * " to crossref " *
499 { "{\em " * series * "\/}" * }
505 { format.crossref.editor * }
507 " \cite{" * crossref * "}" *
509 FUNCTION {format.incoll.inproc.crossref}
511 editor field.or.null author field.or.null =
515 { "need editor, key, or booktitle for " cite$ * " to crossref " *
519 { "In {\em " booktitle * "\/}" * }
525 { "In " format.crossref.editor * }
527 " \cite{" * crossref * "}" *
532 format.authors "author" output.check
535 { journal field.or.null
540 { pop$ format.date paren }
541 { " " * format.date paren * }
547 { format.article.crossref output.nonnull
560 { format.editors "author and editor" output.check }
561 { format.authors output.nonnull
563 { "author and editor" editor either.or.check }
570 { format.book.entry output }
572 format.book.crossref output.nonnull
583 format.authors output
585 format.title "title" output.check
586 howpublished address new.block.checkb
599 { format.editors "author and editor" output.check }
600 { format.authors output.nonnull
602 { "author and editor" editor either.or.check }
609 { format.inbook.entry output }
610 { format.chapter.pages "chapter and pages" output.check
612 format.book.crossref output.nonnull
620 FUNCTION {incollection}
623 format.authors "author" output.check
625 format.title "title" output.check
628 { format.in.ed.booktitle "booktitle" output.check
629 format.bvolume output
630 format.number.series output
631 format.chapter.pages output
633 publisher "publisher" output.check
635 format.edition output
636 format.date "year" output.check
638 { format.incoll.inproc.crossref output.nonnull
639 format.chapter.pages output
647 FUNCTION {inproceedings}
650 format.authors "author" output.check
652 format.title "title" output.check
655 { format.in.ed.booktitle "booktitle" output.check
656 format.bvolume output
657 format.number.series output
660 { organization publisher new.sentence.checkb
663 format.date "year" output.check
665 { address output.nonnull
666 format.date "year" output.check
673 { format.incoll.inproc.crossref output.nonnull
682 FUNCTION {conference} { inproceedings }
687 { organization empty$
689 { organization output.nonnull
694 { format.authors output.nonnull }
697 format.btitle "title" output.check
699 { organization empty$
700 { address new.block.checka
706 { organization address new.block.checkb
711 format.edition output
718 FUNCTION {mastersthesis}
720 format.authors "author" output.check
722 format.title "title" output.check
724 "Master's thesis" format.thesis.type output.nonnull
725 school "school" output.check
727 format.date "year" output.check
736 format.authors output
737 title howpublished new.block.checkb
739 howpublished new.block.checka
750 format.authors "author" output.check
752 format.btitle "title" output.check
754 "PhD thesis" format.thesis.type output.nonnull
755 school "school" output.check
757 format.date "year" output.check
763 FUNCTION {proceedings}
767 { organization output }
768 { format.editors output.nonnull }
771 format.btitle "title" output.check
772 format.bvolume output
773 format.number.series output
776 { publisher new.sentence.checka }
777 { organization publisher new.sentence.checkb
782 format.date "year" output.check
784 { address output.nonnull
785 format.date "year" output.check
789 { organization output }
799 FUNCTION {techreport}
802 format.authors "author" output.check
804 format.inst.tr.num.date output.nonnull
810 FUNCTION {unpublished}
813 format.authors "author" output.check
815 format.title "title" output.check
817 note "note" output.check
821 FUNCTION {default.type} { misc }
830 MACRO {sep} {"Sept."}
834 MACRO {acmcs} {"ACM Comput. Surv."}
835 MACRO {acta} {"Acta Inf."}
836 MACRO {cacm} {"Commun. ACM"}
837 MACRO {ibmjrd} {"IBM J. Res. Dev."}
838 MACRO {ibmsj} {"IBM Syst.~J."}
839 MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
840 MACRO {ieeetc} {"IEEE Trans. Comput."}
842 {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
843 MACRO {ipl} {"Inf. Process. Lett."}
844 MACRO {jacm} {"J.~ACM"}
845 MACRO {jcss} {"J.~Comput. Syst. Sci."}
846 MACRO {scp} {"Sci. Comput. Programming"}
847 MACRO {sicomp} {"SIAM J. Comput."}
848 MACRO {tocs} {"ACM Trans. Comput. Syst."}
849 MACRO {tods} {"ACM Trans. Database Syst."}
850 MACRO {tog} {"ACM Trans. Gr."}
851 MACRO {toms} {"ACM Trans. Math. Softw."}
852 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
853 MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
854 MACRO {tcs} {"Theoretical Comput. Sci."}
855 MACRO {advp} {"Adv. Phys."}
856 MACRO {ajp} {"Am. J. Phys."}
857 MACRO {ao} {"Appl. Opt."}
858 MACRO {apj} {"Astrophys. J."}
859 MACRO {apl} {"Appl. Phys. Lett."}
860 MACRO {arnps} {"Ann. Rev. Nucl. Sci."}
861 MACRO {arns} {"Ann. Rev. Nucl. Part. Sci."}
862 MACRO {baps} {"Bull. Am. Phys. Soc."}
863 MACRO {cpc} {"Computer Phys. Comm."}
864 MACRO {cppcf} {"Comments Plasma Phys. Controlled Fusion"}
865 MACRO {fed} {"Fusion Eng. Design"}
866 MACRO {ft} {"Fusion Tech."}
867 MACRO {ieeens} {"IEEE Trans. Nucl. Sci."}
868 MACRO {ieeeps} {"IEEE Trans. Plasma Sci."}
869 MACRO {ijimw} {"Int. J. Infrared Millimeter Waves"}
870 MACRO {ip} {"Infrared Phys."}
871 MACRO {jap} {"J. Appl. Phys."}
872 MACRO {jcp} {"J. Comput. Phys."}
873 MACRO {jetp} {"Sov. Phys.-JETP"}
874 MACRO {jfe} {"J. Fusion Energy"}
875 MACRO {jfm} {"J. Fluid Mech."}
876 MACRO {jgr} {"J. Geophys. Res."}
877 MACRO {jmp} {"J. Math. Phys."}
878 MACRO {jne} {"J. Nucl. Energy"}
879 MACRO {jnm} {"J. Nucl. Mater."}
880 MACRO {josa} {"J. Opt. Soc. Am."}
881 MACRO {jpg} {"J. Phys.~G: Nucl. and Part. Phys."}
882 MACRO {jphys} {"J. Phys"}
883 MACRO {jpp} {"J. Plasma Phys."}
884 MACRO {jpsj} {"J. Phys. Soc. Jpn"}
885 MACRO {jvst} {"J. Vac. Sci. Technol."}
886 MACRO {modphyslettA} {"Mod. Phys. Lett. A"}
887 MACRO {nedf} {"Nucl. Eng. Design/Fusion"}
888 MACRO {nf} {"Nucl. Fusion"}
889 MACRO {nim} {"Nucl. Instrum. Methods"}
890 MACRO {np} {"Nucl. Phys."}
891 MACRO {npb} {"Nucl. Phys.~B"}
892 MACRO {npbps} {"Nucl. Phys. B (Proc. Suppl.)"}
893 MACRO {nt/f} {"Nucl. Tech./Fusion"}
894 MACRO {pf} {"Phys. Fluids"}
895 MACRO {pl} {"Phys. Lett."}
896 MACRO {plb} {"Phys. Lett.~B"}
897 MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"}
898 MACRO {pp} {"Plasma Phys."}
899 MACRO {physrep} {"Phys. Rep."}
900 MACRO {physrev} {"Phys. Rev."}
901 MACRO {pr} {"Phys. Rev."}
902 MACRO {prd} {"Phys. Rev.~D"}
903 MACRO {prl} {"Phys. Rev. Lett."}
904 MACRO {procroysoc} {"Proc. Roy. Soc"}
905 MACRO {ps} {"Physica Scripta"}
906 MACRO {rmp} {"Rev. Mod. Phys."}
907 MACRO {rsi} {"Rev. Sci. Instrum."}
908 MACRO {sjnp} {"Sov. J. Nucl. Phys."}
909 MACRO {sjpp} {"Sov. J. Plasma Phys."}
910 MACRO {spd} {"Sov. Phys.-Dokl."}
911 MACRO {sptp} {"Sov. Phys.-Tech. Phys."}
912 MACRO {spu} {"Sov. Phys.-Usp."}
913 MACRO {zp} {"Z. Phys."}
914 MACRO {zpc} {"Z. Phys.~C"}
916 STRINGS { longest.label }
917 INTEGERS { number.label longest.label.width }
918 FUNCTION {initialize.longest.label}
919 { "" 'longest.label :=
921 #0 'longest.label.width :=
923 FUNCTION {longest.label.pass}
924 { number.label int.to.str$ 'label :=
925 number.label #1 + 'number.label :=
926 label width$ longest.label.width >
927 { label 'longest.label :=
928 label width$ 'longest.label.width :=
933 EXECUTE {initialize.longest.label}
934 ITERATE {longest.label.pass}
938 { preamble$ write$ newline$ }
940 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
943 EXECUTE {init.state.consts}
947 "\end{thebibliography}" write$ newline$