
seanhalle@29: % BibTeX standard bibliography style `plain'
seanhalle@29: 	% version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
seanhalle@29: 	% Copyright (C) 1985, all rights reserved.
seanhalle@29: 	% Copying of this file is authorized only if either
seanhalle@29: 	% (1) you make absolutely no changes to your copy, including name, or
seanhalle@29: 	% (2) if you do make changes, you name it something other than
seanhalle@29: 	% btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
seanhalle@29: 	% This restriction helps ensure that all standard styles are identical.
seanhalle@29: 	% The file btxbst.doc has the documentation for this style.
seanhalle@29: 
seanhalle@29: ENTRY
seanhalle@29:   { address
seanhalle@29:     author
seanhalle@29:     booktitle
seanhalle@29:     chapter
seanhalle@29:     edition
seanhalle@29:     editor
seanhalle@29:     howpublished
seanhalle@29:     institution
seanhalle@29:     journal
seanhalle@29:     key
seanhalle@29:     month
seanhalle@29:     note
seanhalle@29:     number
seanhalle@29:     organization
seanhalle@29:     pages
seanhalle@29:     publisher
seanhalle@29:     school
seanhalle@29:     series
seanhalle@29:     title
seanhalle@29:     type
seanhalle@29:     volume
seanhalle@29:     year
seanhalle@29:   }
seanhalle@29:   {}
seanhalle@29:   { label }
seanhalle@29: 
seanhalle@29: INTEGERS { output.state before.all mid.sentence after.sentence after.block }
seanhalle@29: 
seanhalle@29: FUNCTION {init.state.consts}
seanhalle@29: { #0 'before.all :=
seanhalle@29:   #1 'mid.sentence :=
seanhalle@29:   #2 'after.sentence :=
seanhalle@29:   #3 'after.block :=
seanhalle@29: }
seanhalle@29: 
seanhalle@29: STRINGS { s t }
seanhalle@29: 
seanhalle@29: FUNCTION {output.nonnull}
seanhalle@29: { 's :=
seanhalle@29:   output.state mid.sentence =
seanhalle@29:     { ", " * write$ }
seanhalle@29:     { output.state after.block =
seanhalle@29: 	{ add.period$ write$
seanhalle@29: 	  newline$
seanhalle@29: 	  "\newblock " write$
seanhalle@29: 	}
seanhalle@29: 	{ output.state before.all =
seanhalle@29: 	    'write$
seanhalle@29: 	    { add.period$ " " * write$ }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:       mid.sentence 'output.state :=
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   s
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {output}
seanhalle@29: { duplicate$ empty$
seanhalle@29:     'pop$
seanhalle@29:     'output.nonnull
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {output.check}
seanhalle@29: { 't :=
seanhalle@29:   duplicate$ empty$
seanhalle@29:     { pop$ "empty " t * " in " * cite$ * warning$ }
seanhalle@29:     'output.nonnull
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {output.bibitem}
seanhalle@29: { newline$
seanhalle@29:   "\bibitem{" write$
seanhalle@29:   cite$ write$
seanhalle@29:   "}" write$
seanhalle@29:   newline$
seanhalle@29:   ""
seanhalle@29:   before.all 'output.state :=
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {fin.entry}
seanhalle@29: { add.period$
seanhalle@29:   write$
seanhalle@29:   newline$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.block}
seanhalle@29: { output.state before.all =
seanhalle@29:     'skip$
seanhalle@29:     { after.block 'output.state := }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.sentence}
seanhalle@29: { output.state after.block =
seanhalle@29:     'skip$
seanhalle@29:     { output.state before.all =
seanhalle@29: 	'skip$
seanhalle@29: 	{ after.sentence 'output.state := }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {not}
seanhalle@29: {   { #0 }
seanhalle@29:     { #1 }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {and}
seanhalle@29: {   'skip$
seanhalle@29:     { pop$ #0 }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {or}
seanhalle@29: {   { pop$ #1 }
seanhalle@29:     'skip$
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.block.checka}
seanhalle@29: { empty$
seanhalle@29:     'skip$
seanhalle@29:     'new.block
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.block.checkb}
seanhalle@29: { empty$
seanhalle@29:   swap$ empty$
seanhalle@29:   and
seanhalle@29:     'skip$
seanhalle@29:     'new.block
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.sentence.checka}
seanhalle@29: { empty$
seanhalle@29:     'skip$
seanhalle@29:     'new.sentence
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {new.sentence.checkb}
seanhalle@29: { empty$
seanhalle@29:   swap$ empty$
seanhalle@29:   and
seanhalle@29:     'skip$
seanhalle@29:     'new.sentence
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {field.or.null}
seanhalle@29: { duplicate$ empty$
seanhalle@29:     { pop$ "" }
seanhalle@29:     'skip$
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {emphasize}
seanhalle@29: { duplicate$ empty$
seanhalle@29:     { pop$ "" }
seanhalle@29:     { "{\em " swap$ * "}" * }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: INTEGERS { nameptr namesleft numnames }
seanhalle@29: 
seanhalle@29: FUNCTION {format.names}
seanhalle@29: { 's :=
seanhalle@29:   #1 'nameptr :=
seanhalle@29:   s num.names$ 'numnames :=
seanhalle@29:   numnames 'namesleft :=
seanhalle@29:     { namesleft #0 > }
seanhalle@29:     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
seanhalle@29:       nameptr #1 >
seanhalle@29: 	{ namesleft #1 >
seanhalle@29: 	    { ", " * t * }
seanhalle@29: 	    { numnames #2 >
seanhalle@29: 		{ "," * }
seanhalle@29: 		'skip$
seanhalle@29: 	      if$
seanhalle@29: 	      t "others" =
seanhalle@29: 		{ " et~al." * }
seanhalle@29: 		{ " and " * t * }
seanhalle@29: 	      if$
seanhalle@29: 	    }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	't
seanhalle@29:       if$
seanhalle@29:       nameptr #1 + 'nameptr :=
seanhalle@29:       namesleft #1 - 'namesleft :=
seanhalle@29:     }
seanhalle@29:   while$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.authors}
seanhalle@29: { author empty$
seanhalle@29:     { "" }
seanhalle@29:     { author format.names }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.editors}
seanhalle@29: { editor empty$
seanhalle@29:     { "" }
seanhalle@29:     { editor format.names
seanhalle@29:       editor num.names$ #1 >
seanhalle@29: 	{ ", editors" * }
seanhalle@29: 	{ ", editor" * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.title}
seanhalle@29: { title empty$
seanhalle@29:     { "" }
seanhalle@29:     { title "t" change.case$ }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {n.dashify}
seanhalle@29: { 't :=
seanhalle@29:   ""
seanhalle@29:     { t empty$ not }
seanhalle@29:     { t #1 #1 substring$ "-" =
seanhalle@29: 	{ t #1 #2 substring$ "--" = not
seanhalle@29: 	    { "--" *
seanhalle@29: 	      t #2 global.max$ substring$ 't :=
seanhalle@29: 	    }
seanhalle@29: 	    {   { t #1 #1 substring$ "-" = }
seanhalle@29: 		{ "-" *
seanhalle@29: 		  t #2 global.max$ substring$ 't :=
seanhalle@29: 		}
seanhalle@29: 	      while$
seanhalle@29: 	    }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ t #1 #1 substring$ *
seanhalle@29: 	  t #2 global.max$ substring$ 't :=
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   while$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.date}
seanhalle@29: { year empty$
seanhalle@29:     { month empty$
seanhalle@29: 	{ "" }
seanhalle@29: 	{ "there's a month but no year in " cite$ * warning$
seanhalle@29: 	  month
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { month empty$
seanhalle@29: 	'year
seanhalle@29: 	{ month " " * year * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.btitle}
seanhalle@29: { title emphasize
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {tie.or.space.connect}
seanhalle@29: { duplicate$ text.length$ #3 <
seanhalle@29:     { "~" }
seanhalle@29:     { " " }
seanhalle@29:   if$
seanhalle@29:   swap$ * *
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {either.or.check}
seanhalle@29: { empty$
seanhalle@29:     'pop$
seanhalle@29:     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.bvolume}
seanhalle@29: { volume empty$
seanhalle@29:     { "" }
seanhalle@29:     { "volume" volume tie.or.space.connect
seanhalle@29:       series empty$
seanhalle@29: 	'skip$
seanhalle@29: 	{ " of " * series emphasize * }
seanhalle@29:       if$
seanhalle@29:       "volume and number" number either.or.check
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.number.series}
seanhalle@29: { volume empty$
seanhalle@29:     { number empty$
seanhalle@29: 	{ series field.or.null }
seanhalle@29: 	{ output.state mid.sentence =
seanhalle@29: 	    { "number" }
seanhalle@29: 	    { "Number" }
seanhalle@29: 	  if$
seanhalle@29: 	  number tie.or.space.connect
seanhalle@29: 	  series empty$
seanhalle@29: 	    { "there's a number but no series in " cite$ * warning$ }
seanhalle@29: 	    { " in " * series * }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { "" }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.edition}
seanhalle@29: { edition empty$
seanhalle@29:     { "" }
seanhalle@29:     { output.state mid.sentence =
seanhalle@29: 	{ edition "l" change.case$ " edition" * }
seanhalle@29: 	{ edition "t" change.case$ " edition" * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: INTEGERS { multiresult }
seanhalle@29: 
seanhalle@29: FUNCTION {multi.page.check}
seanhalle@29: { 't :=
seanhalle@29:   #0 'multiresult :=
seanhalle@29:     { multiresult not
seanhalle@29:       t empty$ not
seanhalle@29:       and
seanhalle@29:     }
seanhalle@29:     { t #1 #1 substring$
seanhalle@29:       duplicate$ "-" =
seanhalle@29:       swap$ duplicate$ "," =
seanhalle@29:       swap$ "+" =
seanhalle@29:       or or
seanhalle@29: 	{ #1 'multiresult := }
seanhalle@29: 	{ t #2 global.max$ substring$ 't := }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   while$
seanhalle@29:   multiresult
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.pages}
seanhalle@29: { pages empty$
seanhalle@29:     { "" }
seanhalle@29:     { pages multi.page.check
seanhalle@29: 	{ "pages" pages n.dashify tie.or.space.connect }
seanhalle@29: 	{ "page" pages tie.or.space.connect }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.vol.num.pages}
seanhalle@29: { volume field.or.null
seanhalle@29:   number empty$
seanhalle@29:     'skip$
seanhalle@29:     { "(" number * ")" * *
seanhalle@29:       volume empty$
seanhalle@29: 	{ "there's a number but no volume in " cite$ * warning$ }
seanhalle@29: 	'skip$
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   pages empty$
seanhalle@29:     'skip$
seanhalle@29:     { duplicate$ empty$
seanhalle@29: 	{ pop$ format.pages }
seanhalle@29: 	{ ":" * pages n.dashify * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.chapter.pages}
seanhalle@29: { chapter empty$
seanhalle@29:     'format.pages
seanhalle@29:     { type empty$
seanhalle@29: 	{ "chapter" }
seanhalle@29: 	{ type "l" change.case$ }
seanhalle@29:       if$
seanhalle@29:       chapter tie.or.space.connect
seanhalle@29:       pages empty$
seanhalle@29: 	'skip$
seanhalle@29: 	{ ", " * format.pages * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.in.ed.booktitle}
seanhalle@29: { booktitle empty$
seanhalle@29:     { "" }
seanhalle@29:     { editor empty$
seanhalle@29: 	{ "In " booktitle emphasize * }
seanhalle@29: 	{ "In " format.editors * ", " * booktitle emphasize * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {empty.misc.check}
seanhalle@29: { author empty$ title empty$ howpublished empty$
seanhalle@29:   month empty$ year empty$ note empty$
seanhalle@29:   and and and and and
seanhalle@29:   key empty$ not and
seanhalle@29:     { "all relevant fields are empty in " cite$ * warning$ }
seanhalle@29:     'skip$
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.thesis.type}
seanhalle@29: { type empty$
seanhalle@29:     'skip$
seanhalle@29:     { pop$
seanhalle@29:       type "t" change.case$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.tr.number}
seanhalle@29: { type empty$
seanhalle@29:     { "Technical Report" }
seanhalle@29:     'type
seanhalle@29:   if$
seanhalle@29:   number empty$
seanhalle@29:     { "t" change.case$ }
seanhalle@29:     { number tie.or.space.connect }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.article.crossref}
seanhalle@29: { key empty$
seanhalle@29:     { journal empty$
seanhalle@29: 	{ "need key or journal for " cite$ * " to crossref " * crossref *
seanhalle@29: 	  warning$
seanhalle@29: 	  ""
seanhalle@29: 	}
seanhalle@29: 	{ "In {\em " journal * "\/}" * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { "In " key * }
seanhalle@29:   if$
seanhalle@29:   " \cite{" * crossref * "}" *
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.crossref.editor}
seanhalle@29: { editor #1 "{vv~}{ll}" format.name$
seanhalle@29:   editor num.names$ duplicate$
seanhalle@29:   #2 >
seanhalle@29:     { pop$ " et~al." * }
seanhalle@29:     { #2 <
seanhalle@29: 	'skip$
seanhalle@29: 	{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
seanhalle@29: 	    { " et~al." * }
seanhalle@29: 	    { " and " * editor #2 "{vv~}{ll}" format.name$ * }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.book.crossref}
seanhalle@29: { volume empty$
seanhalle@29:     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
seanhalle@29:       "In "
seanhalle@29:     }
seanhalle@29:     { "Volume" volume tie.or.space.connect
seanhalle@29:       " of " *
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   editor empty$
seanhalle@29:   editor field.or.null author field.or.null =
seanhalle@29:   or
seanhalle@29:     { key empty$
seanhalle@29: 	{ series empty$
seanhalle@29: 	    { "need editor, key, or series for " cite$ * " to crossref " *
seanhalle@29: 	      crossref * warning$
seanhalle@29: 	      "" *
seanhalle@29: 	    }
seanhalle@29: 	    { "{\em " * series * "\/}" * }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ key * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { format.crossref.editor * }
seanhalle@29:   if$
seanhalle@29:   " \cite{" * crossref * "}" *
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {format.incoll.inproc.crossref}
seanhalle@29: { editor empty$
seanhalle@29:   editor field.or.null author field.or.null =
seanhalle@29:   or
seanhalle@29:     { key empty$
seanhalle@29: 	{ booktitle empty$
seanhalle@29: 	    { "need editor, key, or booktitle for " cite$ * " to crossref " *
seanhalle@29: 	      crossref * warning$
seanhalle@29: 	      ""
seanhalle@29: 	    }
seanhalle@29: 	    { "In {\em " booktitle * "\/}" * }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ "In " key * }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { "In " format.crossref.editor * }
seanhalle@29:   if$
seanhalle@29:   " \cite{" * crossref * "}" *
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {article}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   crossref missing$
seanhalle@29:     { journal emphasize "journal" output.check
seanhalle@29:       format.vol.num.pages output
seanhalle@29:       format.date "year" output.check
seanhalle@29:     }
seanhalle@29:     { format.article.crossref output.nonnull
seanhalle@29:       format.pages output
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {book}
seanhalle@29: { output.bibitem
seanhalle@29:   author empty$
seanhalle@29:     { format.editors "author and editor" output.check }
seanhalle@29:     { format.authors output.nonnull
seanhalle@29:       crossref missing$
seanhalle@29: 	{ "author and editor" editor either.or.check }
seanhalle@29: 	'skip$
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   format.btitle "title" output.check
seanhalle@29:   crossref missing$
seanhalle@29:     { format.bvolume output
seanhalle@29:       new.block
seanhalle@29:       format.number.series output
seanhalle@29:       new.sentence
seanhalle@29:       publisher "publisher" output.check
seanhalle@29:       address output
seanhalle@29:     }
seanhalle@29:     { new.block
seanhalle@29:       format.book.crossref output.nonnull
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   format.edition output
seanhalle@29:   format.date "year" output.check
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {booklet}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors output
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   howpublished address new.block.checkb
seanhalle@29:   howpublished output
seanhalle@29:   address output
seanhalle@29:   format.date output
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {inbook}
seanhalle@29: { output.bibitem
seanhalle@29:   author empty$
seanhalle@29:     { format.editors "author and editor" output.check }
seanhalle@29:     { format.authors output.nonnull
seanhalle@29:       crossref missing$
seanhalle@29: 	{ "author and editor" editor either.or.check }
seanhalle@29: 	'skip$
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   format.btitle "title" output.check
seanhalle@29:   crossref missing$
seanhalle@29:     { format.bvolume output
seanhalle@29:       format.chapter.pages "chapter and pages" output.check
seanhalle@29:       new.block
seanhalle@29:       format.number.series output
seanhalle@29:       new.sentence
seanhalle@29:       publisher "publisher" output.check
seanhalle@29:       address output
seanhalle@29:     }
seanhalle@29:     { format.chapter.pages "chapter and pages" output.check
seanhalle@29:       new.block
seanhalle@29:       format.book.crossref output.nonnull
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   format.edition output
seanhalle@29:   format.date "year" output.check
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {incollection}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   crossref missing$
seanhalle@29:     { format.in.ed.booktitle "booktitle" output.check
seanhalle@29:       format.bvolume output
seanhalle@29:       format.number.series output
seanhalle@29:       format.chapter.pages output
seanhalle@29:       new.sentence
seanhalle@29:       publisher "publisher" output.check
seanhalle@29:       address output
seanhalle@29:       format.edition output
seanhalle@29:       format.date "year" output.check
seanhalle@29:     }
seanhalle@29:     { format.incoll.inproc.crossref output.nonnull
seanhalle@29:       format.chapter.pages output
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {inproceedings}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   crossref missing$
seanhalle@29:     { format.in.ed.booktitle "booktitle" output.check
seanhalle@29:       format.bvolume output
seanhalle@29:       format.number.series output
seanhalle@29:       format.pages output
seanhalle@29:       address empty$
seanhalle@29: 	{ organization publisher new.sentence.checkb
seanhalle@29: 	  organization output
seanhalle@29: 	  publisher output
seanhalle@29: 	  format.date "year" output.check
seanhalle@29: 	}
seanhalle@29: 	{ address output.nonnull
seanhalle@29: 	  format.date "year" output.check
seanhalle@29: 	  new.sentence
seanhalle@29: 	  organization output
seanhalle@29: 	  publisher output
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { format.incoll.inproc.crossref output.nonnull
seanhalle@29:       format.pages output
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {conference} { inproceedings }
seanhalle@29: 
seanhalle@29: FUNCTION {manual}
seanhalle@29: { output.bibitem
seanhalle@29:   author empty$
seanhalle@29:     { organization empty$
seanhalle@29: 	'skip$
seanhalle@29: 	{ organization output.nonnull
seanhalle@29: 	  address output
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { format.authors output.nonnull }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   format.btitle "title" output.check
seanhalle@29:   author empty$
seanhalle@29:     { organization empty$
seanhalle@29: 	{ address new.block.checka
seanhalle@29: 	  address output
seanhalle@29: 	}
seanhalle@29: 	'skip$
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { organization address new.block.checkb
seanhalle@29:       organization output
seanhalle@29:       address output
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   format.edition output
seanhalle@29:   format.date output
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {mastersthesis}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   "Master's thesis" format.thesis.type output.nonnull
seanhalle@29:   school "school" output.check
seanhalle@29:   address output
seanhalle@29:   format.date "year" output.check
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {misc}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors output
seanhalle@29:   title howpublished new.block.checkb
seanhalle@29:   format.title output
seanhalle@29:   howpublished new.block.checka
seanhalle@29:   howpublished output
seanhalle@29:   format.date output
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29:   empty.misc.check
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {phdthesis}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.btitle "title" output.check
seanhalle@29:   new.block
seanhalle@29:   "PhD thesis" format.thesis.type output.nonnull
seanhalle@29:   school "school" output.check
seanhalle@29:   address output
seanhalle@29:   format.date "year" output.check
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {proceedings}
seanhalle@29: { output.bibitem
seanhalle@29:   editor empty$
seanhalle@29:     { organization output }
seanhalle@29:     { format.editors output.nonnull }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   format.btitle "title" output.check
seanhalle@29:   format.bvolume output
seanhalle@29:   format.number.series output
seanhalle@29:   address empty$
seanhalle@29:     { editor empty$
seanhalle@29: 	{ publisher new.sentence.checka }
seanhalle@29: 	{ organization publisher new.sentence.checkb
seanhalle@29: 	  organization output
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:       publisher output
seanhalle@29:       format.date "year" output.check
seanhalle@29:     }
seanhalle@29:     { address output.nonnull
seanhalle@29:       format.date "year" output.check
seanhalle@29:       new.sentence
seanhalle@29:       editor empty$
seanhalle@29: 	'skip$
seanhalle@29: 	{ organization output }
seanhalle@29:       if$
seanhalle@29:       publisher output
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {techreport}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   format.tr.number output.nonnull
seanhalle@29:   institution "institution" output.check
seanhalle@29:   address output
seanhalle@29:   format.date "year" output.check
seanhalle@29:   new.block
seanhalle@29:   note output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {unpublished}
seanhalle@29: { output.bibitem
seanhalle@29:   format.authors "author" output.check
seanhalle@29:   new.block
seanhalle@29:   format.title "title" output.check
seanhalle@29:   new.block
seanhalle@29:   note "note" output.check
seanhalle@29:   format.date output
seanhalle@29:   fin.entry
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {default.type} { misc }
seanhalle@29: 
seanhalle@29: MACRO {jan} {"January"}
seanhalle@29: 
seanhalle@29: MACRO {feb} {"February"}
seanhalle@29: 
seanhalle@29: MACRO {mar} {"March"}
seanhalle@29: 
seanhalle@29: MACRO {apr} {"April"}
seanhalle@29: 
seanhalle@29: MACRO {may} {"May"}
seanhalle@29: 
seanhalle@29: MACRO {jun} {"June"}
seanhalle@29: 
seanhalle@29: MACRO {jul} {"July"}
seanhalle@29: 
seanhalle@29: MACRO {aug} {"August"}
seanhalle@29: 
seanhalle@29: MACRO {sep} {"September"}
seanhalle@29: 
seanhalle@29: MACRO {oct} {"October"}
seanhalle@29: 
seanhalle@29: MACRO {nov} {"November"}
seanhalle@29: 
seanhalle@29: MACRO {dec} {"December"}
seanhalle@29: 
seanhalle@29: MACRO {acmcs} {"ACM Computing Surveys"}
seanhalle@29: 
seanhalle@29: MACRO {acta} {"Acta Informatica"}
seanhalle@29: 
seanhalle@29: MACRO {cacm} {"Communications of the ACM"}
seanhalle@29: 
seanhalle@29: MACRO {ibmjrd} {"IBM Journal of Research and Development"}
seanhalle@29: 
seanhalle@29: MACRO {ibmsj} {"IBM Systems Journal"}
seanhalle@29: 
seanhalle@29: MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
seanhalle@29: 
seanhalle@29: MACRO {ieeetc} {"IEEE Transactions on Computers"}
seanhalle@29: 
seanhalle@29: MACRO {ieeetcad}
seanhalle@29:  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
seanhalle@29: 
seanhalle@29: MACRO {ipl} {"Information Processing Letters"}
seanhalle@29: 
seanhalle@29: MACRO {jacm} {"Journal of the ACM"}
seanhalle@29: 
seanhalle@29: MACRO {jcss} {"Journal of Computer and System Sciences"}
seanhalle@29: 
seanhalle@29: MACRO {scp} {"Science of Computer Programming"}
seanhalle@29: 
seanhalle@29: MACRO {sicomp} {"SIAM Journal on Computing"}
seanhalle@29: 
seanhalle@29: MACRO {tocs} {"ACM Transactions on Computer Systems"}
seanhalle@29: 
seanhalle@29: MACRO {tods} {"ACM Transactions on Database Systems"}
seanhalle@29: 
seanhalle@29: MACRO {tog} {"ACM Transactions on Graphics"}
seanhalle@29: 
seanhalle@29: MACRO {toms} {"ACM Transactions on Mathematical Software"}
seanhalle@29: 
seanhalle@29: MACRO {toois} {"ACM Transactions on Office Information Systems"}
seanhalle@29: 
seanhalle@29: MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
seanhalle@29: 
seanhalle@29: MACRO {tcs} {"Theoretical Computer Science"}
seanhalle@29: 
seanhalle@29: READ
seanhalle@29: 
seanhalle@29: FUNCTION {sortify}
seanhalle@29: { purify$
seanhalle@29:   "l" change.case$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: INTEGERS { len }
seanhalle@29: 
seanhalle@29: FUNCTION {chop.word}
seanhalle@29: { 's :=
seanhalle@29:   'len :=
seanhalle@29:   s #1 len substring$ =
seanhalle@29:     { s len #1 + global.max$ substring$ }
seanhalle@29:     's
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {sort.format.names}
seanhalle@29: { 's :=
seanhalle@29:   #1 'nameptr :=
seanhalle@29:   ""
seanhalle@29:   s num.names$ 'numnames :=
seanhalle@29:   numnames 'namesleft :=
seanhalle@29:     { namesleft #0 > }
seanhalle@29:     { nameptr #1 >
seanhalle@29: 	{ "   " * }
seanhalle@29: 	'skip$
seanhalle@29:       if$
seanhalle@29:       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
seanhalle@29:       nameptr numnames = t "others" = and
seanhalle@29: 	{ "et al" * }
seanhalle@29: 	{ t sortify * }
seanhalle@29:       if$
seanhalle@29:       nameptr #1 + 'nameptr :=
seanhalle@29:       namesleft #1 - 'namesleft :=
seanhalle@29:     }
seanhalle@29:   while$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {sort.format.title}
seanhalle@29: { 't :=
seanhalle@29:   "A " #2
seanhalle@29:     "An " #3
seanhalle@29:       "The " #4 t chop.word
seanhalle@29:     chop.word
seanhalle@29:   chop.word
seanhalle@29:   sortify
seanhalle@29:   #1 global.max$ substring$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {author.sort}
seanhalle@29: { author empty$
seanhalle@29:     { key empty$
seanhalle@29: 	{ "to sort, need author or key in " cite$ * warning$
seanhalle@29: 	  ""
seanhalle@29: 	}
seanhalle@29: 	{ key sortify }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { author sort.format.names }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {author.editor.sort}
seanhalle@29: { author empty$
seanhalle@29:     { editor empty$
seanhalle@29: 	{ key empty$
seanhalle@29: 	    { "to sort, need author, editor, or key in " cite$ * warning$
seanhalle@29: 	      ""
seanhalle@29: 	    }
seanhalle@29: 	    { key sortify }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ editor sort.format.names }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { author sort.format.names }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {author.organization.sort}
seanhalle@29: { author empty$
seanhalle@29:     { organization empty$
seanhalle@29: 	{ key empty$
seanhalle@29: 	    { "to sort, need author, organization, or key in " cite$ * warning$
seanhalle@29: 	      ""
seanhalle@29: 	    }
seanhalle@29: 	    { key sortify }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ "The " #4 organization chop.word sortify }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { author sort.format.names }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {editor.organization.sort}
seanhalle@29: { editor empty$
seanhalle@29:     { organization empty$
seanhalle@29: 	{ key empty$
seanhalle@29: 	    { "to sort, need editor, organization, or key in " cite$ * warning$
seanhalle@29: 	      ""
seanhalle@29: 	    }
seanhalle@29: 	    { key sortify }
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29: 	{ "The " #4 organization chop.word sortify }
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:     { editor sort.format.names }
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {presort}
seanhalle@29: { type$ "book" =
seanhalle@29:   type$ "inbook" =
seanhalle@29:   or
seanhalle@29:     'author.editor.sort
seanhalle@29:     { type$ "proceedings" =
seanhalle@29: 	'editor.organization.sort
seanhalle@29: 	{ type$ "manual" =
seanhalle@29: 	    'author.organization.sort
seanhalle@29: 	    'author.sort
seanhalle@29: 	  if$
seanhalle@29: 	}
seanhalle@29:       if$
seanhalle@29:     }
seanhalle@29:   if$
seanhalle@29:   "    "
seanhalle@29:   *
seanhalle@29:   year field.or.null sortify
seanhalle@29:   *
seanhalle@29:   "    "
seanhalle@29:   *
seanhalle@29:   title field.or.null
seanhalle@29:   sort.format.title
seanhalle@29:   *
seanhalle@29:   #1 entry.max$ substring$
seanhalle@29:   'sort.key$ :=
seanhalle@29: }
seanhalle@29: 
seanhalle@29: ITERATE {presort}
seanhalle@29: 
seanhalle@29: SORT
seanhalle@29: 
seanhalle@29: STRINGS { longest.label }
seanhalle@29: 
seanhalle@29: INTEGERS { number.label longest.label.width }
seanhalle@29: 
seanhalle@29: FUNCTION {initialize.longest.label}
seanhalle@29: { "" 'longest.label :=
seanhalle@29:   #1 'number.label :=
seanhalle@29:   #0 'longest.label.width :=
seanhalle@29: }
seanhalle@29: 
seanhalle@29: FUNCTION {longest.label.pass}
seanhalle@29: { number.label int.to.str$ 'label :=
seanhalle@29:   number.label #1 + 'number.label :=
seanhalle@29:   label width$ longest.label.width >
seanhalle@29:     { label 'longest.label :=
seanhalle@29:       label width$ 'longest.label.width :=
seanhalle@29:     }
seanhalle@29:     'skip$
seanhalle@29:   if$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: EXECUTE {initialize.longest.label}
seanhalle@29: 
seanhalle@29: ITERATE {longest.label.pass}
seanhalle@29: 
seanhalle@29: FUNCTION {begin.bib}
seanhalle@29: { preamble$ empty$
seanhalle@29:     'skip$
seanhalle@29:     { preamble$ write$ newline$ }
seanhalle@29:   if$
seanhalle@29:   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: EXECUTE {begin.bib}
seanhalle@29: 
seanhalle@29: EXECUTE {init.state.consts}
seanhalle@29: 
seanhalle@29: ITERATE {call.type$}
seanhalle@29: 
seanhalle@29: FUNCTION {end.bib}
seanhalle@29: { newline$
seanhalle@29:   "\end{thebibliography}" write$ newline$
seanhalle@29: }
seanhalle@29: 
seanhalle@29: EXECUTE {end.bib}
seanhalle@29: 




