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




