hekeus@45: %% hekeus@45: %% IEEEtran.bst hekeus@45: %% BibTeX Bibliography Style file for IEEE Journals and Conferences (unsorted) hekeus@45: %% Version 1.12 (2007/01/11) hekeus@45: %% hekeus@45: %% Copyright (c) 2003-2007 Michael Shell hekeus@45: %% hekeus@45: %% Original starting code base and algorithms obtained from the output of hekeus@45: %% Patrick W. Daly's makebst package as well as from prior versions of hekeus@45: %% IEEE BibTeX styles: hekeus@45: %% hekeus@45: %% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) hekeus@45: %% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) hekeus@45: %% hekeus@45: %% Support sites: hekeus@45: %% http://www.michaelshell.org/tex/ieeetran/ hekeus@45: %% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/ hekeus@45: %% and/or hekeus@45: %% http://www.ieee.org/ hekeus@45: %% hekeus@45: %% For use with BibTeX version 0.99a or later hekeus@45: %% hekeus@45: %% This is a numerical citation style. hekeus@45: %% hekeus@45: %%************************************************************************* hekeus@45: %% Legal Notice: hekeus@45: %% This code is offered as-is without any warranty either expressed or hekeus@45: %% implied; without even the implied warranty of MERCHANTABILITY or hekeus@45: %% FITNESS FOR A PARTICULAR PURPOSE! hekeus@45: %% User assumes all risk. hekeus@45: %% In no event shall IEEE or any contributor to this code be liable for hekeus@45: %% any damages or losses, including, but not limited to, incidental, hekeus@45: %% consequential, or any other damages, resulting from the use or misuse hekeus@45: %% of any information contained here. hekeus@45: %% hekeus@45: %% All comments are the opinions of their respective authors and are not hekeus@45: %% necessarily endorsed by the IEEE. hekeus@45: %% hekeus@45: %% This work is distributed under the LaTeX Project Public License (LPPL) hekeus@45: %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, hekeus@45: %% distributed and modified. A copy of the LPPL, version 1.3, is included hekeus@45: %% in the base LaTeX documentation of all distributions of LaTeX released hekeus@45: %% 2003/12/01 or later. hekeus@45: %% Retain all contribution notices and credits. hekeus@45: %% ** Modified files should be clearly indicated as such, including ** hekeus@45: %% ** renaming them and changing author support contact information. ** hekeus@45: %% hekeus@45: %% File list of work: IEEEabrv.bib, IEEEfull.bib, IEEEexample.bib, hekeus@45: %% IEEEtran.bst, IEEEtranS.bst, IEEEtranSA.bst, hekeus@45: %% IEEEtranN.bst, IEEEtranSN.bst, IEEEtran_bst_HOWTO.pdf hekeus@45: %%************************************************************************* hekeus@45: % hekeus@45: % hekeus@45: % Changelog: hekeus@45: % hekeus@45: % 1.00 (2002/08/13) Initial release hekeus@45: % hekeus@45: % 1.10 (2002/09/27) hekeus@45: % 1. Corrected minor bug for improperly formed warning message when a hekeus@45: % book was not given a title. Thanks to Ming Kin Lai for reporting this. hekeus@45: % 2. Added support for CTLname_format_string and CTLname_latex_cmd fields hekeus@45: % in the BST control entry type. hekeus@45: % hekeus@45: % 1.11 (2003/04/02) hekeus@45: % 1. Fixed bug with URLs containing underscores when using url.sty. Thanks hekeus@45: % to Ming Kin Lai for reporting this. hekeus@45: % hekeus@45: % 1.12 (2007/01/11) hekeus@45: % 1. Fixed bug with unwanted comma before "et al." when an entry contained hekeus@45: % more than two author names. Thanks to Pallav Gupta for reporting this. hekeus@45: % 2. Fixed bug with anomalous closing quote in tech reports that have a hekeus@45: % type, but without a number or address. Thanks to Mehrdad Mirreza for hekeus@45: % reporting this. hekeus@45: % 3. Use braces in \providecommand in begin.bib to better support hekeus@45: % latex2html. TeX style length assignments OK with recent versions hekeus@45: % of latex2html - 1.71 (2002/2/1) or later is strongly recommended. hekeus@45: % Use of the language field still causes trouble with latex2html. hekeus@45: % Thanks to Federico Beffa for reporting this. hekeus@45: % 4. Added IEEEtran.bst ID and version comment string to .bbl output. hekeus@45: % 5. Provide a \BIBdecl hook that allows the user to execute commands hekeus@45: % just prior to the first entry. hekeus@45: % 6. Use default urlstyle (is using url.sty) of "same" rather than rm to hekeus@45: % better work with a wider variety of bibliography styles. hekeus@45: % 7. Changed month abbreviations from Sept., July and June to Sep., Jul., hekeus@45: % and Jun., respectively, as IEEE now does. Thanks to Moritz Borgmann hekeus@45: % for reporting this. hekeus@45: % 8. Control entry types should not be considered when calculating longest hekeus@45: % label width. hekeus@45: % 9. Added alias www for electronic/online. hekeus@45: % 10. Added CTLname_url_prefix control entry type. hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: % These are the defaults for the user adjustable controls. The values used hekeus@45: % here can be overridden by the user via IEEEtranBSTCTL entry type. hekeus@45: hekeus@45: % NOTE: The recommended LaTeX command to invoke a control entry type is: hekeus@45: % hekeus@45: %\makeatletter hekeus@45: %\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} hekeus@45: %\def\@bstctlcite[#1]#2{\@bsphack hekeus@45: % \@for\@citeb:=#2\do{% hekeus@45: % \edef\@citeb{\expandafter\@firstofone\@citeb}% hekeus@45: % \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% hekeus@45: % \@esphack} hekeus@45: %\makeatother hekeus@45: % hekeus@45: % It is called at the start of the document, before the first \cite, like: hekeus@45: % \bstctlcite{IEEEexample:BSTcontrol} hekeus@45: % hekeus@45: % IEEEtran.cls V1.6 and later does provide this command. hekeus@45: hekeus@45: hekeus@45: hekeus@45: % #0 turns off the display of the number for articles. hekeus@45: % #1 enables hekeus@45: FUNCTION {default.is.use.number.for.article} { #1 } hekeus@45: hekeus@45: hekeus@45: % #0 turns off the display of the paper and type fields in @inproceedings. hekeus@45: % #1 enables hekeus@45: FUNCTION {default.is.use.paper} { #1 } hekeus@45: hekeus@45: hekeus@45: % #0 turns off the forced use of "et al." hekeus@45: % #1 enables hekeus@45: FUNCTION {default.is.forced.et.al} { #0 } hekeus@45: hekeus@45: % The maximum number of names that can be present beyond which an "et al." hekeus@45: % usage is forced. Be sure that num.names.shown.with.forced.et.al (below) hekeus@45: % is not greater than this value! hekeus@45: % Note: There are many instances of references in IEEE journals which have hekeus@45: % a very large number of authors as well as instances in which "et al." is hekeus@45: % used profusely. hekeus@45: FUNCTION {default.max.num.names.before.forced.et.al} { #10 } hekeus@45: hekeus@45: % The number of names that will be shown with a forced "et al.". hekeus@45: % Must be less than or equal to max.num.names.before.forced.et.al hekeus@45: FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } hekeus@45: hekeus@45: hekeus@45: % #0 turns off the alternate interword spacing for entries with URLs. hekeus@45: % #1 enables hekeus@45: FUNCTION {default.is.use.alt.interword.spacing} { #1 } hekeus@45: hekeus@45: % If alternate interword spacing for entries with URLs is enabled, this is hekeus@45: % the interword spacing stretch factor that will be used. For example, the hekeus@45: % default "4" here means that the interword spacing in entries with URLs can hekeus@45: % stretch to four times normal. Does not have to be an integer. Note that hekeus@45: % the value specified here can be overridden by the user in their LaTeX hekeus@45: % code via a command such as: hekeus@45: % "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to hekeus@45: % that via the IEEEtranBSTCTL entry type. hekeus@45: FUNCTION {default.ALTinterwordstretchfactor} { "4" } hekeus@45: hekeus@45: hekeus@45: % #0 turns off the "dashification" of repeated (i.e., identical to those hekeus@45: % of the previous entry) names. IEEE normally does this. hekeus@45: % #1 enables hekeus@45: FUNCTION {default.is.dash.repeated.names} { #1 } hekeus@45: hekeus@45: hekeus@45: % The default name format control string. hekeus@45: FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } hekeus@45: hekeus@45: hekeus@45: % The default LaTeX font command for the names. hekeus@45: FUNCTION {default.name.latex.cmd}{ "" } hekeus@45: hekeus@45: hekeus@45: % The default URL prefix. hekeus@45: FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } hekeus@45: hekeus@45: hekeus@45: % Other controls that cannot be accessed via IEEEtranBSTCTL entry type. hekeus@45: hekeus@45: % #0 turns off the terminal startup banner/completed message so as to hekeus@45: % operate more quietly. hekeus@45: % #1 enables hekeus@45: FUNCTION {is.print.banners.to.terminal} { #1 } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% FILE VERSION AND BANNER %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: FUNCTION{bst.file.version} { "1.12" } hekeus@45: FUNCTION{bst.file.date} { "2007/01/11" } hekeus@45: FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } hekeus@45: hekeus@45: FUNCTION {banner.message} hekeus@45: { is.print.banners.to.terminal hekeus@45: { "-- IEEEtran.bst version" " " * bst.file.version * hekeus@45: " (" * bst.file.date * ") " * "by Michael Shell." * hekeus@45: top$ hekeus@45: "-- " bst.file.website * hekeus@45: top$ hekeus@45: "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." * hekeus@45: top$ hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {completed.message} hekeus@45: { is.print.banners.to.terminal hekeus@45: { "" hekeus@45: top$ hekeus@45: "Done." hekeus@45: top$ hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% STRING CONSTANTS %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: FUNCTION {bbl.and}{ "and" } hekeus@45: FUNCTION {bbl.etal}{ "et~al." } hekeus@45: FUNCTION {bbl.editors}{ "eds." } hekeus@45: FUNCTION {bbl.editor}{ "ed." } hekeus@45: FUNCTION {bbl.edition}{ "ed." } hekeus@45: FUNCTION {bbl.volume}{ "vol." } hekeus@45: FUNCTION {bbl.of}{ "of" } hekeus@45: FUNCTION {bbl.number}{ "no." } hekeus@45: FUNCTION {bbl.in}{ "in" } hekeus@45: FUNCTION {bbl.pages}{ "pp." } hekeus@45: FUNCTION {bbl.page}{ "p." } hekeus@45: FUNCTION {bbl.chapter}{ "ch." } hekeus@45: FUNCTION {bbl.paper}{ "paper" } hekeus@45: FUNCTION {bbl.part}{ "pt." } hekeus@45: FUNCTION {bbl.patent}{ "Patent" } hekeus@45: FUNCTION {bbl.patentUS}{ "U.S." } hekeus@45: FUNCTION {bbl.revision}{ "Rev." } hekeus@45: FUNCTION {bbl.series}{ "ser." } hekeus@45: FUNCTION {bbl.standard}{ "Std." } hekeus@45: FUNCTION {bbl.techrep}{ "Tech. Rep." } hekeus@45: FUNCTION {bbl.mthesis}{ "Master's thesis" } hekeus@45: FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } hekeus@45: FUNCTION {bbl.st}{ "st" } hekeus@45: FUNCTION {bbl.nd}{ "nd" } hekeus@45: FUNCTION {bbl.rd}{ "rd" } hekeus@45: FUNCTION {bbl.th}{ "th" } hekeus@45: hekeus@45: hekeus@45: % This is the LaTeX spacer that is used when a larger than normal space hekeus@45: % is called for (such as just before the address:publisher). hekeus@45: FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } hekeus@45: hekeus@45: % The LaTeX code for dashes that are used to represent repeated names. hekeus@45: % Note: Some older IEEE journals used something like hekeus@45: % "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along hekeus@45: % the baseline. However, IEEE now uses a thinner, above baseline, hekeus@45: % six dash long sequence. hekeus@45: FUNCTION {repeated.name.dashes} { "------" } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% PREDEFINED STRING MACROS %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: MACRO {jan} {"Jan."} hekeus@45: MACRO {feb} {"Feb."} hekeus@45: MACRO {mar} {"Mar."} hekeus@45: MACRO {apr} {"Apr."} hekeus@45: MACRO {may} {"May"} hekeus@45: MACRO {jun} {"Jun."} hekeus@45: MACRO {jul} {"Jul."} hekeus@45: MACRO {aug} {"Aug."} hekeus@45: MACRO {sep} {"Sep."} hekeus@45: MACRO {oct} {"Oct."} hekeus@45: MACRO {nov} {"Nov."} hekeus@45: MACRO {dec} {"Dec."} hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%% hekeus@45: %% ENTRY FIELDS %% hekeus@45: %%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: ENTRY hekeus@45: { address hekeus@45: assignee hekeus@45: author hekeus@45: booktitle hekeus@45: chapter hekeus@45: day hekeus@45: dayfiled hekeus@45: edition hekeus@45: editor hekeus@45: howpublished hekeus@45: institution hekeus@45: intype hekeus@45: journal hekeus@45: key hekeus@45: language hekeus@45: month hekeus@45: monthfiled hekeus@45: nationality hekeus@45: note hekeus@45: number hekeus@45: organization hekeus@45: pages hekeus@45: paper hekeus@45: publisher hekeus@45: school hekeus@45: series hekeus@45: revision hekeus@45: title hekeus@45: type hekeus@45: url hekeus@45: volume hekeus@45: year hekeus@45: yearfiled hekeus@45: CTLuse_article_number hekeus@45: CTLuse_paper hekeus@45: CTLuse_forced_etal hekeus@45: CTLmax_names_forced_etal hekeus@45: CTLnames_show_etal hekeus@45: CTLuse_alt_spacing hekeus@45: CTLalt_stretch_factor hekeus@45: CTLdash_repeated_names hekeus@45: CTLname_format_string hekeus@45: CTLname_latex_cmd hekeus@45: CTLname_url_prefix hekeus@45: } hekeus@45: {} hekeus@45: { label } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% INTEGER VARIABLES %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: INTEGERS { prev.status.punct this.status.punct punct.std hekeus@45: punct.no punct.comma punct.period hekeus@45: prev.status.space this.status.space space.std hekeus@45: space.no space.normal space.large hekeus@45: prev.status.quote this.status.quote quote.std hekeus@45: quote.no quote.close hekeus@45: prev.status.nline this.status.nline nline.std hekeus@45: nline.no nline.newblock hekeus@45: status.cap cap.std hekeus@45: cap.no cap.yes} hekeus@45: hekeus@45: INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } hekeus@45: hekeus@45: INTEGERS { is.use.number.for.article hekeus@45: is.use.paper hekeus@45: is.forced.et.al hekeus@45: max.num.names.before.forced.et.al hekeus@45: num.names.shown.with.forced.et.al hekeus@45: is.use.alt.interword.spacing hekeus@45: is.dash.repeated.names} hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% STRING VARIABLES %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: STRINGS { bibinfo hekeus@45: longest.label hekeus@45: oldname hekeus@45: s hekeus@45: t hekeus@45: ALTinterwordstretchfactor hekeus@45: name.format.string hekeus@45: name.latex.cmd hekeus@45: name.url.prefix} hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% LOW LEVEL FUNCTIONS %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: FUNCTION {initialize.controls} hekeus@45: { default.is.use.number.for.article 'is.use.number.for.article := hekeus@45: default.is.use.paper 'is.use.paper := hekeus@45: default.is.forced.et.al 'is.forced.et.al := hekeus@45: default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := hekeus@45: default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := hekeus@45: default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := hekeus@45: default.is.dash.repeated.names 'is.dash.repeated.names := hekeus@45: default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := hekeus@45: default.name.format.string 'name.format.string := hekeus@45: default.name.latex.cmd 'name.latex.cmd := hekeus@45: default.name.url.prefix 'name.url.prefix := hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % This IEEEtran.bst features a very powerful and flexible mechanism for hekeus@45: % controlling the capitalization, punctuation, spacing, quotation, and hekeus@45: % newlines of the formatted entry fields. (Note: IEEEtran.bst does not need hekeus@45: % or use the newline/newblock feature, but it has been implemented for hekeus@45: % possible future use.) The output states of IEEEtran.bst consist of hekeus@45: % multiple independent attributes and, as such, can be thought of as being hekeus@45: % vectors, rather than the simple scalar values ("before.all", hekeus@45: % "mid.sentence", etc.) used in most other .bst files. hekeus@45: % hekeus@45: % The more flexible and complex design used here was motivated in part by hekeus@45: % IEEE's rather unusual bibliography style. For example, IEEE ends the hekeus@45: % previous field item with a period and large space prior to the publisher hekeus@45: % address; the @electronic entry types use periods as inter-item punctuation hekeus@45: % rather than the commas used by the other entry types; and URLs are never hekeus@45: % followed by periods even though they are the last item in the entry. hekeus@45: % Although it is possible to accommodate these features with the conventional hekeus@45: % output state system, the seemingly endless exceptions make for convoluted, hekeus@45: % unreliable and difficult to maintain code. hekeus@45: % hekeus@45: % IEEEtran.bst's output state system can be easily understood via a simple hekeus@45: % illustration of two most recently formatted entry fields (on the stack): hekeus@45: % hekeus@45: % CURRENT_ITEM hekeus@45: % "PREVIOUS_ITEM hekeus@45: % hekeus@45: % which, in this example, is to eventually appear in the bibliography as: hekeus@45: % hekeus@45: % "PREVIOUS_ITEM," CURRENT_ITEM hekeus@45: % hekeus@45: % It is the job of the output routine to take the previous item off of the hekeus@45: % stack (while leaving the current item at the top of the stack), apply its hekeus@45: % trailing punctuation (including closing quote marks) and spacing, and then hekeus@45: % to write the result to BibTeX's output buffer: hekeus@45: % hekeus@45: % "PREVIOUS_ITEM," hekeus@45: % hekeus@45: % Punctuation (and spacing) between items is often determined by both of the hekeus@45: % items rather than just the first one. The presence of quotation marks hekeus@45: % further complicates the situation because, in standard English, trailing hekeus@45: % punctuation marks are supposed to be contained within the quotes. hekeus@45: % hekeus@45: % IEEEtran.bst maintains two output state (aka "status") vectors which hekeus@45: % correspond to the previous and current (aka "this") items. Each vector hekeus@45: % consists of several independent attributes which track punctuation, hekeus@45: % spacing, quotation, and newlines. Capitalization status is handled by a hekeus@45: % separate scalar because the format routines, not the output routine, hekeus@45: % handle capitalization and, therefore, there is no need to maintain the hekeus@45: % capitalization attribute for both the "previous" and "this" items. hekeus@45: % hekeus@45: % When a format routine adds a new item, it copies the current output status hekeus@45: % vector to the previous output status vector and (usually) resets the hekeus@45: % current (this) output status vector to a "standard status" vector. Using a hekeus@45: % "standard status" vector in this way allows us to redefine what we mean by hekeus@45: % "standard status" at the start of each entry handler and reuse the same hekeus@45: % format routines under the various inter-item separation schemes. For hekeus@45: % example, the standard status vector for the @book entry type may use hekeus@45: % commas for item separators, while the @electronic type may use periods, hekeus@45: % yet both entry handlers exploit many of the exact same format routines. hekeus@45: % hekeus@45: % Because format routines have write access to the output status vector of hekeus@45: % the previous item, they can override the punctuation choices of the hekeus@45: % previous format routine! Therefore, it becomes trivial to implement rules hekeus@45: % such as "Always use a period and a large space before the publisher." By hekeus@45: % pushing the generation of the closing quote mark to the output routine, we hekeus@45: % avoid all the problems caused by having to close a quote before having all hekeus@45: % the information required to determine what the punctuation should be. hekeus@45: % hekeus@45: % The IEEEtran.bst output state system can easily be expanded if needed. hekeus@45: % For instance, it is easy to add a "space.tie" attribute value if the hekeus@45: % bibliography rules mandate that two items have to be joined with an hekeus@45: % unbreakable space. hekeus@45: hekeus@45: FUNCTION {initialize.status.constants} hekeus@45: { #0 'punct.no := hekeus@45: #1 'punct.comma := hekeus@45: #2 'punct.period := hekeus@45: #0 'space.no := hekeus@45: #1 'space.normal := hekeus@45: #2 'space.large := hekeus@45: #0 'quote.no := hekeus@45: #1 'quote.close := hekeus@45: #0 'cap.no := hekeus@45: #1 'cap.yes := hekeus@45: #0 'nline.no := hekeus@45: #1 'nline.newblock := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {std.status.using.comma} hekeus@45: { punct.comma 'punct.std := hekeus@45: space.normal 'space.std := hekeus@45: quote.no 'quote.std := hekeus@45: nline.no 'nline.std := hekeus@45: cap.no 'cap.std := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {std.status.using.period} hekeus@45: { punct.period 'punct.std := hekeus@45: space.normal 'space.std := hekeus@45: quote.no 'quote.std := hekeus@45: nline.no 'nline.std := hekeus@45: cap.yes 'cap.std := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {initialize.prev.this.status} hekeus@45: { punct.no 'prev.status.punct := hekeus@45: space.no 'prev.status.space := hekeus@45: quote.no 'prev.status.quote := hekeus@45: nline.no 'prev.status.nline := hekeus@45: punct.no 'this.status.punct := hekeus@45: space.no 'this.status.space := hekeus@45: quote.no 'this.status.quote := hekeus@45: nline.no 'this.status.nline := hekeus@45: cap.yes 'status.cap := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {this.status.std} hekeus@45: { punct.std 'this.status.punct := hekeus@45: space.std 'this.status.space := hekeus@45: quote.std 'this.status.quote := hekeus@45: nline.std 'this.status.nline := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {cap.status.std}{ cap.std 'status.cap := } hekeus@45: hekeus@45: FUNCTION {this.to.prev.status} hekeus@45: { this.status.punct 'prev.status.punct := hekeus@45: this.status.space 'prev.status.space := hekeus@45: this.status.quote 'prev.status.quote := hekeus@45: this.status.nline 'prev.status.nline := hekeus@45: } hekeus@45: hekeus@45: hekeus@45: FUNCTION {not} hekeus@45: { { #0 } hekeus@45: { #1 } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {and} hekeus@45: { { skip$ } hekeus@45: { pop$ #0 } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {or} hekeus@45: { { pop$ #1 } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % convert the strings "yes" or "no" to #1 or #0 respectively hekeus@45: FUNCTION {yes.no.to.int} hekeus@45: { "l" change.case$ duplicate$ hekeus@45: "yes" = hekeus@45: { pop$ #1 } hekeus@45: { duplicate$ "no" = hekeus@45: { pop$ #0 } hekeus@45: { "unknown boolean " quote$ * swap$ * quote$ * hekeus@45: " in " * cite$ * warning$ hekeus@45: #0 hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % pushes true if the single char string on the stack is in the hekeus@45: % range of "0" to "9" hekeus@45: FUNCTION {is.num} hekeus@45: { chr.to.int$ hekeus@45: duplicate$ "0" chr.to.int$ < not hekeus@45: swap$ "9" chr.to.int$ > not and hekeus@45: } hekeus@45: hekeus@45: % multiplies the integer on the stack by a factor of 10 hekeus@45: FUNCTION {bump.int.mag} hekeus@45: { #0 'multiresult := hekeus@45: { duplicate$ #0 > } hekeus@45: { #1 - hekeus@45: multiresult #10 + hekeus@45: 'multiresult := hekeus@45: } hekeus@45: while$ hekeus@45: pop$ hekeus@45: multiresult hekeus@45: } hekeus@45: hekeus@45: % converts a single character string on the stack to an integer hekeus@45: FUNCTION {char.to.integer} hekeus@45: { duplicate$ hekeus@45: is.num hekeus@45: { chr.to.int$ "0" chr.to.int$ - } hekeus@45: {"noninteger character " quote$ * swap$ * quote$ * hekeus@45: " in integer field of " * cite$ * warning$ hekeus@45: #0 hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % converts a string on the stack to an integer hekeus@45: FUNCTION {string.to.integer} hekeus@45: { duplicate$ text.length$ 'namesleft := hekeus@45: #1 'nameptr := hekeus@45: #0 'numnames := hekeus@45: { nameptr namesleft > not } hekeus@45: { duplicate$ nameptr #1 substring$ hekeus@45: char.to.integer numnames bump.int.mag + hekeus@45: 'numnames := hekeus@45: nameptr #1 + hekeus@45: 'nameptr := hekeus@45: } hekeus@45: while$ hekeus@45: pop$ hekeus@45: numnames hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: % The output routines write out the *next* to the top (previous) item on the hekeus@45: % stack, adding punctuation and such as needed. Since IEEEtran.bst maintains hekeus@45: % the output status for the top two items on the stack, these output hekeus@45: % routines have to consider the previous output status (which corresponds to hekeus@45: % the item that is being output). Full independent control of punctuation, hekeus@45: % closing quote marks, spacing, and newblock is provided. hekeus@45: % hekeus@45: % "output.nonnull" does not check for the presence of a previous empty hekeus@45: % item. hekeus@45: % hekeus@45: % "output" does check for the presence of a previous empty item and will hekeus@45: % remove an empty item rather than outputing it. hekeus@45: % hekeus@45: % "output.warn" is like "output", but will issue a warning if it detects hekeus@45: % an empty item. hekeus@45: hekeus@45: FUNCTION {output.nonnull} hekeus@45: { swap$ hekeus@45: prev.status.punct punct.comma = hekeus@45: { "," * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: prev.status.punct punct.period = hekeus@45: { add.period$ } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: prev.status.quote quote.close = hekeus@45: { "''" * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: prev.status.space space.normal = hekeus@45: { " " * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: prev.status.space space.large = hekeus@45: { large.space * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: write$ hekeus@45: prev.status.nline nline.newblock = hekeus@45: { newline$ "\newblock " write$ } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {output} hekeus@45: { duplicate$ empty$ hekeus@45: 'pop$ hekeus@45: 'output.nonnull hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {output.warn} hekeus@45: { 't := hekeus@45: duplicate$ empty$ hekeus@45: { pop$ "empty " t * " in " * cite$ * warning$ } hekeus@45: 'output.nonnull hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % "fin.entry" is the output routine that handles the last item of the entry hekeus@45: % (which will be on the top of the stack when "fin.entry" is called). hekeus@45: hekeus@45: FUNCTION {fin.entry} hekeus@45: { this.status.punct punct.no = hekeus@45: { skip$ } hekeus@45: { add.period$ } hekeus@45: if$ hekeus@45: this.status.quote quote.close = hekeus@45: { "''" * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: write$ hekeus@45: newline$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: FUNCTION {is.last.char.not.punct} hekeus@45: { duplicate$ hekeus@45: "}" * add.period$ hekeus@45: #-1 #1 substring$ "." = hekeus@45: } hekeus@45: hekeus@45: FUNCTION {is.multiple.pages} hekeus@45: { 't := hekeus@45: #0 'multiresult := hekeus@45: { multiresult not hekeus@45: t empty$ not hekeus@45: and hekeus@45: } hekeus@45: { t #1 #1 substring$ hekeus@45: duplicate$ "-" = hekeus@45: swap$ duplicate$ "," = hekeus@45: swap$ "+" = hekeus@45: or or hekeus@45: { #1 'multiresult := } hekeus@45: { t #2 global.max$ substring$ 't := } hekeus@45: if$ hekeus@45: } hekeus@45: while$ hekeus@45: multiresult hekeus@45: } hekeus@45: hekeus@45: FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } hekeus@45: hekeus@45: FUNCTION {emphasize} hekeus@45: { duplicate$ empty$ hekeus@45: { pop$ "" } hekeus@45: { "\emph{" swap$ * "}" * } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {do.name.latex.cmd} hekeus@45: { name.latex.cmd hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { name.latex.cmd "{" * swap$ * "}" * } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % IEEEtran.bst uses its own \BIBforeignlanguage command which directly hekeus@45: % invokes the TeX hyphenation patterns without the need of the Babel hekeus@45: % package. Babel does a lot more than switch hyphenation patterns and hekeus@45: % its loading can cause unintended effects in many class files (such as hekeus@45: % IEEEtran.cls). hekeus@45: FUNCTION {select.language} hekeus@45: { duplicate$ empty$ 'pop$ hekeus@45: { language empty$ 'skip$ hekeus@45: { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {tie.or.space.prefix} hekeus@45: { duplicate$ text.length$ #3 < hekeus@45: { "~" } hekeus@45: { " " } hekeus@45: if$ hekeus@45: swap$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {get.bbl.editor} hekeus@45: { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } hekeus@45: hekeus@45: FUNCTION {space.word}{ " " swap$ * " " * } hekeus@45: hekeus@45: hekeus@45: % Field Conditioners, Converters, Checkers and External Interfaces hekeus@45: hekeus@45: FUNCTION {empty.field.to.null.string} hekeus@45: { duplicate$ empty$ hekeus@45: { pop$ "" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {either.or.check} hekeus@45: { empty$ hekeus@45: { pop$ } hekeus@45: { "can't use both " swap$ * " fields in " * cite$ * warning$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {empty.entry.warn} hekeus@45: { author empty$ title empty$ howpublished empty$ hekeus@45: month empty$ year empty$ note empty$ url empty$ hekeus@45: and and and and and and hekeus@45: { "all relevant fields are empty in " cite$ * warning$ } hekeus@45: 'skip$ hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % The bibinfo system provides a way for the electronic parsing/acquisition hekeus@45: % of a bibliography's contents as is done by ReVTeX. For example, a field hekeus@45: % could be entered into the bibliography as: hekeus@45: % \bibinfo{volume}{2} hekeus@45: % Only the "2" would show up in the document, but the LaTeX \bibinfo command hekeus@45: % could do additional things with the information. IEEEtran.bst does provide hekeus@45: % a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is hekeus@45: % currently not used as the bogus bibinfo functions defined here output the hekeus@45: % entry values directly without the \bibinfo wrapper. The bibinfo functions hekeus@45: % themselves (and the calls to them) are retained for possible future use. hekeus@45: % hekeus@45: % bibinfo.check avoids acting on missing fields while bibinfo.warn will hekeus@45: % issue a warning message if a missing field is detected. Prior to calling hekeus@45: % the bibinfo functions, the user should push the field value and then its hekeus@45: % name string, in that order. hekeus@45: hekeus@45: FUNCTION {bibinfo.check} hekeus@45: { swap$ duplicate$ missing$ hekeus@45: { pop$ pop$ "" } hekeus@45: { duplicate$ empty$ hekeus@45: { swap$ pop$ } hekeus@45: { swap$ pop$ } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {bibinfo.warn} hekeus@45: { swap$ duplicate$ missing$ hekeus@45: { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } hekeus@45: { duplicate$ empty$ hekeus@45: { swap$ "empty " swap$ * " in " * cite$ * warning$ } hekeus@45: { swap$ pop$ } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % IEEE separates large numbers with more than 4 digits into groups of hekeus@45: % three. IEEE uses a small space to separate these number groups. hekeus@45: % Typical applications include patent and page numbers. hekeus@45: hekeus@45: % number of consecutive digits required to trigger the group separation. hekeus@45: FUNCTION {large.number.trigger}{ #5 } hekeus@45: hekeus@45: % For numbers longer than the trigger, this is the blocksize of the groups. hekeus@45: % The blocksize must be less than the trigger threshold, and 2 * blocksize hekeus@45: % must be greater than the trigger threshold (can't do more than one hekeus@45: % separation on the initial trigger). hekeus@45: FUNCTION {large.number.blocksize}{ #3 } hekeus@45: hekeus@45: % What is actually inserted between the number groups. hekeus@45: FUNCTION {large.number.separator}{ "\," } hekeus@45: hekeus@45: % So as to save on integer variables by reusing existing ones, numnames hekeus@45: % holds the current number of consecutive digits read and nameptr holds hekeus@45: % the number that will trigger an inserted space. hekeus@45: FUNCTION {large.number.separate} hekeus@45: { 't := hekeus@45: "" hekeus@45: #0 'numnames := hekeus@45: large.number.trigger 'nameptr := hekeus@45: { t empty$ not } hekeus@45: { t #-1 #1 substring$ is.num hekeus@45: { numnames #1 + 'numnames := } hekeus@45: { #0 'numnames := hekeus@45: large.number.trigger 'nameptr := hekeus@45: } hekeus@45: if$ hekeus@45: t #-1 #1 substring$ swap$ * hekeus@45: t #-2 global.max$ substring$ 't := hekeus@45: numnames nameptr = hekeus@45: { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ hekeus@45: nameptr large.number.blocksize - #1 + global.max$ substring$ hekeus@45: large.number.separator swap$ * * hekeus@45: nameptr large.number.blocksize - 'numnames := hekeus@45: large.number.blocksize #1 + 'nameptr := hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: while$ hekeus@45: } hekeus@45: hekeus@45: % Converts all single dashes "-" to double dashes "--". hekeus@45: FUNCTION {n.dashify} hekeus@45: { large.number.separate hekeus@45: 't := hekeus@45: "" hekeus@45: { t empty$ not } hekeus@45: { t #1 #1 substring$ "-" = hekeus@45: { t #1 #2 substring$ "--" = not hekeus@45: { "--" * hekeus@45: t #2 global.max$ substring$ 't := hekeus@45: } hekeus@45: { { t #1 #1 substring$ "-" = } hekeus@45: { "-" * hekeus@45: t #2 global.max$ substring$ 't := hekeus@45: } hekeus@45: while$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { t #1 #1 substring$ * hekeus@45: t #2 global.max$ substring$ 't := hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: while$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % This function detects entries with names that are identical to that of hekeus@45: % the previous entry and replaces the repeated names with dashes (if the hekeus@45: % "is.dash.repeated.names" user control is nonzero). hekeus@45: FUNCTION {name.or.dash} hekeus@45: { 's := hekeus@45: oldname empty$ hekeus@45: { s 'oldname := s } hekeus@45: { s oldname = hekeus@45: { is.dash.repeated.names hekeus@45: { repeated.name.dashes } hekeus@45: { s 'oldname := s } hekeus@45: if$ hekeus@45: } hekeus@45: { s 'oldname := s } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % Converts the number string on the top of the stack to hekeus@45: % "numerical ordinal form" (e.g., "7" to "7th"). There is hekeus@45: % no artificial limit to the upper bound of the numbers as the hekeus@45: % least significant digit always determines the ordinal form. hekeus@45: FUNCTION {num.to.ordinal} hekeus@45: { duplicate$ #-1 #1 substring$ "1" = hekeus@45: { bbl.st * } hekeus@45: { duplicate$ #-1 #1 substring$ "2" = hekeus@45: { bbl.nd * } hekeus@45: { duplicate$ #-1 #1 substring$ "3" = hekeus@45: { bbl.rd * } hekeus@45: { bbl.th * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % If the string on the top of the stack begins with a number, hekeus@45: % (e.g., 11th) then replace the string with the leading number hekeus@45: % it contains. Otherwise retain the string as-is. s holds the hekeus@45: % extracted number, t holds the part of the string that remains hekeus@45: % to be scanned. hekeus@45: FUNCTION {extract.num} hekeus@45: { duplicate$ 't := hekeus@45: "" 's := hekeus@45: { t empty$ not } hekeus@45: { t #1 #1 substring$ hekeus@45: t #2 global.max$ substring$ 't := hekeus@45: duplicate$ is.num hekeus@45: { s swap$ * 's := } hekeus@45: { pop$ "" 't := } hekeus@45: if$ hekeus@45: } hekeus@45: while$ hekeus@45: s empty$ hekeus@45: 'skip$ hekeus@45: { pop$ s } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % Converts the word number string on the top of the stack to hekeus@45: % Arabic string form. Will be successful up to "tenth". hekeus@45: FUNCTION {word.to.num} hekeus@45: { duplicate$ "l" change.case$ 's := hekeus@45: s "first" = hekeus@45: { pop$ "1" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "second" = hekeus@45: { pop$ "2" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "third" = hekeus@45: { pop$ "3" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "fourth" = hekeus@45: { pop$ "4" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "fifth" = hekeus@45: { pop$ "5" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "sixth" = hekeus@45: { pop$ "6" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "seventh" = hekeus@45: { pop$ "7" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "eighth" = hekeus@45: { pop$ "8" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "ninth" = hekeus@45: { pop$ "9" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: s "tenth" = hekeus@45: { pop$ "10" } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % Converts the string on the top of the stack to numerical hekeus@45: % ordinal (e.g., "11th") form. hekeus@45: FUNCTION {convert.edition} hekeus@45: { duplicate$ empty$ 'skip$ hekeus@45: { duplicate$ #1 #1 substring$ is.num hekeus@45: { extract.num hekeus@45: num.to.ordinal hekeus@45: } hekeus@45: { word.to.num hekeus@45: duplicate$ #1 #1 substring$ is.num hekeus@45: { num.to.ordinal } hekeus@45: { "edition ordinal word " quote$ * edition * quote$ * hekeus@45: " may be too high (or improper) for conversion" * " in " * cite$ * warning$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% LATEX BIBLIOGRAPHY CODE %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: FUNCTION {start.entry} hekeus@45: { newline$ hekeus@45: "\bibitem{" write$ hekeus@45: cite$ write$ hekeus@45: "}" write$ hekeus@45: newline$ hekeus@45: "" hekeus@45: initialize.prev.this.status hekeus@45: } hekeus@45: hekeus@45: % Here we write out all the LaTeX code that we will need. The most involved hekeus@45: % code sequences are those that control the alternate interword spacing and hekeus@45: % foreign language hyphenation patterns. The heavy use of \providecommand hekeus@45: % gives users a way to override the defaults. Special thanks to Javier Bezos, hekeus@45: % Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all hekeus@45: % the other gurus on comp.text.tex for their help and advice on the topic of hekeus@45: % \selectlanguage, Babel and BibTeX. hekeus@45: FUNCTION {begin.bib} hekeus@45: { "% Generated by IEEEtran.bst, version: " bst.file.version * " (" * bst.file.date * ")" * hekeus@45: write$ newline$ hekeus@45: preamble$ empty$ 'skip$ hekeus@45: { preamble$ write$ newline$ } hekeus@45: if$ hekeus@45: "\begin{thebibliography}{" longest.label * "}" * hekeus@45: write$ newline$ hekeus@45: "\providecommand{\url}[1]{#1}" hekeus@45: write$ newline$ hekeus@45: "\csname url@samestyle\endcsname" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\newblock}{\relax}" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\bibinfo}[2]{#2}" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\BIBentryALTinterwordstretchfactor}{" hekeus@45: ALTinterwordstretchfactor * "}" * hekeus@45: write$ newline$ hekeus@45: "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " hekeus@45: write$ newline$ hekeus@45: "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\BIBforeignlanguage}[2]{{%" hekeus@45: write$ newline$ hekeus@45: "\expandafter\ifx\csname l@#1\endcsname\relax" hekeus@45: write$ newline$ hekeus@45: "\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%" hekeus@45: write$ newline$ hekeus@45: "\typeout{** loaded for the language `#1'. Using the pattern for}%" hekeus@45: write$ newline$ hekeus@45: "\typeout{** the default language instead.}%" hekeus@45: write$ newline$ hekeus@45: "\else" hekeus@45: write$ newline$ hekeus@45: "\language=\csname l@#1\endcsname" hekeus@45: write$ newline$ hekeus@45: "\fi" hekeus@45: write$ newline$ hekeus@45: "#2}}" hekeus@45: write$ newline$ hekeus@45: "\providecommand{\BIBdecl}{\relax}" hekeus@45: write$ newline$ hekeus@45: "\BIBdecl" hekeus@45: write$ newline$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {end.bib} hekeus@45: { newline$ "\end{thebibliography}" write$ newline$ } hekeus@45: hekeus@45: FUNCTION {if.url.alt.interword.spacing} hekeus@45: { is.use.alt.interword.spacing hekeus@45: {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$} hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {if.url.std.interword.spacing} hekeus@45: { is.use.alt.interword.spacing hekeus@45: {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$} hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: %% LONGEST LABEL PASS %% hekeus@45: %%%%%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: FUNCTION {initialize.longest.label} hekeus@45: { "" 'longest.label := hekeus@45: #1 'number.label := hekeus@45: #0 'longest.label.width := hekeus@45: } hekeus@45: hekeus@45: FUNCTION {longest.label.pass} hekeus@45: { type$ "ieeetranbstctl" = hekeus@45: { skip$ } hekeus@45: { number.label int.to.str$ 'label := hekeus@45: number.label #1 + 'number.label := hekeus@45: label width$ longest.label.width > hekeus@45: { label 'longest.label := hekeus@45: label width$ 'longest.label.width := hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%%% hekeus@45: %% FORMAT HANDLERS %% hekeus@45: %%%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: %% Lower Level Formats (used by higher level formats) hekeus@45: hekeus@45: FUNCTION {format.address.org.or.pub.date} hekeus@45: { 't := hekeus@45: "" hekeus@45: year empty$ hekeus@45: { "empty year in " cite$ * warning$ } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: address empty$ t empty$ and hekeus@45: year empty$ and month empty$ and hekeus@45: { skip$ } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: address "address" bibinfo.check * hekeus@45: t empty$ hekeus@45: { skip$ } hekeus@45: { punct.period 'prev.status.punct := hekeus@45: space.large 'prev.status.space := hekeus@45: address empty$ hekeus@45: { skip$ } hekeus@45: { ": " * } hekeus@45: if$ hekeus@45: t * hekeus@45: } hekeus@45: if$ hekeus@45: year empty$ month empty$ and hekeus@45: { skip$ } hekeus@45: { t empty$ address empty$ and hekeus@45: { skip$ } hekeus@45: { ", " * } hekeus@45: if$ hekeus@45: month empty$ hekeus@45: { year empty$ hekeus@45: { skip$ } hekeus@45: { year "year" bibinfo.check * } hekeus@45: if$ hekeus@45: } hekeus@45: { month "month" bibinfo.check * hekeus@45: year empty$ hekeus@45: { skip$ } hekeus@45: { " " * year "year" bibinfo.check * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: FUNCTION {format.names} hekeus@45: { 'bibinfo := hekeus@45: duplicate$ empty$ 'skip$ { hekeus@45: this.to.prev.status hekeus@45: this.status.std hekeus@45: 's := hekeus@45: "" 't := hekeus@45: #1 'nameptr := hekeus@45: s num.names$ 'numnames := hekeus@45: numnames 'namesleft := hekeus@45: { namesleft #0 > } hekeus@45: { s nameptr hekeus@45: name.format.string hekeus@45: format.name$ hekeus@45: bibinfo bibinfo.check hekeus@45: 't := hekeus@45: nameptr #1 > hekeus@45: { nameptr num.names.shown.with.forced.et.al #1 + = hekeus@45: numnames max.num.names.before.forced.et.al > hekeus@45: is.forced.et.al and and hekeus@45: { "others" 't := hekeus@45: #1 'namesleft := hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: namesleft #1 > hekeus@45: { ", " * t do.name.latex.cmd * } hekeus@45: { s nameptr "{ll}" format.name$ duplicate$ "others" = hekeus@45: { 't := } hekeus@45: { pop$ } hekeus@45: if$ hekeus@45: t "others" = hekeus@45: { " " * bbl.etal emphasize * } hekeus@45: { numnames #2 > hekeus@45: { "," * } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: bbl.and hekeus@45: space.word * t do.name.latex.cmd * hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { t do.name.latex.cmd } hekeus@45: if$ hekeus@45: nameptr #1 + 'nameptr := hekeus@45: namesleft #1 - 'namesleft := hekeus@45: } hekeus@45: while$ hekeus@45: cap.status.std hekeus@45: } if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% Higher Level Formats hekeus@45: hekeus@45: %% addresses/locations hekeus@45: hekeus@45: FUNCTION {format.address} hekeus@45: { address duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% author/editor names hekeus@45: hekeus@45: FUNCTION {format.authors}{ author "author" format.names } hekeus@45: hekeus@45: FUNCTION {format.editors} hekeus@45: { editor "editor" format.names duplicate$ empty$ 'skip$ hekeus@45: { ", " * hekeus@45: get.bbl.editor hekeus@45: capitalize hekeus@45: * hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% date hekeus@45: hekeus@45: FUNCTION {format.date} hekeus@45: { hekeus@45: month "month" bibinfo.check duplicate$ empty$ hekeus@45: year "year" bibinfo.check duplicate$ empty$ hekeus@45: { swap$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: "there's a month but no year in " cite$ * warning$ } hekeus@45: if$ hekeus@45: * hekeus@45: } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: swap$ 'skip$ hekeus@45: { hekeus@45: swap$ hekeus@45: " " * swap$ hekeus@45: } hekeus@45: if$ hekeus@45: * hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.date.electronic} hekeus@45: { month "month" bibinfo.check duplicate$ empty$ hekeus@45: year "year" bibinfo.check duplicate$ empty$ hekeus@45: { swap$ hekeus@45: { pop$ } hekeus@45: { "there's a month but no year in " cite$ * warning$ hekeus@45: pop$ ")" * "(" swap$ * hekeus@45: this.to.prev.status hekeus@45: punct.no 'this.status.punct := hekeus@45: space.normal 'this.status.space := hekeus@45: quote.no 'this.status.quote := hekeus@45: cap.yes 'status.cap := hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { swap$ hekeus@45: { swap$ pop$ ")" * "(" swap$ * } hekeus@45: { "(" swap$ * ", " * swap$ * ")" * } hekeus@45: if$ hekeus@45: this.to.prev.status hekeus@45: punct.no 'this.status.punct := hekeus@45: space.normal 'this.status.space := hekeus@45: quote.no 'this.status.quote := hekeus@45: cap.yes 'status.cap := hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% edition/title hekeus@45: hekeus@45: % Note: IEEE considers the edition to be closely associated with hekeus@45: % the title of a book. So, in IEEEtran.bst the edition is normally handled hekeus@45: % within the formatting of the title. The format.edition function is hekeus@45: % retained here for possible future use. hekeus@45: FUNCTION {format.edition} hekeus@45: { edition duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: convert.edition hekeus@45: status.cap hekeus@45: { "t" } hekeus@45: { "l" } hekeus@45: if$ change.case$ hekeus@45: "edition" bibinfo.check hekeus@45: "~" * bbl.edition * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % This is used to format the booktitle of a conference proceedings. hekeus@45: % Here we use the "intype" field to provide the user a way to hekeus@45: % override the word "in" (e.g., with things like "presented at") hekeus@45: % Use of intype stops the emphasis of the booktitle to indicate that hekeus@45: % we no longer mean the written conference proceedings, but the hekeus@45: % conference itself. hekeus@45: FUNCTION {format.in.booktitle} hekeus@45: { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: select.language hekeus@45: intype missing$ hekeus@45: { emphasize hekeus@45: bbl.in " " * hekeus@45: } hekeus@45: { intype " " * } hekeus@45: if$ hekeus@45: swap$ * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % This is used to format the booktitle of collection. hekeus@45: % Here the "intype" field is not supported, but "edition" is. hekeus@45: FUNCTION {format.in.booktitle.edition} hekeus@45: { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: select.language hekeus@45: emphasize hekeus@45: edition empty$ 'skip$ hekeus@45: { ", " * hekeus@45: edition hekeus@45: convert.edition hekeus@45: "l" change.case$ hekeus@45: * "~" * bbl.edition * hekeus@45: } hekeus@45: if$ hekeus@45: bbl.in " " * swap$ * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.article.title} hekeus@45: { title duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: "t" change.case$ hekeus@45: } hekeus@45: if$ hekeus@45: "title" bibinfo.check hekeus@45: duplicate$ empty$ 'skip$ hekeus@45: { quote.close 'this.status.quote := hekeus@45: is.last.char.not.punct hekeus@45: { punct.std 'this.status.punct := } hekeus@45: { punct.no 'this.status.punct := } hekeus@45: if$ hekeus@45: select.language hekeus@45: "``" swap$ * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.article.title.electronic} hekeus@45: { title duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: "t" change.case$ hekeus@45: } hekeus@45: if$ hekeus@45: "title" bibinfo.check hekeus@45: duplicate$ empty$ hekeus@45: { skip$ } hekeus@45: { select.language } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.book.title.edition} hekeus@45: { title "title" bibinfo.check hekeus@45: duplicate$ empty$ hekeus@45: { "empty title in " cite$ * warning$ } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: select.language hekeus@45: emphasize hekeus@45: edition empty$ 'skip$ hekeus@45: { ", " * hekeus@45: edition hekeus@45: convert.edition hekeus@45: status.cap hekeus@45: { "t" } hekeus@45: { "l" } hekeus@45: if$ hekeus@45: change.case$ hekeus@45: * "~" * bbl.edition * hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.book.title} hekeus@45: { title "title" bibinfo.check hekeus@45: duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: select.language hekeus@45: emphasize hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% journal hekeus@45: hekeus@45: FUNCTION {format.journal} hekeus@45: { journal duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: select.language hekeus@45: emphasize hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% how published hekeus@45: hekeus@45: FUNCTION {format.howpublished} hekeus@45: { howpublished duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% institutions/organization/publishers/school hekeus@45: hekeus@45: FUNCTION {format.institution} hekeus@45: { institution duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.organization} hekeus@45: { organization duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.address.publisher.date} hekeus@45: { publisher "publisher" bibinfo.warn format.address.org.or.pub.date } hekeus@45: hekeus@45: FUNCTION {format.address.publisher.date.nowarn} hekeus@45: { publisher "publisher" bibinfo.check format.address.org.or.pub.date } hekeus@45: hekeus@45: FUNCTION {format.address.organization.date} hekeus@45: { organization "organization" bibinfo.check format.address.org.or.pub.date } hekeus@45: hekeus@45: FUNCTION {format.school} hekeus@45: { school duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% volume/number/series/chapter/pages hekeus@45: hekeus@45: FUNCTION {format.volume} hekeus@45: { volume empty.field.to.null.string hekeus@45: duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: bbl.volume hekeus@45: status.cap hekeus@45: { capitalize } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: swap$ tie.or.space.prefix hekeus@45: "volume" bibinfo.check hekeus@45: * * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.number} hekeus@45: { number empty.field.to.null.string hekeus@45: duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: status.cap hekeus@45: { bbl.number capitalize } hekeus@45: { bbl.number } hekeus@45: if$ hekeus@45: swap$ tie.or.space.prefix hekeus@45: "number" bibinfo.check hekeus@45: * * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.number.if.use.for.article} hekeus@45: { is.use.number.for.article hekeus@45: { format.number } hekeus@45: { "" } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: % IEEE does not seem to tie the series so closely with the volume hekeus@45: % and number as is done in other bibliography styles. Instead the hekeus@45: % series is treated somewhat like an extension of the title. hekeus@45: FUNCTION {format.series} hekeus@45: { series empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: bbl.series " " * hekeus@45: series "series" bibinfo.check * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: FUNCTION {format.chapter} hekeus@45: { chapter empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: type empty$ hekeus@45: { bbl.chapter } hekeus@45: { type "l" change.case$ hekeus@45: "type" bibinfo.check hekeus@45: } hekeus@45: if$ hekeus@45: chapter tie.or.space.prefix hekeus@45: "chapter" bibinfo.check hekeus@45: * * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % The intended use of format.paper is for paper numbers of inproceedings. hekeus@45: % The paper type can be overridden via the type field. hekeus@45: % We allow the type to be displayed even if the paper number is absent hekeus@45: % for things like "postdeadline paper" hekeus@45: FUNCTION {format.paper} hekeus@45: { is.use.paper hekeus@45: { paper empty$ hekeus@45: { type empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: type "type" bibinfo.check hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: type empty$ hekeus@45: { bbl.paper } hekeus@45: { type "type" bibinfo.check } hekeus@45: if$ hekeus@45: " " * paper hekeus@45: "paper" bibinfo.check hekeus@45: * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { "" } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: FUNCTION {format.pages} hekeus@45: { pages duplicate$ empty$ 'skip$ hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: duplicate$ is.multiple.pages hekeus@45: { hekeus@45: bbl.pages swap$ hekeus@45: n.dashify hekeus@45: } hekeus@45: { hekeus@45: bbl.page swap$ hekeus@45: } hekeus@45: if$ hekeus@45: tie.or.space.prefix hekeus@45: "pages" bibinfo.check hekeus@45: * * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% technical report number hekeus@45: hekeus@45: FUNCTION {format.tech.report.number} hekeus@45: { number "number" bibinfo.check hekeus@45: this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.status.std hekeus@45: type duplicate$ empty$ hekeus@45: { pop$ hekeus@45: bbl.techrep hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: "type" bibinfo.check hekeus@45: swap$ duplicate$ empty$ hekeus@45: { pop$ } hekeus@45: { tie.or.space.prefix * * } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% note hekeus@45: hekeus@45: FUNCTION {format.note} hekeus@45: { note empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: punct.period 'this.status.punct := hekeus@45: note #1 #1 substring$ hekeus@45: duplicate$ "{" = hekeus@45: { skip$ } hekeus@45: { status.cap hekeus@45: { "u" } hekeus@45: { "l" } hekeus@45: if$ hekeus@45: change.case$ hekeus@45: } hekeus@45: if$ hekeus@45: note #2 global.max$ substring$ * "note" bibinfo.check hekeus@45: cap.yes 'status.cap := hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% patent hekeus@45: hekeus@45: FUNCTION {format.patent.date} hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: year empty$ hekeus@45: { monthfiled duplicate$ empty$ hekeus@45: { "monthfiled" bibinfo.check pop$ "" } hekeus@45: { "monthfiled" bibinfo.check } hekeus@45: if$ hekeus@45: dayfiled duplicate$ empty$ hekeus@45: { "dayfiled" bibinfo.check pop$ "" * } hekeus@45: { "dayfiled" bibinfo.check hekeus@45: monthfiled empty$ hekeus@45: { "dayfiled without a monthfiled in " cite$ * warning$ hekeus@45: * hekeus@45: } hekeus@45: { " " swap$ * * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: yearfiled empty$ hekeus@45: { "no year or yearfiled in " cite$ * warning$ } hekeus@45: { yearfiled "yearfiled" bibinfo.check hekeus@45: swap$ hekeus@45: duplicate$ empty$ hekeus@45: { pop$ } hekeus@45: { ", " * swap$ * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: { month duplicate$ empty$ hekeus@45: { "month" bibinfo.check pop$ "" } hekeus@45: { "month" bibinfo.check } hekeus@45: if$ hekeus@45: day duplicate$ empty$ hekeus@45: { "day" bibinfo.check pop$ "" * } hekeus@45: { "day" bibinfo.check hekeus@45: month empty$ hekeus@45: { "day without a month in " cite$ * warning$ hekeus@45: * hekeus@45: } hekeus@45: { " " swap$ * * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: year "year" bibinfo.check hekeus@45: swap$ hekeus@45: duplicate$ empty$ hekeus@45: { pop$ } hekeus@45: { ", " * swap$ * } hekeus@45: if$ hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.patent.nationality.type.number} hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: nationality duplicate$ empty$ hekeus@45: { "nationality" bibinfo.warn pop$ "" } hekeus@45: { "nationality" bibinfo.check hekeus@45: duplicate$ "l" change.case$ "united states" = hekeus@45: { pop$ bbl.patentUS } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: " " * hekeus@45: } hekeus@45: if$ hekeus@45: type empty$ hekeus@45: { bbl.patent "type" bibinfo.check } hekeus@45: { type "type" bibinfo.check } hekeus@45: if$ hekeus@45: * hekeus@45: number duplicate$ empty$ hekeus@45: { "number" bibinfo.warn pop$ } hekeus@45: { "number" bibinfo.check hekeus@45: large.number.separate hekeus@45: swap$ " " * swap$ * hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% standard hekeus@45: hekeus@45: FUNCTION {format.organization.institution.standard.type.number} hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: organization duplicate$ empty$ hekeus@45: { pop$ hekeus@45: institution duplicate$ empty$ hekeus@45: { "institution" bibinfo.warn } hekeus@45: { "institution" bibinfo.warn " " * } hekeus@45: if$ hekeus@45: } hekeus@45: { "organization" bibinfo.warn " " * } hekeus@45: if$ hekeus@45: type empty$ hekeus@45: { bbl.standard "type" bibinfo.check } hekeus@45: { type "type" bibinfo.check } hekeus@45: if$ hekeus@45: * hekeus@45: number duplicate$ empty$ hekeus@45: { "number" bibinfo.check pop$ } hekeus@45: { "number" bibinfo.check hekeus@45: large.number.separate hekeus@45: swap$ " " * swap$ * hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.revision} hekeus@45: { revision empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: bbl.revision hekeus@45: revision tie.or.space.prefix hekeus@45: "revision" bibinfo.check hekeus@45: * * hekeus@45: cap.status.std hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: %% thesis hekeus@45: hekeus@45: FUNCTION {format.master.thesis.type} hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: type empty$ hekeus@45: { hekeus@45: bbl.mthesis hekeus@45: } hekeus@45: { hekeus@45: type "type" bibinfo.check hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: hekeus@45: FUNCTION {format.phd.thesis.type} hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: type empty$ hekeus@45: { hekeus@45: bbl.phdthesis hekeus@45: } hekeus@45: { hekeus@45: type "type" bibinfo.check hekeus@45: } hekeus@45: if$ hekeus@45: cap.status.std hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: %% URL hekeus@45: hekeus@45: FUNCTION {format.url} hekeus@45: { url empty$ hekeus@45: { "" } hekeus@45: { this.to.prev.status hekeus@45: this.status.std hekeus@45: cap.yes 'status.cap := hekeus@45: name.url.prefix " " * hekeus@45: "\url{" * url * "}" * hekeus@45: punct.no 'this.status.punct := hekeus@45: punct.period 'prev.status.punct := hekeus@45: space.normal 'this.status.space := hekeus@45: space.normal 'prev.status.space := hekeus@45: quote.no 'this.status.quote := hekeus@45: } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%%% hekeus@45: %% ENTRY HANDLERS %% hekeus@45: %%%%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: hekeus@45: % Note: In many journals, IEEE (or the authors) tend not to show the number hekeus@45: % for articles, so the display of the number is controlled here by the hekeus@45: % switch "is.use.number.for.article" hekeus@45: FUNCTION {article} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.journal "journal" bibinfo.check "journal" output.warn hekeus@45: format.volume output hekeus@45: format.number.if.use.for.article output hekeus@45: format.pages output hekeus@45: format.date "year" output.warn hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {book} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: author empty$ hekeus@45: { format.editors "author and editor" output.warn } hekeus@45: { format.authors output.nonnull } hekeus@45: if$ hekeus@45: name.or.dash hekeus@45: format.book.title.edition output hekeus@45: format.series output hekeus@45: author empty$ hekeus@45: { skip$ } hekeus@45: { format.editors output } hekeus@45: if$ hekeus@45: format.address.publisher.date output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {booklet} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.organization "organization" bibinfo.check output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.date output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {electronic} hekeus@45: { std.status.using.period hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.date.electronic output hekeus@45: format.article.title.electronic output hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.organization "organization" bibinfo.check output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: empty.entry.warn hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {inbook} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: author empty$ hekeus@45: { format.editors "author and editor" output.warn } hekeus@45: { format.authors output.nonnull } hekeus@45: if$ hekeus@45: name.or.dash hekeus@45: format.book.title.edition output hekeus@45: format.series output hekeus@45: format.address.publisher.date output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: format.chapter output hekeus@45: format.pages output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {incollection} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.in.booktitle.edition "booktitle" output.warn hekeus@45: format.series output hekeus@45: format.editors output hekeus@45: format.address.publisher.date.nowarn output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: format.chapter output hekeus@45: format.pages output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {inproceedings} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.in.booktitle "booktitle" output.warn hekeus@45: format.series output hekeus@45: format.editors output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: publisher empty$ hekeus@45: { format.address.organization.date output } hekeus@45: { format.organization "organization" bibinfo.check output hekeus@45: format.address.publisher.date output hekeus@45: } hekeus@45: if$ hekeus@45: format.paper output hekeus@45: format.pages output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {manual} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.book.title.edition "title" output.warn hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.organization "organization" bibinfo.check output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.date output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {mastersthesis} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.master.thesis.type output.nonnull hekeus@45: format.school "school" bibinfo.warn output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.date "year" output.warn hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {misc} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.article.title output hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.organization "organization" bibinfo.check output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.pages output hekeus@45: format.date output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: empty.entry.warn hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {patent} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.article.title output hekeus@45: format.patent.nationality.type.number output hekeus@45: format.patent.date output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: empty.entry.warn hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {periodical} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.editors output hekeus@45: name.or.dash hekeus@45: format.book.title "title" output.warn hekeus@45: format.series output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: format.organization "organization" bibinfo.check output hekeus@45: format.date "year" output.warn hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {phdthesis} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.phd.thesis.type output.nonnull hekeus@45: format.school "school" bibinfo.warn output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.date "year" output.warn hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {proceedings} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.editors output hekeus@45: name.or.dash hekeus@45: format.book.title "title" output.warn hekeus@45: format.series output hekeus@45: format.volume output hekeus@45: format.number output hekeus@45: publisher empty$ hekeus@45: { format.address.organization.date output } hekeus@45: { format.organization "organization" bibinfo.check output hekeus@45: format.address.publisher.date output hekeus@45: } hekeus@45: if$ hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {standard} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors output hekeus@45: name.or.dash hekeus@45: format.book.title "title" output.warn hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.organization.institution.standard.type.number output hekeus@45: format.revision output hekeus@45: format.date output hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {techreport} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.howpublished "howpublished" bibinfo.check output hekeus@45: format.institution "institution" bibinfo.warn output hekeus@45: format.address "address" bibinfo.check output hekeus@45: format.tech.report.number output.nonnull hekeus@45: format.date "year" output.warn hekeus@45: format.note output hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: FUNCTION {unpublished} hekeus@45: { std.status.using.comma hekeus@45: start.entry hekeus@45: if.url.alt.interword.spacing hekeus@45: format.authors "author" output.warn hekeus@45: name.or.dash hekeus@45: format.article.title "title" output.warn hekeus@45: format.date output hekeus@45: format.note "note" output.warn hekeus@45: format.url output hekeus@45: fin.entry hekeus@45: if.url.std.interword.spacing hekeus@45: } hekeus@45: hekeus@45: hekeus@45: % The special entry type which provides the user interface to the hekeus@45: % BST controls hekeus@45: FUNCTION {IEEEtranBSTCTL} hekeus@45: { is.print.banners.to.terminal hekeus@45: { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * hekeus@45: top$ hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: CTLuse_article_number hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLuse_article_number hekeus@45: yes.no.to.int hekeus@45: 'is.use.number.for.article := hekeus@45: } hekeus@45: if$ hekeus@45: CTLuse_paper hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLuse_paper hekeus@45: yes.no.to.int hekeus@45: 'is.use.paper := hekeus@45: } hekeus@45: if$ hekeus@45: CTLuse_forced_etal hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLuse_forced_etal hekeus@45: yes.no.to.int hekeus@45: 'is.forced.et.al := hekeus@45: } hekeus@45: if$ hekeus@45: CTLmax_names_forced_etal hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLmax_names_forced_etal hekeus@45: string.to.integer hekeus@45: 'max.num.names.before.forced.et.al := hekeus@45: } hekeus@45: if$ hekeus@45: CTLnames_show_etal hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLnames_show_etal hekeus@45: string.to.integer hekeus@45: 'num.names.shown.with.forced.et.al := hekeus@45: } hekeus@45: if$ hekeus@45: CTLuse_alt_spacing hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLuse_alt_spacing hekeus@45: yes.no.to.int hekeus@45: 'is.use.alt.interword.spacing := hekeus@45: } hekeus@45: if$ hekeus@45: CTLalt_stretch_factor hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLalt_stretch_factor hekeus@45: 'ALTinterwordstretchfactor := hekeus@45: "\renewcommand{\BIBentryALTinterwordstretchfactor}{" hekeus@45: ALTinterwordstretchfactor * "}" * hekeus@45: write$ newline$ hekeus@45: } hekeus@45: if$ hekeus@45: CTLdash_repeated_names hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLdash_repeated_names hekeus@45: yes.no.to.int hekeus@45: 'is.dash.repeated.names := hekeus@45: } hekeus@45: if$ hekeus@45: CTLname_format_string hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLname_format_string hekeus@45: 'name.format.string := hekeus@45: } hekeus@45: if$ hekeus@45: CTLname_latex_cmd hekeus@45: empty$ hekeus@45: { skip$ } hekeus@45: { CTLname_latex_cmd hekeus@45: 'name.latex.cmd := hekeus@45: } hekeus@45: if$ hekeus@45: CTLname_url_prefix hekeus@45: missing$ hekeus@45: { skip$ } hekeus@45: { CTLname_url_prefix hekeus@45: 'name.url.prefix := hekeus@45: } hekeus@45: if$ hekeus@45: hekeus@45: hekeus@45: num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > hekeus@45: { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ hekeus@45: max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := hekeus@45: } hekeus@45: { skip$ } hekeus@45: if$ hekeus@45: } hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%%% hekeus@45: %% ENTRY ALIASES %% hekeus@45: %%%%%%%%%%%%%%%%%%% hekeus@45: FUNCTION {conference}{inproceedings} hekeus@45: FUNCTION {online}{electronic} hekeus@45: FUNCTION {internet}{electronic} hekeus@45: FUNCTION {webpage}{electronic} hekeus@45: FUNCTION {www}{electronic} hekeus@45: FUNCTION {default.type}{misc} hekeus@45: hekeus@45: hekeus@45: hekeus@45: %%%%%%%%%%%%%%%%%% hekeus@45: %% MAIN PROGRAM %% hekeus@45: %%%%%%%%%%%%%%%%%% hekeus@45: hekeus@45: READ hekeus@45: hekeus@45: EXECUTE {initialize.controls} hekeus@45: EXECUTE {initialize.status.constants} hekeus@45: EXECUTE {banner.message} hekeus@45: hekeus@45: EXECUTE {initialize.longest.label} hekeus@45: ITERATE {longest.label.pass} hekeus@45: hekeus@45: EXECUTE {begin.bib} hekeus@45: ITERATE {call.type$} hekeus@45: EXECUTE {end.bib} hekeus@45: hekeus@45: EXECUTE{completed.message} hekeus@45: hekeus@45: hekeus@45: %% That's all folks, mds.