%%% file bib2html.bst %%% modified 21-07-1999 to produce an .html bibliography with %%% links to local preprints %%% %%% 21-07-1999 %%% minor adjustments to fix correct spacing and to add periods after %%% the publication reference. %%% 06-07-1999 %%% function begin.bib customized to output .html header. %%% function write.meta.field added. %%% function output.bibitem modified: check whether a new year started. %%% function format.names does no longer use the LaTeX tie character ~. %%% embolden, paren, emphasize, format.vol and format.page produce .html %%% coding. %%% start.link.to.abstract, end.link.to.abstract produce the .html link %%% to the abstract page, if there is an abstract. %%% the integer variable include.abstracts is set to #1 at the %%% beginning of FUNCTION {customize} if the abstracts are to %%% be included in the file. %%% the entries are sorted in the following order: reverse order of year %%% and alphabetical order of first author and alphabetical order of first %%% non-redundant word of title. %%% %%% ENTRY { abstract address author booktitle chapter edition editor email eprint institution journal key localps localpssize localpdf localpdfsize month note number organization pages publisher school series status title type volume year } {} { label } INTEGERS { vol.used i.temp include.abstracts include.links abstracts.in.one.file weird.entries } STRINGS { s t abstract.list.file abstract.dir } %%% customization of the produce bibliography and initialization of some %%% variables %%% FUNCTION {customize} { %%% if include.links equals 1 (0), then a link if made from the title %%% of the paper to another page (where the abstracts may be found) #1 'include.links := %%% if include.abstracts equals 1 (0), then the abstracts are (not) included %%% in the .html file; no links are made from the title field. #1 'include.abstracts := %%% %%% if abstracts.in.one.file equals 1 (0), then the bibitems are marked with %%% an anchor (lowercase key field), and the links to the abstracts use %%% these links. One can thus create two publication lists: a first one %%% without abstracts (putting include.abstracts = 0), and a second one %%% with abstracts. This second file is supposed to be accessed via %%% the path abstract.list.file. #0 'abstracts.in.one.file := "../Abstracts/abslist.html" 'abstract.list.file := %%% %%% the directory where the abstract .html files are to be put "../Abstracts/" 'abstract.dir := %%% %%% some variables that are needed later #0 'weird.entries := } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {output} { duplicate$ empty$ 'pop$ 'write$ if$ } %%% start of the bibitem: check whether the year has changed %%% and if yes, put a year anchor. STRINGS { current.year new.year } FUNCTION {output.bibitem} { year empty$ { "fix: year field empty or missing in " cite$ * warning$ } { year purify$ 'new.year := } if$ new.year current.year = 'skip$ { " " * write$ "

" new.year * "

