1 % BibTeX standard bibliography style `unsrt'
2 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
3 % Copyright (C) 1985, all rights reserved.
4 % Copying of this file is authorized only if either
5 % (1) you make absolutely no changes to your copy, including name, or
6 % (2) if you do make changes, you name it something other than
7 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
8 % This restriction helps ensure that all standard styles are identical.
9 % The file btxbst.doc has the documentation for this style.
38 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
40 FUNCTION {init.state.consts}
49 FUNCTION {output.nonnull}
51 output.state mid.sentence =
53 { output.state after.block =
58 { output.state before.all =
60 { add.period$ " " * write$ }
64 mid.sentence 'output.state :=
77 FUNCTION {output.check}
80 { pop$ "empty " t * " in " * cite$ * warning$ }
85 FUNCTION {output.bibitem}
92 before.all 'output.state :=
102 { output.state before.all =
104 { after.block 'output.state := }
108 FUNCTION {new.sentence}
109 { output.state after.block =
111 { output.state before.all =
113 { after.sentence 'output.state := }
137 FUNCTION {new.block.checka}
144 FUNCTION {new.block.checkb}
153 FUNCTION {new.sentence.checka}
160 FUNCTION {new.sentence.checkb}
169 FUNCTION {field.or.null}
179 { "{\em " swap$ * "}" * }
183 INTEGERS { nameptr namesleft numnames }
185 FUNCTION {format.names}
188 s num.names$ 'numnames :=
189 numnames 'namesleft :=
191 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
208 nameptr #1 + 'nameptr :=
209 namesleft #1 - 'namesleft :=
214 FUNCTION {format.authors}
217 { author format.names }
221 FUNCTION {format.editors}
224 { editor format.names
225 editor num.names$ #1 >
233 FUNCTION {format.title}
244 { t #1 #1 substring$ "-" =
245 { t #1 #2 substring$ "--" = not
247 t #2 global.max$ substring$ 't :=
249 { { t #1 #1 substring$ "-" = }
251 t #2 global.max$ substring$ 't :=
257 { t #1 #1 substring$ *
258 t #2 global.max$ substring$ 't :=
265 FUNCTION {format.date}
269 { "there's a month but no year in " cite$ * warning$
280 FUNCTION {format.btitle}
284 FUNCTION {tie.or.space.connect}
285 { duplicate$ text.length$ #3 <
292 FUNCTION {either.or.check}
295 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
299 FUNCTION {format.bvolume}
302 { "volume" volume tie.or.space.connect
305 { " of " * series emphasize * }
307 "volume and number" number either.or.check
312 FUNCTION {format.number.series}
315 { series field.or.null }
316 { output.state mid.sentence =
320 number tie.or.space.connect
322 { "there's a number but no series in " cite$ * warning$ }
323 { " in " * series * }
332 FUNCTION {format.edition}
335 { output.state mid.sentence =
336 { edition "l" change.case$ " edition" * }
337 { edition "t" change.case$ " edition" * }
343 INTEGERS { multiresult }
345 FUNCTION {multi.page.check}
354 swap$ duplicate$ "," =
357 { #1 'multiresult := }
358 { t #2 global.max$ substring$ 't := }
365 FUNCTION {format.pages}
368 { pages multi.page.check
369 { "pages" pages n.dashify tie.or.space.connect }
370 { "page" pages tie.or.space.connect }
376 FUNCTION {format.vol.num.pages}
377 { volume field.or.null
380 { "(" number * ")" * *
382 { "there's a number but no volume in " cite$ * warning$ }
390 { pop$ format.pages }
391 { ":" * pages n.dashify * }
397 FUNCTION {format.chapter.pages}
402 { type "l" change.case$ }
404 chapter tie.or.space.connect
407 { ", " * format.pages * }
413 FUNCTION {format.in.ed.booktitle}
417 { "In " booktitle emphasize * }
418 { "In " format.editors * ", " * booktitle emphasize * }
424 FUNCTION {empty.misc.check}
425 { author empty$ title empty$ howpublished empty$
426 month empty$ year empty$ note empty$
428 { "all relevant fields are empty in " cite$ * warning$ }
433 FUNCTION {format.thesis.type}
437 type "t" change.case$
442 FUNCTION {format.tr.number}
444 { "Technical Report" }
449 { number tie.or.space.connect }
453 FUNCTION {format.article.crossref}
456 { "need key or journal for " cite$ * " to crossref " * crossref *
460 { "In {\em " journal * "\/}" * }
465 " \cite{" * crossref * "}" *
468 FUNCTION {format.crossref.editor}
469 { editor #1 "{vv~}{ll}" format.name$
470 editor num.names$ duplicate$
475 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
477 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
485 FUNCTION {format.book.crossref}
487 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
490 { "Volume" volume tie.or.space.connect
495 editor field.or.null author field.or.null =
499 { "need editor, key, or series for " cite$ * " to crossref " *
503 { "{\em " * series * "\/}" * }
509 { format.crossref.editor * }
511 " \cite{" * crossref * "}" *
514 FUNCTION {format.incoll.inproc.crossref}
516 editor field.or.null author field.or.null =
520 { "need editor, key, or booktitle for " cite$ * " to crossref " *
524 { "In {\em " booktitle * "\/}" * }
530 { "In " format.crossref.editor * }
532 " \cite{" * crossref * "}" *
537 format.authors "author" output.check
539 format.title "title" output.check
542 { journal emphasize "journal" output.check
543 format.vol.num.pages output
544 format.date "year" output.check
546 { format.article.crossref output.nonnull
558 { format.editors "author and editor" output.check }
559 { format.authors output.nonnull
561 { "author and editor" editor either.or.check }
567 format.btitle "title" output.check
569 { format.bvolume output
571 format.number.series output
573 publisher "publisher" output.check
577 format.book.crossref output.nonnull
580 format.edition output
581 format.date "year" output.check
589 format.authors output
591 format.title "title" output.check
592 howpublished address new.block.checkb
604 { format.editors "author and editor" output.check }
605 { format.authors output.nonnull
607 { "author and editor" editor either.or.check }
613 format.btitle "title" output.check
615 { format.bvolume output
616 format.chapter.pages "chapter and pages" output.check
618 format.number.series output
620 publisher "publisher" output.check
623 { format.chapter.pages "chapter and pages" output.check
625 format.book.crossref output.nonnull
628 format.edition output
629 format.date "year" output.check
635 FUNCTION {incollection}
637 format.authors "author" output.check
639 format.title "title" output.check
642 { format.in.ed.booktitle "booktitle" output.check
643 format.bvolume output
644 format.number.series output
645 format.chapter.pages output
647 publisher "publisher" output.check
649 format.edition output
650 format.date "year" output.check
652 { format.incoll.inproc.crossref output.nonnull
653 format.chapter.pages output
661 FUNCTION {inproceedings}
663 format.authors "author" output.check
665 format.title "title" output.check
668 { format.in.ed.booktitle "booktitle" output.check
669 format.bvolume output
670 format.number.series output
673 { organization publisher new.sentence.checkb
676 format.date "year" output.check
678 { address output.nonnull
679 format.date "year" output.check
686 { format.incoll.inproc.crossref output.nonnull
695 FUNCTION {conference} { inproceedings }
700 { organization empty$
702 { organization output.nonnull
707 { format.authors output.nonnull }
710 format.btitle "title" output.check
712 { organization empty$
713 { address new.block.checka
719 { organization address new.block.checkb
724 format.edition output
731 FUNCTION {mastersthesis}
733 format.authors "author" output.check
735 format.title "title" output.check
737 "Master's thesis" format.thesis.type output.nonnull
738 school "school" output.check
740 format.date "year" output.check
748 format.authors output
749 title howpublished new.block.checkb
751 howpublished new.block.checka
762 format.authors "author" output.check
764 format.btitle "title" output.check
766 "PhD thesis" format.thesis.type output.nonnull
767 school "school" output.check
769 format.date "year" output.check
775 FUNCTION {proceedings}
778 { organization output }
779 { format.editors output.nonnull }
782 format.btitle "title" output.check
783 format.bvolume output
784 format.number.series output
787 { publisher new.sentence.checka }
788 { organization publisher new.sentence.checkb
793 format.date "year" output.check
795 { address output.nonnull
796 format.date "year" output.check
800 { organization output }
810 FUNCTION {techreport}
812 format.authors "author" output.check
814 format.title "title" output.check
816 format.tr.number output.nonnull
817 institution "institution" output.check
819 format.date "year" output.check
825 FUNCTION {unpublished}
827 format.authors "author" output.check
829 format.title "title" output.check
831 note "note" output.check
836 FUNCTION {default.type} { misc }
838 MACRO {jan} {"January"}
840 MACRO {feb} {"February"}
842 MACRO {mar} {"March"}
844 MACRO {apr} {"April"}
852 MACRO {aug} {"August"}
854 MACRO {sep} {"September"}
856 MACRO {oct} {"October"}
858 MACRO {nov} {"November"}
860 MACRO {dec} {"December"}
862 MACRO {acmcs} {"ACM Computing Surveys"}
864 MACRO {acta} {"Acta Informatica"}
866 MACRO {cacm} {"Communications of the ACM"}
868 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
870 MACRO {ibmsj} {"IBM Systems Journal"}
872 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
874 MACRO {ieeetc} {"IEEE Transactions on Computers"}
877 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
879 MACRO {ipl} {"Information Processing Letters"}
881 MACRO {jacm} {"Journal of the ACM"}
883 MACRO {jcss} {"Journal of Computer and System Sciences"}
885 MACRO {scp} {"Science of Computer Programming"}
887 MACRO {sicomp} {"SIAM Journal on Computing"}
889 MACRO {tocs} {"ACM Transactions on Computer Systems"}
891 MACRO {tods} {"ACM Transactions on Database Systems"}
893 MACRO {tog} {"ACM Transactions on Graphics"}
895 MACRO {toms} {"ACM Transactions on Mathematical Software"}
897 MACRO {toois} {"ACM Transactions on Office Information Systems"}
899 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
901 MACRO {tcs} {"Theoretical Computer Science"}
905 STRINGS { longest.label }
907 INTEGERS { number.label longest.label.width }
909 FUNCTION {initialize.longest.label}
910 { "" 'longest.label :=
912 #0 'longest.label.width :=
915 FUNCTION {longest.label.pass}
916 { number.label int.to.str$ 'label :=
917 number.label #1 + 'number.label :=
918 label width$ longest.label.width >
919 { label 'longest.label :=
920 label width$ 'longest.label.width :=
926 EXECUTE {initialize.longest.label}
928 ITERATE {longest.label.pass}
933 { preamble$ write$ newline$ }
935 "\begin{thebibliography}{" longest.label * "}" * write$ newline$
940 EXECUTE {init.state.consts}
946 "\end{thebibliography}" write$ newline$