% control.bst % This is a control program for BiBTeX % It produces the bibliography file. % With modifications, it will produce any format of references! % % author: % Tom Schneider % NCI/FCRDC Bldg 469. Room 144 % P.O. Box B % Frederick, MD 21702-1201 % (301) 846-5581 (-5532 for messages) % (301) 846-5598 fax % network address: toms@ncifcrf.gov STRINGS { version } FUNCTION {version.identifier} % identify the version of the program { "% version = 1.05 of control.bst 1991 August 7" duplicate$ write$ newline$ warning$ } ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year } {} { label } INTEGERS { dotitle % toggle switch for doinng titles } STRINGS { longest.label } INTEGERS { number.label longest.label.width } STRINGS { s t } % *********************************************************** FUNCTION{comma} { ", " write$ } FUNCTION{period} { ". " write$ } FUNCTION{leftparenthesis} { "(" write$ } FUNCTION{rightparenthesis} { ") " write$ } % *********************************************************** % *********************************************************** % The following functions produce bibliography style FUNCTION{startentry} { % start the entry 's := % pick up the entry name "@" s "{" * * write$ } FUNCTION{endentry} { % end the entry "}" write$ newline$ newline$ } FUNCTION{makekey} { cite$ write$ } FUNCTION{makeauthor} { "author = " quote$ * write$ author write$ quote$ write$ } FUNCTION{maketitle} { "title = " quote$ * write$ title write$ quote$ write$ } FUNCTION{makejournal} { "journal = " quote$ * write$ journal write$ quote$ write$ } FUNCTION{makevolume} { "volume = " quote$ * write$ volume write$ quote$ write$ } FUNCTION{makepages} { "pages = " quote$ * write$ pages write$ quote$ write$ } FUNCTION{makeyear} { "year = " quote$ * write$ year write$ quote$ write$ } FUNCTION{makepublisher} { "publisher = " quote$ * write$ publisher write$ quote$ write$ } FUNCTION{makeaddress} { "address = " quote$ * write$ address write$ quote$ write$ } FUNCTION{makeeditor} { "editor = " quote$ * write$ editor write$ quote$ write$ } FUNCTION{makebooktitle} { "booktitle = " quote$ * write$ booktitle write$ quote$ write$ } FUNCTION{makeschool} { "school = " quote$ * write$ school write$ quote$ write$ } % *********************************************************** % style defined functions FUNCTION{article} { "article" startentry makekey comma newline$ makeauthor comma newline$ maketitle comma newline$ makejournal comma newline$ makevolume comma newline$ makepages comma newline$ makeyear endentry } FUNCTION{book} { "book" startentry makekey comma newline$ makeauthor comma newline$ maketitle comma newline$ makepublisher comma newline$ makeaddress comma newline$ makeyear endentry } FUNCTION{inproceedings} { "inproceedings" startentry makekey comma newline$ makeauthor comma newline$ maketitle comma newline$ makepages comma newline$ makeeditor comma newline$ makebooktitle comma newline$ makepublisher comma newline$ makeyear endentry } FUNCTION{phdthesis} { "phdthesis" startentry makekey comma newline$ makeauthor comma newline$ maketitle comma newline$ makeschool comma newline$ makeyear endentry } % *********************************************************** FUNCTION {initialize.longest.label} % initialize the variables for the longest.label.pass function { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} % determine the longest label in the references { 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$ } % *********************************************************** FUNCTION {begin.bib} { % begin the output file newline$ preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ newline$ } FUNCTION {end.bib} { % end the output file "\end{thebibliography}" write$ newline$ } % *********************************************************** READ EXECUTE {version.identifier} EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} EXECUTE {begin.bib} ITERATE {call.type$} EXECUTE {end.bib}