" * write$ newline$ newline$ } if$ new.year 'current.year := "" * write$ newline$ "
  • " write$ abstracts.in.one.file { "" * write$ } 'skip$ if$ newline$ } %%%check whether email address contains the `@' character %%% FUNCTION {at.in.email} { #0 'i.temp := email 't := { t "" = not } { t #1 #1 substring$ "@" = { i.temp #1 + 'i.temp := } 'skip$ if$ t #2 global.max$ substring$ 't := } while$ i.temp #0 = not } FUNCTION {fin.entry} { eprint empty$ { localps empty$ localpssize empty$ or { localpdf empty$ localpdfsize empty$ or { email empty$ { "fix: neither local .ps/.pdf file nor email address for p/reprint order in " cite$ * warning$ } { "
    " write$ newline$ " [ " write$ "reprint order ] " * write$ } if$ } { "
    " write$ newline$ " [ " write$ ".pdf file (" * localpdfsize * ") ] " * write$ } if$ } { "
    " write$ newline$ " [ " write$ ".ps file (" * localpssize * ") ] " * write$ localpdf empty$ localpdfsize empty$ or 'skip$ { "  [ " write$ ".pdf file (" * localpdfsize * ") ] " * write$ } if$ } if$ } { "
    " write$ newline$ " [ " write$ eprint #1 #4 substring$ "http" = { "electronic journal ] " * write$ } { " xxx eprint ] " * write$ } if$ } if$ include.abstracts #1 = { abstract empty$ { "fix: abstract missing for entry " cite$ * warning$ } { newline$ " " write$ newline$ " " write$ } if$ } 'skip$ if$ newline$ "
  • " write$ newline$ "" * write$ newline$ "
     " write$ newline$ newline$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "" swap$ * "" * } if$ } FUNCTION {embolden} { duplicate$ empty$ { pop$ "" } { "" swap$ * "" * } if$ } FUNCTION {paren} { duplicate$ empty$ { pop$ "" } { "(" swap$ * ")" * } if$ } FUNCTION {quote} { duplicate$ empty$ { pop$ "" } { "``" swap$ * "''" * } if$ } INTEGERS { nameptr namesleft numnames } INTEGERS { etal } % formatting of the list of authors % the line 'numnames #8 >' contains the maximum number of authors % which are printed out explicitly, in this case it equals 8 (eight), % the 'prsty.bst' default value is 4 (four) % FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := % maximum number of authors follows now! numnames #20 > s numnames "{ll}" format.name$ "others" = numnames #1 > and or 'etal := etal { #1 #1 + 'namesleft := } { numnames 'namesleft := } if$ { namesleft #0 > } { s nameptr "{f{. }. }{vv}{ll}{, jj}" format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { nameptr #2 > { "," * } 'skip$ if$ t "others" = etal or { " et al." * } { " and " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.edited} { editor empty$ { "" } { "edited by " editor format.names * } if$ } FUNCTION {format.title} { title empty$ { "fix: title missing in entry" cite$ * warning$ "" } { title } if$ } FUNCTION {lc.first.letter} { 't := "" t #1 #1 substring$ "l" change.case$ * t #2 global.max$ substring$ * } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "-" * t #2 global.max$ substring$ 't := } { "-" * t #3 global.max$ substring$ 't := } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {first.page} { 't := "" { t empty$ not t #1 #1 substring$ "-" = not and } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } while$ } FUNCTION {format.date} { year empty$ { "" } 'year 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$ } 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 * } { "p.\ " pages * } if$ } if$ } FUNCTION {if.comma} { { ", " * } 'skip$ if$ } % pushes "" if value passed is empty$ FUNCTION {push.string} { 'i.temp := duplicate$ empty$ { pop$ "" } { i.temp if.comma } if$ } % pushes "" if value passed is empty$ FUNCTION {push.string.check} { 'i.temp := duplicate$ empty$ { pop$ "Warning: " swap$ * " missing in entry " cite$ "." * * * warning$ "" } { swap$ pop$ i.temp if.comma } if$ } % adds nothing if value passed is empty$ FUNCTION {add.string} { 'i.temp := duplicate$ empty$ { pop$ } { * i.temp if.comma } if$ } % adds nothing if value passed is empty$ FUNCTION {add.string.check} { 'i.temp := duplicate$ empty$ { pop$ "Warning: " swap$ * " missing in entry " cite$ "." * * * warning$ } { swap$ pop$ * i.temp if.comma } if$ } FUNCTION {format.page} { pages empty$ { "" } { include.abstracts #1 = { pages n.dashify " " swap$ * } { pages first.page " " swap$ * } if$ } if$ } FUNCTION {format.vol} { " " volume embolden * " " * } FUNCTION {empty.misc.check} { author empty$ title empty$ year empty$ note empty$ and and and 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$ } { type empty$ { " No. " * } { " " * } if$ number * } if$ } FUNCTION {format.etc} { vol.used 'skip$ { number empty$ { volume empty$ 'skip$ { "Vol. " volume * * chapter empty$ pages empty$ note empty$ and and 'skip$ { ", " * } if$ } if$ } { "No. " number * * chapter empty$ pages empty$ note empty$ and and 'skip$ { ", " * } if$ } if$ } if$ chapter empty$ 'skip$ { type empty$ { "Chap. " chapter * * } { type "u" change.case$ "l" change.case$ " " chapter * * * } if$ pages empty$ note empty$ and 'skip$ { ", " * } if$ } if$ pages empty$ 'skip$ { format.pages * note empty$ 'skip$ { ", " * } if$ } if$ note empty$ 'skip$ { note lc.first.letter * } if$ } FUNCTION {format.pub.add.year.etc} { " (" publisher empty$ { "PUBLISHER" "No publisher for entry " cite$ "." * * warning$ } { publisher } if$ ", " * * address empty$ { "" "Missing address in entry " cite$ * "." * warning$ } { address ", " * } if$ * year empty$ { "YEAR" } 'year if$ ")" * * volume empty$ not number empty$ not or title empty$ series empty$ or and chapter empty$ not or pages empty$ not or type empty$ not or note empty$ not or { ", " * format.etc } 'skip$ if$ } FUNCTION {format.bedition} { edition empty$ { "" } { edition "l" change.case$ duplicate$ "first" = { pop$ "1st " } { duplicate$ "second" = { pop$ "2nd " } { duplicate$ "third" = { pop$ "3rd " } 'skip$ if$ } if$ } if$ " ed." * } if$ } FUNCTION {format.title.and.series.and.org} { #0 'vol.used := "" duplicate$ 's := title empty$ 'skip$ { title quote #1 add.string } % { title 's := } if$ booktitle empty$ 'skip$ { booktitle 's := } if$ s empty$ 'skip$ { type$ "inproceedings" = type$ "proceedings" = or type$ "inbook" = or { " in " * } { author empty$ not editor empty$ not and { " in " * } 'skip$ if$ } if$ s emphasize series empty$ editor empty$ edition empty$ and and not type$ "inproceedings" = organization empty$ not and type$ "proceedings" = organization empty$ not and or or add.string } if$ series empty$ 'skip$ { s empty$ 'skip$ { number empty$ { volume empty$ 'skip$ { "Vol. " volume " of " * * * #1 'vol.used := } if$ } { "No. " number " in " * * * #1 'vol.used := } if$ } if$ series emphasize edition empty$ not editor empty$ not type$ "inproceedings" = organization empty$ not and type$ "proceedings" = organization empty$ not and or or or add.string } if$ type$ "inproceedings" = type$ "proceedings" = or { organization empty$ 'skip$ { organization editor empty$ edition empty$ and not add.string } if$ } 'skip$ if$ } %%% definition of meta function (for meta fields in the .html header) %%% two parameters: meta field NAME and CONTENT %%% these parameters are read from the stack FUNCTION {write.meta.field} { swap$ % swaps last two stack entries " " * write$ newline$ } FUNCTION {start.link.to.abstract} { include.links #1 = { abstract empty$ 'skip$ { "" * write$ } { abstract.dir label * ".html" * quote$ * ">" * write$ } if$ } if$ } 'skip$ if$ } FUNCTION {end.link.to.abstract} { include.links #1 = { abstract empty$ { "
    " write$ } { "

    " write$ } if$ } { "
    " write$ } if$ } % definition of the 'article' \bibitem % % FUNCTION {article} { output.bibitem format.authors " " swap$ * "
    " * write$ newline$ " " write$ start.link.to.abstract %%% the purify$ command after `format.title' removes non-alphanumeric %%% characters from the title field, like {, } and others. Be careful %%% with TeX codings for special characters! Perhaps a different way %%% to remove {, } is better. format.title embolden write$ end.link.to.abstract newline$ status empty$ { "" } { status "p" = { "" } { status "s" = { "submitted to  " } { status "tbp" = { "to be published in  " } { "fix: unknown status in " cite$ * warning$ "" } if$ } if$ } if$ } if$ journal emphasize * " " swap$ * write$ format.vol format.date paren * format.page * note empty$ 'skip$ { ", " * note lc.first.letter * } if$ add.period$ write$ fin.entry } FUNCTION {book} { output.bibitem format.authors #1 push.string "title" format.title.and.series.and.org #0 add.string.check format.bedition editor empty$ not add.string output format.edited #0 push.string format.pub.add.year.etc #0 add.string fin.entry } FUNCTION {inbook} { book } FUNCTION {incollection} { book } FUNCTION {inproceedings}{ book } FUNCTION {proceedings} { book } FUNCTION {conference} { book } FUNCTION {mastersthesis} { output.bibitem "author" format.authors #1 push.string.check output "title" format.title emphasize #1 push.string.check "Master's thesis" format.thesis.type #1 add.string "school" school #1 add.string.check address #1 add.string "year" format.date note empty$ not add.string.check note empty$ 'skip$ { note lc.first.letter * } if$ fin.entry } FUNCTION {phdthesis} { output.bibitem "author" format.authors #1 push.string.check output "title" format.title emphasize #1 push.string.check "Ph.D. thesis" format.thesis.type #1 add.string "school" school #1 add.string.check address #1 add.string "year" format.date note empty$ not add.string.check note empty$ 'skip$ { note lc.first.letter * } if$ fin.entry } FUNCTION {misc} { output.bibitem format.authors title empty$ year empty$ note empty$ and and not push.string format.title year empty$ note empty$ and not add.string format.date note empty$ not add.string note empty$ 'skip$ { note author empty$ title empty$ year empty$ and and 'skip$ 'lc.first.letter if$ #0 add.string } if$ fin.entry empty.misc.check } FUNCTION {manual} { misc } FUNCTION {techreport} { output.bibitem "author" format.authors #1 push.string.check output "title" format.title emphasize #1 push.string.check format.tr.number address empty$ note empty$ and not add.string address #0 add.string year empty$ { " (unpublished)" } { " (" year * ", unpublished)" * } if$ note empty$ not add.string note empty$ 'skip$ { note lc.first.letter * } if$ fin.entry } FUNCTION {unpublished} { output.bibitem "author" format.authors #1 push.string.check output "title" format.title emphasize note empty$ not push.string.check note empty$ 'skip$ { note lc.first.letter #0 add.string } if$ year empty$ { " (unpublished)" } { " (" year * ", unpublished)" * } if$ * fin.entry } FUNCTION {default.type} { misc } %%% macros for value of the status field MACRO {p} {"p"} % published MACRO {s} {"s"} % submitted MACRO {tbp} {"tbp"} % to be published MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} %%% journal abbreviations MACRO {acmcs} {"ACM Comput. Surv."} MACRO {acta} {"Acta Inf."} MACRO {apl} {"Appl. Phys. Lett."} MACRO {applopt} {"Appl. Opt."} MACRO {applph} {"Appl. Phys."} MACRO {applphb} {"Appl. Phys. B"} MACRO {cacm} {"Commun. ACM"} MACRO {epl} {"Europhys. Lett."} 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} {"Theor. Comput. Sci."} MACRO {anp} {"Adv. Nucl. Phys."} MACRO {ap} {"Ann. Phys."} MACRO {arnpc} {"Annu. Rev. Nucl. Part. Sci."} MACRO {baps} {"Bull. Am. Phys. Soc."} MACRO {cp} {"Computers Phys."} MACRO {epjd} {"Eur. Phys. J. D"} MACRO {jp} {"J. Phys."} MACRO {jpa} {"J. Phys. A"} MACRO {jpb} {"J. Phys. B"} MACRO {josa} {"J. Opt. Soc. Am."} MACRO {josaa} {"J. Opt. Soc. Am. A"} MACRO {josab} {"J. Opt. Soc. Am. B"} MACRO {nim} {"Nucl. Instrum. Meth."} MACRO {np} {"Nucl. Phys."} MACRO {rmp} {"Rev. Mod. Phys."} MACRO {optcomm} {"Opt. Commun."} MACRO {optlett} {"Opt. Lett."} MACRO {physbl} {"Phys. Bl."} MACRO {physica} {"Physica"} MACRO {pl} {"Phys. Lett."} MACRO {pla} {"Phys. Lett. A"} MACRO {plb} {"Phys. Lett. B"} MACRO {pr} {"Phys. Rev."} MACRO {pra} {"Phys. Rev. A"} MACRO {prb} {"Phys. Rev. B"} MACRO {prc} {"Phys. Rev. C"} MACRO {prd} {"Phys. Rev. D"} MACRO {pre} {"Phys. Rev. E"} MACRO {prl} {"Phys. Rev. Lett."} MACRO {prep} {"Phys. Rep."} MACRO {ps} {"Phys. Scr."} MACRO {rpp} {"Rep. Prog. Phys."} MACRO {sjnp} {"Sov. J. Nucl. Phys."} MACRO {springmp} {"Springer Tracts in Modern Physics"} MACRO {yadfiz} {"Yad. Fiz."} MACRO {zp} {"Z. Phys."} %%% the real production of the bibliography starts here READ 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} %%% functions needed in the sorting routine EXECUTE {customize} 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$ } %%% this function inverts the year field, assuring the ordering of the entries %%% in reverse chronological order FUNCTION {invert.year} { year empty$ { "fix: year field empty or missing in " cite$ * warning$ "9999" } { year purify$ text.length$ #4 = { "" 's := year purify$ 't := { t text.length$ #0 > } { t #1 #1 substring$ chr.to.int$ #57 swap$ - int.to.str$ s swap$ * 's := t #2 global.max$ substring$ 't := } while$ s } { "fix: year entry in " cite$ * " not in YYYY format!" * warning$ "" } if$ } if$ } %%% the key that is used for the .html abstract file FUNCTION {calc.label} { cite$ "l" change.case$ 'label := } FUNCTION {sort.format.names} %%% takes the last name of the first author in lowercase letters { #1 "{vv{}}{ll{}}" format.name$ sortify } FUNCTION {first.word} { 't := #1 'i.temp := { t i.temp #1 substring$ " " = not } { i.temp #1 + 'i.temp := } while$ t #1 i.temp #1 - substring$ } FUNCTION {sort.format.title} %%% third attribute of sort.key$: first word of title field { title empty$ %%% if no title field given, a number is used { weird.entries #1 + 'weird.entries := weird.entries int.to.str$ } %%% else, the first word of the title (unless A, An or The) is taken %%% in lowercase letters { "A " #2 "An " #3 "The " #4 title chop.word chop.word chop.word sortify first.word } if$ } FUNCTION {author.sort} { author empty$ { editor empty$ { "fix: neither author nor editor in " cite$ * warning$ "" } { editor sort.format.names } if$ } { author sort.format.names } if$ } FUNCTION {presort} { calc.label invert.year author.sort * ":" * sort.format.title * 'sort.key$ := } ITERATE {presort} SORT FUNCTION {begin.bib} { "Hello. This is bib2html.bst creating a HTML bibliography from a BibTeX database." warning$ preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "" write$ newline$ " " write$ newline$ " " * write$ newline$ "Generator" "bib2html.bst [BibTeX]" write.meta.field "Author" "Theoretical Quantum Physics Group" write.meta.field "Description" "Recent publications" write.meta.field "Keywords" "publications,potsdam,quantum theory,quantum physics" write.meta.field include.abstracts { " Publications: abstracts" write$ newline$ } { " Recent publications" write$ newline$ } if$ "" write$ newline$ "" * write$ newline$ newline$ "

    Recent Publications

    " write$ newline$ include.abstracts 'skip$ { "Click on the paper title to get the abstract." write$ newline$ } if$ newline$ "" write$ newline$ "" write$ newline$ "" write$ newline$ stack$ } EXECUTE {end.bib} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % end bib2html.bst % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%