% ============================================================================ % philphys.bst -- Philosophy of Physics BibTeX style, v1.0.1 (2026-10-14) % ============================================================================ % % A modification of Chicago style for the journal Philosophy of Physics. % % Modifications copyright 2026 Bryan W Roberts. % Distributed and/or modified under LPPL 1.3c or any later version. % This file is part of the maintained philphys work listed in LICENSE.txt. % Current maintainer: Bryan W Roberts; philphyssociety@gmail.com. % The original attribution and copying notice remain below. % Journal adaptation of Glenn Paulley's chicago.bst version 4 (1992-08-28). % Upstream downloaded from CTAN on 2026-10-07: % https://mirrors.ctan.org/biblio/bibtex/contrib/chicago/chicago.bst % The upstream attribution and copying notice are retained verbatim below. % This derivative has a distinct filename; upstream metadata below describes % chicago.bst, not this modified file. The journal changes are marked POP. % % USAGE (with philphys.cls, which already loads natbib and url): % \bibliographystyle{philphys} % \bibliography{philphys-sample-bibliography} % Compile LaTeX, BibTeX, LaTeX, LaTeX, or use latexmk -pdf. % Do not load the obsolete chicago.sty mentioned in the upstream comments. % % % DATA CONVENTIONS / SUPPORTED EXTENSIONS: % Use ordinary BibTeX fields, not biblatex date/journaltitle/location fields. % Titles retain exactly the supplied case; enter the desired title case yourself. % Protect TeX accents and special names, e.g. D{\"u}rr and {{Planck Collaboration}}. % DOI accepts a bare identifier, doi:identifier, or http(s)://(dx.)doi.org/... % eid (or articleno) can supply an article identifier when pages is absent. % eprint plus archiveprefix=arXiv supplies a link when url is absent. % urldate is optional free-form text, e.g. {7 October 2026}. % edition is an ordinal without "ed.", e.g. {2nd}; year may be {forthcoming}. % Missing year becomes n.d.; initials, particles, suffixes and corporate names % follow standard BibTeX name parsing. There is no automatic title-case conversion. % Crossref inheritance works; put booktitle on the parent/child for chapters. % % MAINTENANCE MAP: % format.names / format.authors / format.editors: printed names and boldface. % format.title / format.btitle: quotation, punctuation and title capitalization. % format.jour.vol / format.pages: issue, pages and article-ID punctuation. % format.in.ed.booktitle: chapter container and editor order. % normalize.doi / format.url / format.doi / fin.entry: electronic references. % calc.label / presort / forward.pass / pop.alpha.suffix: plain labels and suffixes. % Entry-type functions: ordering of fields. TeX layout stays in philphys.cls. % % ============================================================================ % ORIGINAL chicago.bst HEADER / ATTRIBUTION / COPYING NOTICE (unchanged): % ============================================================================ %%% ==================================================================== %%% @BibTeX-style-file{ %%% author = "Glenn Paulley", %%% version = "4", %%% date = "28 August 1992", %%% time = "10:23:39 199", %%% filename = "chicago.bst", %%% address = "Data Structuring Group %%% Department of Computer Science %%% University of Waterloo %%% Waterloo, Ontario, Canada %%% N2L 3G1", %%% telephone = "(519) 885-1211", %%% FAX = "(519) 885-1208", %%% checksum = "26323 1654 5143 37417", %%% email = "gnpaulle@bluebox.uwaterloo.ca", %%% codetable = "ISO/ASCII", %%% keywords = "", %%% supported = "yes", %%% abstract = "A BibTeX bibliography style that follows the %%% `B' reference style of the 13th Edition of %%% the Chicago Manual of Style. A detailed %%% feature list is given below.", %%% docstring = "The checksum field above contains a CRC-16 %%% checksum as the first value, followed by the %%% equivalent of the standard UNIX wc (word %%% count) utility output of lines, words, and %%% characters. This is produced by Robert %%% Solovay's checksum utility.", %%% } %%% ==================================================================== % % "Chicago" BibTeX style, chicago.bst % =================================== % % BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09 % Place it in a file called chicago.bst in the BibTeX search path. % You need to include chicago.sty as a \documentstyle option. % (Placing it in the same directory as the LaTeX document should also work.) % This "chicago" style is based on newapa.bst (American Psych. Assoc.) % found at ymir.claremont.edu. % % Citation format: (author-last-name year) % (author-last-name and author-last-name year) % (author-last-name, author-last-name, and author-last-name year) % (author-last-name et al. year) % (author-last-name) % author-last-name (year) % (author-last-name and author-last-name) % (author-last-name et al.) % (year) or (year,year) % year or year,year % % Reference list ordering: alphabetical by author or whatever passes % for author in the absence of one. % % This BibTeX style has support for abbreviated author lists and for % year-only citations. This is done by having the citations % actually look like % % \citeauthoryear{full-author-info}{abbrev-author-info}{year} % % The LaTeX style has to have the following (or similar) % % \let\@internalcite\cite % \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite} % \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite} % \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite} % \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite} % \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite} % % These TeX macro definitions are found in chicago.sty. Additional % commands to manipulate different components of a citation can be defined % so that, for example, you can list author's names without parentheses % if using a citation as a noun or object in a sentence. % % This file was originally copied from newapa.bst at ymir.claremont.edu. % % Features of chicago.bst: % ======================= % % - full names used in citations, but abbreviated citations are available % (see above) % - if an entry has a "month", then the month and year are also printed % as part of that bibitem. % - all conjunctions use "and" instead of "\&" % - major modification from Chicago Manual of Style (13th ed.) is that % only the first author in a reference appears last name first- % additional authors appear as J. Q. Public. % - pages are listed as "pp. xx-xx" in all entry types except % article entries. % - book, inbook, and manual use "location: publisher" (or organization) % for address and publisher. All other types list publishers separately. % - "pp." are used to identify page numbers for all entry types except % articles. % - organization is used as a citation label if neither author nor editor % is present (for manuals). % - "et al." is used for long author and editor lists, or when "others" % is used. % % Modifications and bug fixes from newapa.bst: % =========================================== % % - added month, year to bib entries if month is present % - fixed bug with In proceedings, added necessary comma after title % - all conjunctions changed to "and" from "\&" % - fixed bug with author labels in my.full.label: "et al." now is % generated when "others" is an author name % - major modification from Chicago Manual of Style (13th ed.) is that % only the first author in a reference appears last name first- % additional authors appear as J. Q. Public. % - pages are listed as "pp. xx-xx" in all entry types except % article entries. Unnecessary (IMHO) "()" around page numbers % were removed, and page numbers now don't end with a period. % - created chicago.sty for use with this bibstyle (required). % - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume, % number, and /or pages. Renamed to format.jour.vol. % - fixed bug in formatting booktitles: additional period an error if % book has a volume. % - fixed bug: editors usually given redundant period before next clause % (format.editors.dot) removed. % - added label support for organizations, if both author and editor % are missing (from alpha.bst). If organization is too long, then % the key field is used for abbreviated citations. % - In proceedings or books of several volumes, no comma was written % between the "Volume x" and the page numbers (this was intentional % in newapa.bst). Fixed. % - Some journals may not have volumes/numbers, only month/year (eg. % IEEE Computer). Fixed bug in article style that assumed volume/number % was always present. % % Original documentation for newapa.sty: % ===================================== % % This version was made by modifying the master file made by % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX % style of Peter F. Patel-Schneider. % % Copyright (C) 1985, all rights reserved. % Copying of this file is authorized only if either % (1) you make absolutely no changes to your copy, including name, or % (2) if you do make changes, you name it something other than 'newapa.bst'. % There are undoubtably bugs in this style. If you make bug fixes, % improvements, etc. please let me know. My e-mail address is: % spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com % % This style was made from 'plain.bst', 'named.bst', and 'apalike.bst', % with lots of tweaking to make it look like APA style, along with tips % from Young Ryu and Brian Reiser's modifications of 'apalike.bst'. ENTRY { address author booktitle chapter edition doi url urldate eid articleno eprint archiveprefix editor howpublished institution journal key month note number organization pages publisher school series title type volume year } {} { label.year label.short extra.label sort.year sort.label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := } STRINGS { s t u } % POP: The terminal mark is already INSIDE a quoted title. BibTeX's built-in % add.period$ cannot recognize TeX closing quotes and would append a second dot. FUNCTION {pop.add.period} { duplicate$ #-1 #2 substring$ "''" = 'skip$ 'add.period$ if$ } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { pop.add.period write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { pop.add.period " " * write$ } if$ } if$ mid.sentence 'output.state := } if$ s } % Use a colon to separate output. Used only for address/publisher % combination in book/inbook types, address/institution for manuals, % and organization:publisher for proceedings (inproceedings). % FUNCTION {output.nonnull.colon} { 's := output.state mid.sentence = { ": " * write$ } { output.state after.block = { pop.add.period write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { pop.add.period " " * write$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {output.colon} { duplicate$ empty$ 'pop$ 'output.nonnull.colon if$ } FUNCTION {output.check} { 't := duplicate$ empty$ { pop$ "empty " t * " in " * cite$ * warning$ } 'output.nonnull if$ } FUNCTION {output.check.colon} { 't := duplicate$ empty$ { pop$ "empty " t * " in " * cite$ * warning$ } 'output.nonnull.colon if$ } % POP: Flush the leading name, then print the bare year. Month is not an author-year label. FUNCTION {output.year.check} { pop.add.period write$ " " write$ year empty$ { "n.d." } { year } if$ extra.label * mid.sentence 'output.state := } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } % POP: Normalize identifiers for linking and duplicate-URL comparison only. % Never normalize titles or personal names. Leading/trailing spaces are trimmed. FUNCTION {trim.spaces} { 'u := { u empty$ not u #1 #1 substring$ " " = and } { u #2 global.max$ substring$ 'u := } while$ { u empty$ not u #-1 #1 substring$ " " = and } { u #1 u text.length$ #1 - substring$ 'u := } while$ u } FUNCTION {normalize.doi} { doi field.or.null trim.spaces 'u := u #1 #19 substring$ "https://dx.doi.org/" = { u #20 global.max$ substring$ 'u := } 'skip$ if$ u #1 #18 substring$ "http://dx.doi.org/" = { u #19 global.max$ substring$ 'u := } 'skip$ if$ u #1 #16 substring$ "https://doi.org/" = { u #17 global.max$ substring$ 'u := } 'skip$ if$ u #1 #15 substring$ "http://doi.org/" = { u #16 global.max$ substring$ 'u := } 'skip$ if$ u #1 #4 substring$ "doi:" = { u #5 global.max$ substring$ trim.spaces 'u := } 'skip$ if$ u } FUNCTION {format.doi} { doi empty$ { "" } { "DOI: \url{https://doi.org/" normalize.doi * "}" * } if$ } FUNCTION {format.url} { url empty$ { eprint empty$ { "" } { archiveprefix empty$ archiveprefix field.or.null "l" change.case$ "arxiv" = or { "\url{https://arxiv.org/abs/" eprint * "}" * } { archiveprefix ": " * eprint * } if$ } if$ } { url trim.spaces 't := doi empty$ { "\url{" t * "}" * } { normalize.doi 's := t "https://doi.org/" s * = t "http://doi.org/" s * = or t "https://dx.doi.org/" s * = or t "http://dx.doi.org/" s * = or { "" } { "\url{" t * "}" * } if$ } if$ } if$ } % POP: Append a distinct URL (or arXiv eprint link), access date, and DOI to every type. FUNCTION {fin.entry} { output.state before.all = 'skip$ { after.block 'output.state := } if$ format.url output urldate empty$ 'skip$ { "Accessed " urldate * output } if$ output.state before.all = 'skip$ { after.block 'output.state := } if$ format.doi output pop.add.period write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } % % Emphasize the top string on the stack. % FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "{\em " swap$ * "}" * } if$ } % % Emphasize the top string on the stack, but add a trailing space. % FUNCTION {emphasize.space} { duplicate$ empty$ { pop$ "" } { "{\em " swap$ * "\/}" * } if$ } INTEGERS { nameptr namesleft numnames } % % Format bibliographical entries with the first author last name first, % and subsequent authors with supplied given names followed by last name. % All names are formatted in this routine. % % POP: Local bold group for one name (or an organization fallback), not a list. % Never call this from sorting/citation-label functions. FUNCTION {bold.names} { duplicate$ empty$ { pop$ "" } { "\textbf{" swap$ * "}" * } if$ } % POP: Full given names; invert only the first name; Oxford comma even for two authors. % Bold names individually so separators, "and", and "et al." remain unbolded. FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 = { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$ 't := } { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := } if$ nameptr #1 > { t "others" = { ", et~al." * } { t bold.names 't := namesleft #1 > { ", " * t * } { ", and " * t * } if$ } if$ } { t bold.names } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {my.full.label} { 's := #1 'nameptr := % nameptr = 1; s num.names$ 'numnames := % numnames = num.name$(s); numnames 'namesleft := { namesleft #0 > } { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } 'skip$ if$ t "others" = { " et~al." * } { " and " * t * } % from Chicago Manual of Style if$ } if$ } 't if$ nameptr #1 + 'nameptr := % nameptr += 1; namesleft #1 - 'namesleft := % namesleft =- 1; } while$ } % POP: Embedded editor names, without inversion or boldface. FUNCTION {format.names.fml} % % Format names in "familiar" format, with full given names followed by % last name. Like format.names, ALL names are formatted. % { 's := #1 'nameptr := % nameptr = 1; s num.names$ 'numnames := % numnames = num.name$(s); numnames 'namesleft := { namesleft #0 > } { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } 'skip$ if$ t "others" = { " et~al." * } { " and " * t * } % { " \& " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := % nameptr += 1; namesleft #1 - 'namesleft := % namesleft =- 1; } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.key} { empty$ { key field.or.null } { "" } if$ } % % Format embedded editor names for chapter/container text: supplied given % names, then last names. Leading editor names use format.editors instead. % Citation labels are built separately by calc.label. Embedded editors are % neither abbreviated nor bold. % % POP: Embedded editors use full names in normal order, without bold or Ed./Eds. suffixes. FUNCTION {format.editors.fml} { editor empty$ { "" } { editor format.names.fml } if$ } % % Format leading editor names in bibliography entries, inverting only the first. % % POP: Editor-led books/proceedings use bold leading names; the role remains outside bold. FUNCTION {format.editors} { editor empty$ { "" } { editor format.names editor num.names$ #1 > { ", eds." * } { ", ed." * } if$ } if$ } STRINGS { title.text title.quotes } % POP: Punctuate the raw title before wrapping it in bibliography quotes. % If the title itself ends in TeX double quotes, temporarily remove those % closing pairs so punctuation is checked/added inside them. Negative-index % substring$ preserves the raw TeX string, including braces and accent commands. % pop.add.period is only for output strings whose outer quotes already exist. FUNCTION {pop.title.period} { 'title.text := "" 'title.quotes := { title.text #-1 #2 substring$ "''" = } { title.text #-3 global.max$ substring$ 'title.text := "''" title.quotes * 'title.quotes := } while$ title.text add.period$ title.quotes * } % POP: Preserve input capitalization and put terminal punctuation inside quotes. FUNCTION {format.title} { title empty$ { "" } { "``" title pop.title.period * "''" * } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } % POP: Book titles italic; edition outside italics, e.g. 2nd ed. (enter edition={2nd}). FUNCTION {format.btitle} { title empty$ { "" } { title emphasize edition empty$ 'skip$ { ". " * edition * " ed." * } if$ } if$ } FUNCTION {format.emphasize.booktitle} { booktitle empty$ { "" } { booktitle emphasize edition empty$ 'skip$ { ", " * edition * " ed." * } if$ } if$ } 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$ { "" } { "Volume" volume tie.or.space.connect % gnp - changed to mixed case 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" } % gnp - changed to mixed case always { "Number" } if$ number tie.or.space.connect series empty$ { "there's a number but no series in " cite$ * warning$ } { " in " * series * } if$ } 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 } % POP: Full page ranges; no pp. prefix. n.dashify turns single hyphens into TeX en dashes. FUNCTION {format.pages} { pages empty$ { "" } { pages n.dashify } if$ } % By Young (and Spencer) % GNP - fixed bugs with missing volume, number, and/or pages % % Format journal, volume, number, pages for article types. % % POP: Italic journal, plain volume, spaced issue, colon before pages/eid/articleno; allow advance articles. FUNCTION {format.jour.vol} { journal empty$ { "no journal in " cite$ * warning$ "" } { journal emphasize } if$ volume empty$ 'skip$ { " " * volume * } if$ number empty$ 'skip$ { " (" * number * ")" * } if$ pages empty$ { eid empty$ { articleno empty$ { "" } { articleno } if$ } { eid } if$ } { pages n.dashify } if$ duplicate$ empty$ 'pop$ { swap$ duplicate$ empty$ { pop$ } { volume empty$ number empty$ and { ", " } { ": " } if$ * swap$ * } if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "Chapter" } % gnp - changed to mixed case { type "t" change.case$ } if$ chapter tie.or.space.connect pages empty$ {"page numbers missing in " cite$ * warning$} % gnp - added check { ", " * format.pages * } if$ } if$ } % POP: Book title precedes embedded editor names, as in the published PoP chapters. FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { "In " format.emphasize.booktitle * editor empty$ 'skip$ { ", edited by " * format.editors.fml * } if$ } 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} { "See" "\citet{" * 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 " } { "Volume" volume tie.or.space.connect % gnp - changed to mixed case " 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$ " \citet{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { "See" " \citet{" * crossref * "}" * } % format.lab.names: % % determines "short" names for the abbreviated author information. % "Long" labels are created in calc.label, using the routine my.full.label % to format author and editor fields. The abbreviated label uses et al. % for three or more authors; starred natbib commands use the full label. % % Short labels: one author -> Foo; two authors -> Foo and Bar; % three or more authors, or an explicit "and others" -> Foo et al. % Full labels retain all supplied names for starred natbib commands. % FUNCTION {format.lab.names} { 's := s num.names$ 'numnames := numnames #2 > % change number to number of others allowed before % forcing "et al". { s #1 "{vv~}{ll}" format.name$ " et~al." * } { numnames #1 - 'namesleft := #2 'nameptr := s #1 "{vv~}{ll}" format.name$ { namesleft #0 > } { nameptr numnames = { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { " and " * s nameptr "{vv~}{ll}" format.name$ * } if$ } { ", " * s nameptr "{vv~}{ll}" format.name$ * } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } if$ } FUNCTION {author.key.label} { author empty$ { key empty$ { "no key, author in " cite$ * warning$ cite$ #1 #3 substring$ } 'key if$ } { author format.lab.names } if$ } FUNCTION {editor.key.label} { editor empty$ { key empty$ { "no key, editor in " cite$ * warning$ cite$ #1 #3 substring$ } 'key if$ } { editor format.lab.names } if$ } FUNCTION {author.key.organization.label} % % added - gnp. Provide label formatting by organization if author is null. % { author empty$ { organization empty$ { key empty$ { "no key, author or organization in " cite$ * warning$ cite$ #1 #3 substring$ } 'key if$ } { organization } if$ } { author format.lab.names } if$ } FUNCTION {editor.key.organization.label} % % added - gnp. Provide label formatting by organization if editor is null. % { editor empty$ { organization empty$ { key empty$ { "no key, editor or organization in " cite$ * warning$ cite$ #1 #3 substring$ } 'key if$ } { organization } if$ } { editor format.lab.names } if$ } FUNCTION {author.editor.key.label} { author empty$ { editor empty$ { key empty$ { "no key, author, or editor in " cite$ * warning$ cite$ #1 #3 substring$ } 'key if$ } { editor format.lab.names } if$ } { author format.lab.names } if$ } % POP: Plain natbib short/full author labels; preserve forthcoming and n.d. instead of last four characters. FUNCTION {calc.label} { author empty$ { editor empty$ { organization empty$ { key empty$ { "Anonymous" } { key } if$ duplicate$ } { organization duplicate$ } if$ } { editor format.lab.names editor my.full.label } if$ } { author format.lab.names author my.full.label } if$ % POP: Save the abbreviated label separately: different long author lists % can both cite as Smith et al. and still need distinct year suffixes. swap$ duplicate$ 'label.short := swap$ "}{" * swap$ * "}{" * year empty$ { "n.d." } { year } if$ 'label.year := } % POP: Head fallback mirrors calc.label, so printed entries and citations agree. FUNCTION {format.head} { author empty$ { editor empty$ { organization empty$ { key empty$ { "Anonymous" } { key } if$ } { organization bold.names } if$ } { format.editors } if$ } { format.authors } if$ } FUNCTION {output.bibitem} { newline$ "\bibitem[\protect\citeauthoryear{" write$ calc.label write$ sort.year write$ "}]{" write$ cite$ write$ "}" write$ newline$ "" before.all 'output.state := } % POP: Article metadata; absent volume/issue/pages is valid for advance publication. FUNCTION {article} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block format.jour.vol output new.block note output fin.entry } % POP: Book head/title, optional volume/series, City: Publisher, then note and electronic links. FUNCTION {book} { output.bibitem format.head output output.year.check new.block format.btitle "title" output.check format.bvolume output format.number.series output new.block address output publisher "publisher" output.check.colon new.block note output fin.entry } FUNCTION {booklet} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block howpublished output address output new.block note output fin.entry } FUNCTION {inbook} { output.bibitem format.head output output.year.check new.block format.btitle "title" output.check format.bvolume output format.number.series output format.chapter.pages output new.block address output publisher "publisher" output.check.colon new.block note output fin.entry } % POP: Full chapter/container citation; inherited crossref fields do not emit a separate See citation. FUNCTION {incollection} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block format.in.ed.booktitle "booktitle" output.check format.bvolume output format.number.series output format.chapter.pages output new.block address output publisher output.colon new.block note output fin.entry } % POP: Conference papers follow the same title/container/editor/page order as chapters. FUNCTION {inproceedings} { incollection } FUNCTION {conference} { inproceedings } FUNCTION {manual} { output.bibitem format.head output output.year.check new.block format.btitle "title" output.check new.block address output publisher empty$ { organization output.colon } { publisher output.colon } if$ new.block note output fin.entry } FUNCTION {mastersthesis} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block "Master's thesis" format.thesis.type output school "school" output.check address output new.block note output fin.entry } FUNCTION {misc} { output.bibitem format.head output output.year.check new.block format.title output new.block howpublished output new.block note output fin.entry } % POP: Common export aliases; all three use ordinary BibTeX year/title/url fields. FUNCTION {online} { misc } FUNCTION {electronic} { misc } FUNCTION {preprint} { misc } FUNCTION {phdthesis} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block "PhD thesis" format.thesis.type output school "school" output.check address output new.block note output fin.entry } FUNCTION {proceedings} { output.bibitem format.head output output.year.check new.block format.btitle "title" output.check format.bvolume output format.number.series output new.block address output publisher output.colon new.block note output fin.entry } FUNCTION {techreport} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block format.tr.number output institution "institution" output.check address output new.block note output fin.entry } % POP: Notes are optional: a URL/eprint may fully identify an unpublished paper. FUNCTION {unpublished} { output.bibitem format.head output output.year.check new.block format.title "title" output.check new.block note output fin.entry } FUNCTION {default.type} { misc } 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"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {ai} {"Artificial Intelligence"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} 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$ } % POP: Alphabetize by full given names, not only their initials. FUNCTION {sort.format.names} { 's := #1 'nameptr := "" s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 > { " " * } 'skip$ if$ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ 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} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ } { author sort.format.names } if$ } FUNCTION {editor.sort} { editor empty$ { key empty$ { "to sort, need editor or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } FUNCTION {author.editor.sort} { author empty$ { "missing author in " cite$ * warning$ 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} % % added - GNP. Stack author or organization for sorting (from alpha.bst). % Unlike alpha.bst, we need entire names, not abbreviations % { author empty$ { organization empty$ { key empty$ { "to sort, need author, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { organization sortify } if$ } { author sort.format.names } if$ } FUNCTION {editor.organization.sort} % % added - GNP. Stack editor or organization for sorting (from alpha.bst). % Unlike alpha.bst, we need entire names, not abbreviations % { editor empty$ { organization empty$ { key empty$ { "to sort, need editor, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { organization sortify } if$ } { editor sort.format.names } if$ } % POP: Save the full-name sort order for the final bibliography. First group % equal abbreviated citation labels/years together (including et al.), then % allocate a/b suffixes by full names/title. Final bib.sort.order restores % alphabetical full names, year, title ordering. FUNCTION {presort} { calc.label pop$ label.short 'u := author empty$ { editor empty$ { organization empty$ { key empty$ { "anonymous" } { key sortify } if$ } { organization sortify } if$ } { editor sort.format.names } if$ } { author sort.format.names } if$ #1 entry.max$ substring$ 'sort.label := u label.year * " " * sort.label * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {presort} SORT % by label, year, author/editor, title STRINGS { last.label next.extra } INTEGERS { last.extra.num suffix.number suffix.quotient suffix.remainder } STRINGS { suffix.text } % POP: Positive ordinal -> a..z, aa..az, ba..bz, ..., zz, aaa, ... . % BibTeX has no integer division primitive; repeated subtraction supplies the % quotient/remainder for bijective base 26. Never emit ASCII punctuation as a % year suffix: braces would corrupt the natbib optional argument and fail TeX. FUNCTION {pop.alpha.suffix} { 'suffix.number := "" 'suffix.text := { suffix.number #0 > } { suffix.number #1 - 'suffix.remainder := #0 'suffix.quotient := { suffix.remainder #25 > } { suffix.remainder #26 - 'suffix.remainder := suffix.quotient #1 + 'suffix.quotient := } while$ suffix.remainder "a" chr.to.int$ + int.to.chr$ suffix.text * 'suffix.text := suffix.quotient 'suffix.number := } while$ suffix.text } FUNCTION {initialize.extra.label.stuff} { #0 int.to.chr$ 'last.label := "" 'next.extra := #0 'last.extra.num := } FUNCTION {forward.pass} % % Pass through all entries, comparing current entry to last one. % Need to concatenate year to the stack (done by calc.label) to determine % if two entries are the same (see presort) % { last.label calc.label pop$ label.short label.year * % POP: short citation label and full year. #1 entry.max$ substring$ = % are they equal? { last.extra.num #1 + 'last.extra.num := last.extra.num pop.alpha.suffix 'extra.label := } { #1 'last.extra.num := "" 'extra.label := calc.label pop$ label.short label.year * % POP: short citation label and full year. #1 entry.max$ substring$ 'last.label := % assign to last.label } if$ } FUNCTION {reverse.pass} { next.extra "b" = { "a" 'extra.label := } 'skip$ if$ % Natbib reads the suffix as one TeX argument after a four-digit year. % Group multi-letter suffixes so compressed citations retain aa/ab/etc. label.year extra.label text.length$ #1 > { "{" extra.label * "}" * } { extra.label } if$ * 'sort.year := extra.label 'next.extra := } EXECUTE {initialize.extra.label.stuff} ITERATE {forward.pass} REVERSE {reverse.pass} FUNCTION {bib.sort.order} { sort.label " " * year field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {bib.sort.order} SORT % by sort.label, year, title --- giving final bib. order. FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{}" write$ newline$ % POP: Match the publisher's regular text face for links, locally to this list. "\urlstyle{same}" write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib}