9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett% BibTeX standard bibliography style `abbrv'
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % Copyright (C) 1985, all rights reserved.
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % Copying of this file is authorized only if either
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % (1) you make absolutely no changes to your copy, including name, or
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % (2) if you do make changes, you name it something other than
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % This restriction helps ensure that all standard styles are identical.
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett % The file btxbst.doc has the documentation for this style.
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettENTRY
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett { address
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett author
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett booktitle
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett chapter
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett edition
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett editor
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett howpublished
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett institution
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett journal
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett key
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett month
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett note
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett number
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett organization
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett pages
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett publisher
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett school
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett series
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett title
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett type
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett volume
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett year
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett {}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { label }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettINTEGERS { output.state before.all mid.sentence after.sentence after.block }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {init.state.consts}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ #0 'before.all :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett #1 'mid.sentence :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett #2 'after.sentence :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett #3 'after.block :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettSTRINGS { s t }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {output.nonnull}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ 's :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett output.state mid.sentence =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { ", " * write$ }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { output.state after.block =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { add.period$ write$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett newline$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett "\newblock " write$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { output.state before.all =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'write$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { add.period$ " " * write$ }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett mid.sentence 'output.state :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett s
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {output}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ duplicate$ empty$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'pop$
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett 'output.nonnull
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett if$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett}
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettFUNCTION {output.check}
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett{ 't :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett duplicate$ empty$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { pop$ "empty " t * " in " * cite$ * warning$ }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'output.nonnull
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett if$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett}
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettFUNCTION {output.bibitem}
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett{ newline$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett "\bibitem{" write$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett cite$ write$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett "}" write$
aa0d5f8be9950e788884f7431cf4cb7bee74788cAndy Gimblett newline$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett ""
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett before.all 'output.state :=
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {fin.entry}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ add.period$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett write$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett newline$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {new.block}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ output.state before.all =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'skip$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { after.block 'output.state := }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {new.sentence}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ output.state after.block =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'skip$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { output.state before.all =
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'skip$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { after.sentence 'output.state := }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {not}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ { #0 }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { #1 }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {and}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ 'skip$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { pop$ #0 }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {or}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ { pop$ #1 }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'skip$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {new.block.checka}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'skip$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'new.block
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettFUNCTION {new.block.checkb}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett swap$ empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett and
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'skip$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'new.block
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy GimblettFUNCTION {new.sentence.checka}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett{ empty$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett 'skip$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett 'new.sentence
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy GimblettFUNCTION {new.sentence.checkb}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett{ empty$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett swap$ empty$
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett and
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett 'skip$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'new.sentence
b34e5090387d45b3a35f88eaa23477a83d2a2962Andy Gimblett if$
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett}
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett
d40dd10adffcf341489a1310092fcc99de75f225Andy GimblettFUNCTION {field.or.null}
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett{ duplicate$ empty$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { pop$ "" }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett 'skip$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettFUNCTION {emphasize}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ duplicate$ empty$
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { pop$ "" }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { "{\em " swap$ * "}" * }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettINTEGERS { nameptr namesleft numnames }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettFUNCTION {format.names}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ 's :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett #1 'nameptr :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett s num.names$ 'numnames :=
d40dd10adffcf341489a1310092fcc99de75f225Andy Gimblett numnames 'namesleft :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { namesleft #0 > }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett nameptr #1 >
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { namesleft #1 >
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { ", " * t * }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { numnames #2 >
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "," * }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 'skip$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett t "others" =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { " et~al." * }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { " and " * t * }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett 't
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett nameptr #1 + 'nameptr :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett namesleft #1 - 'namesleft :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett while$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettFUNCTION {format.authors}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ author empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "" }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { author format.names }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettFUNCTION {format.editors}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ editor empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "" }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { editor format.names
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett editor num.names$ #1 >
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { ", eds." * }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett { ", ed." * }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if$
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy GimblettFUNCTION {format.title}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett{ title empty$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "" }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett { title "t" change.case$ }
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett if$
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett}
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy GimblettFUNCTION {n.dashify}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett{ 't :=
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett ""
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { t empty$ not }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { t #1 #1 substring$ "-" =
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { t #1 #2 substring$ "--" = not
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "--" *
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett t #2 global.max$ substring$ 't :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { { t #1 #1 substring$ "-" = }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett { "-" *
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett t #2 global.max$ substring$ 't :=
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett while$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett { t #1 #1 substring$ *
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett t #2 global.max$ substring$ 't :=
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett }
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett if$
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett }
ae6d8241c2ce8132a6e22d9f854edb612c2f637dAndy Gimblett while$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy GimblettFUNCTION {format.date}
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett{ year empty$
b5301fa0ef9e88a488e5cfe8c395a05c2f6884d3Andy Gimblett { month empty$
{ "" }
{ "there's a month but no year in " cite$ * warning$
month
}
if$
}
{ month empty$
'year
{ month " " * year * }
if$
}
if$
}
FUNCTION {format.btitle}
{ title emphasize
}
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
{ " " }
if$
swap$ * *
}
FUNCTION {either.or.check}
{ empty$
'pop$
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
if$
}
FUNCTION {format.bvolume}
{ volume empty$
{ "" }
{ "vol." volume tie.or.space.connect
series empty$
'skip$
{ " of " * series emphasize * }
if$
"volume and number" number either.or.check
}
if$
}
FUNCTION {format.number.series}
{ volume empty$
{ number empty$
{ series field.or.null }
{ output.state mid.sentence =
{ "number" }
{ "Number" }
if$
number tie.or.space.connect
series empty$
{ "there's a number but no series in " cite$ * warning$ }
{ " in " * series * }
if$
}
if$
}
{ "" }
if$
}
FUNCTION {format.edition}
{ edition empty$
{ "" }
{ output.state mid.sentence =
{ edition "l" change.case$ " edition" * }
{ edition "t" change.case$ " edition" * }
if$
}
if$
}
INTEGERS { multiresult }
FUNCTION {multi.page.check}
{ 't :=
#0 'multiresult :=
{ multiresult not
t empty$ not
and
}
{ t #1 #1 substring$
duplicate$ "-" =
swap$ duplicate$ "," =
swap$ "+" =
or or
{ #1 'multiresult := }
{ t #2 global.max$ substring$ 't := }
if$
}
while$
multiresult
}
FUNCTION {format.pages}
{ pages empty$
{ "" }
{ pages multi.page.check
{ "pp." pages n.dashify tie.or.space.connect }
{ "page" pages tie.or.space.connect }
if$
}
if$
}
FUNCTION {format.vol.num.pages}
{ volume field.or.null
number empty$
'skip$
{ "(" number * ")" * *
volume empty$
{ "there's a number but no volume in " cite$ * warning$ }
'skip$
if$
}
if$
pages empty$
'skip$
{ duplicate$ empty$
{ pop$ format.pages }
{ ":" * pages n.dashify * }
if$
}
if$
}
FUNCTION {format.chapter.pages}
{ chapter empty$
'format.pages
{ type empty$
{ "chapter" }
{ type "l" change.case$ }
if$
chapter tie.or.space.connect
pages empty$
'skip$
{ ", " * format.pages * }
if$
}
if$
}
FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
{ "" }
{ editor empty$
{ "In " booktitle emphasize * }
{ "In " format.editors * ", " * booktitle emphasize * }
if$
}
if$
}
FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
month empty$ year empty$ note empty$
and and and and and
key empty$ not and
{ "all relevant fields are empty in " cite$ * warning$ }
'skip$
if$
}
FUNCTION {format.thesis.type}
{ type empty$
'skip$
{ pop$
type "t" change.case$
}
if$
}
FUNCTION {format.tr.number}
{ type empty$
{ "Technical Report" }
'type
if$
number empty$
{ "t" change.case$ }
{ number tie.or.space.connect }
if$
}
FUNCTION {format.article.crossref}
{ key empty$
{ journal empty$
{ "need key or journal for " cite$ * " to crossref " * crossref *
warning$
""
}
{ "In {\em " journal * "\/}" * }
if$
}
{ "In " key * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {format.crossref.editor}
{ editor #1 "{vv~}{ll}" format.name$
editor num.names$ duplicate$
#2 >
{ pop$ " et~al." * }
{ #2 <
'skip$
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ " et~al." * }
{ " and " * editor #2 "{vv~}{ll}" format.name$ * }
if$
}
if$
}
if$
}
FUNCTION {format.book.crossref}
{ volume empty$
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
"In "
}
{ "Vol." volume tie.or.space.connect
" of " *
}
if$
editor empty$
editor field.or.null author field.or.null =
or
{ key empty$
{ series empty$
{ "need editor, key, or series for " cite$ * " to crossref " *
crossref * warning$
"" *
}
{ "{\em " * series * "\/}" * }
if$
}
{ key * }
if$
}
{ format.crossref.editor * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {format.incoll.inproc.crossref}
{ editor empty$
editor field.or.null author field.or.null =
or
{ key empty$
{ booktitle empty$
{ "need editor, key, or booktitle for " cite$ * " to crossref " *
crossref * warning$
""
}
{ "In {\em " booktitle * "\/}" * }
if$
}
{ "In " key * }
if$
}
{ "In " format.crossref.editor * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
crossref missing$
{ journal emphasize "journal" output.check
format.vol.num.pages output
format.date "year" output.check
}
{ format.article.crossref output.nonnull
format.pages output
}
if$
new.block
note output
fin.entry
}
FUNCTION {book}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check }
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
new.block
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
new.block
format.number.series output
new.sentence
publisher "publisher" output.check
address output
}
{ new.block
format.book.crossref output.nonnull
}
if$
format.edition output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {booklet}
{ output.bibitem
format.authors output
new.block
format.title "title" output.check
howpublished address new.block.checkb
howpublished output
address output
format.date output
new.block
note output
fin.entry
}
FUNCTION {inbook}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check }
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
new.block
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.chapter.pages "chapter and pages" output.check
new.block
format.number.series output
new.sentence
publisher "publisher" output.check
address output
}
{ format.chapter.pages "chapter and pages" output.check
new.block
format.book.crossref output.nonnull
}
if$
format.edition output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {incollection}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
format.chapter.pages output
new.sentence
publisher "publisher" output.check
address output
format.edition output
format.date "year" output.check
}
{ format.incoll.inproc.crossref output.nonnull
format.chapter.pages output
}
if$
new.block
note output
fin.entry
}
FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
format.pages output
address empty$
{ organization publisher new.sentence.checkb
organization output
publisher output
format.date "year" output.check
}
{ address output.nonnull
format.date "year" output.check
new.sentence
organization output
publisher output
}
if$
}
{ format.incoll.inproc.crossref output.nonnull
format.pages output
}
if$
new.block
note output
fin.entry
}
FUNCTION {conference} { inproceedings }
FUNCTION {manual}
{ output.bibitem
author empty$
{ organization empty$
'skip$
{ organization output.nonnull
address output
}
if$
}
{ format.authors output.nonnull }
if$
new.block
format.btitle "title" output.check
author empty$
{ organization empty$
{ address new.block.checka
address output
}
'skip$
if$
}
{ organization address new.block.checkb
organization output
address output
}
if$
format.edition output
format.date output
new.block
note output
fin.entry
}
FUNCTION {mastersthesis}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
"Master's thesis" format.thesis.type output.nonnull
school "school" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {misc}
{ output.bibitem
format.authors output
title howpublished new.block.checkb
format.title output
howpublished new.block.checka
howpublished output
format.date output
new.block
note output
fin.entry
empty.misc.check
}
FUNCTION {phdthesis}
{ output.bibitem
format.authors "author" output.check
new.block
format.btitle "title" output.check
new.block
"PhD thesis" format.thesis.type output.nonnull
school "school" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {proceedings}
{ output.bibitem
editor empty$
{ organization output }
{ format.editors output.nonnull }
if$
new.block
format.btitle "title" output.check
format.bvolume output
format.number.series output
address empty$
{ editor empty$
{ publisher new.sentence.checka }
{ organization publisher new.sentence.checkb
organization output
}
if$
publisher output
format.date "year" output.check
}
{ address output.nonnull
format.date "year" output.check
new.sentence
editor empty$
'skip$
{ organization output }
if$
publisher output
}
if$
new.block
note output
fin.entry
}
FUNCTION {techreport}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
format.tr.number output.nonnull
institution "institution" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {unpublished}
{ output.bibitem
format.authors "author" output.check
new.block
format.title "title" output.check
new.block
note "note" output.check
format.date output
fin.entry
}
FUNCTION {default.type} { misc }
MACRO {jan} {"Jan."}
MACRO {feb} {"Feb."}
MACRO {mar} {"Mar."}
MACRO {apr} {"Apr."}
MACRO {may} {"May"}
MACRO {jun} {"June"}
MACRO {jul} {"July"}
MACRO {aug} {"Aug."}
MACRO {sep} {"Sept."}
MACRO {oct} {"Oct."}
MACRO {nov} {"Nov."}
MACRO {dec} {"Dec."}
MACRO {acmcs} {"ACM Comput. Surv."}
MACRO {acta} {"Acta Inf."}
MACRO {cacm} {"Commun. ACM"}
MACRO {ibmjrd} {"IBM J. Res. Dev."}
MACRO {ibmsj} {"IBM Syst.~J."}
MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
MACRO {ieeetc} {"IEEE Trans. Comput."}
MACRO {ieeetcad}
{"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
MACRO {ipl} {"Inf. Process. Lett."}
MACRO {jacm} {"J.~ACM"}
MACRO {jcss} {"J.~Comput. Syst. Sci."}
MACRO {scp} {"Sci. Comput. Programming"}
MACRO {sicomp} {"SIAM J. Comput."}
MACRO {tocs} {"ACM Trans. Comput. Syst."}
MACRO {tods} {"ACM Trans. Database Syst."}
MACRO {tog} {"ACM Trans. Gr."}
MACRO {toms} {"ACM Trans. Math. Softw."}
MACRO {toois} {"ACM Trans. Office Inf. Syst."}
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
MACRO {tcs} {"Theoretical Comput. Sci."}
READ
FUNCTION {sortify}
{ purify$
"l" change.case$
}
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
's
if$
}
FUNCTION {sort.format.names}
{ 's :=
#1 'nameptr :=
""
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ " " * }
'skip$
if$
s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
nameptr numnames = t "others" = and
{ "et al" * }
{ t sortify * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {sort.format.title}
{ 't :=
"A " #2
"An " #3
"The " #4 t chop.word
chop.word
chop.word
sortify
#1 global.max$ substring$
}
FUNCTION {author.sort}
{ key empty$
{ author empty$
{ "to sort, need author or key in " cite$ * warning$
""
}
{ author sort.format.names }
if$
}
{ key sortify }
if$
}
FUNCTION {author.editor.sort}
{ author empty$
{ editor empty$
{ key empty$
{ "to sort, need author, editor, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {author.organization.sort}
{ author empty$
{ organization empty$
{ key empty$
{ "to sort, need author, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {editor.organization.sort}
{ editor empty$
{ organization empty$
{ key empty$
{ "to sort, need editor, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ editor sort.format.names }
if$
}
FUNCTION {presort}
{ type$ "book" =
type$ "inbook" =
or
'author.editor.sort
{ type$ "proceedings" =
'editor.organization.sort
{ type$ "manual" =
'author.sort
'author.organization.sort
if$
}
if$
}
if$
" "
*
year field.or.null sortify
*
" "
*
title field.or.null
sort.format.title
*
#1 entry.max$ substring$
'sort.key$ :=
}
ITERATE {presort}
SORT
STRINGS { longest.label }
INTEGERS { number.label longest.label.width }
FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
#1 'number.label :=
#0 'longest.label.width :=
}
FUNCTION {longest.label.pass}
{ number.label int.to.str$ 'label :=
number.label #1 + 'number.label :=
label width$ longest.label.width >
{ label 'longest.label :=
label width$ 'longest.label.width :=
}
'skip$
if$
}
EXECUTE {initialize.longest.label}
ITERATE {longest.label.pass}
FUNCTION {begin.bib}
{ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
"\begin{thebibliography}{" longest.label * "}" * write$ newline$
}
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
}
EXECUTE {end.bib}