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