From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/mciteplus/IEEEtranM.bst | 2443 ++++++++++++++++++ macros/latex/contrib/mciteplus/IEEEtranMN.bst | 2764 +++++++++++++++++++++ macros/latex/contrib/mciteplus/README | 126 + macros/latex/contrib/mciteplus/apsrevM.bst | 2129 ++++++++++++++++ macros/latex/contrib/mciteplus/apsrmpM.bst | 2170 ++++++++++++++++ macros/latex/contrib/mciteplus/changelog.txt | 30 + macros/latex/contrib/mciteplus/mciteplus.sty | 1351 ++++++++++ macros/latex/contrib/mciteplus/mciteplus_code.txt | 218 ++ macros/latex/contrib/mciteplus/mciteplus_doc.pdf | Bin 0 -> 438691 bytes macros/latex/contrib/mciteplus/mciteplus_doc.tex | 2319 +++++++++++++++++ 10 files changed, 13550 insertions(+) create mode 100644 macros/latex/contrib/mciteplus/IEEEtranM.bst create mode 100644 macros/latex/contrib/mciteplus/IEEEtranMN.bst create mode 100644 macros/latex/contrib/mciteplus/README create mode 100644 macros/latex/contrib/mciteplus/apsrevM.bst create mode 100644 macros/latex/contrib/mciteplus/apsrmpM.bst create mode 100644 macros/latex/contrib/mciteplus/changelog.txt create mode 100644 macros/latex/contrib/mciteplus/mciteplus.sty create mode 100644 macros/latex/contrib/mciteplus/mciteplus_code.txt create mode 100644 macros/latex/contrib/mciteplus/mciteplus_doc.pdf create mode 100644 macros/latex/contrib/mciteplus/mciteplus_doc.tex (limited to 'macros/latex/contrib/mciteplus') diff --git a/macros/latex/contrib/mciteplus/IEEEtranM.bst b/macros/latex/contrib/mciteplus/IEEEtranM.bst new file mode 100644 index 0000000000..4470ade57e --- /dev/null +++ b/macros/latex/contrib/mciteplus/IEEEtranM.bst @@ -0,0 +1,2443 @@ +%% +%% IEEEtranM.bst +%% BibTeX Bibliography Style file +%% mciteplus compatible version +%% *** Not for normal IEEE work *** +%% Version 1.13 (2008/09/30) +%% +%% Copyright (c) 2003-2008 Michael Shell +%% +%% Original starting code base and algorithms obtained from the output of +%% Patrick W. Daly's makebst package as well as from prior versions of +%% IEEE BibTeX styles: +%% +%% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) +%% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) +%% +%% Support site: +%% http://www.michaelshell.org/tex/mciteplus/ +%% http://www.michaelshell.org/tex/ieeetran/bibtex/ +%% +%% For use with BibTeX version 0.99a or later +%% +%% This is a numerical citation style. +%% +%%************************************************************************* +%% Legal Notice: +%% This code is offered as-is without any warranty either expressed or +%% implied; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE! +%% User assumes all risk. +%% In no event shall IEEE or any contributor to this code be liable for +%% any damages or losses, including, but not limited to, incidental, +%% consequential, or any other damages, resulting from the use or misuse +%% of any information contained here. +%% +%% All comments are the opinions of their respective authors and are not +%% necessarily endorsed by the IEEE. +%% +%% This work is distributed under the LaTeX Project Public License (LPPL) +%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, +%% distributed and modified. A copy of the LPPL, version 1.3, is included +%% in the base LaTeX documentation of all distributions of LaTeX released +%% 2003/12/01 or later. +%% Retain all contribution notices and credits. +%% ** Modified files should be clearly indicated as such, including ** +%% ** renaming them and changing author support contact information. ** +%%************************************************************************* +% +% Changelog: +% +% 1.12 (2008/01/15) initial release +% +% 1.13 (2008/09/30) +% 1. Fixed bug with edition number to ordinal conversion. Thanks to +% Michael Roland for reporting this and correcting the algorithm. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% These are the defaults for the user adjustable controls. The values used +% here can be overridden by the user via IEEEtranBSTCTL entry type. + +% NOTE: The recommended LaTeX command to invoke a control entry type is: +% +%\makeatletter +%\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} +%\def\@bstctlcite[#1]#2{\@bsphack +% \@for\@citeb:=#2\do{% +% \edef\@citeb{\expandafter\@firstofone\@citeb}% +% \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% +% \@esphack} +%\makeatother +% +% It is called at the start of the document, before the first \cite, like: +% \bstctlcite{IEEEexample:BSTcontrol} +% +% IEEEtran.cls V1.6 and later does provide this command. + + + +% #0 turns off the display of the number for articles. +% #1 enables +FUNCTION {default.is.use.number.for.article} { #1 } + + +% #0 turns off the display of the paper and type fields in @inproceedings. +% #1 enables +FUNCTION {default.is.use.paper} { #1 } + + +% #0 turns off the forced use of "et al." +% #1 enables +FUNCTION {default.is.forced.et.al} { #0 } + +% The maximum number of names that can be present beyond which an "et al." +% usage is forced. Be sure that num.names.shown.with.forced.et.al (below) +% is not greater than this value! +% Note: There are many instances of references in IEEE journals which have +% a very large number of authors as well as instances in which "et al." is +% used profusely. +FUNCTION {default.max.num.names.before.forced.et.al} { #10 } + +% The number of names that will be shown with a forced "et al.". +% Must be less than or equal to max.num.names.before.forced.et.al +FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } + + +% #0 turns off the alternate interword spacing for entries with URLs. +% #1 enables +FUNCTION {default.is.use.alt.interword.spacing} { #1 } + +% If alternate interword spacing for entries with URLs is enabled, this is +% the interword spacing stretch factor that will be used. For example, the +% default "4" here means that the interword spacing in entries with URLs can +% stretch to four times normal. Does not have to be an integer. Note that +% the value specified here can be overridden by the user in their LaTeX +% code via a command such as: +% "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to +% that via the IEEEtranBSTCTL entry type. +FUNCTION {default.ALTinterwordstretchfactor} { "4" } + + +% #0 turns off the "dashification" of repeated (i.e., identical to those +% of the previous entry) names. IEEE normally does this. +% #1 enables +FUNCTION {default.is.dash.repeated.names} { #1 } + + +% The default name format control string. +FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } + + +% The default LaTeX font command for the names. +FUNCTION {default.name.latex.cmd}{ "" } + + +% The default URL prefix. +FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } + + +% Other controls that cannot be accessed via IEEEtranBSTCTL entry type. + +% #0 turns off the terminal startup banner/completed message so as to +% operate more quietly. +% #1 enables +FUNCTION {is.print.banners.to.terminal} { #1 } + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% FILE VERSION AND BANNER %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION{bst.file.version} { "1.13" } +FUNCTION{bst.file.date} { "2008/09/30" } +FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } + +FUNCTION {banner.message} +{ is.print.banners.to.terminal + { "-- IEEEtranM.bst version" " " * bst.file.version * + " (" * bst.file.date * ") " * "by Michael Shell." * + top$ + "-- " bst.file.website * + top$ + "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " and " * quote$ * "mciteplus_doc.pdf" * quote$ * " manuals" * + top$ + " for usage information." + top$ + "** Mciteplus version - not for use with work to be submitted to the IEEE." + top$ + } + { skip$ } + if$ +} + +FUNCTION {completed.message} +{ is.print.banners.to.terminal + { "" + top$ + "Done." + top$ + } + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING CONSTANTS %% +%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {bbl.and}{ "and" } +FUNCTION {bbl.etal}{ "et~al." } +FUNCTION {bbl.editors}{ "eds." } +FUNCTION {bbl.editor}{ "ed." } +FUNCTION {bbl.edition}{ "ed." } +FUNCTION {bbl.volume}{ "vol." } +FUNCTION {bbl.of}{ "of" } +FUNCTION {bbl.number}{ "no." } +FUNCTION {bbl.in}{ "in" } +FUNCTION {bbl.pages}{ "pp." } +FUNCTION {bbl.page}{ "p." } +FUNCTION {bbl.chapter}{ "ch." } +FUNCTION {bbl.paper}{ "paper" } +FUNCTION {bbl.part}{ "pt." } +FUNCTION {bbl.patent}{ "Patent" } +FUNCTION {bbl.patentUS}{ "U.S." } +FUNCTION {bbl.revision}{ "Rev." } +FUNCTION {bbl.series}{ "ser." } +FUNCTION {bbl.standard}{ "Std." } +FUNCTION {bbl.techrep}{ "Tech. Rep." } +FUNCTION {bbl.mthesis}{ "Master's thesis" } +FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } +FUNCTION {bbl.st}{ "st" } +FUNCTION {bbl.nd}{ "nd" } +FUNCTION {bbl.rd}{ "rd" } +FUNCTION {bbl.th}{ "th" } + + +% This is the LaTeX spacer that is used when a larger than normal space +% is called for (such as just before the address:publisher). +FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } + +% The LaTeX code for dashes that are used to represent repeated names. +% Note: Some older IEEE journals used something like +% "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along +% the baseline. However, IEEE now uses a thinner, above baseline, +% six dash long sequence. +FUNCTION {repeated.name.dashes} { "------" } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% PREDEFINED STRING MACROS %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MACRO {jan} {"Jan."} +MACRO {feb} {"Feb."} +MACRO {mar} {"Mar."} +MACRO {apr} {"Apr."} +MACRO {may} {"May"} +MACRO {jun} {"Jun."} +MACRO {jul} {"Jul."} +MACRO {aug} {"Aug."} +MACRO {sep} {"Sep."} +MACRO {oct} {"Oct."} +MACRO {nov} {"Nov."} +MACRO {dec} {"Dec."} + + + +%%%%%%%%%%%%%%%%%% +%% ENTRY FIELDS %% +%%%%%%%%%%%%%%%%%% + +ENTRY + { address + assignee + author + booktitle + chapter + day + dayfiled + edition + editor + howpublished + institution + intype + journal + key + language + month + monthfiled + nationality + note + number + organization + pages + paper + publisher + school + series + revision + title + type + url + volume + year + yearfiled + CTLuse_article_number + CTLuse_paper + CTLuse_forced_etal + CTLmax_names_forced_etal + CTLnames_show_etal + CTLuse_alt_spacing + CTLalt_stretch_factor + CTLdash_repeated_names + CTLname_format_string + CTLname_latex_cmd + CTLname_url_prefix + } + {} + { label } + + + + +%%%%%%%%%%%%%%%%%%%%%%% +%% INTEGER VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%%% + +INTEGERS { prev.status.punct this.status.punct punct.std + punct.no punct.comma punct.period + prev.status.space this.status.space space.std + space.no space.normal space.large + prev.status.quote this.status.quote quote.std + quote.no quote.close + prev.status.nline this.status.nline nline.std + nline.no nline.newblock + status.cap cap.std + cap.no cap.yes} + +INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } + +INTEGERS { is.use.number.for.article + is.use.paper + is.forced.et.al + max.num.names.before.forced.et.al + num.names.shown.with.forced.et.al + is.use.alt.interword.spacing + is.dash.repeated.names} + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%% + +STRINGS { bibinfo + longest.label + oldname + s + t + ALTinterwordstretchfactor + name.format.string + name.latex.cmd + name.url.prefix} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOW LEVEL FUNCTIONS %% +%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {initialize.controls} +{ default.is.use.number.for.article 'is.use.number.for.article := + default.is.use.paper 'is.use.paper := + default.is.forced.et.al 'is.forced.et.al := + default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := + default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := + default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := + default.is.dash.repeated.names 'is.dash.repeated.names := + default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := + default.name.format.string 'name.format.string := + default.name.latex.cmd 'name.latex.cmd := + default.name.url.prefix 'name.url.prefix := +} + + +% This IEEEtran.bst features a very powerful and flexible mechanism for +% controlling the capitalization, punctuation, spacing, quotation, and +% newlines of the formatted entry fields. (Note: IEEEtran.bst does not need +% or use the newline/newblock feature, but it has been implemented for +% possible future use.) The output states of IEEEtran.bst consist of +% multiple independent attributes and, as such, can be thought of as being +% vectors, rather than the simple scalar values ("before.all", +% "mid.sentence", etc.) used in most other .bst files. +% +% The more flexible and complex design used here was motivated in part by +% IEEE's rather unusual bibliography style. For example, IEEE ends the +% previous field item with a period and large space prior to the publisher +% address; the @electronic entry types use periods as inter-item punctuation +% rather than the commas used by the other entry types; and URLs are never +% followed by periods even though they are the last item in the entry. +% Although it is possible to accommodate these features with the conventional +% output state system, the seemingly endless exceptions make for convoluted, +% unreliable and difficult to maintain code. +% +% IEEEtran.bst's output state system can be easily understood via a simple +% illustration of two most recently formatted entry fields (on the stack): +% +% CURRENT_ITEM +% "PREVIOUS_ITEM +% +% which, in this example, is to eventually appear in the bibliography as: +% +% "PREVIOUS_ITEM," CURRENT_ITEM +% +% It is the job of the output routine to take the previous item off of the +% stack (while leaving the current item at the top of the stack), apply its +% trailing punctuation (including closing quote marks) and spacing, and then +% to write the result to BibTeX's output buffer: +% +% "PREVIOUS_ITEM," +% +% Punctuation (and spacing) between items is often determined by both of the +% items rather than just the first one. The presence of quotation marks +% further complicates the situation because, in standard English, trailing +% punctuation marks are supposed to be contained within the quotes. +% +% IEEEtran.bst maintains two output state (aka "status") vectors which +% correspond to the previous and current (aka "this") items. Each vector +% consists of several independent attributes which track punctuation, +% spacing, quotation, and newlines. Capitalization status is handled by a +% separate scalar because the format routines, not the output routine, +% handle capitalization and, therefore, there is no need to maintain the +% capitalization attribute for both the "previous" and "this" items. +% +% When a format routine adds a new item, it copies the current output status +% vector to the previous output status vector and (usually) resets the +% current (this) output status vector to a "standard status" vector. Using a +% "standard status" vector in this way allows us to redefine what we mean by +% "standard status" at the start of each entry handler and reuse the same +% format routines under the various inter-item separation schemes. For +% example, the standard status vector for the @book entry type may use +% commas for item separators, while the @electronic type may use periods, +% yet both entry handlers exploit many of the exact same format routines. +% +% Because format routines have write access to the output status vector of +% the previous item, they can override the punctuation choices of the +% previous format routine! Therefore, it becomes trivial to implement rules +% such as "Always use a period and a large space before the publisher." By +% pushing the generation of the closing quote mark to the output routine, we +% avoid all the problems caused by having to close a quote before having all +% the information required to determine what the punctuation should be. +% +% The IEEEtran.bst output state system can easily be expanded if needed. +% For instance, it is easy to add a "space.tie" attribute value if the +% bibliography rules mandate that two items have to be joined with an +% unbreakable space. + +FUNCTION {initialize.status.constants} +{ #0 'punct.no := + #1 'punct.comma := + #2 'punct.period := + #0 'space.no := + #1 'space.normal := + #2 'space.large := + #0 'quote.no := + #1 'quote.close := + #0 'cap.no := + #1 'cap.yes := + #0 'nline.no := + #1 'nline.newblock := +} + +FUNCTION {std.status.using.comma} +{ punct.comma 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.no 'cap.std := +} + +FUNCTION {std.status.using.period} +{ punct.period 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.yes 'cap.std := +} + +FUNCTION {initialize.prev.this.status} +{ punct.no 'prev.status.punct := + space.no 'prev.status.space := + quote.no 'prev.status.quote := + nline.no 'prev.status.nline := + punct.no 'this.status.punct := + space.no 'this.status.space := + quote.no 'this.status.quote := + nline.no 'this.status.nline := + cap.yes 'status.cap := +} + +FUNCTION {this.status.std} +{ punct.std 'this.status.punct := + space.std 'this.status.space := + quote.std 'this.status.quote := + nline.std 'this.status.nline := +} + +FUNCTION {cap.status.std}{ cap.std 'status.cap := } + +FUNCTION {this.to.prev.status} +{ this.status.punct 'prev.status.punct := + this.status.space 'prev.status.space := + this.status.quote 'prev.status.quote := + this.status.nline 'prev.status.nline := +} + + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ { skip$ } + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + { skip$ } + if$ +} + + +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} + + +% pushes true if the single char string on the stack is in the +% range of "0" to "9" +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +% multiplies the integer on the stack by a factor of 10 +FUNCTION {bump.int.mag} +{ #0 'multiresult := + { duplicate$ #0 > } + { #1 - + multiresult #10 + + 'multiresult := + } + while$ +pop$ +multiresult +} + +% converts a single character string on the stack to an integer +FUNCTION {char.to.integer} +{ duplicate$ + is.num + { chr.to.int$ "0" chr.to.int$ - } + {"noninteger character " quote$ * swap$ * quote$ * + " in integer field of " * cite$ * warning$ + #0 + } + if$ +} + +% converts a string on the stack to an integer +FUNCTION {string.to.integer} +{ duplicate$ text.length$ 'namesleft := + #1 'nameptr := + #0 'numnames := + { nameptr namesleft > not } + { duplicate$ nameptr #1 substring$ + char.to.integer numnames bump.int.mag + + 'numnames := + nameptr #1 + + 'nameptr := + } + while$ +pop$ +numnames +} + + + + +% The output routines write out the *next* to the top (previous) item on the +% stack, adding punctuation and such as needed. Since IEEEtran.bst maintains +% the output status for the top two items on the stack, these output +% routines have to consider the previous output status (which corresponds to +% the item that is being output). Full independent control of punctuation, +% closing quote marks, spacing, and newblock is provided. +% +% "output.nonnull" does not check for the presence of a previous empty +% item. +% +% "output" does check for the presence of a previous empty item and will +% remove an empty item rather than outputing it. +% +% "output.warn" is like "output", but will issue a warning if it detects +% an empty item. + +FUNCTION {output.nonnull} +{ swap$ + prev.status.punct punct.comma = + { "," * } + { skip$ } + if$ + prev.status.punct punct.period = + { add.period$ } + { skip$ } + if$ + prev.status.quote quote.close = + { "''" * } + { skip$ } + if$ + prev.status.space space.normal = + { " " * } + { skip$ } + if$ + prev.status.space space.large = + { large.space * } + { skip$ } + if$ + write$ + prev.status.nline nline.newblock = + { newline$ "\newblock " write$ } + { skip$ } + if$ +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.warn} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + + + +% mciteplus fin.entry +% +% pushes true (1), if add.period$ would add a period to the string on the stack +% pushes false (0), otherwise +% Uses text.length$ to avoid full string comparison and two copies of string. +% Requires one copy of string on stack. +INTEGERS {would.add.period.textlen} +FUNCTION {would.add.period} +{ duplicate$ + add.period$ + text.length$ + 'would.add.period.textlen := + duplicate$ + text.length$ + would.add.period.textlen = + { #0 } + { #1 } + if$ +} + + +FUNCTION {std.interword.spacing.or.relax} +{ is.use.alt.interword.spacing + { url empty$ + { "\relax" } + {"\BIBentrySTDinterwordspacing"} + if$} + { "\relax" } + if$ +} + + +% "fin.entry" is the output routine that handles the last item of the entry +% (which will be on the top of the stack when "fin.entry" is called). +% This is the mciteplus version which passes the punctuation info on to mciteplus.sty +FUNCTION {fin.entry} +{ this.status.punct punct.no = + { #0 } + { would.add.period } + if$ + swap$ + "\relax" * write$ newline$ + { "\mciteBstWouldAddEndPuncttrue" write$ newline$ + this.status.quote quote.close = + { "\mciteSetBstMidEndSepPunct{'';\space}{.''}{\par" std.interword.spacing.or.relax * "}\relax" * } + { "\mciteSetBstMidEndSepPunct{;\space}{.}{\par" std.interword.spacing.or.relax * "}\relax" * } + if$ + } + { "\mciteBstWouldAddEndPunctfalse" write$ newline$ + this.status.quote quote.close = + { "\mciteSetBstMidEndSepPunct{'';\space}{''}{\par" std.interword.spacing.or.relax * "}\relax" * } + { "\mciteSetBstMidEndSepPunct{~;\space}{}{\par" std.interword.spacing.or.relax * "}\relax" * } + if$ + } + if$ + write$ + newline$ + "\EndOfBibitem" write$ +} + + + +FUNCTION {is.last.char.not.punct} +{ duplicate$ + "}" * add.period$ + #-1 #1 substring$ "." = +} + +FUNCTION {is.multiple.pages} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +FUNCTION {do.name.latex.cmd} +{ name.latex.cmd + empty$ + { skip$ } + { name.latex.cmd "{" * swap$ * "}" * } + if$ +} + +% IEEEtran.bst uses its own \BIBforeignlanguage command which directly +% invokes the TeX hyphenation patterns without the need of the Babel +% package. Babel does a lot more than switch hyphenation patterns and +% its loading can cause unintended effects in many class files (such as +% IEEEtran.cls). +FUNCTION {select.language} +{ duplicate$ empty$ 'pop$ + { language empty$ 'skip$ + { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {space.word}{ " " swap$ * " " * } + + +% Field Conditioners, Converters, Checkers and External Interfaces + +FUNCTION {empty.field.to.null.string} +{ duplicate$ empty$ + { pop$ "" } + { skip$ } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + { pop$ } + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {empty.entry.warn} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ url empty$ + and and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + + +% The bibinfo system provides a way for the electronic parsing/acquisition +% of a bibliography's contents as is done by ReVTeX. For example, a field +% could be entered into the bibliography as: +% \bibinfo{volume}{2} +% Only the "2" would show up in the document, but the LaTeX \bibinfo command +% could do additional things with the information. IEEEtran.bst does provide +% a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is +% currently not used as the bogus bibinfo functions defined here output the +% entry values directly without the \bibinfo wrapper. The bibinfo functions +% themselves (and the calls to them) are retained for possible future use. +% +% bibinfo.check avoids acting on missing fields while bibinfo.warn will +% issue a warning message if a missing field is detected. Prior to calling +% the bibinfo functions, the user should push the field value and then its +% name string, in that order. + +FUNCTION {bibinfo.check} +{ swap$ duplicate$ missing$ + { pop$ pop$ "" } + { duplicate$ empty$ + { swap$ pop$ } + { swap$ pop$ } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ duplicate$ missing$ + { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } + { duplicate$ empty$ + { swap$ "empty " swap$ * " in " * cite$ * warning$ } + { swap$ pop$ } + if$ + } + if$ +} + + +% IEEE separates large numbers with more than 4 digits into groups of +% three. IEEE uses a small space to separate these number groups. +% Typical applications include patent and page numbers. + +% number of consecutive digits required to trigger the group separation. +FUNCTION {large.number.trigger}{ #5 } + +% For numbers longer than the trigger, this is the blocksize of the groups. +% The blocksize must be less than the trigger threshold, and 2 * blocksize +% must be greater than the trigger threshold (can't do more than one +% separation on the initial trigger). +FUNCTION {large.number.blocksize}{ #3 } + +% What is actually inserted between the number groups. +FUNCTION {large.number.separator}{ "\," } + +% So as to save on integer variables by reusing existing ones, numnames +% holds the current number of consecutive digits read and nameptr holds +% the number that will trigger an inserted space. +FUNCTION {large.number.separate} +{ 't := + "" + #0 'numnames := + large.number.trigger 'nameptr := + { t empty$ not } + { t #-1 #1 substring$ is.num + { numnames #1 + 'numnames := } + { #0 'numnames := + large.number.trigger 'nameptr := + } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames nameptr = + { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ + nameptr large.number.blocksize - #1 + global.max$ substring$ + large.number.separator swap$ * * + nameptr large.number.blocksize - 'numnames := + large.number.blocksize #1 + 'nameptr := + } + { skip$ } + if$ + } + while$ +} + +% Converts all single dashes "-" to double dashes "--". +FUNCTION {n.dashify} +{ large.number.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + + +% This function detects entries with names that are identical to that of +% the previous entry and replaces the repeated names with dashes (if the +% "is.dash.repeated.names" user control is nonzero). +FUNCTION {name.or.dash} +{ 's := + oldname empty$ + { s 'oldname := s } + { s oldname = + { is.dash.repeated.names + { repeated.name.dashes } + { s 'oldname := s } + if$ + } + { s 'oldname := s } + if$ + } + if$ +} + +% Converts the number string on the top of the stack to +% "numerical ordinal form" (e.g., "7" to "7th"). There is +% no artificial limit to the upper bound of the numbers as the +% two least significant digits determine the ordinal form. +FUNCTION {num.to.ordinal} +{ duplicate$ #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ "1" = + { bbl.st * } + { duplicate$ #-1 #1 substring$ "2" = + { bbl.nd * } + { duplicate$ #-1 #1 substring$ "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +% If the string on the top of the stack begins with a number, +% (e.g., 11th) then replace the string with the leading number +% it contains. Otherwise retain the string as-is. s holds the +% extracted number, t holds the part of the string that remains +% to be scanned. +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +% Converts the word number string on the top of the stack to +% Arabic string form. Will be successful up to "tenth". +FUNCTION {word.to.num} +{ duplicate$ "l" change.case$ 's := + s "first" = + { pop$ "1" } + { skip$ } + if$ + s "second" = + { pop$ "2" } + { skip$ } + if$ + s "third" = + { pop$ "3" } + { skip$ } + if$ + s "fourth" = + { pop$ "4" } + { skip$ } + if$ + s "fifth" = + { pop$ "5" } + { skip$ } + if$ + s "sixth" = + { pop$ "6" } + { skip$ } + if$ + s "seventh" = + { pop$ "7" } + { skip$ } + if$ + s "eighth" = + { pop$ "8" } + { skip$ } + if$ + s "ninth" = + { pop$ "9" } + { skip$ } + if$ + s "tenth" = + { pop$ "10" } + { skip$ } + if$ +} + + +% Converts the string on the top of the stack to numerical +% ordinal (e.g., "11th") form. +FUNCTION {convert.edition} +{ duplicate$ empty$ 'skip$ + { duplicate$ #1 #1 substring$ is.num + { extract.num + num.to.ordinal + } + { word.to.num + duplicate$ #1 #1 substring$ is.num + { num.to.ordinal } + { "edition ordinal word " quote$ * edition * quote$ * + " may be too high (or improper) for conversion" * " in " * cite$ * warning$ + } + if$ + } + if$ + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LATEX BIBLIOGRAPHY CODE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {start.entry} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + initialize.prev.this.status +} + +% Here we write out all the LaTeX code that we will need. The most involved +% code sequences are those that control the alternate interword spacing and +% foreign language hyphenation patterns. The heavy use of \providecommand +% gives users a way to override the defaults. Special thanks to Javier Bezos, +% Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all +% the other gurus on comp.text.tex for their help and advice on the topic of +% \selectlanguage, Babel and BibTeX. +FUNCTION {begin.bib} +{ "% Generated by IEEEtranM.bst, version: " bst.file.version * " (" * bst.file.date * ")" * + write$ newline$ + preamble$ empty$ 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{IEEEtranM.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" longest.label * "}" * + write$ newline$ + "\providecommand{\url}[1]{#1}" + write$ newline$ + "\csname url@samestyle\endcsname" + write$ newline$ + "\providecommand{\newblock}{\relax}" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" + write$ newline$ + "\providecommand{\BIBentryALTinterwordstretchfactor}{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " + write$ newline$ + "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" + write$ newline$ + "\providecommand{\BIBforeignlanguage}[2]{{%" + write$ newline$ + "\expandafter\ifx\csname l@#1\endcsname\relax" + write$ newline$ + "\typeout{** WARNING: IEEEtranM.bst: No hyphenation pattern has been}%" + write$ newline$ + "\typeout{** loaded for the language `#1'. Using the pattern for}%" + write$ newline$ + "\typeout{** the default language instead.}%" + write$ newline$ + "\else" + write$ newline$ + "\language=\csname l@#1\endcsname" + write$ newline$ + "\fi" + write$ newline$ + "#2}}" + write$ newline$ + "\providecommand{\BIBdecl}{\relax}" + write$ newline$ + "\BIBdecl" + write$ newline$ +} + +FUNCTION {end.bib} +{ newline$ "\end{mcitethebibliography}" write$ newline$ } + +FUNCTION {if.url.alt.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ "\relax " write$ } if$} + { skip$ } + if$ +} + +FUNCTION {if.url.std.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ "\relax " write$ } if$} + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%%%% +%% LONGEST LABEL PASS %% +%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ type$ "ieeetranbstctl" = + { skip$ } + { number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + { skip$ } + if$ + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%% +%% FORMAT HANDLERS %% +%%%%%%%%%%%%%%%%%%%%% + +%% Lower Level Formats (used by higher level formats) + +FUNCTION {format.address.org.or.pub.date} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + { skip$ } + if$ + address empty$ t empty$ and + year empty$ and month empty$ and + { skip$ } + { this.to.prev.status + this.status.std + cap.status.std + address "address" bibinfo.check * + t empty$ + { skip$ } + { punct.period 'prev.status.punct := + space.large 'prev.status.space := + address empty$ + { skip$ } + { ": " * } + if$ + t * + } + if$ + year empty$ month empty$ and + { skip$ } + { t empty$ address empty$ and + { skip$ } + { ", " * } + if$ + month empty$ + { year empty$ + { skip$ } + { year "year" bibinfo.check * } + if$ + } + { month "month" bibinfo.check * + year empty$ + { skip$ } + { " " * year "year" bibinfo.check * } + if$ + } + if$ + } + if$ + } + if$ +} + + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + this.to.prev.status + this.status.std + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + name.format.string + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { nameptr num.names.shown.with.forced.et.al #1 + = + numnames max.num.names.before.forced.et.al > + is.forced.et.al and and + { "others" 't := + #1 'namesleft := + } + { skip$ } + if$ + namesleft #1 > + { ", " * t do.name.latex.cmd * } + { s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { " " * bbl.etal emphasize * } + { numnames #2 > + { "," * } + { skip$ } + if$ + bbl.and + space.word * t do.name.latex.cmd * + } + if$ + } + if$ + } + { t do.name.latex.cmd } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + cap.status.std + } if$ +} + + + + +%% Higher Level Formats + +%% addresses/locations + +FUNCTION {format.address} +{ address duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% author/editor names + +FUNCTION {format.authors}{ author "author" format.names } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { ", " * + get.bbl.editor + capitalize + * + } + if$ +} + + + +%% date + +FUNCTION {format.date} +{ + month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { this.to.prev.status + this.status.std + cap.status.std + swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.date.electronic} +{ month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ + { pop$ } + { "there's a month but no year in " cite$ * warning$ + pop$ ")" * "(" swap$ * + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ + } + { swap$ + { swap$ pop$ ")" * "(" swap$ * } + { "(" swap$ * ", " * swap$ * ")" * } + if$ + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ +} + + + +%% edition/title + +% Note: IEEE considers the edition to be closely associated with +% the title of a book. So, in IEEEtran.bst the edition is normally handled +% within the formatting of the title. The format.edition function is +% retained here for possible future use. +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + convert.edition + status.cap + { "t" } + { "l" } + if$ change.case$ + "edition" bibinfo.check + "~" * bbl.edition * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of a conference proceedings. +% Here we use the "intype" field to provide the user a way to +% override the word "in" (e.g., with things like "presented at") +% Use of intype stops the emphasis of the booktitle to indicate that +% we no longer mean the written conference proceedings, but the +% conference itself. +FUNCTION {format.in.booktitle} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + intype missing$ + { emphasize + bbl.in " " * + } + { intype " " * } + if$ + swap$ * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of collection. +% Here the "intype" field is not supported, but "edition" is. +FUNCTION {format.in.booktitle.edition} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + "l" change.case$ + * "~" * bbl.edition * + } + if$ + bbl.in " " * swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { quote.close 'this.status.quote := + is.last.char.not.punct + { punct.std 'this.status.punct := } + { punct.no 'this.status.punct := } + if$ + select.language + "``" swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title.electronic} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ + { skip$ } + { select.language } + if$ +} + +FUNCTION {format.book.title.edition} +{ title "title" bibinfo.check + duplicate$ empty$ + { "empty title in " cite$ * warning$ } + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + status.cap + { "t" } + { "l" } + if$ + change.case$ + * "~" * bbl.edition * + } + if$ + cap.status.std + } + if$ +} + +FUNCTION {format.book.title} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% journal + +FUNCTION {format.journal} +{ journal duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% how published + +FUNCTION {format.howpublished} +{ howpublished duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% institutions/organization/publishers/school + +FUNCTION {format.institution} +{ institution duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.organization} +{ organization duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.address.publisher.date} +{ publisher "publisher" bibinfo.warn format.address.org.or.pub.date } + +FUNCTION {format.address.publisher.date.nowarn} +{ publisher "publisher" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.address.organization.date} +{ organization "organization" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.school} +{ school duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% volume/number/series/chapter/pages + +FUNCTION {format.volume} +{ volume empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + bbl.volume + status.cap + { capitalize } + { skip$ } + if$ + swap$ tie.or.space.prefix + "volume" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number} +{ number empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + status.cap + { bbl.number capitalize } + { bbl.number } + if$ + swap$ tie.or.space.prefix + "number" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number.if.use.for.article} +{ is.use.number.for.article + { format.number } + { "" } + if$ +} + +% IEEE does not seem to tie the series so closely with the volume +% and number as is done in other bibliography styles. Instead the +% series is treated somewhat like an extension of the title. +FUNCTION {format.series} +{ series empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.series " " * + series "series" bibinfo.check * + cap.status.std + } + if$ +} + + +FUNCTION {format.chapter} +{ chapter empty$ + { "" } + { this.to.prev.status + this.status.std + type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + cap.status.std + } + if$ +} + + +% The intended use of format.paper is for paper numbers of inproceedings. +% The paper type can be overridden via the type field. +% We allow the type to be displayed even if the paper number is absent +% for things like "postdeadline paper" +FUNCTION {format.paper} +{ is.use.paper + { paper empty$ + { type empty$ + { "" } + { this.to.prev.status + this.status.std + type "type" bibinfo.check + cap.status.std + } + if$ + } + { this.to.prev.status + this.status.std + type empty$ + { bbl.paper } + { type "type" bibinfo.check } + if$ + " " * paper + "paper" bibinfo.check + * + cap.status.std + } + if$ + } + { "" } + if$ +} + + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + duplicate$ is.multiple.pages + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + cap.status.std + } + if$ +} + + + +%% technical report number + +FUNCTION {format.tech.report.number} +{ number "number" bibinfo.check + this.to.prev.status + this.status.std + cap.status.std + type duplicate$ empty$ + { pop$ + bbl.techrep + } + { skip$ } + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ } + { tie.or.space.prefix * * } + if$ +} + + + +%% note + +FUNCTION {format.note} +{ note empty$ + { "" } + { this.to.prev.status + this.status.std + punct.period 'this.status.punct := + note #1 #1 substring$ + duplicate$ "{" = + { skip$ } + { status.cap + { "u" } + { "l" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + cap.yes 'status.cap := + } + if$ +} + + + +%% patent + +FUNCTION {format.patent.date} +{ this.to.prev.status + this.status.std + year empty$ + { monthfiled duplicate$ empty$ + { "monthfiled" bibinfo.check pop$ "" } + { "monthfiled" bibinfo.check } + if$ + dayfiled duplicate$ empty$ + { "dayfiled" bibinfo.check pop$ "" * } + { "dayfiled" bibinfo.check + monthfiled empty$ + { "dayfiled without a monthfiled in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + yearfiled empty$ + { "no year or yearfiled in " cite$ * warning$ } + { yearfiled "yearfiled" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + } + { month duplicate$ empty$ + { "month" bibinfo.check pop$ "" } + { "month" bibinfo.check } + if$ + day duplicate$ empty$ + { "day" bibinfo.check pop$ "" * } + { "day" bibinfo.check + month empty$ + { "day without a month in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + year "year" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + cap.status.std +} + +FUNCTION {format.patent.nationality.type.number} +{ this.to.prev.status + this.status.std + nationality duplicate$ empty$ + { "nationality" bibinfo.warn pop$ "" } + { "nationality" bibinfo.check + duplicate$ "l" change.case$ "united states" = + { pop$ bbl.patentUS } + { skip$ } + if$ + " " * + } + if$ + type empty$ + { bbl.patent "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.warn pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + + + +%% standard + +FUNCTION {format.organization.institution.standard.type.number} +{ this.to.prev.status + this.status.std + organization duplicate$ empty$ + { pop$ + institution duplicate$ empty$ + { "institution" bibinfo.warn } + { "institution" bibinfo.warn " " * } + if$ + } + { "organization" bibinfo.warn " " * } + if$ + type empty$ + { bbl.standard "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.check pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + +FUNCTION {format.revision} +{ revision empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.revision + revision tie.or.space.prefix + "revision" bibinfo.check + * * + cap.status.std + } + if$ +} + + +%% thesis + +FUNCTION {format.master.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.mthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + +FUNCTION {format.phd.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.phdthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + + + +%% URL + +FUNCTION {format.url} +{ url empty$ + { "" } + { this.to.prev.status + this.status.std + cap.yes 'status.cap := + name.url.prefix " " * + "\url{" * url * "}" * + punct.no 'this.status.punct := + punct.period 'prev.status.punct := + space.normal 'this.status.space := + space.normal 'prev.status.space := + quote.no 'this.status.quote := + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%% +%% ENTRY HANDLERS %% +%%%%%%%%%%%%%%%%%%%% + + +% Note: In many journals, IEEE (or the authors) tend not to show the number +% for articles, so the display of the number is controlled here by the +% switch "is.use.number.for.article" +FUNCTION {article} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.journal "journal" bibinfo.check "journal" output.warn + format.volume output + format.number.if.use.for.article output + format.pages output + format.date "year" output.warn + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {book} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + author empty$ + { skip$ } + { format.editors output } + if$ + format.address.publisher.date output + format.volume output + format.number output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {booklet} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {electronic} +{ std.status.using.period + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.date.electronic output + format.article.title.electronic output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.note output + format.url output + fin.entry + empty.entry.warn +% if.url.std.interword.spacing +} + +FUNCTION {inbook} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + format.address.publisher.date output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {incollection} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle.edition "booktitle" output.warn + format.series output + format.editors output + format.address.publisher.date.nowarn output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {inproceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle "booktitle" output.warn + format.series output + format.editors output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.paper output + format.pages output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {manual} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title.edition "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {mastersthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.master.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {misc} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.pages output + format.date output + format.note output + format.url output + fin.entry + empty.entry.warn +% if.url.std.interword.spacing +} + +FUNCTION {patent} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.patent.nationality.type.number output + format.patent.date output + format.note output + format.url output + fin.entry + empty.entry.warn +% if.url.std.interword.spacing +} + +FUNCTION {periodical} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + format.organization "organization" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {phdthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.phd.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {proceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {standard} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization.institution.standard.type.number output + format.revision output + format.date output + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {techreport} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.institution "institution" bibinfo.warn output + format.address "address" bibinfo.check output + format.tech.report.number output.nonnull + format.date "year" output.warn + format.note output + format.url output + fin.entry +% if.url.std.interword.spacing +} + +FUNCTION {unpublished} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.date output + format.note "note" output.warn + format.url output + fin.entry +% if.url.std.interword.spacing +} + + +% The special entry type which provides the user interface to the +% BST controls +FUNCTION {IEEEtranBSTCTL} +{ is.print.banners.to.terminal + { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * + top$ + } + { skip$ } + if$ + CTLuse_article_number + empty$ + { skip$ } + { CTLuse_article_number + yes.no.to.int + 'is.use.number.for.article := + } + if$ + CTLuse_paper + empty$ + { skip$ } + { CTLuse_paper + yes.no.to.int + 'is.use.paper := + } + if$ + CTLuse_forced_etal + empty$ + { skip$ } + { CTLuse_forced_etal + yes.no.to.int + 'is.forced.et.al := + } + if$ + CTLmax_names_forced_etal + empty$ + { skip$ } + { CTLmax_names_forced_etal + string.to.integer + 'max.num.names.before.forced.et.al := + } + if$ + CTLnames_show_etal + empty$ + { skip$ } + { CTLnames_show_etal + string.to.integer + 'num.names.shown.with.forced.et.al := + } + if$ + CTLuse_alt_spacing + empty$ + { skip$ } + { CTLuse_alt_spacing + yes.no.to.int + 'is.use.alt.interword.spacing := + } + if$ + CTLalt_stretch_factor + empty$ + { skip$ } + { CTLalt_stretch_factor + 'ALTinterwordstretchfactor := + "\renewcommand{\BIBentryALTinterwordstretchfactor}{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + } + if$ + CTLdash_repeated_names + empty$ + { skip$ } + { CTLdash_repeated_names + yes.no.to.int + 'is.dash.repeated.names := + } + if$ + CTLname_format_string + empty$ + { skip$ } + { CTLname_format_string + 'name.format.string := + } + if$ + CTLname_latex_cmd + empty$ + { skip$ } + { CTLname_latex_cmd + 'name.latex.cmd := + } + if$ + CTLname_url_prefix + missing$ + { skip$ } + { CTLname_url_prefix + 'name.url.prefix := + } + if$ + + + num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > + { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ + max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := + } + { skip$ } + if$ +} + + +%%%%%%%%%%%%%%%%%%% +%% ENTRY ALIASES %% +%%%%%%%%%%%%%%%%%%% +FUNCTION {conference}{inproceedings} +FUNCTION {online}{electronic} +FUNCTION {internet}{electronic} +FUNCTION {webpage}{electronic} +FUNCTION {www}{electronic} +FUNCTION {default.type}{misc} + + + +%%%%%%%%%%%%%%%%%% +%% MAIN PROGRAM %% +%%%%%%%%%%%%%%%%%% + +READ + +EXECUTE {initialize.controls} +EXECUTE {initialize.status.constants} +EXECUTE {banner.message} + +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} + +EXECUTE {begin.bib} +ITERATE {call.type$} +EXECUTE {end.bib} + +EXECUTE{completed.message} + + +%% That's all folks, mds. diff --git a/macros/latex/contrib/mciteplus/IEEEtranMN.bst b/macros/latex/contrib/mciteplus/IEEEtranMN.bst new file mode 100644 index 0000000000..2554356917 --- /dev/null +++ b/macros/latex/contrib/mciteplus/IEEEtranMN.bst @@ -0,0 +1,2764 @@ +%% +%% IEEEtranMN.bst +%% BibTeX Bibliography Style file +%% mciteplus compatible natbib version of IEEEtran.bst +%% *** Not for normal IEEE work *** +%% Version 1.13 (2008/09/30) +%% +%% Copyright (c) 2003-2008 Michael Shell +%% +%% Original starting code base and algorithms obtained from the output of +%% Patrick W. Daly's makebst package as well as from prior versions of +%% IEEE BibTeX styles: +%% +%% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) +%% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) +%% +%% Added sorting and natbib code is from Patrick W Daly's unsrtnat.bst +%% +%% Support site: +%% http://www.michaelshell.org/tex/mciteplus/ +%% http://www.michaelshell.org/tex/ieeetran/bibtex/ +%% +%% For use with BibTeX version 0.99a or later +%% +%% This is a natbib compatible citation style. +%% +%%************************************************************************* +%% Legal Notice: +%% This code is offered as-is without any warranty either expressed or +%% implied; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE! +%% User assumes all risk. +%% In no event shall IEEE or any contributor to this code be liable for +%% any damages or losses, including, but not limited to, incidental, +%% consequential, or any other damages, resulting from the use or misuse +%% of any information contained here. +%% +%% All comments are the opinions of their respective authors and are not +%% necessarily endorsed by the IEEE. +%% +%% This work is distributed under the LaTeX Project Public License (LPPL) +%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, +%% distributed and modified. A copy of the LPPL, version 1.3, is included +%% in the base LaTeX documentation of all distributions of LaTeX released +%% 2003/12/01 or later. +%% Retain all contribution notices and credits. +%% ** Modified files should be clearly indicated as such, including ** +%% ** renaming them and changing author support contact information. ** +%%************************************************************************* +% +% +% Changelog: +% +% 1.12 (2008/01/15) initial release +% +% 1.13 (2008/09/30) +% 1. Fixed bug with edition number to ordinal conversion. Thanks to +% Michael Roland for reporting this and correcting the algorithm. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% These are the defaults for the user adjustable controls. The values used +% here can be overridden by the user via IEEEtranBSTCTL entry type. + +% NOTE: The recommended LaTeX command to invoke a control entry type is: +% +%\makeatletter +%\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} +%\def\@bstctlcite[#1]#2{\@bsphack +% \@for\@citeb:=#2\do{% +% \edef\@citeb{\expandafter\@firstofone\@citeb}% +% \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% +% \@esphack} +%\makeatother +% +% It is called at the start of the document, before the first \cite, like: +% \bstctlcite{IEEEexample:BSTcontrol} +% +% IEEEtran.cls V1.6 and later does provide this command. + + + +% #0 turns off the display of the number for articles. +% #1 enables +FUNCTION {default.is.use.number.for.article} { #1 } + + +% #0 turns off the display of the paper and type fields in @inproceedings. +% #1 enables +FUNCTION {default.is.use.paper} { #1 } + + +% #0 turns off the forced use of "et al." +% #1 enables +FUNCTION {default.is.forced.et.al} { #0 } + +% The maximum number of names that can be present beyond which an "et al." +% usage is forced. Be sure that num.names.shown.with.forced.et.al (below) +% is not greater than this value! +% Note: There are many instances of references in IEEE journals which have +% a very large number of authors as well as instances in which "et al." is +% used profusely. +FUNCTION {default.max.num.names.before.forced.et.al} { #10 } + +% The number of names that will be shown with a forced "et al.". +% Must be less than or equal to max.num.names.before.forced.et.al +FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } + + +% #0 turns off the alternate interword spacing for entries with URLs. +% #1 enables +FUNCTION {default.is.use.alt.interword.spacing} { #1 } + +% If alternate interword spacing for entries with URLs is enabled, this is +% the interword spacing stretch factor that will be used. For example, the +% default "4" here means that the interword spacing in entries with URLs can +% stretch to four times normal. Does not have to be an integer. Note that +% the value specified here can be overridden by the user in their LaTeX +% code via a command such as: +% "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to +% that via the IEEEtranBSTCTL entry type. +FUNCTION {default.ALTinterwordstretchfactor} { "4" } + + +% #0 turns off the "dashification" of repeated (i.e., identical to those +% of the previous entry) names. IEEE normally does this. +% #1 enables +FUNCTION {default.is.dash.repeated.names} { #1 } + + +% The default name format control string. +FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } + + +% The default LaTeX font command for the names. +FUNCTION {default.name.latex.cmd}{ "" } + + +% The default URL prefix. +FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } + + +% Other controls that cannot be accessed via IEEEtranBSTCTL entry type. + +% #0 turns off the terminal startup banner/completed message so as to +% operate more quietly. +% #1 enables +FUNCTION {is.print.banners.to.terminal} { #1 } + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% FILE VERSION AND BANNER %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION{bst.file.version} { "1.13" } +FUNCTION{bst.file.date} { "2008/09/30" } +FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } + +FUNCTION {banner.message} +{ is.print.banners.to.terminal + { "-- IEEEtranMN.bst version" " " * bst.file.version * + " (" * bst.file.date * ") " * "by Michael Shell." * + top$ + "-- " bst.file.website * + top$ + "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " and " * quote$ * "mciteplus_doc.pdf" * quote$ * " manuals" * + top$ + " for usage information." + top$ + "** Mciteplus, natbib version - not for use with work to be submitted to the IEEE." + top$ + } + { skip$ } + if$ +} + +FUNCTION {completed.message} +{ is.print.banners.to.terminal + { "" + top$ + "Done." + top$ + } + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING CONSTANTS %% +%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {bbl.and}{ "and" } +FUNCTION {bbl.etal}{ "et~al." } +FUNCTION {bbl.editors}{ "eds." } +FUNCTION {bbl.editor}{ "ed." } +FUNCTION {bbl.edition}{ "ed." } +FUNCTION {bbl.volume}{ "vol." } +FUNCTION {bbl.of}{ "of" } +FUNCTION {bbl.number}{ "no." } +FUNCTION {bbl.in}{ "in" } +FUNCTION {bbl.pages}{ "pp." } +FUNCTION {bbl.page}{ "p." } +FUNCTION {bbl.chapter}{ "ch." } +FUNCTION {bbl.paper}{ "paper" } +FUNCTION {bbl.part}{ "pt." } +FUNCTION {bbl.patent}{ "Patent" } +FUNCTION {bbl.patentUS}{ "U.S." } +FUNCTION {bbl.revision}{ "Rev." } +FUNCTION {bbl.series}{ "ser." } +FUNCTION {bbl.standard}{ "Std." } +FUNCTION {bbl.techrep}{ "Tech. Rep." } +FUNCTION {bbl.mthesis}{ "Master's thesis" } +FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } +FUNCTION {bbl.st}{ "st" } +FUNCTION {bbl.nd}{ "nd" } +FUNCTION {bbl.rd}{ "rd" } +FUNCTION {bbl.th}{ "th" } + + +% This is the LaTeX spacer that is used when a larger than normal space +% is called for (such as just before the address:publisher). +FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } + +% The LaTeX code for dashes that are used to represent repeated names. +% Note: Some older IEEE journals used something like +% "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along +% the baseline. However, IEEE now uses a thinner, above baseline, +% six dash long sequence. +FUNCTION {repeated.name.dashes} { "------" } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% PREDEFINED STRING MACROS %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +MACRO {jan} {"Jan."} +MACRO {feb} {"Feb."} +MACRO {mar} {"Mar."} +MACRO {apr} {"Apr."} +MACRO {may} {"May"} +MACRO {jun} {"Jun."} +MACRO {jul} {"Jul."} +MACRO {aug} {"Aug."} +MACRO {sep} {"Sep."} +MACRO {oct} {"Oct."} +MACRO {nov} {"Nov."} +MACRO {dec} {"Dec."} + + + +%%%%%%%%%%%%%%%%%% +%% ENTRY FIELDS %% +%%%%%%%%%%%%%%%%%% + +ENTRY + { address + assignee + author + booktitle + chapter + day + dayfiled + edition + editor + howpublished + institution + intype + journal + key + language + month + monthfiled + nationality + note + number + organization + pages + paper + publisher + school + series + revision + title + type + url + volume + year + yearfiled + CTLuse_article_number + CTLuse_paper + CTLuse_forced_etal + CTLmax_names_forced_etal + CTLnames_show_etal + CTLuse_alt_spacing + CTLalt_stretch_factor + CTLdash_repeated_names + CTLname_format_string + CTLname_latex_cmd + CTLname_url_prefix + } + {} + { label extra.label sort.label short.list} + + + + +%%%%%%%%%%%%%%%%%%%%%%% +%% INTEGER VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%%% + +INTEGERS { prev.status.punct this.status.punct punct.std + punct.no punct.comma punct.period + prev.status.space this.status.space space.std + space.no space.normal space.large + prev.status.quote this.status.quote quote.std + quote.no quote.close + prev.status.nline this.status.nline nline.std + nline.no nline.newblock + status.cap cap.std + cap.no cap.yes} + +INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } + +INTEGERS { is.use.number.for.article + is.use.paper + is.forced.et.al + max.num.names.before.forced.et.al + num.names.shown.with.forced.et.al + is.use.alt.interword.spacing + is.dash.repeated.names} + + +%%%%%%%%%%%%%%%%%%%%%% +%% STRING VARIABLES %% +%%%%%%%%%%%%%%%%%%%%%% + +STRINGS { bibinfo + longest.label + oldname + s + t + ALTinterwordstretchfactor + name.format.string + name.latex.cmd + name.url.prefix} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOW LEVEL FUNCTIONS %% +%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {initialize.controls} +{ default.is.use.number.for.article 'is.use.number.for.article := + default.is.use.paper 'is.use.paper := + default.is.forced.et.al 'is.forced.et.al := + default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := + default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := + default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := + default.is.dash.repeated.names 'is.dash.repeated.names := + default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := + default.name.format.string 'name.format.string := + default.name.latex.cmd 'name.latex.cmd := + default.name.url.prefix 'name.url.prefix := +} + + +% This IEEEtran.bst features a very powerful and flexible mechanism for +% controlling the capitalization, punctuation, spacing, quotation, and +% newlines of the formatted entry fields. (Note: IEEEtran.bst does not need +% or use the newline/newblock feature, but it has been implemented for +% possible future use.) The output states of IEEEtran.bst consist of +% multiple independent attributes and, as such, can be thought of as being +% vectors, rather than the simple scalar values ("before.all", +% "mid.sentence", etc.) used in most other .bst files. +% +% The more flexible and complex design used here was motivated in part by +% IEEE's rather unusual bibliography style. For example, IEEE ends the +% previous field item with a period and large space prior to the publisher +% address; the @electronic entry types use periods as inter-item punctuation +% rather than the commas used by the other entry types; and URLs are never +% followed by periods even though they are the last item in the entry. +% Although it is possible to accommodate these features with the conventional +% output state system, the seemingly endless exceptions make for convoluted, +% unreliable and difficult to maintain code. +% +% IEEEtran.bst's output state system can be easily understood via a simple +% illustration of two most recently formatted entry fields (on the stack): +% +% CURRENT_ITEM +% "PREVIOUS_ITEM +% +% which, in this example, is to eventually appear in the bibliography as: +% +% "PREVIOUS_ITEM," CURRENT_ITEM +% +% It is the job of the output routine to take the previous item off of the +% stack (while leaving the current item at the top of the stack), apply its +% trailing punctuation (including closing quote marks) and spacing, and then +% to write the result to BibTeX's output buffer: +% +% "PREVIOUS_ITEM," +% +% Punctuation (and spacing) between items is often determined by both of the +% items rather than just the first one. The presence of quotation marks +% further complicates the situation because, in standard English, trailing +% punctuation marks are supposed to be contained within the quotes. +% +% IEEEtran.bst maintains two output state (aka "status") vectors which +% correspond to the previous and current (aka "this") items. Each vector +% consists of several independent attributes which track punctuation, +% spacing, quotation, and newlines. Capitalization status is handled by a +% separate scalar because the format routines, not the output routine, +% handle capitalization and, therefore, there is no need to maintain the +% capitalization attribute for both the "previous" and "this" items. +% +% When a format routine adds a new item, it copies the current output status +% vector to the previous output status vector and (usually) resets the +% current (this) output status vector to a "standard status" vector. Using a +% "standard status" vector in this way allows us to redefine what we mean by +% "standard status" at the start of each entry handler and reuse the same +% format routines under the various inter-item separation schemes. For +% example, the standard status vector for the @book entry type may use +% commas for item separators, while the @electronic type may use periods, +% yet both entry handlers exploit many of the exact same format routines. +% +% Because format routines have write access to the output status vector of +% the previous item, they can override the punctuation choices of the +% previous format routine! Therefore, it becomes trivial to implement rules +% such as "Always use a period and a large space before the publisher." By +% pushing the generation of the closing quote mark to the output routine, we +% avoid all the problems caused by having to close a quote before having all +% the information required to determine what the punctuation should be. +% +% The IEEEtran.bst output state system can easily be expanded if needed. +% For instance, it is easy to add a "space.tie" attribute value if the +% bibliography rules mandate that two items have to be joined with an +% unbreakable space. + +FUNCTION {initialize.status.constants} +{ #0 'punct.no := + #1 'punct.comma := + #2 'punct.period := + #0 'space.no := + #1 'space.normal := + #2 'space.large := + #0 'quote.no := + #1 'quote.close := + #0 'cap.no := + #1 'cap.yes := + #0 'nline.no := + #1 'nline.newblock := +} + +FUNCTION {std.status.using.comma} +{ punct.comma 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.no 'cap.std := +} + +FUNCTION {std.status.using.period} +{ punct.period 'punct.std := + space.normal 'space.std := + quote.no 'quote.std := + nline.no 'nline.std := + cap.yes 'cap.std := +} + +FUNCTION {initialize.prev.this.status} +{ punct.no 'prev.status.punct := + space.no 'prev.status.space := + quote.no 'prev.status.quote := + nline.no 'prev.status.nline := + punct.no 'this.status.punct := + space.no 'this.status.space := + quote.no 'this.status.quote := + nline.no 'this.status.nline := + cap.yes 'status.cap := +} + +FUNCTION {this.status.std} +{ punct.std 'this.status.punct := + space.std 'this.status.space := + quote.std 'this.status.quote := + nline.std 'this.status.nline := +} + +FUNCTION {cap.status.std}{ cap.std 'status.cap := } + +FUNCTION {this.to.prev.status} +{ this.status.punct 'prev.status.punct := + this.status.space 'prev.status.space := + this.status.quote 'prev.status.quote := + this.status.nline 'prev.status.nline := +} + + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ { skip$ } + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + { skip$ } + if$ +} + + +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} + + +% pushes true if the single char string on the stack is in the +% range of "0" to "9" +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +% multiplies the integer on the stack by a factor of 10 +FUNCTION {bump.int.mag} +{ #0 'multiresult := + { duplicate$ #0 > } + { #1 - + multiresult #10 + + 'multiresult := + } + while$ +pop$ +multiresult +} + +% converts a single character string on the stack to an integer +FUNCTION {char.to.integer} +{ duplicate$ + is.num + { chr.to.int$ "0" chr.to.int$ - } + {"noninteger character " quote$ * swap$ * quote$ * + " in integer field of " * cite$ * warning$ + #0 + } + if$ +} + +% converts a string on the stack to an integer +FUNCTION {string.to.integer} +{ duplicate$ text.length$ 'namesleft := + #1 'nameptr := + #0 'numnames := + { nameptr namesleft > not } + { duplicate$ nameptr #1 substring$ + char.to.integer numnames bump.int.mag + + 'numnames := + nameptr #1 + + 'nameptr := + } + while$ +pop$ +numnames +} + + + + +% The output routines write out the *next* to the top (previous) item on the +% stack, adding punctuation and such as needed. Since IEEEtran.bst maintains +% the output status for the top two items on the stack, these output +% routines have to consider the previous output status (which corresponds to +% the item that is being output). Full independent control of punctuation, +% closing quote marks, spacing, and newblock is provided. +% +% "output.nonnull" does not check for the presence of a previous empty +% item. +% +% "output" does check for the presence of a previous empty item and will +% remove an empty item rather than outputing it. +% +% "output.warn" is like "output", but will issue a warning if it detects +% an empty item. + +FUNCTION {output.nonnull} +{ swap$ + prev.status.punct punct.comma = + { "," * } + { skip$ } + if$ + prev.status.punct punct.period = + { add.period$ } + { skip$ } + if$ + prev.status.quote quote.close = + { "''" * } + { skip$ } + if$ + prev.status.space space.normal = + { " " * } + { skip$ } + if$ + prev.status.space space.large = + { large.space * } + { skip$ } + if$ + write$ + prev.status.nline nline.newblock = + { newline$ "\newblock " write$ } + { skip$ } + if$ +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.warn} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + + + +% mciteplus fin.entry +% +% pushes true (1), if add.period$ would add a period to the string on the stack +% pushes false (0), otherwise +% Uses text.length$ to avoid full string comparison and two copies of string. +% Requires one copy of string on stack. +INTEGERS {would.add.period.textlen} +FUNCTION {would.add.period} +{ duplicate$ + add.period$ + text.length$ + 'would.add.period.textlen := + duplicate$ + text.length$ + would.add.period.textlen = + { #0 } + { #1 } + if$ +} + + +FUNCTION {std.interword.spacing.or.relax} +{ is.use.alt.interword.spacing + { url empty$ + { "\relax" } + {"\BIBentrySTDinterwordspacing"} + if$} + { "\relax" } + if$ +} + + +% "fin.entry" is the output routine that handles the last item of the entry +% (which will be on the top of the stack when "fin.entry" is called). +% This is the mciteplus version which passes the punctuation info on to mciteplus.sty +FUNCTION {fin.entry} +{ this.status.punct punct.no = + { #0 } + { would.add.period } + if$ + swap$ + "\relax" * write$ newline$ + { "\mciteBstWouldAddEndPuncttrue" write$ newline$ + this.status.quote quote.close = + { "\mciteSetBstMidEndSepPunct{'';\space}{.''}{\par" std.interword.spacing.or.relax * "}\relax" * } + { "\mciteSetBstMidEndSepPunct{;\space}{.}{\par" std.interword.spacing.or.relax * "}\relax" * } + if$ + } + { "\mciteBstWouldAddEndPunctfalse" write$ newline$ + this.status.quote quote.close = + { "\mciteSetBstMidEndSepPunct{'';\space}{''}{\par" std.interword.spacing.or.relax * "}\relax" * } + { "\mciteSetBstMidEndSepPunct{~;\space}{}{\par" std.interword.spacing.or.relax * "}\relax" * } + if$ + } + if$ + write$ + newline$ + "\EndOfBibitem" write$ +} + + + +FUNCTION {is.last.char.not.punct} +{ duplicate$ + "}" * add.period$ + #-1 #1 substring$ "." = +} + +FUNCTION {is.multiple.pages} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +FUNCTION {do.name.latex.cmd} +{ name.latex.cmd + empty$ + { skip$ } + { name.latex.cmd "{" * swap$ * "}" * } + if$ +} + +% IEEEtran.bst uses its own \BIBforeignlanguage command which directly +% invokes the TeX hyphenation patterns without the need of the Babel +% package. Babel does a lot more than switch hyphenation patterns and +% its loading can cause unintended effects in many class files (such as +% IEEEtran.cls). +FUNCTION {select.language} +{ duplicate$ empty$ 'pop$ + { language empty$ 'skip$ + { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } + if$ + } + if$ +} + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {space.word}{ " " swap$ * " " * } + + +% Field Conditioners, Converters, Checkers and External Interfaces + +FUNCTION {empty.field.to.null.string} +{ duplicate$ empty$ + { pop$ "" } + { skip$ } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + { pop$ } + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {empty.entry.warn} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ url empty$ + and and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + + +% The bibinfo system provides a way for the electronic parsing/acquisition +% of a bibliography's contents as is done by ReVTeX. For example, a field +% could be entered into the bibliography as: +% \bibinfo{volume}{2} +% Only the "2" would show up in the document, but the LaTeX \bibinfo command +% could do additional things with the information. IEEEtran.bst does provide +% a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is +% currently not used as the bogus bibinfo functions defined here output the +% entry values directly without the \bibinfo wrapper. The bibinfo functions +% themselves (and the calls to them) are retained for possible future use. +% +% bibinfo.check avoids acting on missing fields while bibinfo.warn will +% issue a warning message if a missing field is detected. Prior to calling +% the bibinfo functions, the user should push the field value and then its +% name string, in that order. + +FUNCTION {bibinfo.check} +{ swap$ duplicate$ missing$ + { pop$ pop$ "" } + { duplicate$ empty$ + { swap$ pop$ } + { swap$ pop$ } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ duplicate$ missing$ + { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } + { duplicate$ empty$ + { swap$ "empty " swap$ * " in " * cite$ * warning$ } + { swap$ pop$ } + if$ + } + if$ +} + + +% IEEE separates large numbers with more than 4 digits into groups of +% three. IEEE uses a small space to separate these number groups. +% Typical applications include patent and page numbers. + +% number of consecutive digits required to trigger the group separation. +FUNCTION {large.number.trigger}{ #5 } + +% For numbers longer than the trigger, this is the blocksize of the groups. +% The blocksize must be less than the trigger threshold, and 2 * blocksize +% must be greater than the trigger threshold (can't do more than one +% separation on the initial trigger). +FUNCTION {large.number.blocksize}{ #3 } + +% What is actually inserted between the number groups. +FUNCTION {large.number.separator}{ "\," } + +% So as to save on integer variables by reusing existing ones, numnames +% holds the current number of consecutive digits read and nameptr holds +% the number that will trigger an inserted space. +FUNCTION {large.number.separate} +{ 't := + "" + #0 'numnames := + large.number.trigger 'nameptr := + { t empty$ not } + { t #-1 #1 substring$ is.num + { numnames #1 + 'numnames := } + { #0 'numnames := + large.number.trigger 'nameptr := + } + if$ + t #-1 #1 substring$ swap$ * + t #-2 global.max$ substring$ 't := + numnames nameptr = + { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ + nameptr large.number.blocksize - #1 + global.max$ substring$ + large.number.separator swap$ * * + nameptr large.number.blocksize - 'numnames := + large.number.blocksize #1 + 'nameptr := + } + { skip$ } + if$ + } + while$ +} + +% Converts all single dashes "-" to double dashes "--". +FUNCTION {n.dashify} +{ large.number.separate + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + + +% This function detects entries with names that are identical to that of +% the previous entry and replaces the repeated names with dashes (if the +% "is.dash.repeated.names" user control is nonzero). +FUNCTION {name.or.dash} +{ 's := + oldname empty$ + { s 'oldname := s } + { s oldname = + { is.dash.repeated.names + { repeated.name.dashes } + { s 'oldname := s } + if$ + } + { s 'oldname := s } + if$ + } + if$ +} + +% Converts the number string on the top of the stack to +% "numerical ordinal form" (e.g., "7" to "7th"). There is +% no artificial limit to the upper bound of the numbers as the +% two least significant digits determine the ordinal form. +FUNCTION {num.to.ordinal} +{ duplicate$ #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ "1" = + { bbl.st * } + { duplicate$ #-1 #1 substring$ "2" = + { bbl.nd * } + { duplicate$ #-1 #1 substring$ "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +% If the string on the top of the stack begins with a number, +% (e.g., 11th) then replace the string with the leading number +% it contains. Otherwise retain the string as-is. s holds the +% extracted number, t holds the part of the string that remains +% to be scanned. +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +% Converts the word number string on the top of the stack to +% Arabic string form. Will be successful up to "tenth". +FUNCTION {word.to.num} +{ duplicate$ "l" change.case$ 's := + s "first" = + { pop$ "1" } + { skip$ } + if$ + s "second" = + { pop$ "2" } + { skip$ } + if$ + s "third" = + { pop$ "3" } + { skip$ } + if$ + s "fourth" = + { pop$ "4" } + { skip$ } + if$ + s "fifth" = + { pop$ "5" } + { skip$ } + if$ + s "sixth" = + { pop$ "6" } + { skip$ } + if$ + s "seventh" = + { pop$ "7" } + { skip$ } + if$ + s "eighth" = + { pop$ "8" } + { skip$ } + if$ + s "ninth" = + { pop$ "9" } + { skip$ } + if$ + s "tenth" = + { pop$ "10" } + { skip$ } + if$ +} + + +% Converts the string on the top of the stack to numerical +% ordinal (e.g., "11th") form. +FUNCTION {convert.edition} +{ duplicate$ empty$ 'skip$ + { duplicate$ #1 #1 substring$ is.num + { extract.num + num.to.ordinal + } + { word.to.num + duplicate$ #1 #1 substring$ is.num + { num.to.ordinal } + { "edition ordinal word " quote$ * edition * quote$ * + " may be too high (or improper) for conversion" * " in " * cite$ * warning$ + } + if$ + } + if$ + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LATEX BIBLIOGRAPHY CODE %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% from plainnat.bst +FUNCTION {format.full.names} +{'s := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { " et~al." * } + { " and " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.full} +{ author empty$ + { editor empty$ + { "" } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.full} +{ author empty$ + { "" } + { author format.full.names } + if$ +} + +FUNCTION {editor.full} +{ editor empty$ + { "" } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + { author.editor.full } + { type$ "proceedings" = + type$ "periodical" = + or + { editor.full } + { author.full } + if$ + } + if$ +} +% END from plainnat.bst + +FUNCTION {start.entry} +{ newline$ + "\bibitem[" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + initialize.prev.this.status +} + +% Here we write out all the LaTeX code that we will need. The most involved +% code sequences are those that control the alternate interword spacing and +% foreign language hyphenation patterns. The heavy use of \providecommand +% gives users a way to override the defaults. Special thanks to Javier Bezos, +% Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all +% the other gurus on comp.text.tex for their help and advice on the topic of +% \selectlanguage, Babel and BibTeX. +FUNCTION {begin.bib} +{ "% Generated by IEEEtranMN.bst, version: " bst.file.version * " (" * bst.file.date * ")" * + write$ newline$ + preamble$ empty$ 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{IEEEtranMN.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{#1}" + write$ newline$ + "\csname url@samestyle\endcsname" + write$ newline$ + "\providecommand{\newblock}{\relax}" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" + write$ newline$ + "\providecommand{\BIBentryALTinterwordstretchfactor}{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " + write$ newline$ + "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" + write$ newline$ + "\providecommand{\BIBforeignlanguage}[2]{{%" + write$ newline$ + "\expandafter\ifx\csname l@#1\endcsname\relax" + write$ newline$ + "\typeout{** WARNING: IEEEtranMN.bst: No hyphenation pattern has been}%" + write$ newline$ + "\typeout{** loaded for the language `#1'. Using the pattern for}%" + write$ newline$ + "\typeout{** the default language instead.}%" + write$ newline$ + "\else" + write$ newline$ + "\language=\csname l@#1\endcsname" + write$ newline$ + "\fi" + write$ newline$ + "#2}}" + write$ newline$ + "\providecommand{\BIBdecl}{\relax}" + write$ newline$ + "\BIBdecl" + write$ newline$ +} + +FUNCTION {end.bib} +{ newline$ "\end{mcitethebibliography}" write$ newline$ } + +FUNCTION {if.url.alt.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ "\relax " write$ } if$} + { skip$ } + if$ +} + +FUNCTION {if.url.std.interword.spacing} +{ is.use.alt.interword.spacing + {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ "\relax " write$ } if$} + { skip$ } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%%% +%% FORMAT HANDLERS %% +%%%%%%%%%%%%%%%%%%%%% + +%% Lower Level Formats (used by higher level formats) + +FUNCTION {format.address.org.or.pub.date} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + { skip$ } + if$ + address empty$ t empty$ and + year empty$ and month empty$ and + { skip$ } + { this.to.prev.status + this.status.std + cap.status.std + address "address" bibinfo.check * + t empty$ + { skip$ } + { punct.period 'prev.status.punct := + space.large 'prev.status.space := + address empty$ + { skip$ } + { ": " * } + if$ + t * + } + if$ + year empty$ month empty$ and + { skip$ } + { t empty$ address empty$ and + { skip$ } + { ", " * } + if$ + month empty$ + { year empty$ + { skip$ } + { year "year" bibinfo.check * } + if$ + } + { month "month" bibinfo.check * + year empty$ + { skip$ } + { " " * year "year" bibinfo.check * } + if$ + } + if$ + } + if$ + } + if$ +} + + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + this.to.prev.status + this.status.std + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + name.format.string + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { nameptr num.names.shown.with.forced.et.al #1 + = + numnames max.num.names.before.forced.et.al > + is.forced.et.al and and + { "others" 't := + #1 'namesleft := + } + { skip$ } + if$ + namesleft #1 > + { ", " * t do.name.latex.cmd * } + { s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { " " * bbl.etal emphasize * } + { numnames #2 > + { "," * } + { skip$ } + if$ + bbl.and + space.word * t do.name.latex.cmd * + } + if$ + } + if$ + } + { t do.name.latex.cmd } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + cap.status.std + } if$ +} + + + + +%% Higher Level Formats + +%% addresses/locations + +FUNCTION {format.address} +{ address duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% author/editor names + +FUNCTION {format.authors}{ author "author" format.names } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { ", " * + get.bbl.editor + capitalize + * + } + if$ +} + + + +%% date + +FUNCTION {format.date} +{ + month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { this.to.prev.status + this.status.std + cap.status.std + swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.date.electronic} +{ month "month" bibinfo.check duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ + { pop$ } + { "there's a month but no year in " cite$ * warning$ + pop$ ")" * "(" swap$ * + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ + } + { swap$ + { swap$ pop$ ")" * "(" swap$ * } + { "(" swap$ * ", " * swap$ * ")" * } + if$ + this.to.prev.status + punct.no 'this.status.punct := + space.normal 'this.status.space := + quote.no 'this.status.quote := + cap.yes 'status.cap := + } + if$ +} + + + +%% edition/title + +% Note: IEEE considers the edition to be closely associated with +% the title of a book. So, in IEEEtran.bst the edition is normally handled +% within the formatting of the title. The format.edition function is +% retained here for possible future use. +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + convert.edition + status.cap + { "t" } + { "l" } + if$ change.case$ + "edition" bibinfo.check + "~" * bbl.edition * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of a conference proceedings. +% Here we use the "intype" field to provide the user a way to +% override the word "in" (e.g., with things like "presented at") +% Use of intype stops the emphasis of the booktitle to indicate that +% we no longer mean the written conference proceedings, but the +% conference itself. +FUNCTION {format.in.booktitle} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + intype missing$ + { emphasize + bbl.in " " * + } + { intype " " * } + if$ + swap$ * + cap.status.std + } + if$ +} + +% This is used to format the booktitle of collection. +% Here the "intype" field is not supported, but "edition" is. +FUNCTION {format.in.booktitle.edition} +{ booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + "l" change.case$ + * "~" * bbl.edition * + } + if$ + bbl.in " " * swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { quote.close 'this.status.quote := + is.last.char.not.punct + { punct.std 'this.status.punct := } + { punct.no 'this.status.punct := } + if$ + select.language + "``" swap$ * + cap.status.std + } + if$ +} + +FUNCTION {format.article.title.electronic} +{ title duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + "t" change.case$ + } + if$ + "title" bibinfo.check + duplicate$ empty$ + { skip$ } + { select.language } + if$ +} + +FUNCTION {format.book.title.edition} +{ title "title" bibinfo.check + duplicate$ empty$ + { "empty title in " cite$ * warning$ } + { this.to.prev.status + this.status.std + select.language + emphasize + edition empty$ 'skip$ + { ", " * + edition + convert.edition + status.cap + { "t" } + { "l" } + if$ + change.case$ + * "~" * bbl.edition * + } + if$ + cap.status.std + } + if$ +} + +FUNCTION {format.book.title} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% journal + +FUNCTION {format.journal} +{ journal duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + select.language + emphasize + } + if$ +} + + + +%% how published + +FUNCTION {format.howpublished} +{ howpublished duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% institutions/organization/publishers/school + +FUNCTION {format.institution} +{ institution duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.organization} +{ organization duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + +FUNCTION {format.address.publisher.date} +{ publisher "publisher" bibinfo.warn format.address.org.or.pub.date } + +FUNCTION {format.address.publisher.date.nowarn} +{ publisher "publisher" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.address.organization.date} +{ organization "organization" bibinfo.check format.address.org.or.pub.date } + +FUNCTION {format.school} +{ school duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + cap.status.std + } + if$ +} + + + +%% volume/number/series/chapter/pages + +FUNCTION {format.volume} +{ volume empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + bbl.volume + status.cap + { capitalize } + { skip$ } + if$ + swap$ tie.or.space.prefix + "volume" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number} +{ number empty.field.to.null.string + duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + status.cap + { bbl.number capitalize } + { bbl.number } + if$ + swap$ tie.or.space.prefix + "number" bibinfo.check + * * + cap.status.std + } + if$ +} + +FUNCTION {format.number.if.use.for.article} +{ is.use.number.for.article + { format.number } + { "" } + if$ +} + +% IEEE does not seem to tie the series so closely with the volume +% and number as is done in other bibliography styles. Instead the +% series is treated somewhat like an extension of the title. +FUNCTION {format.series} +{ series empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.series " " * + series "series" bibinfo.check * + cap.status.std + } + if$ +} + + +FUNCTION {format.chapter} +{ chapter empty$ + { "" } + { this.to.prev.status + this.status.std + type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + cap.status.std + } + if$ +} + + +% The intended use of format.paper is for paper numbers of inproceedings. +% The paper type can be overridden via the type field. +% We allow the type to be displayed even if the paper number is absent +% for things like "postdeadline paper" +FUNCTION {format.paper} +{ is.use.paper + { paper empty$ + { type empty$ + { "" } + { this.to.prev.status + this.status.std + type "type" bibinfo.check + cap.status.std + } + if$ + } + { this.to.prev.status + this.status.std + type empty$ + { bbl.paper } + { type "type" bibinfo.check } + if$ + " " * paper + "paper" bibinfo.check + * + cap.status.std + } + if$ + } + { "" } + if$ +} + + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { this.to.prev.status + this.status.std + duplicate$ is.multiple.pages + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + cap.status.std + } + if$ +} + + + +%% technical report number + +FUNCTION {format.tech.report.number} +{ number "number" bibinfo.check + this.to.prev.status + this.status.std + cap.status.std + type duplicate$ empty$ + { pop$ + bbl.techrep + } + { skip$ } + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ } + { tie.or.space.prefix * * } + if$ +} + + + +%% note + +FUNCTION {format.note} +{ note empty$ + { "" } + { this.to.prev.status + this.status.std + punct.period 'this.status.punct := + note #1 #1 substring$ + duplicate$ "{" = + { skip$ } + { status.cap + { "u" } + { "l" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + cap.yes 'status.cap := + } + if$ +} + + + +%% patent + +FUNCTION {format.patent.date} +{ this.to.prev.status + this.status.std + year empty$ + { monthfiled duplicate$ empty$ + { "monthfiled" bibinfo.check pop$ "" } + { "monthfiled" bibinfo.check } + if$ + dayfiled duplicate$ empty$ + { "dayfiled" bibinfo.check pop$ "" * } + { "dayfiled" bibinfo.check + monthfiled empty$ + { "dayfiled without a monthfiled in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + yearfiled empty$ + { "no year or yearfiled in " cite$ * warning$ } + { yearfiled "yearfiled" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + } + { month duplicate$ empty$ + { "month" bibinfo.check pop$ "" } + { "month" bibinfo.check } + if$ + day duplicate$ empty$ + { "day" bibinfo.check pop$ "" * } + { "day" bibinfo.check + month empty$ + { "day without a month in " cite$ * warning$ + * + } + { " " swap$ * * } + if$ + } + if$ + year "year" bibinfo.check + swap$ + duplicate$ empty$ + { pop$ } + { ", " * swap$ * } + if$ + } + if$ + cap.status.std +} + +FUNCTION {format.patent.nationality.type.number} +{ this.to.prev.status + this.status.std + nationality duplicate$ empty$ + { "nationality" bibinfo.warn pop$ "" } + { "nationality" bibinfo.check + duplicate$ "l" change.case$ "united states" = + { pop$ bbl.patentUS } + { skip$ } + if$ + " " * + } + if$ + type empty$ + { bbl.patent "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.warn pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + + + +%% standard + +FUNCTION {format.organization.institution.standard.type.number} +{ this.to.prev.status + this.status.std + organization duplicate$ empty$ + { pop$ + institution duplicate$ empty$ + { "institution" bibinfo.warn } + { "institution" bibinfo.warn " " * } + if$ + } + { "organization" bibinfo.warn " " * } + if$ + type empty$ + { bbl.standard "type" bibinfo.check } + { type "type" bibinfo.check } + if$ + * + number duplicate$ empty$ + { "number" bibinfo.check pop$ } + { "number" bibinfo.check + large.number.separate + swap$ " " * swap$ * + } + if$ + cap.status.std +} + +FUNCTION {format.revision} +{ revision empty$ + { "" } + { this.to.prev.status + this.status.std + bbl.revision + revision tie.or.space.prefix + "revision" bibinfo.check + * * + cap.status.std + } + if$ +} + + +%% thesis + +FUNCTION {format.master.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.mthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + +FUNCTION {format.phd.thesis.type} +{ this.to.prev.status + this.status.std + type empty$ + { + bbl.phdthesis + } + { + type "type" bibinfo.check + } + if$ +cap.status.std +} + + + +%% URL + +FUNCTION {format.url} +{ url empty$ + { "" } + { this.to.prev.status + this.status.std + cap.yes 'status.cap := + name.url.prefix " " * + "\url{" * url * "}" * + punct.no 'this.status.punct := + punct.period 'prev.status.punct := + space.normal 'this.status.space := + space.normal 'prev.status.space := + quote.no 'this.status.quote := + } + if$ +} + + + + +%%%%%%%%%%%%%%%%%%%% +%% ENTRY HANDLERS %% +%%%%%%%%%%%%%%%%%%%% + + +% Note: In many journals, IEEE (or the authors) tend not to show the number +% for articles, so the display of the number is controlled here by the +% switch "is.use.number.for.article" +FUNCTION {article} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.journal "journal" bibinfo.check "journal" output.warn + format.volume output + format.number.if.use.for.article output + format.pages output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {book} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + author empty$ + { skip$ } + { format.editors output } + if$ + format.address.publisher.date output + format.volume output + format.number output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {booklet} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {electronic} +{ std.status.using.period + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.date.electronic output + format.article.title.electronic output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {inbook} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + author empty$ + { format.editors "author and editor" output.warn } + { format.authors output.nonnull } + if$ + name.or.dash + format.book.title.edition output + format.series output + format.address.publisher.date output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {incollection} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle.edition "booktitle" output.warn + format.series output + format.editors output + format.address.publisher.date.nowarn output + format.volume output + format.number output + format.chapter output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {inproceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.in.booktitle "booktitle" output.warn + format.series output + format.editors output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.paper output + format.pages output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {manual} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title.edition "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {mastersthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.master.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {misc} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.howpublished "howpublished" bibinfo.check output + format.organization "organization" bibinfo.check output + format.address "address" bibinfo.check output + format.pages output + format.date output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {patent} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.article.title output + format.patent.nationality.type.number output + format.patent.date output + format.note output + format.url output + fin.entry + empty.entry.warn + if.url.std.interword.spacing +} + +FUNCTION {periodical} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + format.organization "organization" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {phdthesis} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.phd.thesis.type output.nonnull + format.school "school" bibinfo.warn output + format.address "address" bibinfo.check output + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {proceedings} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.editors output + name.or.dash + format.book.title "title" output.warn + format.series output + format.volume output + format.number output + publisher empty$ + { format.address.organization.date output } + { format.organization "organization" bibinfo.check output + format.address.publisher.date output + } + if$ + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {standard} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors output + name.or.dash + format.book.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.organization.institution.standard.type.number output + format.revision output + format.date output + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {techreport} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.howpublished "howpublished" bibinfo.check output + format.institution "institution" bibinfo.warn output + format.address "address" bibinfo.check output + format.tech.report.number output.nonnull + format.date "year" output.warn + format.note output + format.url output + fin.entry + if.url.std.interword.spacing +} + +FUNCTION {unpublished} +{ std.status.using.comma + start.entry + if.url.alt.interword.spacing + format.authors "author" output.warn + name.or.dash + format.article.title "title" output.warn + format.date output + format.note "note" output.warn + format.url output + fin.entry + if.url.std.interword.spacing +} + + +% The special entry type which provides the user interface to the +% BST controls +FUNCTION {IEEEtranBSTCTL} +{ is.print.banners.to.terminal + { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * + top$ + } + { skip$ } + if$ + CTLuse_article_number + empty$ + { skip$ } + { CTLuse_article_number + yes.no.to.int + 'is.use.number.for.article := + } + if$ + CTLuse_paper + empty$ + { skip$ } + { CTLuse_paper + yes.no.to.int + 'is.use.paper := + } + if$ + CTLuse_forced_etal + empty$ + { skip$ } + { CTLuse_forced_etal + yes.no.to.int + 'is.forced.et.al := + } + if$ + CTLmax_names_forced_etal + empty$ + { skip$ } + { CTLmax_names_forced_etal + string.to.integer + 'max.num.names.before.forced.et.al := + } + if$ + CTLnames_show_etal + empty$ + { skip$ } + { CTLnames_show_etal + string.to.integer + 'num.names.shown.with.forced.et.al := + } + if$ + CTLuse_alt_spacing + empty$ + { skip$ } + { CTLuse_alt_spacing + yes.no.to.int + 'is.use.alt.interword.spacing := + } + if$ + CTLalt_stretch_factor + empty$ + { skip$ } + { CTLalt_stretch_factor + 'ALTinterwordstretchfactor := + "\renewcommand{\BIBentryALTinterwordstretchfactor}{" + ALTinterwordstretchfactor * "}" * + write$ newline$ + } + if$ + CTLdash_repeated_names + empty$ + { skip$ } + { CTLdash_repeated_names + yes.no.to.int + 'is.dash.repeated.names := + } + if$ + CTLname_format_string + empty$ + { skip$ } + { CTLname_format_string + 'name.format.string := + } + if$ + CTLname_latex_cmd + empty$ + { skip$ } + { CTLname_latex_cmd + 'name.latex.cmd := + } + if$ + CTLname_url_prefix + missing$ + { skip$ } + { CTLname_url_prefix + 'name.url.prefix := + } + if$ + + + num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > + { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ + max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := + } + { skip$ } + if$ +} + + +%%%%%%%%%%%%%%%%%%% +%% ENTRY ALIASES %% +%%%%%%%%%%%%%%%%%%% +FUNCTION {conference}{inproceedings} +FUNCTION {online}{electronic} +FUNCTION {internet}{electronic} +FUNCTION {webpage}{electronic} +FUNCTION {www}{electronic} +FUNCTION {default.type}{misc} + + + +%%%%%%%%%%%%%%%%%% +%% MAIN PROGRAM %% +%%%%%%%%%%%%%%%%%% + +READ + +EXECUTE {initialize.controls} +EXECUTE {initialize.status.constants} +EXECUTE {banner.message} + + + +% BEGIN sort code based on unsrtnat.bst +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + { s } + if$ +} + +STRINGS { last.label next.extra } + +INTEGERS { last.extra.num } + +FUNCTION {format.lab.names} +{ 's := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { " et~al." * } + { " and " * s #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + { key } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + { key } + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.institution.label} +{ author empty$ + { key empty$ + { organization empty$ + { institution empty$ + { cite$ #1 #3 substring$ } + { "The " #4 institution chop.word #3 text.prefix$ } + if$ + } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ + { cite$ #1 #3 substring$ } + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key } + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.label} +{ type$ "book" = + type$ "inbook" = + or + { author.editor.key.label } + { type$ "proceedings" = + type$ "periodical" = + or + { editor.key.organization.label } + { type$ "manual" = + type$ "electronic" = + type$ "misc" = + or or + { author.key.organization.label } + { type$ "standard" = + { author.key.organization.institution.label } + { author.key.label } + if$ + } + if$ + } + if$ + } + if$ + duplicate$ + 'short.list := + "(" + * + type$ "patent" = + { year empty$ + { yearfiled } + { year } + if$ + } + { year } + if$ + duplicate$ + empty$ + short.list key empty.field.to.null.string = or + { pop$ "" } + { skip$ } + if$ + * + 'label := +} + + +INTEGERS { seq.num } + +FUNCTION {init.seq} +{ #0 'seq.num :=} + + +FUNCTION {int.to.fix} +{ "000000000" swap$ int.to.str$ * + #-1 #10 substring$ +} + + +FUNCTION {presort} +{ type$ "ieeetranbstctl" = + { key empty$ + { "_" } + { key sortify } + if$ + " " + * + seq.num int.to.fix + } + { calc.label + label sortify + " " + * + seq.num #1 + 'seq.num := + seq.num int.to.fix + } + if$ + 'sort.label := + sort.label * + #1 entry.max$ substring$ + 'sort.key$ := +} + + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'longest.label.width := + #0 'last.extra.num := + #0 'number.label := +} + +FUNCTION {forward.pass} +{ type$ "ieeetranbstctl" = + { skip$ } + { last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := + } + if$ +} + +FUNCTION {reverse.pass} +{ type$ "ieeetranbstctl" = + { skip$ } + { next.extra "b" = + { "a" 'extra.label := } + { skip$ } + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + { skip$ } + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := + } + if$ +} + +FUNCTION {bib.sort.order} +{ sort.label 'sort.key$ := +} +% END sort code based on unsrtnat.bst + + + +EXECUTE {init.seq} + +ITERATE {presort} + +SORT + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} +REVERSE {reverse.pass} + +ITERATE {bib.sort.order} + +SORT + +EXECUTE {begin.bib} +ITERATE {call.type$} +EXECUTE {end.bib} + +EXECUTE{completed.message} + + +%% That's all folks, mds. diff --git a/macros/latex/contrib/mciteplus/README b/macros/latex/contrib/mciteplus/README new file mode 100644 index 0000000000..7618ccbd14 --- /dev/null +++ b/macros/latex/contrib/mciteplus/README @@ -0,0 +1,126 @@ + + +September 13, 2013 + +The mciteplus LaTeX package is an enhanced reimplementation of +Thorsten Ohl's mcite package: + +http://www.ctan.org/tex-archive/macros/latex/contrib/mcite/ + +which provides support for the grouping of multiple citations together +as is often done in physics journals. An extensive set of features +provide for other applications such as reference sublisting. + +Mciteplus offers the following features, many of which are not available +with the original mcite: + + 1. Entry punctuation can be controlled by the bibstyle (.bst) as well + as the user. + + 2. No "double periods" when an entry already ends with a period + (e.g., an abbreviated journal name). + + 3. Support for sublists. + + 4. Support for multiple bibliographies and/or auxiliary files. + + 5. The bibliography sample label width is automatically updated to + account for the changes in the numbering due to the grouped entries. + Maximum label width information is available to user. + + 6. Compatible with the natbib package. (The bibstyle must support both + mciteplus as well as natbib.) + + 7. Compatible with the REVTeX4 class. (The bibstyle must support both + mciteplus as well as natbib.) + + 8. Support for the optional argument of \cite[]{}. + + 9. Provides a means to allow users to use almost any cite command via + custom command wrappers and the ability to manually disable all + automatic internal hooks. + +10. Mciteplus compatible sorting bibstyles are possible via the use of a + "mcitetail" field in the BibTeX database entries. + + +Please note that existing mcite bibstyles (.bst files) are not compatible +with mciteplus. They will have to be remodified as explained in the +mciteplus documentation. + +See the mciteplus_doc.pdf user manual for full details. + +For helpful tips, answers to frequently asked questions and other support, +visit the Mciteplus home page at my website: + +http://www.michaelshell.org/tex/mciteplus/ + + +Enjoy! + +Michael Shell + + +******* +Version 1.2 (2013/09/13) changes: + + 1) Add support for \citenum of natbib version 8.0 and later. + Thanks to Joseph Wright for reporting this. + + 2) Corrected bug with cross-referenced entries with backref.sty. + Thanks to Martin Böttcher for reporting this problem. + +********************************** Files ********************************** + +README - This file. + +changelog.txt - Version history. + +mciteplus.sty - The mciteplus LaTeX package. + +mciteplus_doc.pdf - The mciteplus user manual. + +mciteplus_doc.tex - LaTeX source code for the user manual. + +mciteplus_code.txt - Selected .bst modification and other code listings. + +apsrevM.bst - An mciteplus compatible version of REVTeX4's + apsrev.bst. + +apsrmpM.bst - An mciteplus compatible version of REVTeX4's + apsrmp.bst. Note: This is a sorting style. For it to + work properly, you must set the "mcitetail" BibTeX + database field for every tail entry. + +IEEEtranM.bst - An mciteplus compatible version of IEEEtran.bst. + +IEEEtranMN.bst - An mciteplus compatible version of IEEEtranN.bst + (natbib compatible). + +*************************************************************************** +Legal Notice: +This code is offered as-is without any warranty either expressed or +implied; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE! +User assumes all risk. +In no event shall any contributor to this code be liable for any damages or +losses, including, but not limited to, incidental, consequential, or any +other damages, resulting from the use or misuse of any information contained +here. + +All comments are the opinions of their respective authors. + +This work is distributed under the LaTeX Project Public License (LPPL) +( http://www.latex-project.org/ ) version 1.3, and may be freely used, +distributed and modified. A copy of the LPPL, version 1.3, is included +in the base LaTeX documentation of all distributions of LaTeX released +2003/12/01 or later. +Retain all contribution notices and credits. +** Modified files should be clearly indicated as such, including ** +** renaming them and changing author support contact information. ** + +File list of work: mciteplus.sty, mciteplus_doc.pdf, mciteplus_doc.tex, + mciteplus_code.txt, apsrevM.bst, apsrmpM.bst, + IEEEtranM.bst, IEEEtranMN.bst + +*************************************************************************** diff --git a/macros/latex/contrib/mciteplus/apsrevM.bst b/macros/latex/contrib/mciteplus/apsrevM.bst new file mode 100644 index 0000000000..6bc2e664d0 --- /dev/null +++ b/macros/latex/contrib/mciteplus/apsrevM.bst @@ -0,0 +1,2129 @@ +%% +%% apsrevM.bst +%% Version 1.0 (2008/01/15) +%% REVTeX4 apsrev.bst with added mciteplus compatibility code by Michael Shell +%% Distributed with the mciteplus LaTeX package. +%% Support site: +%% http://www.michaelshell.org/tex/mciteplus/ +%% +%% This is file `apsrevM.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,ay,nat,seq-no,nm-init,ed-au,nmlm,x10,x0,m10,m0,nmft,nmft-def,fnm-def,nmfted,lab,lab-def,keyxyr,yr-par,note-yr,tit-it,jtit-x,jttl-rm,thtit-x,trtit-x,vol-bf,vnum-x,volp-com,jpg-1,num-xser,jnm-x,pub-date,pre-pub,isbn,issn,edby,blk-com,pp,ed,abr,ednx,ord,jabr,revdata,eprint,url,url-blk,misc-simple,bibinfo,nfss,{}') +%% physjour.mbs (with options: `ay,nat,seq-no,nm-init,ed-au,nmlm,x10,x0,m10,m0,nmft,nmft-def,fnm-def,nmfted,lab,lab-def,keyxyr,yr-par,note-yr,tit-it,jtit-x,jttl-rm,thtit-x,trtit-x,vol-bf,vnum-x,volp-com,jpg-1,num-xser,jnm-x,pub-date,pre-pub,isbn,issn,edby,blk-com,pp,ed,abr,ednx,ord,jabr,revdata,eprint,url,url-blk,misc-simple,bibinfo,nfss,{}') +%% geojour.mbs (with options: `ay,nat,seq-no,nm-init,ed-au,nmlm,x10,x0,m10,m0,nmft,nmft-def,fnm-def,nmfted,lab,lab-def,keyxyr,yr-par,note-yr,tit-it,jtit-x,jttl-rm,thtit-x,trtit-x,vol-bf,vnum-x,volp-com,jpg-1,num-xser,jnm-x,pub-date,pre-pub,isbn,issn,edby,blk-com,pp,ed,abr,ednx,ord,jabr,revdata,eprint,url,url-blk,misc-simple,bibinfo,nfss,{}') +%% photjour.mbs (with options: `ay,nat,seq-no,nm-init,ed-au,nmlm,x10,x0,m10,m0,nmft,nmft-def,fnm-def,nmfted,lab,lab-def,keyxyr,yr-par,note-yr,tit-it,jtit-x,jttl-rm,thtit-x,trtit-x,vol-bf,vnum-x,volp-com,jpg-1,num-xser,jnm-x,pub-date,pre-pub,isbn,issn,edby,blk-com,pp,ed,abr,ednx,ord,jabr,revdata,eprint,url,url-blk,misc-simple,bibinfo,nfss,{}') +%% merlin.mbs (with options: `tail,ay,nat,seq-no,nm-init,ed-au,nmlm,x10,x0,m10,m0,nmft,nmft-def,fnm-def,nmfted,lab,lab-def,keyxyr,yr-par,note-yr,tit-it,jtit-x,jttl-rm,thtit-x,trtit-x,vol-bf,vnum-x,volp-com,jpg-1,num-xser,jnm-x,pub-date,pre-pub,isbn,issn,edby,blk-com,pp,ed,abr,ednx,ord,jabr,revdata,eprint,url,url-blk,misc-simple,bibinfo,nfss,{}') +%% ---------------------------------------- +%% *** REVTeX-compatible apsrevM.bst 1702 *** +%% +%% Copyright 1994-2000 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2000/05/04 4.01 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + collaboration + edition + editor + eid + eprint + howpublished + institution + isbn + issn + journal + key + month + note + number + numpages + organization + pages + publisher + school + series + title + type + url + volume + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + + + +% mciteplus fin.entry +% +% pushes true (1), if add.period$ would add a period to the string on the stack +% pushes false (0), otherwise +% Uses text.length$ to avoid full string comparison and two copies of string. +% Requires one copy of string on stack. +INTEGERS {would.add.period.textlen} +FUNCTION {would.add.period} +{ duplicate$ + add.period$ + text.length$ + 'would.add.period.textlen := + duplicate$ + text.length$ + would.add.period.textlen = + { #0 } + { #1 } + if$ +} + +FUNCTION {fin.entry} +{ would.add.period + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPuncttrue" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax" + } + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPunctfalse" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{}{\mcitedefaultseppunct}\relax" + } + if$ + write$ + newline$ + "\EndOfBibitem" write$ +} +% end mciteplus fin.entry + + + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {bib.name.font} +{ duplicate$ empty$ + { pop$ "" } + { "\bibnamefont{" swap$ * "}" * } + if$ +} +FUNCTION {bib.fname.font} +{ duplicate$ empty$ + { pop$ "" } + { "\bibfnamefont{" swap$ * "}" * } + if$ +} +FUNCTION {cite.name.font} +{ duplicate$ empty$ + { pop$ "" } + { "\citenamefont{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.eidpp} +{ "pages" } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + + + %------------------------------------------------------------------- + + % Begin module: + % \ProvidesFile{physjour.mbs}[1999/10/05 2.1 (PWD)] + +MACRO {aa}{"Astron. \& Astrophys."} + +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} + +MACRO {aj} {"Astron. J."} + +MACRO {aph} {"Acta Phys."} + +MACRO {advp} {"Adv. Phys."} + +MACRO {ajp} {"Amer. J. Phys."} + +MACRO {ajm} {"Amer. J. Math."} + +MACRO {amsci} {"Amer. Sci."} + +MACRO {anofd} {"Ann. Fluid Dyn."} + +MACRO {am} {"Ann. Math."} + +MACRO {ap} {"Ann. Phys. (NY)"} + +MACRO {adp} {"Ann. Phys. (Leipzig)"} + +MACRO {ao} {"Appl. Opt."} + +MACRO {apl} {"Appl. Phys. Lett."} + +MACRO {app} {"Astroparticle Phys."} + +MACRO {apj} {"Astrophys. J."} + +MACRO {apjsup} {"Astrophys. J. Suppl."} + +MACRO {apss} {"Astrophys. Space Sci."} + +MACRO {araa} {"Ann. Rev. Astron. Astrophys."} + +MACRO {baas} {"Bull. Amer. Astron. Soc."} + +MACRO {baps} {"Bull. Amer. Phys. Soc."} + +MACRO {cmp} {"Comm. Math. Phys."} + +MACRO {cpam} {"Commun. Pure Appl. Math."} + +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} + +MACRO {cpc} {"Comp. Phys. Comm."} + +MACRO {cqg} {"Class. Quant. Grav."} + +MACRO {cra} {"C. R. Acad. Sci. A"} + +MACRO {fed} {"Fusion Eng. \& Design"} + +MACRO {ft} {"Fusion Tech."} + +MACRO {grg} {"Gen. Relativ. Gravit."} + +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} + +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} + +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} + +MACRO {ip} {"Infrared Phys."} + +MACRO {irp} {"Infrared Phys."} + +MACRO {jap} {"J. Appl. Phys."} + +MACRO {jasa} {"J. Acoust. Soc. America"} + +MACRO {jcp} {"J. Comp. Phys."} + +MACRO {jetp} {"Sov. Phys.--JETP"} + +MACRO {jfe} {"J. Fusion Energy"} + +MACRO {jfm} {"J. Fluid Mech."} + +MACRO {jmp} {"J. Math. Phys."} + +MACRO {jne} {"J. Nucl. Energy"} + +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} + +MACRO {jnm} {"J. Nucl. Mat."} + +MACRO {jpc} {"J. Phys. Chem."} + +MACRO {jpp} {"J. Plasma Phys."} + +MACRO {jpsj} {"J. Phys. Soc. Japan"} + +MACRO {jsi} {"J. Sci. Instrum."} + +MACRO {jvst} {"J. Vac. Sci. \& Tech."} + +MACRO {nat} {"Nature"} + +MACRO {nature} {"Nature"} + +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} + +MACRO {nf} {"Nucl. Fusion"} + +MACRO {nim} {"Nucl. Inst. \& Meth."} + +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} + +MACRO {np} {"Nucl. Phys."} + +MACRO {npb} {"Nucl. Phys. B"} + +MACRO {nt/f} {"Nucl. Tech./Fusion"} + +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} + +MACRO {inc} {"Nuovo Cimento"} + +MACRO {nc} {"Nuovo Cimento"} + +MACRO {pf} {"Phys. Fluids"} + +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} + +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} + +MACRO {pl} {"Phys. Lett."} + +MACRO {pla} {"Phys. Lett. A"} + +MACRO {plb} {"Phys. Lett. B"} + +MACRO {prep} {"Phys. Rep."} + +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} + +MACRO {pp} {"Phys. Plasmas"} + +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} + +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} + +MACRO {prl} {"Phys. Rev. Lett."} + +MACRO {pr} {"Phys. Rev."} + +MACRO {physrev} {"Phys. Rev."} + +MACRO {pra} {"Phys. Rev. A"} + +MACRO {prb} {"Phys. Rev. B"} + +MACRO {prc} {"Phys. Rev. C"} + +MACRO {prd} {"Phys. Rev. D"} + +MACRO {pre} {"Phys. Rev. E"} + +MACRO {ps} {"Phys. Scripta"} + +MACRO {procrsl} {"Proc. Roy. Soc. London"} + +MACRO {rmp} {"Rev. Mod. Phys."} + +MACRO {rsi} {"Rev. Sci. Inst."} + +MACRO {science} {"Science"} + +MACRO {sciam} {"Sci. Am."} + +MACRO {sam} {"Stud. Appl. Math."} + +MACRO {sjpp} {"Sov. J. Plasma Phys."} + +MACRO {spd} {"Sov. Phys.--Doklady"} + +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} + +MACRO {spu} {"Sov. Phys.--Uspeki"} + +MACRO {st} {"Sky and Telesc."} + + % End module: physjour.mbs + + + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{geojour.mbs}[1999/11/16 2.0g (PWD)] +MACRO {aisr} {"Adv. Space Res."} +MACRO {ag} {"Ann. Geophys."} +MACRO {anigeo} {"Ann. Geofis."} +MACRO {angl} {"Ann. Glaciol."} +MACRO {andmet} {"Ann. d. Meteor."} +MACRO {andgeo} {"Ann. d. Geophys."} +MACRO {andphy} {"Ann. Phys.-Paris"} +MACRO {afmgb} {"Arch. Meteor. Geophys. Bioklimatol."} +MACRO {atph} {"Atm\'osphera"} +MACRO {aao} {"Atmos. Ocean"} +MACRO {ass}{"Astrophys. Space Sci."} +MACRO {atenv} {"Atmos. Environ."} +MACRO {aujag} {"Aust. J. Agr. Res."} +MACRO {aumet} {"Aust. Meteorol. Mag."} +MACRO {blmet} {"Bound.-Lay. Meteorol."} +MACRO {bams} {"Bull. Amer. Meteorol. Soc."} +MACRO {cch} {"Clim. Change"} +MACRO {cdyn} {"Clim. Dynam."} +MACRO {cbul} {"Climatol. Bull."} +MACRO {cap} {"Contrib. Atmos. Phys."} +MACRO {dsr} {"Deep-Sea Res."} +MACRO {dhz} {"Dtsch. Hydrogr. Z."} +MACRO {dao} {"Dynam. Atmos. Oceans"} +MACRO {eco} {"Ecology"} +MACRO {empl}{"Earth, Moon and Planets"} +MACRO {envres} {"Environ. Res."} +MACRO {envst} {"Environ. Sci. Technol."} +MACRO {ecms} {"Estuarine Coastal Mar. Sci."} +MACRO {expa}{"Exper. Astron."} +MACRO {geoint} {"Geofis. Int."} +MACRO {geopub} {"Geofys. Publ."} +MACRO {geogeo} {"Geol. Geofiz."} +MACRO {gafd} {"Geophys. Astrophys. Fluid Dyn."} +MACRO {gfd} {"Geophys. Fluid Dyn."} +MACRO {geomag} {"Geophys. Mag."} +MACRO {georl} {"Geophys. Res. Lett."} +MACRO {grl} {"Geophys. Res. Lett."} +MACRO {ga} {"Geophysica"} +MACRO {gs} {"Geophysics"} +MACRO {ieeetap} {"IEEE Trans. Antenn. Propag."} +MACRO {ijawp} {"Int. J. Air Water Pollut."} +MACRO {ijc} {"Int. J. Climatol."} +MACRO {ijrs} {"Int. J. Remote Sens."} +MACRO {jam} {"J. Appl. Meteorol."} +MACRO {jaot} {"J. Atmos. Ocean. Technol."} +MACRO {jatp} {"J. Atmos. Terr. Phys."} +MACRO {jce} {"J. Climate"} +MACRO {jcam} {"J. Climate Appl. Meteor."} +MACRO {jcm} {"J. Climate Meteor."} +MACRO {jcy} {"J. Climatol."} +MACRO {jgr} {"J. Geophys. Res."} +MACRO {jga} {"J. Glaciol."} +MACRO {jh} {"J. Hydrol."} +MACRO {jmr} {"J. Mar. Res."} +MACRO {jmrj} {"J. Meteor. Res. Japan"} +MACRO {jm} {"J. Meteor."} +MACRO {jpo} {"J. Phys. Oceanogr."} +MACRO {jra} {"J. Rech. Atmos."} +MACRO {jaes} {"J. Aeronaut. Sci."} +MACRO {japca} {"J. Air Pollut. Control Assoc."} +MACRO {jas} {"J. Atmos. Sci."} +MACRO {jmts} {"J. Mar. Technol. Soc."} +MACRO {jmsj} {"J. Meteorol. Soc. Japan"} +MACRO {josj} {"J. Oceanogr. Soc. Japan"} +MACRO {jwm} {"J. Wea. Mod."} +MACRO {lao} {"Limnol. Oceanogr."} +MACRO {mwl} {"Mar. Wea. Log"} +MACRO {mau} {"Mausam"} +MACRO {meteor} {"``Meteor'' Forschungsergeb."} +MACRO {map} {"Meteorol. Atmos. Phys."} +MACRO {metmag} {"Meteor. Mag."} +MACRO {metmon} {"Meteor. Monogr."} +MACRO {metrun} {"Meteor. Rundsch."} +MACRO {metzeit} {"Meteor. Z."} +MACRO {metgid} {"Meteor. Gidrol."} +MACRO {mwr} {"Mon. Weather Rev."} +MACRO {nwd} {"Natl. Weather Dig."} +MACRO {nzjmfr} {"New Zeal. J. Mar. Freshwater Res."} +MACRO {npg} {"Nonlin. Proc. Geophys."} +MACRO {om} {"Oceanogr. Meteorol."} +MACRO {ocac} {"Oceanol. Acta"} +MACRO {oceanus} {"Oceanus"} +MACRO {paleoc} {"Paleoceanography"} +MACRO {pce} {"Phys. Chem. Earth"} +MACRO {pmg} {"Pap. Meteor. Geophys."} +MACRO {ppom} {"Pap. Phys. Oceanogr. Meteor."} +MACRO {physzeit} {"Phys. Z."} +MACRO {pps} {"Planet. Space Sci."} +MACRO {pss} {"Planet. Space Sci."} +MACRO {pag} {"Pure Appl. Geophys."} +MACRO {qjrms} {"Quart. J. Roy. Meteorol. Soc."} +MACRO {quatres} {"Quat. Res."} +MACRO {rsci} {"Radio Sci."} +MACRO {rse} {"Remote Sens. Environ."} +MACRO {rgeo} {"Rev. Geophys."} +MACRO {rgsp} {"Rev. Geophys. Space Phys."} +MACRO {rdgeo} {"Rev. Geofis."} +MACRO {revmeta} {"Rev. Meteorol."} +MACRO {sgp}{"Surveys in Geophys."} +MACRO {sp} {"Solar Phys."} +MACRO {ssr} {"Space Sci. Rev."} +MACRO {tellus} {"Tellus"} +MACRO {tac} {"Theor. Appl. Climatol."} +MACRO {tagu} {"Trans. Am. Geophys. Union (EOS)"} +MACRO {wrr} {"Water Resour. Res."} +MACRO {weather} {"Weather"} +MACRO {wafc} {"Weather Forecast."} +MACRO {ww} {"Weatherwise"} +MACRO {wmob} {"WMO Bull."} +MACRO {zeitmet} {"Z. Meteorol."} + % End module: geojour.mbs + + + %------------------------------------------------------------------- + + % Begin module: + + + % \ProvidesFile{photjour.mbs}[1999/02/24 2.0b (PWD)] + +MACRO {appopt} {"Appl. Opt."} + +MACRO {bell} {"Bell Syst. Tech. J."} + +MACRO {ell} {"Electron. Lett."} + +MACRO {jasp} {"J. Appl. Spectr."} + +MACRO {jqe} {"IEEE J. Quantum Electron."} + +MACRO {jlwt} {"J. Lightwave Technol."} + +MACRO {jmo} {"J. Mod. Opt."} + +MACRO {josa} {"J. Opt. Soc. America"} + +MACRO {josaa} {"J. Opt. Soc. Amer.~A"} + +MACRO {josab} {"J. Opt. Soc. Amer.~B"} + +MACRO {jdp} {"J. Phys. (Paris)"} + +MACRO {oc} {"Opt. Commun."} + +MACRO {ol} {"Opt. Lett."} + +MACRO {phtl} {"IEEE Photon. Technol. Lett."} + +MACRO {pspie} {"Proc. Soc. Photo-Opt. Instrum. Eng."} + +MACRO {sse} {"Solid-State Electron."} + +MACRO {sjot} {"Sov. J. Opt. Technol."} + +MACRO {sjqe} {"Sov. J. Quantum Electron."} + +MACRO {sleb} {"Sov. Phys.--Leb. Inst. Rep."} + +MACRO {stph} {"Sov. Phys.--Techn. Phys."} + +MACRO {stphl} {"Sov. Techn. Phys. Lett."} + +MACRO {vr} {"Vision Res."} + +MACRO {zph} {"Z. f. Physik"} + +MACRO {zphb} {"Z. f. Physik~B"} + +MACRO {zphd} {"Z. f. Physik~D"} + +MACRO {CLEO} {"CLEO"} + +MACRO {ASSL} {"Adv. Sol.-State Lasers"} + +MACRO {OSA} {"OSA"} + + % End module: photjour.mbs + + + +%% Copyright 1994-2000 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.}" format.name$ duplicate$ empty$ 'skip$ + { tie.or.space.prefix bib.fname.font swap$ * } + if$ + s nameptr + "{vv~}{ll}" format.name$ bib.name.font * + s nameptr + "{jj}" format.name$ duplicate$ empty$ 'skip$ + { bib.fname.font ", " swap$ * } + if$ + * + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #0 + #10 + + #1 + = + numnames #0 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal bib.name.font * + } + { + bbl.and + bib.name.font + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names + duplicate$ empty$ 'skip$ + { collaboration "collaboration" bibinfo.check + duplicate$ empty$ 'skip$ + { " (" swap$ * ")" * } + if$ + * + } + if$ +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} +FUNCTION {format.isbn} +{ isbn "isbn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISBN " swap$ * + } + if$ +} + +FUNCTION {format.issn} +{ issn "issn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISSN " swap$ * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ + { skip$ } + { "t" change.case$ } + if$ + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} + +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + nameptr #0 + #10 + + #1 + = + numnames #0 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + cite.name.font + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + " (" swap$ * ")" * +} +FUNCTION {format.date.misc} +{ + year empty$ 'skip$ { + format.date "year" output.check + } if$ +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {first.page} +{ 't := + "" + { t empty$ not t #1 #1 substring$ "-" = not and } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + while$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + first.page + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'skip$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ + numpages empty$ 'skip$ + { bbl.eidpp numpages tie.or.space.prefix + "numpages" bibinfo.check * * + " (" swap$ * ")" * * + } + if$ + } + if$ * +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + bbl.edby + " " * swap$ * + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year duplicate$ empty$ + { "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" } + { "year" bibinfo.check extra.label * } + if$ + t empty$ address empty$ and + { * } + { ", " swap$ * * } + if$ + ")" * +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + crossref missing$ + { + "" + journal + duplicate$ empty$ + { pop$ pop$ } { + "journal" bibinfo.check + * "journal" output.check + add.blank + } if$ + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.issn output + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.number.series output + format.publisher.address output + } + { + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + format.isbn output + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.title "title" output.check + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.date "year" output.check + format.isbn output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { + format.publisher.address output + format.bvolume output + format.chapter.pages "chapter and pages" output.check + format.number.series output + } + { + format.chapter.pages "chapter and pages" output.check + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + crossref missing$ + { format.isbn output } + 'skip$ + if$ + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.publisher.address output + format.bvolume output + format.number.series output + format.chapter.pages output + format.edition output + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.bvolume output + format.number.series output + format.pages output + format.isbn output + format.issn output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.btitle "title" output.check + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.date "year" output.check + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.title output + howpublished "howpublished" bibinfo.check output + format.date.misc + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date.misc + format.note "note" output.check + format.eprint output + format.url output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + cite.name.font + "others" 't := + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + cite.name.font + "others" 't := + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + nameptr #0 + #10 + + #1 + = + numnames #0 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +INTEGERS { seq.num } +FUNCTION {init.seq} +{ #0 'seq.num :=} +EXECUTE {init.seq} +FUNCTION {int.to.fix} +{ "000000000" swap$ int.to.str$ * + #-1 #10 substring$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + seq.num #1 + 'seq.num := + seq.num int.to.fix + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{apsrevM.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname bibnamefont\endcsname\relax" + write$ newline$ + " \def\bibnamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname bibfnamefont\endcsname\relax" + write$ newline$ + " \def\bibfnamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname citenamefont\endcsname\relax" + write$ newline$ + " \def\citenamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname url\endcsname\relax" + write$ newline$ + " \def\url#1{\texttt{#1}}\fi" + write$ newline$ + "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{mcitethebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `apsrevM.bst'. diff --git a/macros/latex/contrib/mciteplus/apsrmpM.bst b/macros/latex/contrib/mciteplus/apsrmpM.bst new file mode 100644 index 0000000000..4d0129fe2e --- /dev/null +++ b/macros/latex/contrib/mciteplus/apsrmpM.bst @@ -0,0 +1,2170 @@ +%% +%% apsrmpM.bst +%% Version 1.0 (2008/01/15) +%% REVTeX4 apsrmp.bst with added mciteplus compatibility code by Michael Shell +%% Distributed with the mciteplus LaTeX package. +%% Support site: +%% http://www.michaelshell.org/tex/mciteplus/ +%% +%% This is file `apsrmpM.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,ay,nat,vonx,nm-rev1,jnrlst,nmlm,x10,x2,m10,m2,nmft,nmft-def,fnm-def,nmfted,nmand-rm,lab,lab-def,keyxyr,dt-beg,xmth,yr-com,note-yr,jtit-x,jttl-rm,trtit-b,vol-bf,volp-com,jpg-1,pp-last,num-xser,jnm-x,pub-par,pre-pub,isbn,issn,edpar,edby,blk-com,pp,ed,xedn,jabr,and-com,etal-it,revdata,eprint,url,url-blk,pub-over-eprint,bibinfo,nfss,{}') +%% physjour.mbs (with options: `ay,nat,vonx,nm-rev1,jnrlst,nmlm,x10,x2,m10,m2,nmft,nmft-def,fnm-def,nmfted,nmand-rm,lab,lab-def,keyxyr,dt-beg,xmth,yr-com,note-yr,jtit-x,jttl-rm,trtit-b,vol-bf,volp-com,jpg-1,pp-last,num-xser,jnm-x,pub-par,pre-pub,isbn,issn,edpar,edby,blk-com,pp,ed,xedn,jabr,and-com,etal-it,revdata,eprint,url,url-blk,pub-over-eprint,bibinfo,nfss,{}') +%% geojour.mbs (with options: `ay,nat,vonx,nm-rev1,jnrlst,nmlm,x10,x2,m10,m2,nmft,nmft-def,fnm-def,nmfted,nmand-rm,lab,lab-def,keyxyr,dt-beg,xmth,yr-com,note-yr,jtit-x,jttl-rm,trtit-b,vol-bf,volp-com,jpg-1,pp-last,num-xser,jnm-x,pub-par,pre-pub,isbn,issn,edpar,edby,blk-com,pp,ed,xedn,jabr,and-com,etal-it,revdata,eprint,url,url-blk,pub-over-eprint,bibinfo,nfss,{}') +%% photjour.mbs (with options: `ay,nat,vonx,nm-rev1,jnrlst,nmlm,x10,x2,m10,m2,nmft,nmft-def,fnm-def,nmfted,nmand-rm,lab,lab-def,keyxyr,dt-beg,xmth,yr-com,note-yr,jtit-x,jttl-rm,trtit-b,vol-bf,volp-com,jpg-1,pp-last,num-xser,jnm-x,pub-par,pre-pub,isbn,issn,edpar,edby,blk-com,pp,ed,xedn,jabr,and-com,etal-it,revdata,eprint,url,url-blk,pub-over-eprint,bibinfo,nfss,{}') +%% merlin.mbs (with options: `tail,ay,nat,vonx,nm-rev1,jnrlst,nmlm,x10,x2,m10,m2,nmft,nmft-def,fnm-def,nmfted,nmand-rm,lab,lab-def,keyxyr,dt-beg,xmth,yr-com,note-yr,jtit-x,jttl-rm,trtit-b,vol-bf,volp-com,jpg-1,pp-last,num-xser,jnm-x,pub-par,pre-pub,isbn,issn,edpar,edby,blk-com,pp,ed,xedn,jabr,and-com,etal-it,revdata,eprint,url,url-blk,pub-over-eprint,bibinfo,nfss,{}') +%% ---------------------------------------- +%% *** REVTeX-compatible apsrmpM.bst 1702 *** +%% +%% Copyright 1994-2000 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2000/05/04 4.01 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + + +% mciteplus add mcitetail field +ENTRY + { address + archive + author + booktitle + chapter + collaboration + edition + editor + eid + eprint + howpublished + institution + isbn + issn + journal + key + mcitetail + month + note + number + numpages + organization + pages + publisher + school + series + title + type + url + volume + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} + + + +% mciteplus mcitetail field and sort key adjust support +INTEGERS {mcitetailcnt is.mcitetail} +STRINGS {mciteheadsortkey} +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {mciteplus.yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} +FUNCTION {mciteplustail.adj.sort.key} +{ mcitetail + empty$ + { #0 'is.mcitetail := } + { mcitetail + mciteplus.yes.no.to.int + 'is.mcitetail := + } + if$ + is.mcitetail + { #1 mcitetailcnt + + 'mcitetailcnt := + mciteheadsortkey + "__" * + "000000000" + mcitetailcnt + int.to.str$ + * + #-1 #10 substring$ + * + 'sort.key$ := + } + { #0 'mcitetailcnt := + sort.key$ 'mciteheadsortkey := + } + if$ +} +% END mciteplus mcitetail field support + + + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + + + +% mciteplus fin.entry +% +% pushes true (1), if add.period$ would add a period to the string on the stack +% pushes false (0), otherwise +% Uses text.length$ to avoid full string comparison and two copies of string. +% Requires one copy of string on stack. +INTEGERS {would.add.period.textlen} +FUNCTION {would.add.period} +{ duplicate$ + add.period$ + text.length$ + 'would.add.period.textlen := + duplicate$ + text.length$ + would.add.period.textlen = + { #0 } + { #1 } + if$ +} + +FUNCTION {fin.entry} +{ would.add.period + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPuncttrue" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax" + } + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPunctfalse" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{}{\mcitedefaultseppunct}\relax" + } + if$ + write$ + newline$ + "\EndOfBibitem" write$ +} +% end mciteplus fin.entry + + + + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {bib.name.font} +{ duplicate$ empty$ + { pop$ "" } + { "\bibnamefont{" swap$ * "}" * } + if$ +} +FUNCTION {bib.fname.font} +{ duplicate$ empty$ + { pop$ "" } + { "\bibfnamefont{" swap$ * "}" * } + if$ +} +FUNCTION {cite.name.font} +{ duplicate$ empty$ + { pop$ "" } + { "\citenamefont{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edition" } + +FUNCTION {bbl.volume} +{ "volume" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "number" } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.eidpp} +{ "pages" } + +FUNCTION {bbl.chapter} +{ "chapter" } + +FUNCTION {bbl.techrep} +{ "Technical Report" } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + + + %------------------------------------------------------------------- + + % Begin module: + + + % \ProvidesFile{physjour.mbs}[1999/10/05 2.1 (PWD)] + +MACRO {aa}{"Astron. \& Astrophys."} + + +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} + +MACRO {aj} {"Astron. J."} + +MACRO {aph} {"Acta Phys."} + +MACRO {advp} {"Adv. Phys."} + +MACRO {ajp} {"Amer. J. Phys."} + +MACRO {ajm} {"Amer. J. Math."} + +MACRO {amsci} {"Amer. Sci."} + +MACRO {anofd} {"Ann. Fluid Dyn."} + +MACRO {am} {"Ann. Math."} + +MACRO {ap} {"Ann. Phys. (NY)"} + +MACRO {adp} {"Ann. Phys. (Leipzig)"} + +MACRO {ao} {"Appl. Opt."} + +MACRO {apl} {"Appl. Phys. Lett."} + +MACRO {app} {"Astroparticle Phys."} + +MACRO {apj} {"Astrophys. J."} + +MACRO {apjsup} {"Astrophys. J. Suppl."} + +MACRO {apss} {"Astrophys. Space Sci."} + +MACRO {araa} {"Ann. Rev. Astron. Astrophys."} + +MACRO {baas} {"Bull. Amer. Astron. Soc."} + +MACRO {baps} {"Bull. Amer. Phys. Soc."} + +MACRO {cmp} {"Comm. Math. Phys."} + +MACRO {cpam} {"Commun. Pure Appl. Math."} + +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} + +MACRO {cpc} {"Comp. Phys. Comm."} + +MACRO {cqg} {"Class. Quant. Grav."} + +MACRO {cra} {"C. R. Acad. Sci. A"} + +MACRO {fed} {"Fusion Eng. \& Design"} + +MACRO {ft} {"Fusion Tech."} + +MACRO {grg} {"Gen. Relativ. Gravit."} + +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} + +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} + +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} + +MACRO {ip} {"Infrared Phys."} + +MACRO {irp} {"Infrared Phys."} + +MACRO {jap} {"J. Appl. Phys."} + +MACRO {jasa} {"J. Acoust. Soc. America"} + +MACRO {jcp} {"J. Comp. Phys."} + +MACRO {jetp} {"Sov. Phys.--JETP"} + +MACRO {jfe} {"J. Fusion Energy"} + +MACRO {jfm} {"J. Fluid Mech."} + +MACRO {jmp} {"J. Math. Phys."} + +MACRO {jne} {"J. Nucl. Energy"} + +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} + +MACRO {jnm} {"J. Nucl. Mat."} + +MACRO {jpc} {"J. Phys. Chem."} + +MACRO {jpp} {"J. Plasma Phys."} + +MACRO {jpsj} {"J. Phys. Soc. Japan"} + +MACRO {jsi} {"J. Sci. Instrum."} + +MACRO {jvst} {"J. Vac. Sci. \& Tech."} + +MACRO {nat} {"Nature"} + +MACRO {nature} {"Nature"} + +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} + +MACRO {nf} {"Nucl. Fusion"} + +MACRO {nim} {"Nucl. Inst. \& Meth."} + +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} + +MACRO {np} {"Nucl. Phys."} + +MACRO {npb} {"Nucl. Phys. B"} + +MACRO {nt/f} {"Nucl. Tech./Fusion"} + +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} + +MACRO {inc} {"Nuovo Cimento"} + +MACRO {nc} {"Nuovo Cimento"} + +MACRO {pf} {"Phys. Fluids"} + +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} + +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} + +MACRO {pl} {"Phys. Lett."} + +MACRO {pla} {"Phys. Lett. A"} + +MACRO {plb} {"Phys. Lett. B"} + +MACRO {prep} {"Phys. Rep."} + +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} + +MACRO {pp} {"Phys. Plasmas"} + +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} + +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} + +MACRO {prl} {"Phys. Rev. Lett."} + +MACRO {pr} {"Phys. Rev."} + +MACRO {physrev} {"Phys. Rev."} + +MACRO {pra} {"Phys. Rev. A"} + +MACRO {prb} {"Phys. Rev. B"} + +MACRO {prc} {"Phys. Rev. C"} + +MACRO {prd} {"Phys. Rev. D"} + +MACRO {pre} {"Phys. Rev. E"} + +MACRO {ps} {"Phys. Scripta"} + +MACRO {procrsl} {"Proc. Roy. Soc. London"} + +MACRO {rmp} {"Rev. Mod. Phys."} + +MACRO {rsi} {"Rev. Sci. Inst."} + +MACRO {science} {"Science"} + +MACRO {sciam} {"Sci. Am."} + +MACRO {sam} {"Stud. Appl. Math."} + +MACRO {sjpp} {"Sov. J. Plasma Phys."} + +MACRO {spd} {"Sov. Phys.--Doklady"} + +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} + +MACRO {spu} {"Sov. Phys.--Uspeki"} + +MACRO {st} {"Sky and Telesc."} + + % End module: physjour.mbs + + + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{geojour.mbs}[1999/11/16 2.0g (PWD)] +MACRO {aisr} {"Adv. Space Res."} +MACRO {ag} {"Ann. Geophys."} +MACRO {anigeo} {"Ann. Geofis."} +MACRO {angl} {"Ann. Glaciol."} +MACRO {andmet} {"Ann. d. Meteor."} +MACRO {andgeo} {"Ann. d. Geophys."} +MACRO {andphy} {"Ann. Phys.-Paris"} +MACRO {afmgb} {"Arch. Meteor. Geophys. Bioklimatol."} +MACRO {atph} {"Atm\'osphera"} +MACRO {aao} {"Atmos. Ocean"} +MACRO {ass}{"Astrophys. Space Sci."} +MACRO {atenv} {"Atmos. Environ."} +MACRO {aujag} {"Aust. J. Agr. Res."} +MACRO {aumet} {"Aust. Meteorol. Mag."} +MACRO {blmet} {"Bound.-Lay. Meteorol."} +MACRO {bams} {"Bull. Amer. Meteorol. Soc."} +MACRO {cch} {"Clim. Change"} +MACRO {cdyn} {"Clim. Dynam."} +MACRO {cbul} {"Climatol. Bull."} +MACRO {cap} {"Contrib. Atmos. Phys."} +MACRO {dsr} {"Deep-Sea Res."} +MACRO {dhz} {"Dtsch. Hydrogr. Z."} +MACRO {dao} {"Dynam. Atmos. Oceans"} +MACRO {eco} {"Ecology"} +MACRO {empl}{"Earth, Moon and Planets"} +MACRO {envres} {"Environ. Res."} +MACRO {envst} {"Environ. Sci. Technol."} +MACRO {ecms} {"Estuarine Coastal Mar. Sci."} +MACRO {expa}{"Exper. Astron."} +MACRO {geoint} {"Geofis. Int."} +MACRO {geopub} {"Geofys. Publ."} +MACRO {geogeo} {"Geol. Geofiz."} +MACRO {gafd} {"Geophys. Astrophys. Fluid Dyn."} +MACRO {gfd} {"Geophys. Fluid Dyn."} +MACRO {geomag} {"Geophys. Mag."} +MACRO {georl} {"Geophys. Res. Lett."} +MACRO {grl} {"Geophys. Res. Lett."} +MACRO {ga} {"Geophysica"} +MACRO {gs} {"Geophysics"} +MACRO {ieeetap} {"IEEE Trans. Antenn. Propag."} +MACRO {ijawp} {"Int. J. Air Water Pollut."} +MACRO {ijc} {"Int. J. Climatol."} +MACRO {ijrs} {"Int. J. Remote Sens."} +MACRO {jam} {"J. Appl. Meteorol."} +MACRO {jaot} {"J. Atmos. Ocean. Technol."} +MACRO {jatp} {"J. Atmos. Terr. Phys."} +MACRO {jce} {"J. Climate"} +MACRO {jcam} {"J. Climate Appl. Meteor."} +MACRO {jcm} {"J. Climate Meteor."} +MACRO {jcy} {"J. Climatol."} +MACRO {jgr} {"J. Geophys. Res."} +MACRO {jga} {"J. Glaciol."} +MACRO {jh} {"J. Hydrol."} +MACRO {jmr} {"J. Mar. Res."} +MACRO {jmrj} {"J. Meteor. Res. Japan"} +MACRO {jm} {"J. Meteor."} +MACRO {jpo} {"J. Phys. Oceanogr."} +MACRO {jra} {"J. Rech. Atmos."} +MACRO {jaes} {"J. Aeronaut. Sci."} +MACRO {japca} {"J. Air Pollut. Control Assoc."} +MACRO {jas} {"J. Atmos. Sci."} +MACRO {jmts} {"J. Mar. Technol. Soc."} +MACRO {jmsj} {"J. Meteorol. Soc. Japan"} +MACRO {josj} {"J. Oceanogr. Soc. Japan"} +MACRO {jwm} {"J. Wea. Mod."} +MACRO {lao} {"Limnol. Oceanogr."} +MACRO {mwl} {"Mar. Wea. Log"} +MACRO {mau} {"Mausam"} +MACRO {meteor} {"``Meteor'' Forschungsergeb."} +MACRO {map} {"Meteorol. Atmos. Phys."} +MACRO {metmag} {"Meteor. Mag."} +MACRO {metmon} {"Meteor. Monogr."} +MACRO {metrun} {"Meteor. Rundsch."} +MACRO {metzeit} {"Meteor. Z."} +MACRO {metgid} {"Meteor. Gidrol."} +MACRO {mwr} {"Mon. Weather Rev."} +MACRO {nwd} {"Natl. Weather Dig."} +MACRO {nzjmfr} {"New Zeal. J. Mar. Freshwater Res."} +MACRO {npg} {"Nonlin. Proc. Geophys."} +MACRO {om} {"Oceanogr. Meteorol."} +MACRO {ocac} {"Oceanol. Acta"} +MACRO {oceanus} {"Oceanus"} +MACRO {paleoc} {"Paleoceanography"} +MACRO {pce} {"Phys. Chem. Earth"} +MACRO {pmg} {"Pap. Meteor. Geophys."} +MACRO {ppom} {"Pap. Phys. Oceanogr. Meteor."} +MACRO {physzeit} {"Phys. Z."} +MACRO {pps} {"Planet. Space Sci."} +MACRO {pss} {"Planet. Space Sci."} +MACRO {pag} {"Pure Appl. Geophys."} +MACRO {qjrms} {"Quart. J. Roy. Meteorol. Soc."} +MACRO {quatres} {"Quat. Res."} +MACRO {rsci} {"Radio Sci."} +MACRO {rse} {"Remote Sens. Environ."} +MACRO {rgeo} {"Rev. Geophys."} +MACRO {rgsp} {"Rev. Geophys. Space Phys."} +MACRO {rdgeo} {"Rev. Geofis."} +MACRO {revmeta} {"Rev. Meteorol."} +MACRO {sgp}{"Surveys in Geophys."} +MACRO {sp} {"Solar Phys."} +MACRO {ssr} {"Space Sci. Rev."} +MACRO {tellus} {"Tellus"} +MACRO {tac} {"Theor. Appl. Climatol."} +MACRO {tagu} {"Trans. Am. Geophys. Union (EOS)"} +MACRO {wrr} {"Water Resour. Res."} +MACRO {weather} {"Weather"} +MACRO {wafc} {"Weather Forecast."} +MACRO {ww} {"Weatherwise"} +MACRO {wmob} {"WMO Bull."} +MACRO {zeitmet} {"Z. Meteorol."} + % End module: geojour.mbs + + + %------------------------------------------------------------------- + + % Begin module: + + + % \ProvidesFile{photjour.mbs}[1999/02/24 2.0b (PWD)] + +MACRO {appopt} {"Appl. Opt."} + +MACRO {bell} {"Bell Syst. Tech. J."} + +MACRO {ell} {"Electron. Lett."} + +MACRO {jasp} {"J. Appl. Spectr."} + +MACRO {jqe} {"IEEE J. Quantum Electron."} + +MACRO {jlwt} {"J. Lightwave Technol."} + +MACRO {jmo} {"J. Mod. Opt."} + +MACRO {josa} {"J. Opt. Soc. America"} + +MACRO {josaa} {"J. Opt. Soc. Amer.~A"} + +MACRO {josab} {"J. Opt. Soc. Amer.~B"} + +MACRO {jdp} {"J. Phys. (Paris)"} + +MACRO {oc} {"Opt. Commun."} + +MACRO {ol} {"Opt. Lett."} + +MACRO {phtl} {"IEEE Photon. Technol. Lett."} + +MACRO {pspie} {"Proc. Soc. Photo-Opt. Instrum. Eng."} + +MACRO {sse} {"Solid-State Electron."} + +MACRO {sjot} {"Sov. J. Opt. Technol."} + +MACRO {sjqe} {"Sov. J. Quantum Electron."} + +MACRO {sleb} {"Sov. Phys.--Leb. Inst. Rep."} + +MACRO {stph} {"Sov. Phys.--Techn. Phys."} + +MACRO {stphl} {"Sov. Techn. Phys. Lett."} + +MACRO {vr} {"Vision Res."} + +MACRO {zph} {"Z. f. Physik"} + +MACRO {zphb} {"Z. f. Physik~B"} + +MACRO {zphd} {"Z. f. Physik~D"} + +MACRO {CLEO} {"CLEO"} + +MACRO {ASSL} {"Adv. Sol.-State Lasers"} + +MACRO {OSA} {"OSA"} + + % End module: photjour.mbs + + + +%% Copyright 1994-2000 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + "\bibinfo{" swap$ * "}{" * swap$ * "}" * + } + if$ + } + if$ +} +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} +FUNCTION {format.url} +{ url empty$ + { "" } + { "\urlprefix\url{" url * "}" * } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + nameptr #1 > + { "{f.}" format.name$ duplicate$ empty$ 'skip$ + { tie.or.space.prefix bib.fname.font swap$ * } + if$ + s nameptr + "{vv~}{ll}" format.name$ bib.name.font * + s nameptr + "{jj}" format.name$ duplicate$ empty$ 'skip$ + { bib.fname.font ", " swap$ * } + if$ + } + { "{vv~}{ll}" format.name$ bib.name.font + s nameptr + "{f.}{, jj}" + format.name$ duplicate$ empty$ 'skip$ + { bib.fname.font ", " swap$ * } + if$ + } + if$ + * + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #2 + #10 + + #1 + = + numnames #2 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.}" format.name$ duplicate$ empty$ 'skip$ + { tie.or.space.prefix bib.fname.font swap$ * } + if$ + s nameptr + "{vv~}{ll}" format.name$ bib.name.font * + s nameptr + "{jj}" format.name$ duplicate$ empty$ 'skip$ + { bib.fname.font ", " swap$ * } + if$ + * + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + numnames #2 > + { "," * } + 'skip$ + if$ + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + + " " * bbl.etal emphasize * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names + duplicate$ empty$ 'skip$ + { collaboration "collaboration" bibinfo.check + duplicate$ empty$ 'skip$ + { " (" swap$ * ")" * } + if$ + * + } + if$ +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.isbn} +{ isbn "isbn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISBN " swap$ * + } + if$ +} + +FUNCTION {format.issn} +{ issn "issn" bibinfo.check + duplicate$ empty$ 'skip$ + { + "ISSN " swap$ * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + duplicate$ empty$ + { skip$ } + { "t" change.case$ } + if$ + "title" bibinfo.check +} + +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + nameptr #2 + #10 + + #1 + = + numnames #2 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + cite.name.font + " " * bbl.etal emphasize * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + ", " swap$ * +} +FUNCTION {format.date.misc} +{ + format.date "year" output.check +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {first.page} +{ 't := + "" + { t empty$ not t #1 #1 substring$ "-" = not and } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + while$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + first.page + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'skip$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ + numpages empty$ 'skip$ + { bbl.eidpp numpages tie.or.space.prefix + "numpages" bibinfo.check * * + " (" swap$ * ")" * * + } + if$ + } + if$ * +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + { "" } + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + bbl.edby + " " * swap$ * + swap$ + "," * + " " * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + ")" * + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { + "" + journal + duplicate$ empty$ + { pop$ pop$ } { + "journal" bibinfo.check + * "journal" output.check + add.blank + } if$ + format.vol.num.pages output + } + { format.article.crossref output.nonnull + } + if$ + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ + format.issn output + format.note output + journal empty$ volume empty$ or { + format.eprint output + } {} if$ + format.url output + fin.entry +} +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.number.series output + format.publisher.address output + } + { + format.book.crossref output.nonnull + } + if$ + format.edition output + format.isbn output + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.isbn output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { + format.publisher.address output + format.bvolume output + format.chapter.pages "chapter and pages" output.check + format.number.series output + } + { + format.chapter.pages "chapter and pages" output.check + format.book.crossref output.nonnull + } + if$ + format.edition output + crossref missing$ + { format.isbn output } + 'skip$ + if$ + format.pages "pages" output.check + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.publisher.address output + format.bvolume output + format.number.series output + format.chapter.pages output + format.edition output + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.pages "pages" output.check + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.bvolume output + format.number.series output + format.pages output + format.isbn output + format.issn output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.btitle + "title" output.check + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date.misc + date.block + format.title output + howpublished "howpublished" bibinfo.check output + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.btitle + "title" output.check + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.btitle + "title" output.check + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.note "note" output.check + format.eprint output + format.url output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + cite.name.font + " " * bbl.etal emphasize * + "others" 't := + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal emphasize * + "others" 't := + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ + t "others" = + 'skip$ + { cite.name.font } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + nameptr #2 + #10 + + #1 + = + numnames #2 + #10 + + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} + +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := + mciteplustail.adj.sort.key +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := + mciteplustail.adj.sort.key +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{apsrmpM.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname bibnamefont\endcsname\relax" + write$ newline$ + " \def\bibnamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname bibfnamefont\endcsname\relax" + write$ newline$ + " \def\bibfnamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname citenamefont\endcsname\relax" + write$ newline$ + " \def\citenamefont#1{#1}\fi" + write$ newline$ + "\expandafter\ifx\csname url\endcsname\relax" + write$ newline$ + " \def\url#1{\texttt{#1}}\fi" + write$ newline$ + "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi" + write$ newline$ + "\providecommand{\bibinfo}[2]{#2}" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{mcitethebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `apsrmpM.bst'. diff --git a/macros/latex/contrib/mciteplus/changelog.txt b/macros/latex/contrib/mciteplus/changelog.txt new file mode 100644 index 0000000000..53a6ef6e8e --- /dev/null +++ b/macros/latex/contrib/mciteplus/changelog.txt @@ -0,0 +1,30 @@ + +Changelog history of the mciteplus package + 2013/09/13 + by Michael Shell + http://www.michaelshell.org/ + + +******* + 2008/01/15 V1.0 initial release + + +******* + 2008/09/30 V1.1 changes: + + 1) Corrected error message when a tail is declared again under a different + head. + + 2) Updated IEEEtranM.bst and IEEEtranMN.bst to IEEEtran.bst v1.13 code base. + + +******* + 2013/09/13 V1.2 changes: + + + 1) Add support for \citenum of natbib version 8.0 and later. + Thanks to Joseph Wright for reporting this. + + 2) Corrected bug with cross-referenced entries with backref.sty. + Thanks to Martin Böttcher for reporting this problem. + diff --git a/macros/latex/contrib/mciteplus/mciteplus.sty b/macros/latex/contrib/mciteplus/mciteplus.sty new file mode 100644 index 0000000000..e02af40757 --- /dev/null +++ b/macros/latex/contrib/mciteplus/mciteplus.sty @@ -0,0 +1,1351 @@ +%% mciteplus.sty +%% enhanced mcite +%% Version 1.2, 2013/09/13 +%% +%% Development beta test version, not for public release. +%% +%% Copyright (c) 2008-2013 Michael Shell +%% Support site: +%% http://www.michaelshell.org/tex/mciteplus/ +%% +%%************************************************************************* +%% Legal Notice: +%% This code is offered as-is without any warranty either expressed or +%% implied; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE! +%% User assumes all risk. +%% In no event shall any contributor to this code be liable for any damages +%% or losses, including, but not limited to, incidental, consequential, or +%% any other damages, resulting from the use or misuse of any information +%% contained here. +%% +%% All comments are the opinions of their respective authors. +%% +%% This work is distributed under the LaTeX Project Public License (LPPL) +%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, +%% distributed and modified. A copy of the LPPL, version 1.3, is included +%% in the base LaTeX documentation of all distributions of LaTeX released +%% 2003/12/01 or later. +%% Retain all contribution notices and credits. +%% ** Modified files should be clearly indicated as such, including ** +%% ** renaming them and changing author support contact information. ** +%%********************************************************************** + + + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mciteplus}[2013/09/13 v1.2 enhanced mcite] + +% package option conditionals +\newif\if@OPTIONmcitenohooks\@OPTIONmcitenohooksfalse +\newif\if@OPTIONmcitechapterbibrootbib\@OPTIONmcitechapterbibrootbibfalse +\newif\if@OPTIONmcitedebug\@OPTIONmcitedebugfalse + + +\DeclareOption{debug}{\global\@OPTIONmcitedebugtrue} +\DeclareOption{nohooks}{\global\@OPTIONmcitenohookstrue} +% use ds@ for chapterbibrootbib to keep option local +\def\ds@chapterbibrootbib{\global\@OPTIONmcitechapterbibrootbibtrue} + +\ProcessOptions + +% first entry in citation or bibliography flag +\newif\if@mcitefirstentry +% first head entry in citation or bibliography flag +\newif\if@mcitefirstheadentry +% entry using star (is a tail) flag +\newif\if@mcitestarentry +% head declared more than once flag +\newif\if@mciteheadredeclared +% sublist block is open flag +\newif\if@mcitesublistopen +% bst indicates that end punctuation would normally be used +\newif\ifmciteBstWouldAddEndPunct + + +% flag to indicate that the label widths have changed +% and that LaTeX has to be rerun +\newif\if@mciteLaTeXrerun\@mciteLaTeXrerunfalse + +% flag to indicate the use of the first optional argument of a macro +\newif\ifmciteMacroOptArgI\mciteMacroOptArgIfalse +% flag to indicate the use of the first optional argument of a macro (local, non user, use) +\newif\if@mciteLocalMacroOptArgI\@mciteLocalMacroOptArgIfalse +% flag to indicate the use of the second optional argument of a macro +\newif\ifmciteMacroOptArgII\mciteMacroOptArgIIfalse +% flag to indicate the use of the star form of a macro +\newif\ifmciteMacroStarForm\mciteMacroStarFormfalse +% flag to indicate the use of the star form of the \cite forwarding macro +\newif\ifmciteCiteStarFwdArg\mciteCiteStarFwdArgfalse +% flag to indicate the use of the sec ID argument for the \cite forwarding macro +\newif\if@mciteCiteSecIDArg\@mciteCiteSecIDArgfalse + +% flag to indicate the use of the first optional argument of a bibitem +\newif\ifmciteBibitemOptArgI\mciteBibitemOptArgIfalse +% flag to indicate the use of the first optional argument of the current head bibitem +\newif\ifmciteCurheadBibitemOptArgI\mciteCurheadBibitemOptArgIfalse + + +% temporary token list +\newtoks\@mcitetmptoksA +% macro to add (unexpanded) to token list +\def\@mciteAppendToTmpToksA#1{\@mcitetmptoksA=\expandafter{\the\@mcitetmptoksA#1}} + + +% temporary dimen registers +\newdimen\@mcitetmpdima +\newdimen\@mcitetmpdimb + +% temporary count registers +\newcount\@mcitetmpcnta +\newcount\@mcitetmpcntb + +% count of entries +\newcounter{mcitebibitemcount} +\setcounter{mcitebibitemcount}{0} +% count of sub items +\newcounter{mcitesubitemcount} + + +% the default entry punctuation and separator +\providecommand{\mcitedefaultmidpunct}{;\space} +\providecommand{\mcitedefaultendpunct}{.} +\providecommand{\mcitedefaultseppunct}{\relax} +% the default sublist label, begin and end macros +\providecommand{\mcitedefaultsublistlabel}{\alph{mcitesubitemcount})\space} +\providecommand{\mcitedefaultsublistbegin}{\relax} +\providecommand{\mcitedefaultsublistend}{\relax} +% the default max width forms +\providecommand{\mcitedefaultmaxwidthbibitemform}{\arabic{mcitebibitemcount}} +\providecommand{\mcitedefaultmaxwidthbibitemforminit}{\mciteorgbibsamplelabel} +\providecommand{\mcitedefaultmaxwidthsubitemform}{\alph{mcitesubitemcount})} +\providecommand{\mcitedefaultmaxwidthsubitemforminit}{a)} + +% sample label which is forwarded to \thebibliography +\def\mcitebibsamplelabel{\rule{\mcitemaxwidthbibitem sp}{0.2pt}} + + + +% Aux and track handles +% +% aux used by \mcite +\def\mciteauxout{\@auxout} +% aux used within \mcitethebibliography +\def\mcitebibauxout{\@mainaux} +% current auxout in use +\def\@mcitecurauxout{\mciteauxout} + +% This is the unique ID string used to track multiple bibliographies. +\def\mcitetrackID{main} +% for \mcitethebibliography +\def\mcitebibtrackID{main} +% current Track ID in use +\def\@mcitecurtrackID{\mcitetrackID} + + +% macros for letter code and string tests +\def\@mciteMacrod{d} +\def\@mciteMacron{n} +\def\@mciteMacros{s} +\def\@mciteMacrob{b} +\def\@mciteMacrof{f} +\def\@mciteMacroh{h} +\def\@mciteMacrobibitem{bibitem} +\def\@mciteMacrosubitem{subitem} + + + +% sets the punctuation bst hooks +\long\def\mciteSetBstMidEndSepPunct#1#2#3{\long\def\mcitebstmidpunct{#1}\relax + \long\def\mcitebstendpunct{#2}\long\def\mcitebstseppunct{#3}} +% sets the actual punctuation used +\long\def\mciteSetMidEndSepPunct#1#2#3{\long\def\mcitemidpunct{#1}\relax + \long\def\mciteendpunct{#2}\long\def\mciteseppunct{#3}} + +% sets the sublabel bst hooks +\long\def\mciteSetBstSublistLabelBeginEnd#1#2#3{\long\def\mcitebstsublistlabel{#1}\relax +\long\def\mcitebstsublistbegin{#2}\long\def\mcitebstsublistend{#3}} +% sets the actual sublabel used +\long\def\mciteSetSublistLabelBeginEnd#1#2#3{\long\def\mcitesublistlabel{#1}\relax +\long\def\mcitesublistbegin{#2}\long\def\mcitesublistend{#3}} + + + + +% sublist mode flags, b and first forms should be set to false unless \@mcitesublistmode is also true +\newif\if@mcitesublistmode\@mcitesublistmodefalse +\newif\if@mcitesublistmodeb\@mcitesublistmodebfalse +\newif\if@mcitesublistmodef\@mcitesublistmodeffalse +\newif\if@mcitesublistmodeh\@mcitesublistmodehfalse +% reset entry counter flag +\newif\ifmciteResetBibitemCount\mciteResetBibitemCounttrue +% error on unknown entries +\newif\ifmciteErrorOnUnknown\mciteErrorOnUnknowntrue + + +% BST can request a sublist mode using \mciteSetBstSublistMode, but user requests can override it: +% d = default, use current settings +% n = no sublist +% s = sublist +% b = sublistb +% f = sublistfirst +% h = sublistfirst, including single heads +% note that the changes here are local and will not be remembered outside of the \mcitethebibliography environment +\def\mciteSetBstSublistMode#1{\edef\@mcitetemp{#1}\relax +% only make changes if the user mode allows +\ifx\@mcitesublistmode\@mciteMacrod\relax + \ifx\@mcitetemp\@mciteMacrod + \def\@mcitebstsublistmode{d}\else + \ifx\@mcitetemp\@mciteMacron + \def\@mcitebstsublistmode{n}\@mcitesublistmodefalse\@mcitesublistmodebfalse\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacros + \def\@mcitebstsublistmode{s}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacrob + \def\@mcitebstsublistmode{b}\@mcitesublistmodetrue\@mcitesublistmodebtrue\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacrof + \def\@mcitebstsublistmode{f}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeftrue\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacroh + \def\@mcitebstsublistmode{h}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeftrue\@mcitesublistmodehtrue\else + \PackageError{mciteplus}{Unknown mode `#1' in argument to \protect\mciteSetBstSublistMode}% + {Only `d', `n', `s', `b', `f' and `h' are valid.}\relax + \fi + \fi + \fi + \fi + \fi + \fi +\fi} + + +% User can specify a sublist mode: +% d = default, use current settings, allow BST to choose +% n = no sublist +% s = sublist +% b = sublistb +% f = sublistfirst +% h = sublistfirst, including single heads +\def\mciteSetSublistMode#1{\edef\@mcitetemp{#1}\relax +\ifx\@mcitetemp\@mciteMacrod + \def\@mcitesublistmode{d}\else + \ifx\@mcitetemp\@mciteMacron + \def\@mcitesublistmode{n}\@mcitesublistmodefalse\@mcitesublistmodebfalse\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacros + \def\@mcitesublistmode{s}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacrob + \def\@mcitesublistmode{b}\@mcitesublistmodetrue\@mcitesublistmodebtrue\@mcitesublistmodeffalse\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacrof + \def\@mcitesublistmode{f}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeftrue\@mcitesublistmodehfalse\else + \ifx\@mcitetemp\@mciteMacroh + \def\@mcitesublistmode{h}\@mcitesublistmodetrue\@mcitesublistmodebfalse\@mcitesublistmodeftrue\@mcitesublistmodehtrue\else + \PackageError{mciteplus}{Unknown mode `#1' in argument to \protect\mciteSetSublistMode}% + {Only `d', `n', `s', `b', `f' and `h' are valid.}\relax + \fi + \fi + \fi + \fi + \fi +\fi} + + + + +% checks to see if valid type in \@mciteformtypeArg (bibitem or subitem), errors if not +% #1 is name of calling macro +\def\@mcitecheckformtypeerror#1{\relax +\ifx\@mciteformtypeArg\@mciteMacrobibitem\relax +\else + \ifx\@mciteformtypeArg\@mciteMacrosubitem\relax + \else + \PackageError{mciteplus}{Unknown form type `\@mciteformtypeArg' in argument to \protect#1}% + {Only `bibitem' and `subitem' are valid.}\relax + \fi +\fi} + + +% sets the bst max width forms +% usage: \mciteSetBstMaxWidthForm[init]{type}{form} +% where type is bibitem or subitem +% if [init] not given, uses \mcitedefaultmaxwidth[TYPE]forminit +\def\mciteSetBstMaxWidthForm{\@ifnextchar[{\@mciteLocalMacroOptArgItrue\@mciteSetBstMaxWidthForm}{\@mciteLocalMacroOptArgIfalse\@mciteSetBstMaxWidthForm[\relax]}} +\def\@mciteSetBstMaxWidthForm[#1]#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteSetBstMaxWidthForm}\relax +\expandafter\def\csname mcitebstmaxwidth\@mciteformtypeArg form\endcsname{#3}\relax +\if@mciteLocalMacroOptArgI +\expandafter\def\csname mcitebstmaxwidth\@mciteformtypeArg forminit\endcsname{#1}\relax +\else +\expandafter\expandafter\expandafter\def\expandafter\expandafter\csname mcitebstmaxwidth\@mciteformtypeArg forminit\endcsname\expandafter{\csname mcitedefaultmaxwidth\@mciteformtypeArg forminit\endcsname}\relax +\fi} + +% sets the max width forms +% usage: \mciteSetMaxWidthForm[init]{type}{form} +% where type is bibitem or subitem +% if [init] not given, uses \mcitebstmaxwidth[TYPE]forminit +\def\mciteSetMaxWidthForm{\@ifnextchar[{\@mciteLocalMacroOptArgItrue\@mciteSetMaxWidthForm}{\@mciteLocalMacroOptArgIfalse\@mciteSetMaxWidthForm[\relax]}} +\def\@mciteSetMaxWidthForm[#1]#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteSetMaxWidthForm}\relax +\expandafter\def\csname mcitemaxwidth\@mciteformtypeArg form\endcsname{#3}\relax +\if@mciteLocalMacroOptArgI +\expandafter\def\csname mcitemaxwidth\@mciteformtypeArg forminit\endcsname{#1}\relax +\else +\expandafter\expandafter\expandafter\def\expandafter\expandafter\csname mcitemaxwidth\@mciteformtypeArg forminit\endcsname\expandafter{\csname mcitebstmaxwidth\@mciteformtypeArg forminit\endcsname}\relax +\fi} + + + + +% initialize punctuation, sublist and maxwidth hooks +% +% punctuation controls +% default is to hook into the bst +\mciteSetMidEndSepPunct{\mcitebstmidpunct}{\mcitebstendpunct}{\mcitebstseppunct} +% the default bst setting is to use the package defaults +\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}{\mcitedefaultendpunct}{\mcitedefaultseppunct} +% +% sublist controls +% default sublist mode is to use the defaults +\mciteSetBstSublistMode{d} +\mciteSetSublistMode{d} +% the default sublabel bst setting is to use the package defaults +\mciteSetBstSublistLabelBeginEnd{\mcitedefaultsublistlabel}{\mcitedefaultsublistbegin}{\mcitedefaultsublistend} +% default sublabel setting is to hook into the bst settings +\mciteSetSublistLabelBeginEnd{\mcitebstsublistlabel}{\mcitebstsublistbegin}{\mcitebstsublistend} +% +% max width form controls +% the default max width form bst settings is to use the package defaults +\mciteSetBstMaxWidthForm[\mcitedefaultmaxwidthbibitemforminit]{bibitem}{\mcitedefaultmaxwidthbibitemform} +\mciteSetBstMaxWidthForm[\mcitedefaultmaxwidthsubitemforminit]{subitem}{\mcitedefaultmaxwidthsubitemform} +% the default max width form settings is to hook into the bst settings +\mciteSetMaxWidthForm[\mcitebstmaxwidthbibitemforminit]{bibitem}{\mcitebstmaxwidthbibitemform} +\mciteSetMaxWidthForm[\mcitebstmaxwidthsubitemforminit]{subitem}{\mcitebstmaxwidthsubitemform} + + + + +% Defines a macro to track the status of entries. An example showing the +% format is \@mciteEntryStatus@1@Smith98 +% where the 1 is the tracking ID, and Smith98 is the cite key. +% Possible values for this status macro are: +% 0 = not yet determined +% 1 = tail (tail entry following a head entry) +% 2 = head (head entry followed by one or more tails) +% 3 = single (head entry not followed by any tails) +% usage: \@mciteSetEntryStatus{track ID}{cite key}{status} +\def\@mciteSetEntryStatus#1#2#3{\expandafter\xdef\csname @mciteEntryStatus@#1@#2\endcsname{#3}\relax +%\typeout{SetEntryStatus: Track:`#1' Key:`#2' Status:`#3'}\relax +} +% used to obtain status of a given cite key +% usage: \@mciteGetEntryStatus*{track ID}{cite key}{status out} +% star form: no error checking +\def\@mciteGetEntryStatus{\@ifstar{\@mciteGetEntryStatusStar}{\@mciteGetEntryStatusNoStar}} + +\def\@mciteGetEntryStatusStar#1#2#3{\expandafter\let\expandafter#3\csname @mciteEntryStatus@#1@#2\endcsname} + +\def\@mciteGetEntryStatusNoStar#1#2#3{\expandafter\let\expandafter#3\csname @mciteEntryStatus@#1@#2\endcsname\relax +\ifx#3\relax +\ifmciteErrorOnUnknown +\PackageError{mciteplus}{Entry Status for cite key `#2' under tracking ID `#1' is undefined, treating it as a head entry}{I don't have a +record of the head/tail status of this citation. Possible reasons include the use +of a cite command that is not mciteplus aware, the use of `\string\nocite{*}', or a problem with the +tracking ID and/or aux file handles. `\string\mciteErrorOnUnknownfalse' can be used to disable this error message.}\relax +\fi +\expandafter\def#3{3}\relax +\fi} + + +% set head key for given tail +% usage: \@mciteSetHeadofTail{track ID}{tail cite key}{head cite key} +\def\@mciteSetHeadofTail#1#2#3{\expandafter\xdef\csname @mciteHeadofTail@#1@#2\endcsname{#3}} +% get head key for given tail +% usage: \@mciteGetHeadofTail{track ID}{tail cite key}{head key out} +% star form: no error checking +\def\@mciteGetHeadofTail{\@ifstar{\@mciteGetHeadofTailStar}{\@mciteGetHeadofTailNoStar}} + +\def\@mciteGetHeadofTailStar#1#2#3{\expandafter\let\expandafter#3\csname @mciteHeadofTail@#1@#2\endcsname} + +\def\@mciteGetHeadofTailNoStar#1#2#3{\expandafter\let\expandafter#3\csname @mciteHeadofTail@#1@#2\endcsname\relax +\ifx#3\relax +\PackageError{mciteplus}{Head for tail cite key `#2' under tracking ID `#1' is undefined}{I don't have a +record of the head key of this citation.}\relax +\fi} + + +% for debug status messages +% converts given status number to word description +\def\@mciteStatusNumToWord#1{\expandafter\ifcase#1\relax +Unknown\or Tail\or Head with tails\or Head without tails\else Invalid (#1)\fi} +% form that makes no distinction between status 2 or 3. Used with \cite debug as +% head status is not finalized till after the entry group +\def\@mciteStatusNumToWordH#1{\expandafter\ifcase#1\relax +Unknown\or Tail\or Head\or Head\else Invalid (#1)\fi} + + + + +% usage:\mciteSetMaxWidth{track ID}{type}{width} +% Defines a macro to track the max width of a given label type. +% An example showing the format is \@mciteMaxWidthStore@main@bibitem +% which is set globally +% we don't use @ in the macro name as this cmd appears in the aux +\def\mciteSetMaxWidth#1#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteSetMaxWidth}\relax +\expandafter\xdef\csname @mciteMaxWidthStore@#1@\@mciteformtypeArg\endcsname{#3}} +% +% usage:\mciteGetMaxWidth{track ID}{type}{out macro} +% reads the stored max width of the given label type into the out macro +% which is set globally +\def\mciteGetMaxWidth#1#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteGetMaxWidth}\relax +\expandafter\global\expandafter\let\expandafter#3\csname @mciteMaxWidthStore@#1@\@mciteformtypeArg\endcsname} + +% usage:\mciteSetMaxCount{track ID}{type}{count} +% Defines a macro to track the max count of a given label type. +% An example showing the format is \@mciteMaxCountStore@main@bibitem +% which is set globally +% we don't use @ in the macro name as this cmd appears in the aux +\def\mciteSetMaxCount#1#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteSetMaxCount}\relax +\expandafter\xdef\csname @mciteMaxCountStore@#1@\@mciteformtypeArg\endcsname{#3}} +% +% usage:\mciteGetMaxCount{track ID}{type}{out macro} +% reads the stored max count of the given label type into the out macro +% which is set globally +\def\mciteGetMaxCount#1#2#3{\edef\@mciteformtypeArg{#2}\relax +\@mcitecheckformtypeerror{\mciteGetMaxCount}\relax +\expandafter\global\expandafter\let\expandafter#3\csname @mciteMaxCountStore@#1@\@mciteformtypeArg\endcsname} + + +% sets \mcitemaxcountbibitem and \mcitemaxcountsubitem via \mciteGetMaxCount globally +% sets them to zero if \mciteGetMaxCount returns \relax +% clears \@mcitecorrectmaxcountbibitem and \@mcitecorrectmaxcountsubitem +% uses \@mcitecurtrackID +\def\@mciteMaxCountInitialize{\mciteGetMaxCount{\@mcitecurtrackID}{bibitem}{\mcitemaxcountbibitem}\relax +\ifx\mcitemaxcountbibitem\relax\gdef\mcitemaxcountbibitem{0}\fi +\mciteGetMaxCount{\@mcitecurtrackID}{subitem}{\mcitemaxcountsubitem}\relax +\ifx\mcitemaxcountsubitem\relax\gdef\mcitemaxcountsubitem{0}\fi +\global\let\mcitemaxcountbibitem\mcitemaxcountbibitem +\global\let\mcitemaxcountsubitem\mcitemaxcountsubitem +\xdef\@mcitecorrectmaxcountbibitem{0}\relax +\xdef\@mcitecorrectmaxcountsubitem{0}\relax} +% +% usage: \@mciteMaxCountUpdate +% updates \@mcitecorrectmaxcountsubitem +% no need for \@mcitecorrectmaxcountbibitem as this is carried by the counter itself +\def\@mciteMaxCountUpdate{\relax +\ifnum\@mcitecorrectmaxcountsubitem<\arabic{mcitesubitemcount}\relax + \xdef\@mcitecorrectmaxcountsubitem{\arabic{mcitesubitemcount}}\relax +\fi} +% +% usage: \@mciteMaxCountAuxWrite uses \@mcitecurauxout and \@mcitecurtrackID +% writes \mciteSetMaxCount{track ID}{type}{count} to \@mcitecurauxout +% and warns if correct values do not match \mcitemaxcountbibitem, \mcitemaxcountsubitem +\def\@mciteMaxCountAuxWrite{\relax +\if@filesw + \immediate\write\@mcitecurauxout{\string\mciteSetMaxCount{\@mcitecurtrackID}{bibitem}{\arabic{mcitebibitemcount}}}\relax + \immediate\write\@mcitecurauxout{\string\mciteSetMaxCount{\@mcitecurtrackID}{subitem}{\@mcitecorrectmaxcountsubitem}}\relax +\fi +\ifnum\mcitemaxcountbibitem=\arabic{mcitebibitemcount}\relax + \ifnum\mcitemaxcountsubitem=\@mcitecorrectmaxcountsubitem\relax\else + \@latex@warning@no@line{Mciteplus max count has changed}\global\@mciteLaTeXreruntrue + \fi +\else + \@latex@warning@no@line{Mciteplus max count has changed}\global\@mciteLaTeXreruntrue +\fi} + + +% usage: \@mciteMaxWidthInitialize{type} +% sets \mcitemaxwidth[TYPE] via \GetMaxWidth globally +% if \GetMaxWidth returns \relax, sets them to the width (without sp units at end) of \mcitebstmaxwidth[TYPE]forminit +% as evaluated when bibitem and subitem counters are both = 1 +% clears \@mcitecorrectmaxwidth[TYPE] globally to 0 +% uses \@mcitecurtrackID +\def\@mciteMaxWidthInitialize#1{\edef\@mcitemaxwidthinitializetypeArg{#1}\relax +\expandafter\mciteGetMaxWidth\expandafter{\expandafter\@mcitecurtrackID\expandafter}\expandafter{\expandafter\@mcitemaxwidthinitializetypeArg\expandafter}\expandafter{\csname mcitemaxwidth#1\endcsname}\relax +\expandafter\ifx\csname mcitemaxwidth#1\endcsname\relax + \begingroup + % set counters to 1 locally + \csname c@mcitebibitemcount\endcsname 1\relax + \csname c@mcitesubitemcount\endcsname 1\relax + \settowidth{\@mcitetmpdima}{\csname mcitemaxwidth#1forminit\endcsname}\relax + \@mcitetmpcnta=\@mcitetmpdima\relax + \expandafter\xdef\csname mcitemaxwidth#1\endcsname{\the\@mcitetmpcnta}\relax + \endgroup +\fi +\expandafter\xdef\csname @mcitecorrectmaxwidth#1\endcsname{0}} +% +% usage: \@mciteMaxWidthUpdate{type} +% globally updates \@mcitecorrectmaxwidth[TYPE] based on \mcitemaxwidth[TYPE]form +\def\@mciteMaxWidthUpdate#1{\relax +\settowidth{\@mcitetmpdima}{\csname mcitemaxwidth#1form\endcsname}\relax +\@mcitetmpcnta=\@mcitetmpdima\relax +\@mcitetmpcntb=\csname @mcitecorrectmaxwidth#1\endcsname\relax +\ifnum\@mcitetmpcnta>\@mcitetmpcntb\relax + \expandafter\xdef\csname @mcitecorrectmaxwidth#1\endcsname{\the\@mcitetmpcnta}\relax +\fi} +% +% +% usage: \@mciteMaxWidthAuxWrite uses \@mcitecurauxout and \@mcitecurtrackID +% writes \mciteSetMaxWidth{track ID}{type}{correct width in sp} +% for both bibitem and subitem to \@mcitecurauxout +% and warns if correct values do not match \mcitemaxwidthbibitem, \mcitemaxwidthsubitem +\def\@mciteMaxWidthAuxWrite{\relax +\if@filesw + \immediate\write\@mcitecurauxout{\string\mciteSetMaxWidth{\@mcitecurtrackID}{bibitem}{\@mcitecorrectmaxwidthbibitem}}\relax + \immediate\write\@mcitecurauxout{\string\mciteSetMaxWidth{\@mcitecurtrackID}{subitem}{\@mcitecorrectmaxwidthsubitem}}\relax +\fi +\ifnum\mcitemaxwidthbibitem=\@mcitecorrectmaxwidthbibitem\relax + \ifnum\mcitemaxwidthsubitem=\@mcitecorrectmaxwidthsubitem\relax\else + \@latex@warning@no@line{Mciteplus max width has changed}\global\@mciteLaTeXreruntrue + \fi +\else + \@latex@warning@no@line{Mciteplus max width has changed}\global\@mciteLaTeXreruntrue +\fi} + + + + + +% empty \mciteheadlist in case someone trys to access it before a \cite +\def\mciteheadlist{} + +% default wrappers for \cite and \nocite, package hooks (e.g., multibbl) can change these later +\def\@mciteCiteWrapper{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgcite}} +\def\@mciteNociteWrapper{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgnocite}} + + +% \mcite was undocumented in mcite.sty. We don't need it and it will not work with +% some multibibliography packages. So, we'll not use them. +% mcite version of \cite +%\def\mcite{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgcite}} +% mcite version of \nocite +%\def\mnocite{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgnocite}} + + +% mciteplus \cite wrappers +% usage: \mciteCiteA*{aux out}{track ID}{prehandler}{posthandler}{fwd macro}*[opt1][opt2]{cite list} +% \mciteCiteB*{aux out}{track ID}{prehandler}{posthandler}{fwd macro}*[opt1][opt2]{sec ID}{cite list} +% B form is for \cite that use two arguments, such as that of multibbl.sty +% processes cite list and fowards arguments and list of heads to specified \cite macro +% star form means no default \mciteDoList processing +\DeclareRobustCommand{\mciteCiteA}{\@mciteCiteSecIDArgfalse\@mciteCiteAB} +\DeclareRobustCommand{\mciteCiteB}{\@mciteCiteSecIDArgtrue\@mciteCiteAB} + + +\def\@mciteCiteAB{\@ifstar{\mciteMacroStarFormtrue\@@mciteCiteAB}{\mciteMacroStarFormfalse\@@mciteCiteAB}} + +\def\@@mciteCiteAB#1#2#3#4#5{\def\mciteCiteAuxArg{#1}\def\mciteCiteTrackArg{#2}\def\mciteCitePrehandlerArg{#3}\relax + \def\mciteCitePosthandlerArg{#4}\relax\def\mciteCiteFwdArg{#5}\relax + \@ifstar{\mciteCiteStarFwdArgtrue\@@@mciteCiteAB}{\mciteCiteStarFwdArgfalse\@@@mciteCiteAB}} + +\def\@@@mciteCiteAB{\@ifnextchar[{\mciteMacroOptArgItrue\@@@@mciteCiteAB}% +{\mciteMacroOptArgIfalse\@@@@mciteCiteAB[\relax]}} + +\def\@@@@mciteCiteAB[#1]{\def\mciteCiteOptArgI{#1}\relax +\@ifnextchar[{\mciteMacroOptArgIItrue\@@@@@mciteCiteAB}% +{\mciteMacroOptArgIIfalse\@@@@@mciteCiteAB[\relax]}} + +\def\@@@@@mciteCiteAB[#1]{\def\mciteCiteOptArgII{#1}\relax +\if@mciteCiteSecIDArg +\def\@mciteNextMacroChain{\@@@@@mciteCiteB}\relax +\else +\let\mciteCiteSecIDArg\relax +\def\@mciteNextMacroChain{\@@@@@@mciteCiteAB}\relax +\fi +\@mciteNextMacroChain} + + +\def\@@@@@mciteCiteB#1{\def\mciteCiteSecIDArg{#1}\@@@@@@mciteCiteAB} + +\def\@@@@@@mciteCiteAB#1{\def\mciteCiteListArg{#1}\relax +\edef\mciteFwdCiteListArg{}\relax +% execute the user's pre-handler code +\mciteCitePrehandlerArg\relax +\ifmciteMacroStarForm +% star form means no mcite default processing +% the user will have to do all of this in their handler +\else +% otherwise, process the cite list and set the forward cite list to the list of heads +\mciteDoList{\mciteCiteAuxArg}{\mciteCiteTrackArg}{\mciteCiteListArg}\relax +\edef\mciteFwdCiteListArg{\mciteheadlist}\relax +% optional additional calls to do lists for duplicate/global bibliographies +\mciteExtraDoLists\relax +\fi +\relax +% execute the user's post-handler code +\mciteCitePosthandlerArg\relax +% build the forwarding macro and arguments list +\@mcitetmptoksA=\expandafter{\mciteCiteFwdArg}\relax +\ifmciteCiteStarFwdArg +\@mciteAppendToTmpToksA{*}\relax +\fi +\ifmciteMacroOptArgI +\@mciteAppendToTmpToksA{[}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\mciteCiteOptArgI}\relax +\@mciteAppendToTmpToksA{]}\relax +\fi +\ifmciteMacroOptArgII +\@mciteAppendToTmpToksA{[}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\mciteCiteOptArgII}\relax +\@mciteAppendToTmpToksA{]}\relax +\fi +\if@mciteCiteSecIDArg +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\mciteCiteSecIDArg}}\relax +\fi +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\mciteFwdCiteListArg}}\relax +\edef\@mciteCiteFwd{\the\@mcitetmptoksA}\relax +% forward to the "real" \cite +\@mciteCiteFwd} + + +% mciteplus engine +% processes cite list, records status of keys and writes tail (and head) +% citations to aux file +% list of heads is output to \mciteheadlist for forwarding to \cite +% usage: \mciteDoList{aux out}{track ID}{cite list} +% use noauxwrite for aux out to disable writes to aux +\def\mciteDoList#1#2#3{\edef\@mcitecurauxout{#1}\edef\@mcitecurtrackID{#2}\edef\@mcitetemp{#3}\relax +\expandafter\@mciteDoList\expandafter{\@mcitetemp}} + +% flag to determine if mciteDoList should write to aux file +\newif\if@mciteDoListwriteaux \@mciteDoListwriteauxtrue +\def\@mciteMacronoauxwrite{noauxwrite} + +\def\@mciteDoList#1{\let\@mcitecurhead\relax % reset current head +\@mciteDoListwriteauxtrue +% disable aux writes if aux parameter is "noauxwrite" +\ifx\@mcitecurauxout\@mciteMacronoauxwrite\@mciteDoListwriteauxfalse\fi +\@mcitefirstentrytrue\@mcitefirstheadentrytrue +\def\mciteheadlist{}\def\@mcitecurstatus{\relax}\relax +\@for\@mcitecurkey:=#1\do{\expandafter\@mciteCheckKey\@mcitecurkey\end\relax +% ignore empty keys +\ifx\@mcitecurkey\@empty +% warn about \nocite{*} +\if@mcitestarentry + \typeout{** WARNING: mciteplus: Wildcard `*' citation entry declared. BibTeX will add untracked entries to the bibliography.}\relax + % add * to the head list + \if@mcitefirstentry + \@mcitefirstentryfalse + \edef\mciteheadlist{*}\relax + \else + \edef\mciteheadlist{\mciteheadlist,*}\relax + \fi +\fi +\else % key is not empty +% get entry status +\@mciteGetEntryStatus*{\@mcitecurtrackID}{\@mcitecurkey}{\@mcitecurstatus}\relax +% if entry status is undefined, set status number code to undetermined and update \@mcitecurstatus +\ifx\@mcitecurstatus\relax + \@mciteSetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{0}\relax + \@mciteGetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{\@mcitecurstatus}\relax +\fi +\if@mcitestarentry % if declared to be a tail + \if@mcitefirstheadentry % tail cannot be declared until after a head + \PackageError{mciteplus}{Tail `\@mcitecurkey' is declared without a valid head}{You have to + declare a head citation before entering tail citations in cite list.}\relax + \fi + \ifnum\@mcitecurstatus>1\relax % cannot have been previously declared as a head + \PackageError{mciteplus}{Tail citation `\@mcitecurkey' has previously been declared as a head}{Declare + each citation entry as a head or a tail, but not both.}\relax + \fi + \if@mciteheadredeclared % the current head has been redeclared, OK with some restrictions + \ifnum\@mcitecurstatus=0\relax % cannot add new tails to previous group definitions + \PackageError{mciteplus}{New tail citation `\@mcitecurkey' cannot be added to the already existing + definition of group of head `\@mcitecurhead'}{You cannot define a group, + then reissue the head and add new tail citations.}\relax + \fi + \ifnum\@mcitecurstatus=1\relax % OK to respecify tails as long as they already belong to this group, + % this allows for overall (global) bibliographies + \@mciteGetHeadofTail{\@mcitecurtrackID}{\@mcitecurkey}{\@mciteheadofcurkey}\relax + \ifx\@mciteheadofcurkey\@mcitecurhead + % Note: We don't/can't catch the case of repeated tail declarations under a redeclared head. + % Not a mandatory error anyway. + \else + % tail cannot have been declared in definition of another group + \PackageError{mciteplus}{Tail citation `\@mcitecurkey' is not allowed in group of head + `\@mcitecurhead' as this tail has already been declared in group + of head `\@mciteheadofcurkey'}{You cannot have a tail citation + that appears in more than one citation group.}\relax + \fi + \fi + \else % head not redeclared + \ifnum\@mcitecurstatus=1\relax % the current head has not been declared before, so neither should any of its tails + \@mciteGetHeadofTail{\@mcitecurtrackID}{\@mcitecurkey}{\@mciteheadofcurkey}\relax + \ifx\@mciteheadofcurkey\@mcitecurhead + % tail cannot be declared twice in initial definition, this is an optional error + \PackageError{mciteplus}{Tail citation `\@mcitecurkey' has been declared more than once in + definition of group for head `\@mcitecurhead'}{Each tail + citation can only be specified once in the definition + of a group.}\relax + \else + % tail cannot have been declared in definition of another group + \PackageError{mciteplus}{Tail citation `\@mcitecurkey' is not allowed in group of head + `\@mcitecurhead' as this tail has already been declared in group + of head `\@mciteheadofcurkey'}{You cannot have a tail citation + that appears in more than one citation group.}\relax + \fi + \fi + \fi% end if head redeclared + % if not declared before, process as a valid tail + \ifnum\@mcitecurstatus=0\relax + % record type as tail + \@mciteSetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{1}\relax + \@mciteGetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{\@mcitecurstatus}\relax + % write out tail citation to aux as it will not be forwarded to \cite + \if@mciteDoListwriteaux + \@mcitewritecurkeytoaux + \fi + % record head for this tail + \@mciteSetHeadofTail{\@mcitecurtrackID}{\@mcitecurkey}{\@mcitecurhead}\relax + % change current head from code 3 (single) to 2 (one or more tails) + \@mciteSetEntryStatus{\@mcitecurtrackID}{\@mcitecurhead}{2}\relax + \fi +\else % is declared to be a head + \edef\@mcitecurhead{\@mcitecurkey}\relax % this is our new current head + % add to the head list + \if@mcitefirstentry + \@mcitefirstentryfalse + \edef\mciteheadlist{\@mcitecurkey}\relax + \else + \edef\mciteheadlist{\mciteheadlist,\@mcitecurkey}\relax + \fi + \@mcitefirstheadentryfalse + \ifnum\@mcitecurstatus=1\relax % cannot have previously been used as a tail + \@mciteGetHeadofTail{\@mcitecurtrackID}{\@mcitecurkey}{\@mciteheadofcurkey}\relax + \PackageError{mciteplus}{Head citation `\@mcitecurkey' has previously been declared + as a tail of `\@mciteheadofcurkey'}{Declare each citation + entry as a head or a tail, but not both.}\relax + \fi + \@mciteheadredeclaredfalse % assume not redeclared + \ifnum\@mcitecurstatus>1\relax % has already been declared? + \@mciteheadredeclaredtrue % OK, but do not allow any new future tails for this head + \fi + % if not declared before, set as a head, single. Will later change to code 2 if tails are found. + \if@mciteheadredeclared\else + \@mciteSetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{3}\relax + \@mciteGetEntryStatus{\@mcitecurtrackID}{\@mcitecurkey}{\@mcitecurstatus}\relax + % write out head citation to aux. + % This will result in the entry appearing twice in the aux file as the + % entry will be part of the \mciteheadlist which will be forwarded to \cite. + % However, we need to write this out now to preserve the order of the citations. + \if@mciteDoListwriteaux + \@mcitewritecurkeytoaux + \fi + % this is the new current head + \let\@mcitecurhead\@mcitecurkey + \fi % fi not headredeclared +\fi % fi tail or head +% debug report +\if@OPTIONmcitedebug + \ifnum\@mcitecurstatus=1\relax + \edef\@mcitedebugheadoftail{Head of this tail: `\@mcitecurhead'}\relax + \else + \edef\@mcitedebugheadoftail{}\relax + \fi + \typeout{** Mciteplus Debug: Citation Entry: `\@mcitecurkey' TrackID: `\@mcitecurtrackID' + Auxout: \ifx\@mcitecurauxout\@mciteMacronoauxwrite `none (\@mciteMacronoauxwrite)' \else `\the\@mcitecurauxout' \fi + Status: `\@mciteStatusNumToWordH{\@mcitecurstatus}' \@mcitedebugheadoftail}\relax +\fi +% end debug report +\fi % only nonempty +}% end do loop +} + +% hook to allow for a redo. Useful for global bibliographies +\def\mciteExtraDoLists{\relax} + +% determines if an entry starts with an *, removes the * from the start of the entry name +% and sets \@mcitestarentry and \@mcitecurkey accordingly +\def\@mciteCheckKey#1#2\end{\@mcitestarentryfalse +\ifx*#1\@mcitestarentrytrue\edef\@mcitecurkey{#2}\relax +\else +\edef\@mcitecurkey{#1#2}% +\fi} + +% writes current key citation to aux. We put this in a macro because some packages +% may fiddle with \if@filesw (making it a macro rather than an if), tripping up +% TeX's parser if \if@filesw is ever within another conditional as is the case +% within \@mciteDoList +\def\@mcitewritecurkeytoaux{\if@filesw\immediate\write\@mcitecurauxout{\string\citation{\@mcitecurkey}}\fi} + + + +% custom \ref command displays \mcitesubrefform when +% \ref'd +% prefix to reference labels to avoid namespace clash +\def\@mcitereflabelprefix{MciteSubReferenceLabel} +\def\@mciteSetSubRefLabel{\begingroup\def\@currentlabel{\mcitesubrefform}\label{\@mcitereflabelprefix:\@mcitecurtrackID:\mciteBibitemArgI}\endgroup} +% default to using the actual sublist form. +\providecommand{\mcitesubrefform}{\arabic{mcitebibitemcount}.\alph{mcitesubitemcount}} +% give user access to sublist \ref and \pageref +% usage: \mciteSubRef[track ID]{cite key} +\def\mciteSubRef{\@ifnextchar[{\@mciteSubRef}{\@mciteSubRef[\mcitetrackID]}} +\def\@mciteSubRef[#1]#2{\ref{\@mcitereflabelprefix:#1:#2}} +\def\mciteSubPageRef{\@ifnextchar[{\@mciteSubPageRef}{\@mciteSubPageRef[\mcitetrackID]}} +\def\@mciteSubPageRef[#1]#2{\pageref{\@mcitereflabelprefix:#1:#2}} + + +% for debug, head of tail lookup +\def\@mcitecurbibheadlookup{} + + + + +% mciteplus version of \bibitem +% support the optional arg of \bibitem[]{} as well +\def\mcitebibitem{\@ifnextchar[{\global\mciteBibitemOptArgItrue\@mcitebibitem}% +{\global\mciteBibitemOptArgIfalse\@mcitebibitem[\relax]}} + +\def\@mcitebibitem[#1]#2{\relax +% build the forwarding macro: \mciteOrgbibitem{#2} or \mciteOrgbibitem[#1]{#2} +\gdef\mciteBibitemOptArgI{#1}\gdef\mciteBibitemArgI{#2}\relax +\@mcitetmptoksA={\mciteOrgbibitem}\relax +\ifmciteBibitemOptArgI +\@mciteAppendToTmpToksA{[}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\mciteBibitemOptArgI}\relax +\@mciteAppendToTmpToksA{]}\relax +\fi +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\mciteBibitemArgI}}\relax +% build the command. we need a global def here so that the changes will persist in spite +% of a later closed sublist +\xdef\@mciteBibitemFwdMacroArgs{\the\@mcitetmptoksA}\relax +% on the very first \bibitem initialize the maxwidths +% we do this here so that the bibstyle can have its say on the forminit +\if@mcitefirstentry + \@mciteMaxWidthInitialize{bibitem}\relax + \@mciteMaxWidthInitialize{subitem}\relax +\fi +% get status of entry and process accordingly +\@mciteGetEntryStatus{\@mcitecurtrackID}{#2}{\@mcitecurstatus}\relax +% status get may happen inside a list, so make the changes to \@mcitecurstatus global +\global\let\@mcitecurstatus\@mcitecurstatus +% debug report +\if@OPTIONmcitedebug + \ifnum\@mcitecurstatus=1\relax + \@mciteGetHeadofTail{\@mcitecurtrackID}{\mciteBibitemArgI}{\@mcitecurbibheadlookup}\relax + \edef\@mcitedebugheadoftail{Head of this tail: `\@mcitecurbibheadlookup' (from citation), `\@mcitecurbibhead' (in bibliography)}\relax + \else + \edef\@mcitedebugheadoftail{}\relax + \fi + \typeout{** Mciteplus Debug: \string\mcitebibitem\space Entry: `\mciteBibitemArgI' TrackID: `\@mcitecurtrackID' + Status: `\@mciteStatusNumToWord{\@mcitecurstatus}' \@mcitedebugheadoftail}\relax +\fi +% end debug report +\ifnum\@mcitecurstatus=1\relax % if a tail + % error if a tail starts the bibliography + \if@mcitefirstentry + \PackageError{mciteplus}{Bibliography begins with a tail entry `\mciteBibitemArgI'}{For sorting + bibstyles, you must set the `mcitetail' BibTeX database field + for each tail entry and use a bibstyle that understands that field.}\relax + \fi + \mcitemidpunct\relax + % open sublist if needed + \if@mcitesublistmode + \if@mcitesublistopen\else + \global\@mcitesublistopentrue + \relax\mcitesublistbegin\relax + \fi + \relax\mcitesublistlabel\relax\@mciteSetSubRefLabel\relax\@mciteMaxWidthUpdate{subitem}\relax + \fi + \@mciteMaxCountUpdate + \addtocounter{mcitesubitemcount}{1}\relax +\else% is head + \if@mcitefirstentry\else\mciteendpunct\relax\mciteEndOfBibGroupPresubcloseHook\relax\fi + % close sublist if open + % watch out with variables as this will close off local changes + % addtocounter and setcounter make global changes + \if@mcitesublistopen + \mcitesublistend\relax + \global\@mcitesublistopenfalse + \fi + \relax\mciteEndOfBibGroupPostsubcloseHook\relax + % record current bib head key and argument info + \xdef\@mcitecurbibhead{#2}\relax + \gdef\mciteCurheadBibitemArgI{#2}\relax + \gdef\mciteCurheadBibitemOptArgI{#1}\relax + \ifmciteBibitemOptArgI\global\mciteCurheadBibitemOptArgItrue\else\global\mciteCurheadBibitemOptArgIfalse\fi + % note: with \mcitebibitem mcitebibitemcount advances with heads + % and holds the current head count until the next \mcitebibitem + % However, at the end of the \mcitebibitem, mcitesubitemcount + % is one more than the number of subitems as the label is + % rendered before updating the counter. + \setcounter{mcitesubitemcount}{1}\relax + \addtocounter{mcitebibitemcount}{1}\relax + \@mciteMaxCountUpdate + \if@mcitefirstentry\else\relax\mciteseppunct\relax\fi + \@mciteBibitemFwdMacroArgs\relax\relax\relax + % check and update the bibitem label width + \@mciteMaxWidthUpdate{bibitem}\relax + \ifnum\@mcitecurstatus=2\relax % if head with tails + \if@mcitesublistmodef + % open sublist if needed + \if@mcitesublistopen\else + \global\@mcitesublistopentrue + \mcitesublistbegin\relax + \fi + \relax\mcitesublistlabel\relax\@mciteSetSubRefLabel\relax\@mciteMaxWidthUpdate{subitem}\relax + \addtocounter{mcitesubitemcount}{1}\relax + \fi + \fi + \ifnum\@mcitecurstatus=3\relax % if head without tails + \if@mcitesublistmodeh + % open sublist if needed + \if@mcitesublistopen\else + \global\@mcitesublistopentrue + \mcitesublistbegin\relax + \fi + \relax\mcitesublistlabel\relax\@mciteSetSubRefLabel\relax\@mciteMaxWidthUpdate{subitem}\relax + \addtocounter{mcitesubitemcount}{1}\relax + \fi + \fi + \if@mcitesublistmodeb + \addtocounter{mcitesubitemcount}{1}\relax + \fi +\fi% if tail or head +\global\@mcitefirstentryfalse\ignorespaces} + +% End of \bibitem marker from bibstyle +\def\EndOfBibitem{\relax} + +% hook inserted at the end of bibitem group, before the sublist is closed +\def\mciteEndOfBibGroupPresubcloseHook{\relax} +% hook inserted at the end of bibitem group, after the sublist is closed +\def\mciteEndOfBibGroupPostsubcloseHook{\relax} + +% hook inserted at \mcitethebibliography +\def\mcitethebibliographyHook{\relax} + + +% hook to allow insertion of custom code at end of mcitethebibliography +\def\mciteBIBdecl{\relax} +% hook to allow insertion of custom code at end of endmcitethebibliography +\def\mciteBIBenddecl{\relax} +% hook to allow insertion of custom code at end of thebibliography +\def\mcitefwdBIBdecl{\relax} + + + + +% Bibdecl for package hooks +\def\@mcitepkgBIBdecl{\relax} +% single use internal BIB hook, is automatically reset to \relax at end of \mcitethebibliography +\let\@mciteoneshotBIBdecl\relax + + +% mciteplus version of \thebibliography +\def\mcitethebibliography#1{\@mcitefirstentrytrue + \@mcitesublistopenfalse + \let\@mcitecurauxout\mcitebibauxout + \let\@mcitecurtrackID\mcitebibtrackID + \ifmciteResetBibitemCount\setcounter{mcitebibitemcount}{0}\fi + \setcounter{mcitesubitemcount}{0}\relax + \xdef\mciteorgbibsamplelabel{#1}\relax + % set these to something so that init forms that reference them won't choke + \gdef\mciteBibitemOptArgI{\relax}\relax + \gdef\mciteBibitemArgI{\relax}\relax + \global\mciteBibitemOptArgIfalse + \gdef\mciteCurheadBibitemOptArgI{\relax}\relax + \gdef\mciteCurheadBibitemArgI{\relax}\relax + \global\mciteCurheadBibitemOptArgIfalse + % note: pkg and user hooks may update tracking ID + \relax\@mcitepkgBIBdecl\relax + \relax\@mciteoneshotBIBdecl\relax + \relax\mciteBIBdecl\relax + \@mciteMaxCountInitialize + % we initialize here to get a valid \mcitemaxwidthbibitem for \mcitebibsamplelabel + % but we will reinitialize again at the first \bibitem so that any BST changes can take affect + \@mciteMaxWidthInitialize{bibitem}\relax + % debug report + \if@OPTIONmcitedebug + \typeout{}\typeout{}\relax + \typeout{** Mciteplus Debug: \string\mcitethebibliography\space TrackID: `\@mcitecurtrackID' Auxout: `\the\@mcitecurauxout'}\relax + \fi + % end debug report + \thebibliography{\mcitebibsamplelabel}\relax + \mcitethebibliographyHook\relax + \relax\mcitefwdBIBdecl\relax + \let\mciteOrgbibitem\bibitem + \def\bibitem{\mcitebibitem}} + +\def\endmcitethebibliography{\mciteendpunct\relax + \relax\mciteEndOfBibGroupPresubcloseHook\relax + % close sublist if open + \if@mcitesublistopen + \mcitesublistend\relax + \@mcitesublistopenfalse + \fi + \relax\mciteEndOfBibGroupPostsubcloseHook\relax + \relax\mciteBIBenddecl\relax + % globally clear oneshot decl + \global\let\@mciteoneshotBIBdecl\relax + % restore original \bibitem as some \endthebibliography tack notes at the end (e.g., REVTeX) + % we'll add them to the count with mcite's counters and continue to track the bibitem width + \setcounter{mcitesubitemcount}{1}\relax + \def\bibitem{\addtocounter{mcitebibitemcount}{1}\@mciteMaxWidthUpdate{bibitem}\relax\mciteOrgbibitem} + \endthebibliography\relax + % update max count for possible \endthebibliography tack notes + \@mciteMaxCountUpdate + % write correct max counter to aux and warn if changed + \@mciteMaxCountAuxWrite + % write correct max widths to aux and warn if changed + \@mciteMaxWidthAuxWrite + % debug report + \if@OPTIONmcitedebug + \typeout{}\relax + \typeout{** Mciteplus Debug: \string\endmcitethebibliography^^J + Current Max bibitem count: `\mcitemaxcountbibitem'^^J + Correct Max bibitem count: `\arabic{mcitebibitemcount}'^^J^^J + Current Max subitem count: `\mcitemaxcountsubitem'^^J + Correct Max subitem count: `\@mcitecorrectmaxcountsubitem'^^J^^J + Current Max bibitem width: `\mcitemaxwidthbibitem'(sp)^^J + Correct Max bibitem width: `\@mcitecorrectmaxwidthbibitem'(sp)^^J^^J + Current Max subitem width: `\mcitemaxwidthsubitem'(sp)^^J + Correct Max subitem width: `\@mcitecorrectmaxwidthsubitem'(sp)}^^J + \fi} + + +% warn at end if any \mcitethebibliography requires a rerun due to a max width/count change +\AtEndDocument{\if@mciteLaTeXrerun\@latex@warning@no@line{Rerun to ensure correct mciteplus label max width/count}\fi} + +% always ensure \mciteSetMaxWidth{}{}{} and \mciteSetMaxCount{}{}{} are defined in the .aux, +% lest the package be unloaded and the initial .aux still refers to it. +\AtBeginDocument{\if@filesw\immediate\write\@mainaux{\string\providecommand{\string\mciteSetMaxWidth}[3]{\string\relax}}\relax +\immediate\write\@mainaux{\string\providecommand{\string\mciteSetMaxCount}[3]{\string\relax}}\fi} + + + +% hook into system only after all packages have been loaded +\AtBeginDocument{\let\mciteOrgcite\cite\let\mciteOrgnocite\nocite +\if@OPTIONmcitenohooks\else +% hook into system \cite unless user says otherwise +\def\cite{\@mciteCiteWrapper} +\def\nocite{\@mciteNociteWrapper} +\fi} + + + + + +% special \if macros needed for PKG hooks +% we've got to define these here to shield the \ifcontinuouslabels +% and and \fi from TeX's scanner when multibib is *not* loaded +% as \ifcontinuouslabels will not be defined and TeX would still +% see the \fi when skipping over the code. +% +% multibib +\def\@mciteMULTIBIBcontinuouslabelsWarn{\relax +\ifmciteResetBibitemCount + \ifcontinuouslabels + \typeout{** WARNING: mciteplus is using \string\mciteResetBibitemCounttrue, but multibib was not invoked with `resetlabels' option.} + \fi +\else + \ifcontinuouslabels\else + \typeout{** WARNING: mciteplus is using \string\mciteResetBibitemCountfalse, but multibib was invoked with `resetlabels' option.} + \fi +\fi} + + +% bibunits global copy list handler +\def\@mciteBIBUNITSExtraDoListHandler{\ifglobalcitecopy +\mciteDoList{\mciteauxout}{main}{\mciteCiteListArg}\relax +\else +\ifmciteCiteStarFwdArg +\mciteDoList{\mciteauxout}{main}{\mciteCiteListArg}\relax +\fi +\fi} + + +% natbib command names +\def\@mciteNatbibCiteCmdList{citenum,citep,Citep,citet,Citet,citealp,Citealp,citealt,Citealt,citeauthor,Citeauthor,citeyear,citeyearpar,citepalias,citetalias} + +% if natbib loaded, save originals at start +\expandafter\ifx\csname ver@natbib.sty\endcsname\relax\else +\AtBeginDocument{\@for\@mcitecurcmdname:=\@mciteNatbibCiteCmdList\do{\relax +\expandafter\let\expandafter\@mcitetmpA\csname \@mcitecurcmdname\endcsname +\expandafter\let\csname mciteOrg\@mcitecurcmdname\endcsname\@mcitetmpA}} +\fi + + + + + +% *** External Package Hooks *** +\if@OPTIONmcitenohooks\else% hook into packages + + + +% *** natbib.sty hooks +\expandafter\ifx\csname ver@natbib.sty\endcsname\relax\else +\typeout{** mciteplus: Detected natbib.sty. Invoking hooks.}\relax +\AtBeginDocument{\@for\@mcitecurcmdname:=\@mciteNatbibCiteCmdList\do{\relax +% reroute original cite macro \X through \mciteCiteA +% \X -> \mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgX} +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\csname mciteOrg\@mcitecurcmdname\endcsname}\relax +\expandafter\edef\csname \@mcitecurcmdname\endcsname{\noexpand\mciteCiteA{\noexpand\mciteauxout}{\noexpand\mcitetrackID}{\relax}{\relax}{\the\@mcitetmptoksA}}\relax +}} +\fi % if natbib.sty detected + + + + +% *** cite.sty hooks +\expandafter\ifx\csname ver@cite.sty\endcsname\relax\else +\typeout{** mciteplus: Detected cite.sty. Invoking hooks.}\relax +\AtBeginDocument{\let\@mciteCITEOrgciten\citen +\def\@mciteCITEciten{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\@mciteCITEOrgciten}}\relax +% This will still work even though cite.sty routes \citex through \citen. +% The double calls to mciteplus will be OK as the second call to mciteplus +% will only have a head list of already defined entries and so it will do nothing +% other than write the list to the aux again. +% Not the most elegant approach though. +\def\citen{\@mciteCITEciten}\relax +% Handle the aliases as well. +\def\citenum{\@mciteCITEciten}\relax +\def\citeonline{\@mciteCITEciten}} +\fi % if cite.sty detected + + + +% *** drftcite.sty hooks +\expandafter\ifx\csname ver@drftcite.sty\endcsname\relax\else +\typeout{** mciteplus: Detected drftcite.sty. Invoking hooks.}\relax +\AtBeginDocument{\let\@mciteDRFTCITEOrgciten\citen +\def\@mciteDRFTCITEciten{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\@mciteDRFTCITEOrgciten}}\relax +% As with cite.sty, this will still work even though drftcite.sty +% routes \citex through \citen. +\def\citen{\@mciteDRFTCITEciten}\relax} +\fi % if drftcite.sty detected + + + +% *** chapterbib hooks +\expandafter\ifx\csname ver@chapterbib.sty\endcsname\relax\else +\typeout{** mciteplus: Detected chapterbib.sty. Invoking hooks.}\relax +% one gotcha is that LaTeX closes and reopens \@partaux so aux handle number +% does not change +\def\mcitetrackID{chapterbib\@currentipfile} +\def\mcitebibtrackID{chapterbib\@currentipfile} +% make a second set of entry status macros for the duplicate bibliographies +% produced under the duplicate option. Won't hurt anything if the duplicate +% bibliography is not used. Note that chapterbib uses the .bbl suffix for +% \@currentipfile when reading the duplicate bibliographies. +\def\mciteExtraDoLists{\mciteDoList{noauxwrite}{chapterbib\@currentipfile.bbl}{\mciteCiteListArg}\relax +% create third set only when chapterbib is using the rootbib option. +% We can't just write this out all the time because the rootbib option can +% cause a conflict in the mciteplus status of a key if that same key is +% used in different parts of the document. And we can't test for the use of +% the chapterbib rootbib option because chapterbib is rerun without the +% rootbib option. +\if@OPTIONmcitechapterbibrootbib + \mciteDoList{noauxwrite}{chapterbib\jobname}{\mciteCiteListArg}\relax +\fi} +\fi % if chapterbib detected + + + + +% *** multibib hooks +\expandafter\ifx\csname ver@multibib.sty\endcsname\relax\else +\typeout{** mciteplus: Detected multibib.sty. Invoking hooks.}\relax +\let\@mciteOrgMULTIBIBnewcites\newcites + +% internally braced \nocite with \@aux handler as needed by multibib +% usage: \@mciteMULTIBIBgroupedOrgNocite{multibib section name}{cite list} +\def\@mciteMULTIBIBgroupedOrgNocite#1#2{{\expandafter\let\expandafter\@auxout\csname @auxout#1\endcsname +\mciteOrgnocite{#2}}} + +\def\@mciteMULTIBIBnewcites#1#2{\relax +% forward to original \newcites and let it do its thing first +\@mciteOrgMULTIBIBnewcites{#1}{#2}% +% now redo some of what it did our way +\@for\@mciteCurRefName:=#1\do{\relax +% +% build auxout names and track ID +\edef\@mcitetempauxout{\csname @auxout\@mciteCurRefName\endcsname}\relax +\edef\@mcitetemptrackID{multibib\@mciteCurRefName}\relax +% +% reroute original \citeX through \mciteCiteA using \@mciteCurRefName in aux and track +% \citeX -> \mciteCiteA{\@auxoutX}{multibibX}{\relax} +% {\let\@citex\mb@@citex\let\@newciteauxhandle\@auxoutX} +% {\mciteOrgcite} +% basic command name list +\def\@mciteMULTIBIBCiteCmdList{cite} +% add natbib names if natbib is loaded +\expandafter\ifx\csname ver@natbib.sty\endcsname\relax\else +\edef\@mciteMULTIBIBCiteCmdList{\@mciteMULTIBIBCiteCmdList,\@mciteNatbibCiteCmdList}\relax +\fi +\@for\@mcitecurcmdname:=\@mciteMULTIBIBCiteCmdList\do{\relax +\@mcitetmptoksA=\expandafter{\expandafter{\@mcitetempauxout}}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\@mcitetemptrackID}{\relax}}\relax +% install multibib \citeX internals into handler +\edef\@mcitetemp{{\let\noexpand\@citex\noexpand\mb@@citex +\let\noexpand\@newciteauxhandle\csname @auxout\@mciteCurRefName\endcsname}}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\@mcitetemp}\relax +% forward to standard \cite (\mciteOrgcite), can't go through current \cite +% as that goes through mcite again and would write entries to standard aux +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\csname mciteOrg\@mcitecurcmdname\endcsname}}\relax +% define new \citeX wrapper +\expandafter\expandafter\expandafter\def\expandafter\expandafter\csname \@mcitecurcmdname\@mciteCurRefName\endcsname +\expandafter{\expandafter\mciteCiteA\the\@mcitetmptoksA}\relax +}% \do for \@mciteMULTIBIBCiteCmdList +% +% reroute original \nociteX through \mciteCiteA using \@mciteCurRefName in aux and track +% \nociteX -> \mciteCiteA{\@auxoutX}{multibibX}{\relax} +% {\relax} +% {\@mciteMULTIBIBgroupedOrgNocite} +\@mcitetmptoksA=\expandafter{\expandafter{\@mcitetempauxout}}\relax +\expandafter\@mciteAppendToTmpToksA\expandafter{\expandafter{\@mcitetemptrackID}{\relax}{\relax}}\relax +% forward to standard \@mciteMULTIBIBgroupedOrgNocite, can't go through current \nocite +% as that goes through mcite again and would write entries to standard aux also because +% multibib changes \@auxout, we need to use the internally grouped version with +% the \@aux handler in it +\edef\@mcitetemp{{\noexpand\@mciteMULTIBIBgroupedOrgNocite{\@mciteCurRefName}}} +% define new \nociteX wrapper +\expandafter\@mciteAppendToTmpToksA\expandafter{\@mcitetemp} +\expandafter\expandafter\expandafter\def\expandafter\expandafter\csname nocite\@mciteCurRefName\endcsname +\expandafter{\expandafter\mciteCiteA\the\@mcitetmptoksA}\relax +% now reroute \bibliographyX +% save as \@mciteOrgMULTIBIBbibliographyX +\expandafter\let\expandafter\@mcitetemp\csname bibliography\@mciteCurRefName\endcsname +\expandafter\let\csname @mciteOrgMULTIBIBbibliography\@mciteCurRefName\endcsname\@mcitetemp +\@mcitetmptoksA=\expandafter{\csname @mciteOrgMULTIBIBbibliography\@mciteCurRefName\endcsname}\relax +\expandafter\edef\csname bibliography\@mciteCurRefName\endcsname{\def\@mciteoneshotBIBdecl{\def\noexpand\@mcitecurtrackID{\@mcitetemptrackID}}\the\@mcitetmptoksA}\relax +% we depend on the default \mciteauxout and \mcitetrackID for \cite, \nocite and \mcite +}% end ref name do loop +}% end def \@mcitePKGnewcites +% +% setup multibib BIB hooks +% no need to install bibliography wrapper uaing \@auxoutX as multibbl wrapper alters +% \@auxout to point to \@auxoutX before starting \mcitethebibliography +% Thus, the default bibteckID will work. +% +% warn if a mismatch between the settings of mciteplus entry label counter resets and those of multibib +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\@mcitepkgBIBdecl} +\addto@hook\@mcitetmptoksA{\@mciteMULTIBIBcontinuouslabelsWarn} +\edef\@mcitepkgBIBdecl{\the\@mcitetmptoksA} +% reroute all \newcites calls through \@mciteMULTIBIBnewcites +\let\newcites\@mciteMULTIBIBnewcites +\fi% if multibib detected + + + +% *** multibbl hooks +\expandafter\ifx\csname ver@multibbl.sty\endcsname\relax\else +\typeout{** mciteplus: Detected multibbl.sty. Invoking hooks.}\relax +% for checking that the user has called \newbibliography before \cite. +\def\@mciteMULTIBBLcheckAuxDefined{\expandafter\ifx\csname\mciteCiteSecIDArg @auxfile\endcsname\relax +\PackageError{mciteplus}{multibbl: Bibliography `\mciteCiteSecIDArg' has not been defined}{Use multibbl's \string\newbibliography\space to + declare this bibliography before using it in \string\cite.}\relax +\fi} +%\cite -> \mciteCiteB{\secID@auxfile}{multibbl\secID}{create aux track arguments}{\relax}{\mciteOrgcite}} +%\cite -> \mciteCiteB{\secID@auxfile}{multibbl\secID}{create aux track arguments}{\relax}{\mciteOrgcite}} +% we use prehandler to set aux and track arguments to use mciteCiteSecIDArg +\def\@mciteCiteWrapper{\mciteCiteB{Bogus auxout}{Bogus trackID}{\relax +\def\mciteCiteAuxArg{\csname \mciteCiteSecIDArg @auxfile\endcsname}\relax +\def\mciteCiteTrackArg{multibbl\mciteCiteSecIDArg}\@mciteMULTIBBLcheckAuxDefined}{\relax}{\mciteOrgcite}} +% nocite +\def\@mciteNociteWrapper{\mciteCiteB{Bogus auxout}{Bogus trackID}{\relax +\def\mciteCiteAuxArg{\csname \mciteCiteSecIDArg @auxfile\endcsname}\relax +\def\mciteCiteTrackArg{multibbl\mciteCiteSecIDArg}\@mciteMULTIBBLcheckAuxDefined}{\relax}{\mciteOrgnocite}} +% hook into bibliography at start of document, use one shot interface for single use setup of the aux and track ID +\AtBeginDocument{\let\mciteOrgbibliography\bibliography +% we need to update \mcitethebibliography's tracking ID, to reflect what multibbl is using, +% multibbl.sty does not read in non-main aux files. We use the one shot so that the definition is cleared +% after each bibliography (but in this case it would be anyway as it is defined inside the +% \bibliography environment). +\def\bibliography#1#2#3{\def\@mciteoneshotBIBdecl{\relax + \def\@mcitecurtrackID{multibbl#1}} + \mciteOrgbibliography{#1}{#2}{#3}}} + +\fi% if multibbl detected + + + +% *** bibunits hooks +\expandafter\ifx\csname ver@bibunits.sty\endcsname\relax\else +\typeout{** mciteplus: Detected bibunits.sty. Invoking hooks.}\relax + +\def\@mciteBIBUNITSbibunit{\def\mcitetrackID{bibunits\@bibunitname}\relax +\def\mcitebibtrackID{bibunits\@bibunitname}\mciteOrgBIBUNITSbibunit} + +\def\@mciteBIBUNITSbu@cite{\@startbibunitorrelax\mciteCiteA{\@bibunitaux}{\mcitetrackID}{\relax}{\@mciteBIBUNITSExtraDoListHandler}{\mciteOrgBIBUNITSbu@cite}} +\def\@mciteBIBUNITSbu@nocite{\@startbibunitorrelax\mciteCiteA{\@bibunitaux}{\mcitetrackID}{\relax}{\@mciteBIBUNITSExtraDoListHandler}{\mciteOrgBIBUNITSbu@nocite}} + +\AtBeginDocument{\let\mciteOrgBIBUNITSbu@cite\bu@cite +\let\mciteOrgBIBUNITSbu@nocite\bu@nocite +\let\mciteOrgBIBUNITSbibunit\bibunit +\let\mciteOrgBIBUNITSstd@bibliography\std@bibliography +\let\bibunit\@mciteBIBUNITSbibunit +\let\bu@cite\@mciteBIBUNITSbu@cite +\let\bu@nocite\@mciteBIBUNITSbu@nocite +% have to restore main track ID for global bibliography when using \bibliographyunit +\def\std@bibliography{\def\mcitebibtrackID{main}\mciteOrgBIBUNITSstd@bibliography}} + +\fi% if bibunits detected + + +% *** backref.sty (from hyperref) hooks +\expandafter\ifx\csname ver@backref.sty\endcsname\relax\else +\typeout{** mciteplus: Detected backref.sty. Invoking hooks.}\relax +% disable backref's \bibitem intercept within mcitethebibliography +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\mcitethebibliographyHook} +\addto@hook\@mcitetmptoksA{\def\BR@@lbibitem{\@lbibitem}\def\BR@@bibitem{\@bibitem}} +\edef\mcitethebibliographyHook{\the\@mcitetmptoksA} +%\def\BR@bibitem{\BRorg@bibitem} +% and install our own +\def\mciteBACKREFform{{}\ \BR@backref{\@mcitecurbibhead}} +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\mciteEndOfBibGroupPresubcloseHook} +\addto@hook\@mcitetmptoksA{\mciteBACKREFform} +\edef\mciteEndOfBibGroupPresubcloseHook{\the\@mcitetmptoksA} +\fi % if backref.sty detected + + +% *** citeref.sty hooks +\expandafter\ifx\csname ver@citeref.sty\endcsname\relax\else +\typeout{** mciteplus: Detected citeref.sty. Invoking hooks.}\relax +% disable citeref's \bibitem intercepts within mcitethebibliography +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\mcitethebibliographyHook} +\addto@hook\@mcitetmptoksA{\def\@@lbibitem{\@lbibitem}\def\@@bibitem{\@bibitem}} +\edef\mcitethebibliographyHook{\the\@mcitetmptoksA} +%\def\@@lbibitem{\@lbibitem} +%\def\@@bibitem{\@bibitem} +% and install our own +\def\mciteCITEREFform{\bibitempages{\@citerefpages{\@mcitecurbibhead}}} +\expandafter\@mcitetmptoksA\expandafter=\expandafter{\mciteEndOfBibGroupPresubcloseHook} +\addto@hook\@mcitetmptoksA{\mciteCITEREFform} +\edef\mciteEndOfBibGroupPresubcloseHook{\the\@mcitetmptoksA} +\fi % if citeref.sty detected + + + +% *** detect attempts to use incompatible packages *** +% might be best not to lockout amsrefs and biblatex - maybe somebody wants +% and knows how to use them "in parallel" with mciteplus + +% *** incompatible with bibtopic.sty +\expandafter\ifx\csname ver@bibtopic.sty\endcsname\relax\else +\PackageError{mciteplus}{Bibtopic.sty cannot be used with mciteplus.sty}{These two packages won't work together.}\relax +\fi + +% *** incompatible with inlinebib.sty +\expandafter\ifx\csname ver@inlinebib.sty\endcsname\relax\else +\PackageError{mciteplus}{inlinebib.sty cannot be used with mciteplus.sty}{These two packages won't work together.}\relax +\fi + +% *** incompatible with jurabib.sty +\expandafter\ifx\csname ver@jurabib.sty\endcsname\relax\else +\PackageError{mciteplus}{jurabib.sty cannot be used with mciteplus.sty}{These two packages won't work together.}\relax +\fi + +% *** incompatible with opcit.sty +\expandafter\ifx\csname ver@opcit.sty\endcsname\relax\else +\PackageError{mciteplus}{opcit.sty cannot be used with mciteplus.sty}{These two packages won't work together.}\relax +\fi + +% *** incompatible with splitbib.sty +\expandafter\ifx\csname ver@splitbib.sty\endcsname\relax\else +\PackageError{mciteplus}{Splitbib.sty cannot be used with mciteplus.sty}{These two packages won't work together.}\relax +\fi +\fi % if hooks enabled + + +\endinput diff --git a/macros/latex/contrib/mciteplus/mciteplus_code.txt b/macros/latex/contrib/mciteplus/mciteplus_code.txt new file mode 100644 index 0000000000..6f8207fbdb --- /dev/null +++ b/macros/latex/contrib/mciteplus/mciteplus_code.txt @@ -0,0 +1,218 @@ + +Bst modification and other code listings for the mciteplus package +Version 1.2, 2013/09/13 + +Copyright (c) 2008-2013 Michael Shell +Support site: +http://www.michaelshell.org/tex/mciteplus/ + + +************************************************************************* + Legal Notice: + This code is offered as-is without any warranty either expressed or + implied; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE! User assumes all risk. + In no event shall any contributor to this code be liable for any damages + or losses, including, but not limited to, incidental, consequential, or + any other damages, resulting from the use or misuse of any information + contained here. + + All comments are the opinions of their respective authors. + + This work is distributed under the LaTeX Project Public License (LPPL) + ( http://www.latex-project.org/ ) version 1.3, and may be freely used, + distributed and modified. A copy of the LPPL, version 1.3, is included + in the base LaTeX documentation of all distributions of LaTeX released + 2003/12/01 or later. + Retain all contribution notices and credits. + ** Modified files should be clearly indicated as such, including ** + ** renaming them and changing author support contact information. ** +********************************************************************** + + + + + +***** start mciteplus begin.bib **** + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{unsrtM.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" longest.label * "}" * write$ newline$ +} + +***** end mciteplus begin.bib **** + + + + +***** start mciteplus begin.bib, more advanced example **** + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\ifx\mcitethebibliography\mciteundefinedmacro" + write$ newline$ + "\PackageError{unsrtM.bst}{mciteplus.sty has not been loaded}" + write$ newline$ + "{This bibstyle requires the use of the mciteplus package.}\fi" + write$ newline$ + "\begin{mcitethebibliography}{" longest.label * "}" * write$ newline$ + "\mciteSetBstSublistMode{b}" + write$ newline$ + "\mciteSetBstMaxWidthForm{subitem}{\alph{mcitesubitemcount})}" + write$ newline$ + "\mciteSetBstSublistLabelBeginEnd{\mcitemaxwidthsubitemform\space}" + write$ newline$ + "{\relax}{\relax}" + write$ newline$ +} + +***** end mciteplus begin.bib, more advanced example **** + + + + +***** start mciteplus end.bib **** + +FUNCTION {end.bib} +{ newline$ + "\end{mcitethebibliography}" write$ newline$ +} + +***** end mciteplus end.bib **** + + + + + +***** start mciteplus fin.entry **** + +% mciteplus fin.entry +% +% pushes true (1), if add.period$ would add a period to the string on the stack +% pushes false (0), otherwise +% Uses text.length$ to avoid full string comparison and two copies of string. +% Requires one copy of string on stack. +INTEGERS {would.add.period.textlen} +FUNCTION {would.add.period} +{ duplicate$ + add.period$ + text.length$ + 'would.add.period.textlen := + duplicate$ + text.length$ + would.add.period.textlen = + { #0 } + { #1 } + if$ +} + +FUNCTION {fin.entry} +{ would.add.period + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPuncttrue" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax" + } + { "\relax" * write$ newline$ + "\mciteBstWouldAddEndPunctfalse" write$ newline$ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}" + write$ newline$ + "{}{\mcitedefaultseppunct}\relax" + } + if$ + write$ + newline$ + "\EndOfBibitem" write$ +} +% end mciteplus fin.entry + +***** end mciteplus fin.entry **** + + + + + +***** start mciteplus mcitetail field and sort key adjust support **** + +% mciteplus mcitetail field and sort key adjust support +INTEGERS {mcitetailcnt is.mcitetail} +STRINGS {mciteheadsortkey} +% convert the strings "yes" or "no" to #1 or #0 respectively +FUNCTION {mciteplus.yes.no.to.int} +{ "l" change.case$ duplicate$ + "yes" = + { pop$ #1 } + { duplicate$ "no" = + { pop$ #0 } + { "unknown boolean " quote$ * swap$ * quote$ * + " in " * cite$ * warning$ + #0 + } + if$ + } + if$ +} +FUNCTION {mciteplustail.adj.sort.key} +{ mcitetail + empty$ + { #0 'is.mcitetail := } + { mcitetail + mciteplus.yes.no.to.int + 'is.mcitetail := + } + if$ + is.mcitetail + { #1 mcitetailcnt + + 'mcitetailcnt := + mciteheadsortkey + "__" * + "000000000" + mcitetailcnt + int.to.str$ + * + #-1 #10 substring$ + * + 'sort.key$ := + } + { #0 'mcitetailcnt := + sort.key$ 'mciteheadsortkey := + } + if$ +} +% END mciteplus mcitetail field support + +***** end mciteplus mcitetail field and sort key adjust support **** + + + + + +***** REVTeX Patch code to prevent BibTeX from seeing endnotes ***** + + +% Patch REVTeX to prevent BibTeX from seeing endnotes as citations +% Insert just after REVTeX is loaded +\makeatletter +\let\@ORGREVTEXendnotemark\@endnotemark +\let\@ORGREVTEX@makefnmark@cite\@makefnmark@cite +\def\@endnotemark{\bgroup\@fileswfalse\@ORGREVTEXendnotemark\egroup} +\def\@makefnmark@cite{\bgroup\@fileswfalse\@ORGREVTEX@makefnmark@cite\egroup} +\makeatother + + +***** END REVTeX Patch Code ***** + +EOF diff --git a/macros/latex/contrib/mciteplus/mciteplus_doc.pdf b/macros/latex/contrib/mciteplus/mciteplus_doc.pdf new file mode 100644 index 0000000000..4a50e4f343 Binary files /dev/null and b/macros/latex/contrib/mciteplus/mciteplus_doc.pdf differ diff --git a/macros/latex/contrib/mciteplus/mciteplus_doc.tex b/macros/latex/contrib/mciteplus/mciteplus_doc.tex new file mode 100644 index 0000000000..eca5be36c8 --- /dev/null +++ b/macros/latex/contrib/mciteplus/mciteplus_doc.tex @@ -0,0 +1,2319 @@ +%% mciteplus_doc.tex +%% V1.2 +%% 2013/09/13 +%% Copyright (c) 2008 by Michael Shell +%% See: +%% http://www.michaelshell.org/ +%% for current contact information. +%% +%% This is the documentation for the mciteplus.sty package. +%% +%% Support sites: +%% http://www.michaelshell.org/tex/mciteplus/ +%% http://www.ctan.org/tex-archive/macros/latex/contrib/mciteplus/ +%% +%%************************************************************************* +%% Legal Notice: +%% This code is offered as-is without any warranty either expressed or +%% implied; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE! +%% User assumes all risk. +%% In no event shall IEEE or any contributor to this code be liable for +%% any damages or losses, including, but not limited to, incidental, +%% consequential, or any other damages, resulting from the use or misuse +%% of any information contained here. +%% +%% All comments are the opinions of their respective authors and are not +%% necessarily endorsed by the IEEE. +%% +%% This work is distributed under the LaTeX Project Public License (LPPL) +%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, +%% distributed and modified. A copy of the LPPL, version 1.3, is included +%% in the base LaTeX documentation of all distributions of LaTeX released +%% 2003/12/01 or later. +%% Retain all contribution notices and credits. +%% ** Modified files should be clearly indicated as such, including ** +%% ** renaming them and changing author support contact information. ** +%% +%% File list of work: mciteplus.sty, mciteplus_doc.pdf, mciteplus_doc.tex, +%% mciteplus_code.txt, apsrevM.bst, apsrmpM.bst, +%% IEEEtranM.bst, IEEEtranMN.bst +%%************************************************************************* + +\documentclass[10pt,letterpaper]{article} + + +% tweak article.cls +\makeatletter + +\newcommand\tableofcontentssectiononly{% + \section*{\contentsname + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}} +\newcommand\tableofcontentsstarttoc{\@starttoc{toc}} + + +\def\@maketitle{% + \newpage + \null + \vspace{-3em}% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \par}% + \vskip 1em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \end{center} + \par + \vskip 1em} + +\makeatother + + + +\usepackage{multicol} + + + +\parskip 1ex plus 1ex minus 0.75ex + +\parindent 1.0em + +\topmargin -49.0pt +\headheight 12pt +\headsep 0.25in +\footskip 0.4in + +% want 1in margins +\setlength{\topmargin}{-\headsep}% +\addtolength{\topmargin}{-\headheight}% +% we want 1in side margins regardless of paper type +\oddsidemargin 0in +\evensidemargin 0in +% set the text width +\setlength{\textwidth}{\paperwidth}% +\addtolength{\textwidth}{-2.0in}% +\setlength{\textheight}{\paperheight}% +\addtolength{\textheight}{-2.0in}% +% digitize textheight to be an integer number of lines. +% this may cause the bottom margin to be off a tad +\addtolength{\textheight}{-1\topskip}% +\divide\textheight by \baselineskip% +\multiply\textheight by \baselineskip% +\addtolength{\textheight}{\topskip}% + + +\newcommand{\MYdocversion}{1.1} + +\usepackage{type1ec} +%\usepackage{type1cm} +\usepackage[T1]{fontenc} + +\usepackage{ifpdf} +\usepackage{notoccite} + +%\usepackage[retainorgcmds]{IEEEtrantools} +% use roman url style +\usepackage{url} + +\csname url@rmstyle\endcsname +\ifpdf + \usepackage[pdftex]{graphicx} + \graphicspath{{.}} + \DeclareGraphicsExtensions{.pdf} +\else + \usepackage[dvips]{graphicx} + \graphicspath{{.}} + \DeclareGraphicsExtensions{.eps} +\fi + +\ifpdf + \usepackage[pdftex]{thumbpdf} +\else + \usepackage[dvips]{thumbpdf} +\fi + +\newcommand\MYhyperrefoptions{hypertexnames=false,bookmarks=true, +bookmarksnumbered=true, pdfpagemode={UseOutlines},plainpages=false, +pdfpagelabels=true,colorlinks=true,linkcolor={darkred}, +citecolor={darkgreen},urlcolor={darkblue}, +pdftitle={Mciteplus: Enhanced Multicitations}, +pdfsubject={Typesetting}, +pdfauthor={Michael D. Shell}, +pdfkeywords={bibliography, BibTeX, collapsed entries, LaTeX, mcite, +mciteplus, multicitations, physics journals, references, typesetting}} +\ifpdf + \usepackage[\MYhyperrefoptions,pdftex]{hyperref} +\else + \usepackage[\MYhyperrefoptions,dvips]{hyperref} + \usepackage{breakurl} +\fi + +\usepackage{color} +\definecolor{darkred}{rgb}{0.8,0.0,0.0} +\definecolor{darkgreen}{rgb}{0.0,0.5,0.0} +\definecolor{darkblue}{rgb}{0.0,0.0,0.7} + + +\providecommand{\texorpdfstring}[2]{#1} + + +% Improved \textunderscore to provide a much better fake _ when used with +% OT1 encoding. Under OT1, detect use of pcr or cmtt \ttfamily and use +% available true _ glyph for those two typewriter fonts. +\makeatletter +\def\@MYstringptm{ptm} % Times Roman family +\def\@MYstringppl{ppl} % Palatino Roman family +\def\@MYstringphv{phv} % Helvetica Sans Serif family +\def\@MYstringpcr{pcr} % Courier typewriter family +\def\@MYstringcmtt{cmtt} % Computer Modern typewriter family +\DeclareTextCommandDefault{\textunderscore}{\leavevmode +\ifx\f@family\@MYstringpcr\string_\else +\ifx\f@family\@MYstringcmtt\string_\else +\ifx\f@family\@MYstringptm\kern 0em\vbox{\hrule\@width 0.5em\@height 0.5pt\kern -0.3ex}\else +\ifx\f@family\@MYstringppl\kern 0em\vbox{\hrule\@width 0.5em\@height 0.5pt\kern -0.3ex}\else +\ifx\f@family\@MYstringphv\kern -0.03em\vbox{\hrule\@width 0.62em\@height 0.52pt\kern -0.33ex}\kern -0.03em\else +\kern 0.09em\vbox{\hrule\@width 0.6em\@height 0.44pt\kern -0.63pt\kern -0.42ex}\kern 0.09em\fi\fi\fi\fi\fi\relax} +\makeatother + +\makeatletter +\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} +\def\@bstctlcite[#1]#2{\@bsphack + \@for\@citeb:=#2\do{% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% + \@esphack} +\makeatother + +\makeatletter +%% ***** Start ZAX defs ***** +%% based on unreleased zax.sty, not ready yet for formal use +%% V0.9 +%% 2005/05/02 +%% Copyright (c) 2005 by Michael Shell +%% see http://www.michaelshell.org/contact.html +%% for current contact information. +% +% +% Showing LaTeX source code poses some difficulties. I probably could have +% done things with \verbatim. But, I don't like it for a number of reasons. +% For me, the main drawbacks are: +% +% 1. hyphenates words +% 2. does not perfectly left and right justify the \ttfamily text +% 3. does not allow the use of active LaTeX commands within the displayed +% code +% +% Basically, I wanted a little more control. +% +% So, I developed a set of commands that will display LaTeX code. +% The \ZAXlong and \ZAXshort commands allow the direct +% display of LaTeX commands. The difference between the two is that +% \ZAXlong will retain spaces and allows the inter-letter spacing +% to expand slightly so that the text will always be justified while +% \ZAXshort ignores spaces and uses no inter-letter space. +% Variations of these two can be created by the user to provide +% fo different font sizes and styles. +% +% When one of these commands is issued: +% +% | becomes the control character: |relax +% ( use |ZAXbar to get a | character) +% +% { } becomes like punctuation +% (use |bgroup and |egroup instead) +% +% + prevents a break between the characters it appears between +% (use |ZAXplus to get a + character) +% +% ~ nonbreaking spaces become visible tildes +% +% breaks are not allowed right after a "\" or a space +% +% For the long form, since normal spaces are not ignored: +% & becomes an (ignored) space character for use after commands. +% e.g., " |mbox|bgroup&Unbro|egroup&ken and " +% +% to stop the action of a \ZAX command, issue an |end. +% +% The trick is to read all the input characters and to insert a "sliver" +% of hspace glue between them! TeX will be happy to make a break at any +% glue, and it will never hyphenate at the break. With the long form, +% this interletter glue is also allowed to stretch a very small amount - +% because a long sequence could stretch across the entire column without +% any spaces to break on. +% When real spaces are encountered, we replace them with \hspace* commands +% of the same nominal length, but that can stretch and shrink a fair +% amount. The \hspace* form ensures that the space will not be lost +% at the start/end of the lines. By using \penalty10000 at the end of +% the artificial spaces, we ensure that TeX will not break right after a +% space - the user will be able to explicitly see the space at the +% beginning of the next line. +% +% This command family can be thought of as implementing a type of "backward" +% line breaking world in which breaks are assumed to possible everywhere except +% were indicated as prohibited. Furthermore, hyphenation is not used as spaces +% are not implicit with line breaks, but must be carried to the start of the +% next line. In other words, commands are not thought of as words, but rather +% as sequences of letters. +% +% +% Note: TeX parser tokenizes commands and special characters when acquiring +% an argument for a command. Thus, when used within an argument to a command, +% the code in the \ZAX never gets a chance to alter "\", "|", "{", "}", +% etc., before TeX acquires the argument. For such use, the syntax is reversed, +% i.e., call the commands using the "\" as one normally would. The "+", "~" will +% still operate as described above: +% \footnote{\ZAXlong this\ZAXplus is+a\ZAXbar big\_\ZAXbsl mbox% +% \ZAXobrace~\ZAXcbrace\ test\end.} +% Future versions of this code may use this latter approach exclusively so +% as to unify the syntax (although entering LaTeX code will then take longer +% command sequences in the main text). + + +\def\ZAXplus{\mbox{+}} % a plus sign +\def\ZAXbar{\mbox{|}} % a vert bar +\def\ZAXvtilde{\~{}} % a visible tilde +%\def\ZAXvtilde{\textasciitilde} % another form of a visible tilde + +% define \ZAXbsl which is a "\" character +\catcode`\|=0 \catcode`\\=12 +|edef|ZAXbsl{|mbox{\}} +|catcode`|\=0 |catcode`||=12 + +% define \ZAXbslnobrk macro that gives an unbreakable backslash character +% this is used only in \ZAXrun to prevent breaks around \ +\catcode`\|=0\catcode`\\=12 |def|ZAXbslnobrk{\} |catcode`|\=0 |catcode`||=12 + +% define \ZAXobrace which is a "{" character +\catcode`\$=1 \catcode`\{=12 +\edef\ZAXobrace$\mbox${}} +\catcode`\$=3 \catcode`\{=1 + +% define \ZAXcbrace which is a "}" character +\catcode`\$=2 \catcode`\}=12 +\edef\ZAXcbrace{\mbox{}$$ +\catcode`\$=3 \catcode`\}=2 + +% define \ZAXmath which is the "$" math shift character +\edef\ZAXmath{$} + +% makes spaces visible +\def\ZAXvspon{\catcode`\ =12} +% makes spaces invisible +\def\ZAXvspoff{\catcode`\ =10} + +% \ZAXvsp is a macro that produces a visible space +% can be used to show spaces within the short or long cmdword forms +\ZAXvspon\def\ZAXvsp{ }\ZAXvspoff + +% \\ does not work in ZAX environments do to the change in +% cat codes. We provide it here as \ZAXnl - this definition +% is updated as ZAX starts. +\let\ZAXnl=\\ + +% fat space nominal factor (multiplied by width of \ ) +\def\ZAXfatspacenorm{1} +% fat space stretch factor +\def\ZAXfatspacestretch{0.43} +% fat space shrink factor +\def\ZAXfatspaceshrink{0.24} +% slim space +\def\ZAXslimspacelen{0pt plus 0.15pt minus 0pt} + + + +% these are determined in the start code, but provide dummys here so they are defined +\def\ZAXfatspace{\hspace*{10pt}\penalty10000} +\def\ZAXslimspace{\penalty0\hspace{0pt plus 0pt minus 0pt}} + + +% flag to indicate if font was saved +\newif\if@ZAXsavedfont \@ZAXsavedfontfalse + +% saves all the properties of the given font +% use global in case font save is set within a group +\def\ZAXsavefont{\global\let\@ZAXfontENCODINGsave\f@encoding% +\global\let\@ZAXfontFAMILYsave\f@family\global\let\@ZAXfontSERIESsave\f@series% +\global\let\@ZAXfontSHAPEsave\f@shape\global\let\@ZAXfontSIZEsave\f@size% +\global\let\@ZAXfontBASELINESKIPsave\f@baselineskip\global\@ZAXsavedfonttrue} +% restores font back to saved value +\def\ZAXrestorefont{\fontencoding{\@ZAXfontENCODINGsave}\fontfamily{\@ZAXfontFAMILYsave}% +\fontseries{\@ZAXfontSERIESsave}\fontshape{\@ZAXfontSHAPEsave}% +\fontsize{\@ZAXfontSIZEsave}{\@ZAXfontBASELINESKIPsave}\selectfont} + + +% lengths +\newskip\@ZAXtemplen +\newskip\@ZAXfatspacelen + + +% Setup for the longcmdword form +% make a stretchable fat spacer equal in length to the nominal space length +% use penalty's to ensure easy breaks before and impossible breaks after spaces +% allow the inter-letter slim "sliver" space to stretch a tad +% make | the control character, & a space, and \{}, $ and blank characters +% equal to punctuation +\def\ZAXstartLong{\let\@ZAXnextbrk=0% no sliver before start +\settowidth{\@ZAXfatspacelen}{\ }% +\setlength{\@ZAXfatspacelen}{\ZAXfatspacenorm\@ZAXfatspacelen}% +\setlength{\@ZAXtemplen}{\ZAXfatspacestretch\@ZAXfatspacelen}% +\addtolength{\@ZAXfatspacelen}{0pt plus \the\@ZAXtemplen}% +\setlength{\@ZAXtemplen}{\ZAXfatspaceshrink\@ZAXfatspacelen}% +\addtolength{\@ZAXfatspacelen}{0pt minus \the\@ZAXtemplen}% +\def\ZAXfatspace{\penalty0\hspace*{\@ZAXfatspacelen}\penalty10000}% +\def\ZAXslimspace{\hspace{\ZAXslimspacelen}}% +\let\ZAXnl=\\% +\catcode`\|=0 \catcode`\\=12 \catcode`\{=12 \catcode`\}=12 \catcode`\ =12 \catcode`\&=10% +\catcode`\^=12 \catcode`\$=12 \catcode`\#=12% +\ZAXrun} + + +% Setup for the shortcmdword form +% make a stretchable fat spacer equal in length to the nominal space length +% use penalty's to ensure impossible breaks after spaces +% the inter-letter slim "sliver" space is rigid at 0pt +% make | the control character and \{}, $, # and characters equal to punctuation +\def\ZAXstartShort{\let\@ZAXnextbrk=0%% no sliver before start +\settowidth{\@ZAXfatspacelen}{\ }% +\setlength{\@ZAXtemplen}{\ZAXfatspacestretch\@ZAXfatspacelen}% +\addtolength{\@ZAXfatspacelen}{0pt plus \the\@ZAXtemplen}% +\setlength{\@ZAXtemplen}{\ZAXfatspaceshrink\@ZAXfatspacelen}% +\addtolength{\@ZAXfatspacelen}{0pt minus \the\@ZAXtemplen}% +\def\ZAXfatspace{\hspace*{\@ZAXfatspacelen}\penalty10000}% +\def\ZAXslimspace{\hspace{0pt plus 0pt minus 0pt}}% +\let\ZAXnl=\\% +\catcode`\|=0 \catcode`\\=12 \catcode`\{=12 \catcode`\}=12 \catcode`\$=12 \catcode`\#=12% +\ZAXrun} + + +\def\ZAXrun#1{\ifx#1\end\catcode`\{=1 \catcode`\}=2 \catcode`\\=0% stop if we hit an |end +\catcode`\|=12 \catcode`\ =10 \catcode`\&=4 \catcode`\^=7 \catcode`\$=3 \catcode`\#=6% +\if@ZAXsavedfont\ZAXrestorefont\fi\global\@ZAXsavedfontfalse\let\@ZAXnext=\relax% +\else% +\def\@ZAXtokenout{#1}% save the token as a macro +\let\@ZAXout=1\relax% assume we wish to output this character +\let\@ZAXbrk=1\relax% assume this is a breakable point +\ifx\@ZAXnextbrk0\let\@ZAXbrk=0\fi% unless prev char wants no break here +\let\@ZAXnextbrk=1\relax% we assume this char will allow the next char to break +\let\@ZAXoutspace=\ZAXslimspace% assume the output spacer is a sliver +\ifx\@ZAXtokenout\ZAXvsp\let\@ZAXout=0\let\@ZAXoutspace=\ZAXfatspace\let\@ZAXnextbrk=0\fi% visible space, output the space instead +\ifx#1\ \let\@ZAXout=0\let\@ZAXoutspace=\ZAXfatspace\let\@ZAXnextbrk=0\fi% control space, output the spacer instead +\ifx#1+\let\@ZAXout=0\let\@ZAXbrk=0\let\@ZAXnextbrk=0\fi% a + means not to break here or at the next, discard token and no spacer +\ifx\@ZAXtokenout\ZAXbslnobrk\let\@ZAXnextbrk=0\fi% we don't want breaks right after \ +\ifx#1~\def\@ZAXtokenout{\ZAXvtilde}\fi% make nonbreaking spaces visible +%\ifx#1\ZAXobrace\def\@ZAXtokenout{{\catcode`\{=1\{}}\typeout{obrace}\fi% +%\ifx#1\ZAXcbrace\def\@ZAXtokenout{\}}\fi% +\ifx\@ZAXbrk1\@ZAXoutspace\else\penalty10000\relax\@ZAXoutspace\fi% output spacer, stop breaks if needed +\ifx\@ZAXout1\ifx\@ZAXbrk1\relax\@ZAXtokenout\relax\else\penalty10000\relax\@ZAXtokenout\relax\fi\fi% output the token if desired +\let\@ZAXnext=\ZAXrun% ready to get next token +\fi% now get the next token +\@ZAXnext} + + +\def\ZAXlong#1{\ZAXsavefont#1\ZAXstartLong} +\def\ZAXshort#1{\ZAXsavefont#1\ZAXstartShort} + + +% to define custom commands, do like: +% \def\ZAXlongSTT{\ZAXsavefont\small\ttfamily\ZAXstartLong} + + +%% ***** End ZAX defs ***** +\makeatother + + +% Bogus thebibliography for apsrev.bst extracts +\makeatletter +\newenvironment{MYapsrevthebibliography}[1]{\relax +\list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.\@m\relax +\expandafter\ifx\csname bibnamefont\endcsname\relax + \def\bibnamefont##1{##1}\fi +\expandafter\ifx\csname bibfnamefont\endcsname\relax + \def\bibfnamefont##1{##1}\fi +\expandafter\ifx\csname citenamefont\endcsname\relax + \def\citenamefont##1{##1}\fi +\expandafter\ifx\csname url\endcsname\relax + \def\url##1{\texttt{##1}}\fi +\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi +\providecommand{\bibinfo}[2]{##2}\relax +\providecommand{\eprint}[2][]{\url{##2}}\relax +\def\@MYapsrevbogusbibitem{\@ifnextchar[{\@@MYapsrevbogusbibitem}{\@@MYapsrevbogusbibitem[\relax]}}\relax +\def\@@MYapsrevbogusbibitem[##1]##2{\item}\relax +\let\bibitem\@MYapsrevbogusbibitem}{\endlist} +\makeatother + + +\def\BibTeX{{\rmfamily B\kern-.05em{\scshape i\kern-.025em b}\kern-.08em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +% needed only when not using the CM super fonts as they do not +% have bold small caps needed for a bold \BibTeX +%\newcommand{\MYfontfix}[1]{\textmd{#1}} +% +\newcommand{\MYfontfix}[1]{\relax #1} + +\newenvironment{MYlistblk}{\parindent=0pt\trivlist\item\relax\small}{\endtrivlist} + +\newcommand{\MYemdash}{\,---\,} + +\newcommand{\MYshortcmd}{\ZAXshort{\ttfamily\small}} +\newcommand{\MYlongcmd}{\ZAXlong{\ttfamily\small}} + +\newcommand{\MYsmalltt}[1]{\texttt{\small #1}} + +\newcommand{\MYsecref}[1]{section~\ref{#1}} +\newcommand{\MYSecref}[1]{Section~\ref{#1}} + + +\pagestyle{headings} + +%\vskip -20em + + +\title{Mciteplus: Enhanced Multicitations} +\author{Michael Shell\thanks{See \url{http://www.michaelshell.org/} for +current contact information.\hfil\break +\indent\ Manuscript originally created on January 15, 2008; revised September 13, 2013. +The latest version of this package can be obtained at \mbox{CTAN} \cite{ctan:mciteplus}. +This work is distributed under the \LaTeX\ Project Public License (LPPL) + ( \url{http://www.latex-project.org/} ) +version 1.3. A copy of the LPPL, version 1.3, is included in the base \LaTeX\ +documentation of all distributions of \LaTeX\ released 2003/12/01 or later. +The opinions expressed here are entirely that of the author. No warranty is expressed +or implied. User assumes all risk.}\\ +{\small\hfill\textit{with special thanks to Joseph Wright}\hfill\mbox{}}} + +\date{Version 1.2, September 13, 2013\\[0.5\baselineskip] +{\normalfont\normalsize\url{http://www.michaelshell.org/tex/mciteplus/}}} + + +\flushbottom + +\begin{document} + +\bstctlcite{BSTcontrol} + +\thispagestyle{empty} + +\maketitle +\begin{abstract} +This \LaTeXe{} package is an enhanced reimplementation of Thorsten Ohl's mcite package +which provides support for the grouping of multiple citations together as is +often done in physics journals. An extensive set of features provide for +other applications such as reference sublisting. +\end{abstract} + +\tableofcontentssectiononly +\begin{multicols}{2} +\tableofcontentsstarttoc +\end{multicols} + + + +\section{Introduction} +Mciteplus is a reimplementation of Thorsten Ohl's +(\url{http://theorie.physik.uni-wuerzburg.de/~ohl/}) mcite \LaTeX\ package +\cite{ctan:mcite}, which +provides for ``collapsed'' citations (i.e., a grouping of multiple references +under a single collective reference) as is often done in physics journals. +Using Thorsten Ohl's example in the documentation for mcite: +\begin{MYapsrevthebibliography}{3} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +\bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}). + +\bibitem[{\citenamefont{Salam}(1968)}]{Salam} +\bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}. + +\bibitem[{\citenamefont{Weinberg}(1967)}]{Weinberg} +\bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{MYapsrevthebibliography} +becomes:\footnote{Formatting produced by the apsrevM.bst bibstyle.}\relax +\begin{MYapsrevthebibliography}{1} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +\bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}); +\bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}; +\bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{MYapsrevthebibliography} + + +\subsection{Features} +Mciteplus offers the following features many of which are not available with the +original mcite: +\begin{itemize} +\item Entry punctuation can be controlled by the bibstyle (.bst) as well as the user. +\item No ``double periods'' when an entry already ends with a period (e.g., an +abbreviated journal name). +\item Support for sublists. +\item Support for multiple bibliographies and/or auxiliary files. +\item The bibliography sample label width is automatically updated to account for the changes + in the numbering due to the grouped entries. Maximum label width information is + available to user. +\item Compatible with the natbib package. (The bibstyle must support both +mciteplus as well as natbib.) +\item Compatible with the REV\TeX4 class. (The bibstyle must support both +mciteplus as well as natbib.) +\item Support for the optional argument of \MYshortcmd\cite[]{}|end. +\item Provides a means to allow users to use almost any cite command via custom command +wrappers and the ability to manually disable all automatic internal hooks. +\item Mciteplus compatible sorting bibstyles are possible via the use of a ``mcitetail'' +field in the \BibTeX\ database entries. See \MYsecref{sec:sortingbibstyles} for details. +\end{itemize} + + +\subsection{File List} +The files in this package are as follows: +\begin{description} +\item[\ttfamily mciteplus.sty] The mciteplus \LaTeX\ package. +\item[\ttfamily mciteplus\_doc.pdf] The user manual (this document). +\item[\ttfamily mciteplus\_doc.tex] The \LaTeX\ source of the user manual. +\item[\ttfamily mciteplus\_code.txt] Selected .bst modification and other code listings. +\item[\ttfamily apsrevM.bst] An mciteplus compatible version of REV\TeX4's apsrev.bst \cite{ctan:revtex}. +\item[\ttfamily apsrmpM.bst] An mciteplus compatible version of REV\TeX4's apsrmp.bst \cite{ctan:revtex}. +\textbf{Note: This is a sorting style. For it to work properly, you must set the +``mcitetail'' \BibTeX\ database field for every tail entry as mentioned in +\MYsecref{sec:sortingbibstyles}.} +\item[\ttfamily IEEEtranM.bst] An mciteplus compatible version of IEEEtran.bst \cite{ctan:ieeetranbst}. +\item[\ttfamily IEEEtranMN.bst] An mciteplus compatible version of IEEEtranN.bst (natbib compatible) \cite{ctan:ieeetranbst}. + +\end{description} + + + +\section{Basic Usage} + + +\subsection{Bibstyle (.bst) Requirements} +Mciteplus does require an mciteplus compatible bibstyle (.bst file). +\textbf{Unfortunately, bibstyles designed for use with mcite will not +work with mciteplus.} See \MYsecref{sec:bibstylemods} for +information on how to convert existing bibstyles for use with mciteplus. + + +\subsection{Package Loading and Options} +Mciteplus is invoked in the standard \LaTeX\ way: +\begin{MYlistblk} +\MYlongcmd +\usepackage[|itshape+options|upshape]{mciteplus}|end +\end{MYlistblk} +{\bfseries As mciteplus installs command wrappers over existing \MYshortcmd\cite|end\ commands, +it should be loaded last, even after other packages that normally are loaded last such +as hyperref \cite{ctan:hyperref}.} + +Be aware that LaTeX may have to be run twice in order for the correct label +width to be calculated and used after entries are collapsed. When this happens, +mciteplus will issue the warning +``Rerun to ensure correct mciteplus label max width/count''. + +\subsubsection{Package Options} +\label{sec:packageoptions} +Valid options are: + +\indent\textbf{chapterbibrootbib}\MYemdash +This option must be specified when using the rootbib option/mode of the chapterbib package +\cite{ctan:chapterbib}. Mciteplus is not able to auto-detect the rootbib mode +of chapterbib directly because when invoking that mode, the user must run \LaTeX\ a second time +without the rootbib option. For all of these \LaTeX\ runs, keep this mciteplus option +enabled (i.e., as long as there is, or is going to be, a jobname.bbl file under +chapterbib). Beware of the possibility of an mciteplus status (i.e., head or tail) +conflict in an overall bibliography if the same entry is cited differently in +different parts of the document. See \MYsecref{sec:chapterbib} for more details on +the use of chapterbib. + +\indent\textbf{debug}\MYemdash +Invoking this option will cause mciteplus to issue debugging information +to the console whenever it processes: (1) a citation list; (2) an mciteplus aware +bibliography; and (3) entries within the mciteplus bibliography. This may be helpful to +diagnose problems or to learn what tracking IDs, etc., mciteplus is using. + +\indent\textbf{nohooks}\MYemdash +This option will prevent mciteplus from automatically hooking into \LaTeX's +\MYshortcmd\cite|end\ internals and/or autodetecting and interfacing with +external packages. The intended use is for advanced users who want to create +their own mciteplus' \MYshortcmd\cite|end\ wrappers. When using this option, +users will then have to manually define their own cite wrappers using the internal +mciteplus engine (which is always available to users regardless of whether this +option is selected or not). See \MYsecref{sec:customwrappers} for how to do this. +Beware that this option can cause some packages to issue errors when used with +mciteplus, especially those that alter the bibliography environments (e.g., +citeref.sty, pageref.sty, etc.) + + +\subsection{Cite Format} +In the example given at the start of the introduction, the Glashow entry is +known as the ``head'' entry and those of Salam and +Weinberg are known as ``tails''. As with mcite, tails are declared within +the \MYshortcmd\cite|end\ command immediately after their head entry by prefixing them with a *: +\begin{MYlistblk} +\MYlongcmd +\cite{Glashow,*Salam,*Weinberg}|end +\end{MYlistblk} +Head entries may or may not have tails. However, every tail must have a head entry. +The tail entries for a group must all be declared (without duplication) when their +head entry is first cited. After that, the head entry may be recited as often as desired. +It is possible, though bad practice, to redeclare the tails (or a subset thereof) when +reciting the head. This allows for the case of overall bibliographies in which the +same citation group is defined in multiple local bibliographies, all the entries +of which are later combined into a single overall bibliography. +However, new tails cannot be later added to an existing citation group. + +Thus, each of the following lines will generate an error as they are \textbf{invalid}: +\begin{MYlistblk} +\MYlongcmd +\cite{*Salam} |% missing head declaration |\ +| |\ +\cite{Glashow,*Salam} \cite{Glashow,*Salam,*Weinberg} |% tails added after initial definition|\ +| |\ +\cite{Glashow,*Salam,*Salam} |% duplicate tails in initial definition|end +\end{MYlistblk} +Each of the following lines is \textbf{valid}: +\begin{MYlistblk} +\MYlongcmd +\cite{Glashow,*Salam,*Weinberg,Smith,*Jones} |% multiple groups OK |\ +| |\ +\cite{Glashow,*Salam,*Weinberg} \cite{Glashow} |% head can be recited anytime |\ +| |\ +\cite{Glashow,*Salam,*Weinberg} \cite{Glashow,*Salam,*Weinberg} |% restate previous definition |\ +| |\ +\cite{Glashow,*Salam,*Weinberg} \cite{Glashow,*Weinberg} |% restate part of previous definition |\ +| |\ +\cite[page 580 of Glashow]{Glashow,*Salam} |% optional argument is supported |\ +| |\ +\nocite{*} |% BibTeX wildcard OK, but use with caution |end +\end{MYlistblk} +The \BibTeX\ ``wildcard'' entry ``*'' for \MYshortcmd\nocite|end\ is allowed. However, +it is important to ensure that the entries \BibTeX\ will automatically add to the +bibliography from its databases will not get ``in between'' any head/tail groupings. This +will not be a problem with unsorted bibstyles as long as the head/tail groups are +cited prior to the invocation of the wildcard entry or as long as the head/tail group +entries are listed together and in the correct order in the \BibTeX\ databases. However, with +sorting bibstyles extra care must be taken to keep the head/tail groups together in +spite of the reordering process. See \MYsecref{sec:sortingbibstyles} for more information. + +By default, mciteplus will issue an error message if it encounters +bibliography\footnote{Well, only those in a \texttt{mcitethebibliography} environment.} +entries that it has no record of. This will almost certainly be the case if the +\BibTeX\ wildcard entry is used. To disable the error messages and allow +mciteplus to automatically assume that all unknown entries are heads, just issue +the \TeX\ conditional: +\begin{MYlistblk} +\MYlongcmd +\mciteErrorOnUnknownfalse|end +\end{MYlistblk} +before the bibliography it is to affect. Mciteplus will issue a warning message +to the console as a reminder if it detects the use of the \BibTeX\ wildcard entry. + + +\subsection{Punctuation Controls} +There are three kinds of punctuation/spacing mciteplus uses in the formatting of entries +in the bibliography: (1) Middle punctuation which is used between entries within a +collapsed group (typically ``; ''); (2) End punctuation which is used at the end +of each entry group (typically ``.''); and (3) separation punctuation/spacing +which is inserted before each head entry after the very first. Separation +punctuation/spacing is usually not used (it is typically ``\MYshortcmd\relax|end''), +but it is provided for because some bibliography styles may require unusual spacing +or a \MYshortcmd\par|end\ between the entries, but under mciteplus, bibstyles cannot +directly insert such things as \BibTeX\ does not know at run time which +entries are heads and which are tails. + +Mciteplus defines the package defaults of each as:\footnote{{\ttfamily\ZAXbsl providecommand} is +used so that class files can declare their own mciteplus defaults.} +\begin{MYlistblk} +\MYlongcmd +\providecommand{\mcitedefaultmidpunct}{;\space}|\ +\providecommand{\mcitedefaultendpunct}{.}|\ +\providecommand{\mcitedefaultseppunct}{\relax}|end +\end{MYlistblk} +However, both the bibstyle and the user can override the defaults with the user having +the final say in the matter. + +Bibstyles can override the package defaults via issuing the command: +\begin{MYlistblk} +\MYlongcmd +\mciteSetBstMidEndSepPunct{|bgroup|itshape+middle punctuation|egroup}{|bgroup|itshape+end punctuation|egroup}{|bgroup|itshape+separation punctuation|egroup}|end +\end{MYlistblk} +\MYshortcmd\mciteSetBstMidEndSepPunct|end\ must be issued at the end of the entry it is to +affect (prior to the next \MYshortcmd\bibitem|end) and the values given will remain in effect +until specified again. + +The user can override the bibstyle by issuing the command: +\begin{MYlistblk} +\MYlongcmd +\mciteSetMidEndSepPunct{|bgroup|itshape+middle punctuation|egroup}{|bgroup|itshape+end punctuation|egroup}{|bgroup|itshape+separation punctuation|egroup}|end +\end{MYlistblk} +before the bibliography it is to affect. However, this poses a problem because +the bibstyle may or may not specify end punctuation for each entry (e.g., such +as when an entry ends with a URL or an abbreviated journal name). To provide for +this, mciteplus provides a \TeX\ conditional \MYshortcmd\ifmciteBstWouldAddEndPunct|end, +that a bibstyle can set to true if and only if \BibTeX\ would add end punctuation +to the given entry. (See \MYsecref{sec:bibstylemods} for how bibstyle designers +should implement this feature.) If the bibstyle provides this feature, and it is +recommended that they do, then users can take advantage of this conditional in their use +of \MYshortcmd\mciteSetMidEndSepPunct|end: +\begin{MYlistblk} +\MYlongcmd +\mciteSetMidEndSepPunct{;\space}{\ifmciteBstWouldAddEndPunct.\else\fi}{\relax}|end +\end{MYlistblk} +and thus still avoid the ``double period'' problem under their +own custom punctuation. + +After issuing a user defined \MYshortcmd\mciteSetMidEndSepPunct|end\ for a bibliography, +a user can restore control back to the bibstyle for later bibliographies by issuing: +\begin{MYlistblk} +\MYlongcmd +\mciteSetMidEndSepPunct{\mcitebstmidpunct}{\mcitebstendpunct}{\mcitebstseppunct}|end +\end{MYlistblk} +before the bibliography(ies) to be affected. + + + +\subsection{Counters} +\label{sec:counters} +Mciteplus provides two \LaTeX\ counters, \MYshortcmd+mcitebibitemcount|end\ and +\MYshortcmd+mcitesubitemcount|end, which track the number of head, and tail entries +for each head, respectively. At each head entry, \MYshortcmd+mcitebibitemcount|end\ is +incremented and \MYshortcmd+mcitesubitemcount|end\ is reset, by/to one. +At each tail entry (or sublisted head entry under sublist modes ``b'', ``f'' and ``h'' +as described in \MYsecref{sec:sublistlabelbeginend}), \MYshortcmd+mcitesubitemcount|end\ +is incremented by one after each subitem label is rendered. +Be aware that \MYshortcmd+mcitebibitemcount|end\ is \emph{not} what is used to +actually generate the entry labels in the bibliography as \LaTeX\ handles this +the same way it normally does (typically using it's own counter, +\MYsmalltt{enumiv}). + +These counters can be referenced by the user to generate sublist labels +(\MYsecref{sec:sublistlabelbeginend}), to determine maximum label +widths (\MYsecref{sec:maxwidths}) as well as to control +other counters (e.g., \MYsecref{sec:mcitethebibliographyhooks}). + + +\subsubsection{Bibitem Counter Reset} +\label{sec:bibitemcounterreset} +By default, mciteplus resets \MYshortcmd+mcitebibitemcount|end\ at the +start of each bibliography. However, in some documents with multiple bibliographies, +the entries are to be numbered consecutively throughout the document and, thus, +the entry count should not reset at the start of each bibliography. For +such cases, you can issue a: +\begin{MYlistblk} +\MYlongcmd +\mciteResetBibitemCountfalse|end +\end{MYlistblk} +before a bibliography to disable the counter reset (so that the maximum +label widths and counts will be correct, see \MYsecref{sec:labelwidths}). +There is also a \MYshortcmd\mciteResetBibitemCounttrue|end\ which reenables the +resetting of the counter. + + + + +\subsection{Sublists} +\label{sec:sublists} +Sublisting within entry groups is supported by mciteplus. For example: +\begin{MYapsrevthebibliography}{1} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +\bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}); +a) \bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}; +b) \bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{MYapsrevthebibliography} +The sublist labels (e.g., ``a)'', ``b)'', etc.) are based on the mciteplus +provided \LaTeX\ counter, +\MYshortcmd+mcitesubitemcount|end, which is reset at the start +of each head. + +\subsubsection{Sublist Modes} +\label{sec:sublistmodes} +The standard sublist mode ``s'' (as show above) is to +begin numbering with the first tail. + +Mciteplus can begin numbering with the head entries, but +omit the sublabel for the heads via sublist mode ``b'': +\begin{MYapsrevthebibliography}{1} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +\bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}); +b) \bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}; +c) \bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{MYapsrevthebibliography} + +To sublabel the first entries of each group (heads) use +the sublist mode ``f'': +\begin{MYapsrevthebibliography}{1} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +a) \bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}); +b) \bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}; +c) \bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{MYapsrevthebibliography} +Entries without tails (single heads) are not sublisted under sublist +mode ``f''. To enable that, use sublist mode ``h''. + +As with punctuation, the sublist mode can be specified by both the bibstyle +as well as the user with the latter overriding the former: +\begin{MYlistblk} +\MYlongcmd +\mciteSetBstSublistMode{|itshape+mode|upshape} |% for use by bibstyles|\ +| |\ +\mciteSetSublistMode{|itshape+mode|upshape} |% for use by the user in the document|end +\end{MYlistblk} +where \textit{mode} is one of: +\begin{enumerate} +\item[\textbf{d}] \MYemdash ``Default'', do not alter whatever mode is currently in effect. +For bibstyles, this is essentially a NOOP, but when invoked by the user, the bibstyle is +allowed to alter the sublist mode. +\item[\textbf{n}] \MYemdash No sublist, do not sublist the entries. +\item[\textbf{s}] \MYemdash Sublist mode ``s'', sublist the tail entries. +\item[\textbf{b}] \MYemdash Sublist mode ``b'', sublist the tail entries, start the count with their +head, but omit labeling the head. +\item[\textbf{f}] \MYemdash Sublist mode ``f'', sublist the tail entries including their head. +\item[\textbf{h}] \MYemdash Sublist mode ``h'', implies sublist mode ``f'', but sublist all entries, +even heads without tails. +\end{enumerate} +Unless specified otherwise, sublisting will not be done. + +\subsubsection{Sublist Label, Begin and End} +\label{sec:sublistlabelbeginend} +Mciteplus allows bibstyles and users to specify the sublist label form used, +the code that gets executed at the start of the sublist and the code +that ends a sublist. Mciteplus defines the package defaults of each as: +\begin{MYlistblk} +\MYlongcmd +\providecommand{\mcitedefaultsublistlabel}{\alph{mcitesubitemcount})\space}|\ +\providecommand{\mcitedefaultsublistbegin}{\relax}|\ +\providecommand{\mcitedefaultsublistend}{\relax}|end +\end{MYlistblk} +The result of which is as shown in the previous examples. +However, both the bibstyle and the user can override the defaults with the user having +the final say in the matter. The sublist label/begin/end code can be specified by both +the bibstyle as well as the user with the latter overriding the former: +\begin{MYlistblk} +\MYlongcmd +\mciteSetBstSublistLabelBeginEnd{|itshape+label|upshape}{|itshape+begin|upshape}{|itshape+end|upshape} |% for use by bibstyles|\ +| |\ +\mciteSetSublistLabelBeginEnd{|itshape+label|upshape}{|itshape+begin|upshape}{|itshape+end|upshape} |% for use by the user in the document|end +\end{MYlistblk} +This flexibility provides a way to use customized environments for the sublists: +\begin{MYlistblk} +\MYlongcmd +\mciteSetSublistMode{s}|\ +\mciteSetSublistLabelBeginEnd{\item[\arabic{mcitebibitemcount}.\alph{mcitesubitemcount})]}{\begin{enumerate}}{\end{enumerate}}|end +\end{MYlistblk} +which yields: +\begin{MYapsrevthebibliography}{1} +\bibitem[{\citenamefont{Glashow}(1961)}]{Glashow} +\bibinfo{author}{\bibfnamefont{S.~L.} \bibnamefont{Glashow}}, + \bibinfo{journal}{Nucl. Phys.} \textbf{\bibinfo{volume}{22}}, + \bibinfo{pages}{579} (\bibinfo{year}{1961}); +\begin{enumerate} +\item[1.a)] \bibinfo{author}{\bibfnamefont{A.}~\bibnamefont{Salam}}, in + \emph{\bibinfo{booktitle}{Elementary Particle Theory}}, edited by + \bibinfo{editor}{\bibfnamefont{N.}~\bibnamefont{Svartholm}} + (\bibinfo{publisher}{Almquist and Wiksell}, \bibinfo{address}{Stockholm}, + \bibinfo{year}{1968}), pp. \bibinfo{pages}{367--377}; +\item[1.b)] \bibinfo{author}{\bibfnamefont{S.}~\bibnamefont{Weinberg}}, + \bibinfo{journal}{Phys. Rev. Lett.} \textbf{\bibinfo{volume}{19}}, + \bibinfo{pages}{1264} (\bibinfo{year}{1967}). +\end{enumerate} +\end{MYapsrevthebibliography} + +After issuing a user defined \MYshortcmd\mciteSetSublistLabelBeginEnd|end\ for a bibliography, +a user can restore control back to the bibstyle for later bibliographies by issuing: +\begin{MYlistblk} +\MYlongcmd +\mciteSetSublistLabelBeginEnd{\mcitebstsublistlabel}{\mcitebstsublistbegin}{\mcitebstsublistend}|end +\end{MYlistblk} +before the bibliography(ies) to be affected. + + + +\subsubsection{Referencing Sublist Labels} +\label{sec:refsublistlabel} +It is not possible to reference the tails using \MYshortcmd\cite|end: +\begin{MYlistblk} +\MYlongcmd +\cite{Salam} |% invalid, tail redeclared as a head|\ +\cite{*Salam} |% invalid, tail cannot be referenced|end +\end{MYlistblk} +and even if it were allowed, it would likely cause problems with packages +that compress and sort citation numbers. + +However, mciteplus does provide two commands that work much like \MYshortcmd\ref|end\ +and \MYshortcmd\pageref|end\ that can be used to reference the sublabeled entries +and the page numbers they appear on: +\begin{MYlistblk} +\MYlongcmd +\mciteSubRef[|itshape+track ID|upshape]{|itshape+cite key|upshape}|\ +\mciteSubPageRef[|itshape+track ID|upshape]{|itshape+cite key|upshape}|end +\end{MYlistblk} +where \textit{cite key} is a (single) citation key and \textit{track ID} is +the tracking ID (\MYsecref{sec:trackingandaux}) string which mciteplus uses +to uniquely identify bibliographies. Please note that these commands will not work +for entries that are not sublabeled (e.g., heads with tails if the sublist +mode is not ``f'' or ``h''). The tracking IDs used by each bibliography can be +displayed by loading mciteplus with the ``debug'' package option (\MYsecref{sec:packageoptions}). +For virtually all single bibliography documents, the default tracking ID should work +fine. However, when multiple bibliographies are in use, the tracking ID may +have to be specified so that mciteplus will know which bibliography entry to +reference. Some packages such as chapterbib, may even put the same citation +in multiple bibliographies. + +For the part/chapter bibliographies of chapterbib.sty, there is no need to specify a +tracking ID as mciteplus will automatically use the correct one within each part. +The tracking ID of the duplicate bibliographies of chapterbib (produced by +chapterbib's ``duplicate'' package option) is given by ``chapterbib\textit{inputfile}.bbl'', +where ``\textit{inputfile}'' is the include file the given citation occurred in. +For the rootbib bibliography (produced by chapterbib's ``rootbib'' package option), +the tracking ID is of the form ``chapterbib\textit{jobname}'', where +``\textit{jobname}'' is the name of the main .tex document file (without the .tex +suffix). + +For multibib.sty, the tracking ID is given by ``multibib\textit{secname}'', where +``\textit{secname}'' is the multibib bibliography section name (as declared +via \MYshortcmd\newcites|end). + +For multibbl.sty, the tracking ID is given by ``multibbl\textit{secname}'', where +``\textit{secname}'' is the multibbl bibliography section name. + +For bibunits.sty, mciteplus will automatically use the correct tracking ID within +each bibunit, but to reference an entry outside of a bibunit, the tracking ID of +each bibunit is given by ``bibunits\textit{unitname}'', where ``\textit{unitname}'' +is the name of the auxiliary file of the desired bibunit without the .aux suffix +(e.g., ``bu1'', ``bu2'', etc.). + +The form of the replacement text of \MYshortcmd\mciteSubRef|end\ is defined by +mciteplus as: +\begin{MYlistblk} +\MYlongcmd +\providecommand{\mcitesubrefform}{\arabic{mcitebibitemcount}.\alph{mcitesubitemcount}}|end +\end{MYlistblk} +which can be redefined (via \MYshortcmd\renewcommand|end) by the user as desired. + + +\subsubsection{Bibitem Argument Macros} +\label{sec:bibitemarguments} +When creating sublist labels (or the maximum width forms discussed in +\MYsecref{sec:maxwidths}), the user may wish to have access to the +argument(s) of the \MYshortcmd\bibitem|end\ of the entries. Mciteplus +provides these as macros. The required argument of the current +\MYshortcmd\bibitem|end, which is usually the citation key, is provided +as \MYshortcmd\mciteBibitemArgI|end. The optional argument of the current +\MYshortcmd\bibitem|end, which, if present, is provided as +\MYshortcmd\mciteBibitemOptArgI|end. There is also the \TeX\ conditional +\MYshortcmd\ifmciteBibitemOptArgI|end, which will evaluate true if the +optional argument to \MYshortcmd\bibitem|end\ is present. + +Lastly, there are \MYshortcmd\mciteCurheadBibitemArgI|end, +\MYshortcmd\mciteCurheadBibitemOptArgI|end\ and +\MYshortcmd\ifmciteCurheadBibitemOptArgI|end\ which contain the +same argument information, but for the head of the current entry +group. + + + +\subsection{Label Widths} +\label{sec:labelwidths} + +\textbf{Note: Problems with incorrect label widths will usually manifest themselves +as incorrect label spacing and/or bibliography entry text that is not properly +aligned, but often will not otherwise generate warning messages or errors.} + + +\subsubsection{The Bibliography Sample Label} +\label{sec:bibsamplelabel} +With most bibstyles, \BibTeX\ produces what is known as a ``sample label,'' +which is the widest label used by the bibliography entries. This sample label is +recorded as the argument to \MYshortcmd\thebibliography|end\ when \BibTeX\ creates +the .bbl bibliography file so as to provide a way for the \MYshortcmd\thebibliography|end\ +environment to know in advance how much space to reserve for the labels. + +For example, \BibTeX\ may produce something like this in the .bbl file for a +bibliography with ten entries:\footnote{Some bibstyles use a number equal to the +number of entries, others use a form such as ``1X'', where ``X'' is a number of zeros +such that the sample label length matches that of the number of entries (e.g., +``10'' if there are 10--99 entries). With most fonts, the numerical digits +all have the same width so ``10'' has the same width as ``99''.} +\begin{MYlistblk} +\MYlongcmd +\begin{thebibliography}{10}|end +\end{MYlistblk} +Mciteplus provides users access to the original \BibTeX-produced sample label +as the macro \MYshortcmd\mciteorgbibsamplelabel|end. + +A problem arises with the sample label system when mciteplus combines multiple entries in +that the \BibTeX\ generated sample label in the .bbl file will not be +correct after the tail entries are no longer counted as actual entries. With the +original mcite package, this would often result in incorrect label spacing. Mciteplus +addresses this problem by actively tracking the maximum width label used in each bibliography. + +The sample label form that mciteplus forwards to \MYshortcmd+thebibliography|end\ +is defined as: +\begin{MYlistblk} +\MYlongcmd +\def\mcitebibsamplelabel{\rule{\mcitemaxwidthbibitem sp}{0.2pt}}|end +\end{MYlistblk} +which is simply a rule with a width equal to the widest label as determined +by the maximum width system discussed in \MYsecref{sec:maxwidths}. +If necessary, this can be redefined by the user via \MYshortcmd\renewcommand|end. + +Most class files will not be bothered by the fact that a rule rather than +actual digits is being used for the sample label. However, if this becomes +a problem, something like: +\begin{MYlistblk} +\MYlongcmd +\renewcommand{\mcitebibsamplelabel}{\mcitemaxcountbibitem}|end +\end{MYlistblk} +can be tried where \MYshortcmd\mcitemaxcountbibitem|end\ will contain +the number of the last entry in the current bibliography as discussed +in \MYsecref{sec:maxcounts}. + +The \MYshortcmd+thebibliography|end\ environments of some \LaTeX\ classes +(e.g., REV\TeX) perform their own label width calculations and ignore the sample +label entirely making the issue a moot point. However, the most common \LaTeX\ +classes do depend on the sample label being accurate. + + +\subsubsection{Maximum Widths} +\label{sec:maxwidths} +The problem of knowing the widest of a group of labels in advance of their +actual rendering\footnote{Obviously, solving this problem requires more than one +\LaTeX\ pass as well as the use of the auxiliary file to store information about the +widest label which will be read during the second pass.} is commonly encountered +in \LaTeX\ (e.g., lists, section numbering within the table of contents, etc.) and +is an issue that, in this author's opinion, has not been dealt with adequately by +the base \LaTeX\ system.\footnote{Packages such as Scott Pakin's eqparbox.sty +\cite{ctan:eqparbox} are most welcome solutions to this type of problem.} With +regard to mciteplus bibliographies, not only is the width of the head entries (i.e., +the sample label) an issue, but potentially so are the sublist (tail) labels if +they are rendered in enumerated list form rather than inline. + +To assist the user in determining the required width of labels, mciteplus provides +its own maximum width and count tracking facilities. Both the bibitem (main entry) and +subitem (sublist entry) label widths can tracked independently of each other. + +In order to measure widths, mciteplus must know what exactly it is to measure. +This is specified by macros that contain the ``width forms'' which are simply +``text'' whose width will be measured for each bibitem or subitem. The package +defaults of each are defined as: +\begin{MYlistblk} +\MYlongcmd +\providecommand{\mcitedefaultmaxwidthbibitemform}{\arabic{mcitebibitemcount}}|\ +\providecommand{\mcitedefaultmaxwidthsubitemform}{\alph{mcitesubitemcount})}|end +\end{MYlistblk} +There are also the initial width forms that will be used only during the very first +\LaTeX\ run before the maximum label widths are actually known (i.e., when the +auxiliary file is absent): +\begin{MYlistblk} +\MYlongcmd +\providecommand{\mcitedefaultmaxwidthbibitemforminit}{\mciteorgbibsamplelabel}|\ +\providecommand{\mcitedefaultmaxwidthsubitemforminit}{a)}|end +\end{MYlistblk} +The initial width forms will be evaluated with the bibitem and subitem counters both set to one. +The purpose of the initial width forms is just to provide a rough guess as to the +label widths to try to avoid large formatting changes or errors within label +formatting code that cannot deal with unknown, or zero, widths. + +As with the punctuation and sublist controls, both the bibstyle and the user can +specify the width forms with the latter overriding the former: +\begin{MYlistblk} +\MYlongcmd +\mciteSetBstMaxWidthForm[|itshape+init|upshape]{|itshape+type|upshape}{|itshape+form|upshape} |% for use by bibstyles|\ +| |\ +\mciteSetMaxWidthForm[|itshape+init|upshape]{|itshape+type|upshape}{|itshape+form|upshape} |% for use by the user in the document|end +\end{MYlistblk} +where \textit{type} is ``\texttt{bibitem}'' or ``\texttt{subitem}''. The optional argument +\textit{init} is used to specify the initial width form that will be used. If it is not specified, +the current initial width form in use will not be altered. The code specified in the forms +should be self contained (i.e., not have commands which require an external environment +such as \MYshortcmd+\item|end) as well as allow reevaluation at any time (e.g., should +not do things such as alter counters). Note that these restrictions +do not apply to the actual sublist code (\MYsecref{sec:sublistlabelbeginend}) and is +one reason why mciteplus distinguishes between that which measures the width of the +a label (discussed in this section) and that which actually forms the label +(\MYsecref{sec:sublistlabelbeginend}). If desired, the current width forms (see below) +can be used within the actual sublist code. + +After issuing a user defined \MYshortcmd\mciteSetMaxWidthForm|end\ for a bibliography, +a user can restore control back to the bibstyle for later bibliographies by issuing: +\begin{MYlistblk} +\MYlongcmd +\mciteSetMaxWidthForm[\mcitebstmaxwidthbibitemforminit]{bibitem}{\mcitebstmaxwidthbibitemform}|\ +\mciteSetMaxWidthForm[\mcitebstmaxwidthsubitemforminit]{subitem}{\mcitebstmaxwidthsubitemform}|end +\end{MYlistblk} +before the bibliography(ies) to be affected. + +Please note that for bibstyles, there +is no use in specifying an initial width form via \MYshortcmd+\mciteSetBstMaxWidthForm[]|end\ +after the bibliography begins because, by that point, it is too late as the sample label +has already been forwarded. However, this is not a problem because by default, the initial +width form is the original sample label as given by the bibstyle.\footnote{Another +possible approach would be to specify the bibitem width form before the bibliography begins, +possibly surrounding the entire environment in a group to keep the changes local.} +This is not an issue for the normal bibitem width form or the subitem width forms as +they are not evaluated until the first \MYshortcmd\bibitem|end. + +The user has access to the currently used bibitem and subitem width forms and +their maximum widths as the macros: +\begin{MYlistblk} +\MYlongcmd +\mcitemaxwidthbibitemform |% current bibitem width form |\ +\mcitemaxwidthsubitemform |% current subitem width form |\ +\mcitemaxwidthbibitem |% the maximum width of the bibitem form|\ +\mcitemaxwidthsubitem |% the maximum width of the subitem form|end +\end{MYlistblk} +The maximum widths are macros containing an integer which is the width +in \TeX\ scaled points (sp).\footnote{In \TeX, a scaled point is the smallest +dimensional unit available and is equal to $\frac{1}{65536}$ of a point.} The +widths are not length commands (e.g., a dimension or skip register), but their +values can be assigned to a length command by appending a ``sp'' to the +length specification: +\begin{MYlistblk} +\MYlongcmd +\newlength{\MYlength}|\ +\setlength{\MYlength}{\mcitemaxwidthsubitem sp}|end +\end{MYlistblk} + + +\subsubsection{Maximum Counts} +\label{sec:maxcounts} +Also available are the macros: +\begin{MYlistblk} +\MYlongcmd +\mcitemaxcountbibitem|\ +\mcitemaxcountsubitem|end +\end{MYlistblk} +which contain the value of the highest count of the bibitem or subitem\footnote{For +subitems, it is the highest count that occurred \textit{during} the generation of the +sublist labels. Because the subitem counter is advanced by one \textit{after} each +sublist label is rendered, the actual counter itself does reach one count higher than +its maxcount, but that value was not actually used.} +counters, respectively, in the current bibliography. The maxcount +macros are not counters, but they can be used to set them, among other things. +There are no ``forms'' associated with the maxcounts and their initial values +(during the very first \LaTeX\ run in the absence of an auxiliary file) will be zero. +So, any code that references them should be able to handle (without error) the case +of zero. + +If, at the end of the bibliography, the correct maximum widths and counts +do not match what mciteplus used at the start of the run, mciteplus will issue +a package warning to request that \LaTeX\ be rerun. + + +\subsubsection{Non-Numerical Labels} +\label{sec:nonnumericallabels} +The maxwidth forms may have to be changed for some non-numerical bibstyles. +For example, under alpha.bst \cite{ctan:alphabst}, the entry labels are +carried within the optional arguments of the \MYshortcmd+bibitem|end, in +which case +\begin{MYlistblk} +\MYlongcmd +\mciteSetMaxWidthForm{bibitem}{\mciteBibitemOptArgI}|end +\end{MYlistblk} +would be appropriate when using such a bibstyle under mciteplus. Actually, +it is better to do such setup within the bibliography code of the +bibstyle (.bst) so that the maxwidth form will be correct by default +without any effort on the part of the user: +\begin{MYlistblk} +\MYlongcmd +\mciteSetBstMaxWidthForm{bibitem}{\mciteBibitemOptArgI}|end +\end{MYlistblk} +This should not be an issue with natbib compatible bibstyles, even +under the author-date mode, as natbib automatically does its own label +generation and management. + + + +\subsection{Example of Use} +\label{sec:exampleofuse} +Perhaps the maxwidth system is easiest to understand from an example: +\begin{MYlistblk} +\MYlongcmd +\mciteSetSublistMode{f}|% start numbering with the first item|\ +\mciteSetMaxWidthForm{subitem}{\scriptsize\textbf{\roman{mcitesubitemcount})}}|% small, bold, roman|\ +| |\ +\newcommand{\MYlistsetup}{\relax|\ +\setlength{\labelwidth}{\mcitemaxwidthsubitem sp}|% reserve room for widest label|\ +\setlength{\labelsep}{5pt}|% 5pt label/text separation|\ +\setlength{\itemindent}{0pt}% no indent|\ +\setlength{\leftmargin}{\labelwidth}|% text to left of label|\ +\addtolength{\leftmargin}{\labelsep}}|% and separation space|\ +| |\ +\mciteSetSublistLabelBeginEnd{\item}{\begin{list}{\hfill\mcitemaxwidthsubitemform}{\MYlistsetup}}{\end{list}}|end +\end{MYlistblk} +which produces a sublist via a customized list with small, bold and right aligned +roman numerals as labels and with block indented text. Note that in the list setup +code, we need to know the amount of room to reserve for the labels. Mciteplus provides this as +\MYshortcmd\mcitemaxwidthsubitem|end\ (to which the units ``sp'' must be appended when +assigning it to a length command). The maxwidth form itself, +\MYshortcmd\mcitemaxwidthsubitemform|end\ was used in the specification of the +labels within the list setup, but its definition (as used within +\MYshortcmd\mciteSetMaxWidthForm|end) could have been respecified in the list +setup code if desired. Once the list is setup, each sublabel is generated by a +simple call to \MYshortcmd\item|end. So, this example shows a case in which the code +actually used to produced the sublabels at run time (\MYshortcmd\item|end) +is not (directly) the same as that code which is used to measure the sublabel +widths. Indeed, as it is not self contained, \MYshortcmd\item|end\ cannot +even be used in the definition of a maxwidth form. + + + + +\section{Bibstyle (.bst) Modification} +\label{sec:bibstylemods} +Original mcite bibstyles cannot be used with mciteplus. They will have to be remodified +as described below. + +To modify a standard bibstyle (.bst) for use with mciteplus (unsrt.bst +is used as an example here), find the instances of \MYshortcmd\begin{thebibliography}|end\ +and \MYshortcmd\end{thebibliography}|end\ in the \MYshortcmd+begin.bib|end\ +and \MYshortcmd+end.bib|end\ functions and change them to use +\MYshortcmd+mcitethebibliography|end. It may also be a good idea to test for +the existence of \MYshortcmd+mcitethebibliography|end\ in case the user ever +forgets to load mciteplus.sty. + +{\bfseries Note: Many of the functions, +or parts of functions, shown below are listed in the included file \MYsmalltt{mciteplus\_code.txt}, +which can be used to cut and paste from. Beware of slight code differences between the different bibstyles. +For example, some use \MYshortcmd+longest.label|end\ like this example, but others may +use something else like \MYshortcmd+number.label| int.to.str$|end\ and/or may have extra code +after the \MYshortcmd\begin{mcitethebibliography}|end\ line. Leave these other things as they are.} + +Thus, +\begin{MYlistblk} +\MYlongcmd +FUNCTION {begin.bib}|\ +{ preamble$ empty$|\ + 'skip$|\ + { preamble$ write$ newline$ }|\ + if$|\ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$|\ +}|\ +| |\ +.|\ +.|\ +| |\ +FUNCTION {end.bib}|\ +{ newline$|\ + "\end{thebibliography}" write$ newline$|\ +}|end +\end{MYlistblk} +becomes (change the string "unsrtM.bst" to the name of your new .bst file): +\begin{MYlistblk} +\MYlongcmd +FUNCTION {begin.bib}|\ +{ preamble$ empty$|\ + 'skip$|\ + { preamble$ write$ newline$ }|\ + if$|\ + "\ifx\mcitethebibliography\mciteundefinedmacro"|\ + write$ newline$|\ + "\PackageError{unsrtM.bst}{mciteplus.sty has not been loaded}"|\ + write$ newline$|\ + "{This bibstyle requires the use of the mciteplus package.}\fi"|\ + write$ newline$ + "\begin{mcitethebibliography}{" longest.label * "}" * write$ newline$|\ +}|\ +| |\ +.|\ +.|\ +| |\ +FUNCTION {end.bib}|\ +{ newline$|\ + "\end{mcitethebibliography}" write$ newline$|\ +}|end +\end{MYlistblk} + +You may also want to declare the sublist mode via a +\MYshortcmd\mciteSetBstSublistMode|end, as mentioned in \MYsecref{sec:sublists}, +just after the \MYshortcmd+mcitethebibliography|end\ environment +begins, that will be used if the user does not otherwise specify a sublist mode, +as well as other bibliography setup commands. + +For example: +\begin{MYlistblk} +\MYlongcmd +FUNCTION {begin.bib}|\ +{ preamble$ empty$|\ + 'skip$|\ + { preamble$ write$ newline$ }|\ + if$|\ + "\ifx\mcitethebibliography\mciteundefinedmacro"|\ + write$ newline$|\ + "\PackageError{unsrtM.bst}{mciteplus.sty has not been loaded}"|\ + write$ newline$|\ + "{This bibstyle requires the use of the mciteplus package.}\fi"|\ + write$ newline$|\ + "\begin{mcitethebibliography}{" longest.label * "}" * write$ newline$|\ + "\mciteSetBstSublistMode{b}"|\ + write$ newline$|\ + "\mciteSetBstMaxWidthForm{subitem}{\alph{mcitesubitemcount})}"|\ + write$ newline$|\ + "\mciteSetBstSublistLabelBeginEnd{\mcitemaxwidthsubitemform\space}"|\ + write$ newline$|\ + "{\relax}{\relax}"|\ + write$ newline$|\ +}|end +\end{MYlistblk} +will specify a \MYshortcmd+mcitethebibliography|end\ that defaults to using the sublist +``b'' mode and enumerates the subentries using letters. The middle and end punctuation +was not be specified via \MYshortcmd\mciteSetBstMidEndSepPunct|end\ and so the package +defaults will be used. In this example, the subitem maxwidth form is not so +important as the labels are rendered inline, but other types of lists may require it. + +Next, find the \MYshortcmd+fin.entry|end\ function: +\begin{MYlistblk} +\MYlongcmd +FUNCTION {fin.entry}|\ +{ add.period$|\ + write$|\ + newline$|\ +}|end +\end{MYlistblk} +and change it to (which you can cut and paste from \MYsmalltt{mciteplus\_code.txt}): +\begin{MYlistblk} +\MYlongcmd +|% mciteplus fin.entry|\ +|%|\ +|% pushes true (1), if add.period$ would add a period to the string on the stack|\ +|% pushes false (0), otherwise|\ +|% Uses text.length$ to avoid full string comparison and two copies of string.|\ +|% Requires one copy of string on stack.|\ +INTEGERS {would.add.period.textlen}|\ +FUNCTION {would.add.period}|\ +{ duplicate$|\ + add.period$|\ + text.length$|\ + 'would.add.period.textlen :=|\ + duplicate$|\ + text.length$|\ + would.add.period.textlen =|\ + { #0 }|\ + { #1 }|\ + if$|\ +}|\ +| |\ +FUNCTION {fin.entry}|\ +{ would.add.period|\ + { "\relax" * write$ newline$|\ + "\mciteBstWouldAddEndPuncttrue" write$ newline$|\ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}"|\ + write$ newline$|\ + "{\mcitedefaultendpunct}{\mcitedefaultseppunct}\relax"|\ + }|\ + { "\relax" * write$ newline$|\ + "\mciteBstWouldAddEndPunctfalse" write$ newline$|\ + "\mciteSetBstMidEndSepPunct{\mcitedefaultmidpunct}"|\ + write$ newline$|\ + "{}{\mcitedefaultseppunct}\relax"|\ + }|\ + if$|\ + write$|\ + newline$|\ + "\EndOfBibitem" write$|\ +}|\ +|% end mciteplus fin.entry|end +\end{MYlistblk} + +The \MYshortcmd\mciteSetBstMidEndSepPunct|end\ line is broken into two lines (after the first argument) +to prevent \BibTeX\ from breaking what would be a long single line (over 80 +columns) at an unacceptable place. + +By providing a way for the .bst to tell mciteplus not to use an end period +if \BibTeX's \MYshortcmd+add.period$|end\ command would not, we avoid the double end period +problem. The \MYshortcmd\mciteBstWouldAddEndPuncttrue/false|end\ flag does not in itself +do anything. However, if set appropriately by the .bst, it can be employed +by the user in the definition custom punctuation via \MYshortcmd\mciteSetMidEndSepPunct|end. + +Other .bst files may hardcode values other than the defaults and/or use +more complex conditions as is needed for that particular bibstyle. + +The \MYshortcmd\EndOfBibitem|end\ is defined by mciteplus.sty as a macro containing +\MYshortcmd\relax|end. Although it does nothing at present, it's purpose is to make it +easier to identify the end of each bibliography entry for the purposes of inspection +or parsing. + + +\subsection{Sorting Bibstyles} +\label{sec:sortingbibstyles} +Perhaps surprisingly, it is possible to use mciteplus with sorting bibstyles. +The difficulty is that \BibTeX\ must keep an entry group together, in citation +order with the tails immediately following their respective head, despite +sorting the entries. This is possible with the use of special bibstyle code +if the user is willing and able to declare all the tails via a special entry +field ``mcitetail'', which should be set to ``yes'' for each tail, in the +\BibTeX\ database.\footnote{Thus, we have to specify the tails +twice\MYemdash once for \LaTeX\ and once for \BibTeX\ because there is no +other way to get the information to \BibTeX. This limitation +helped to inspire \LaTeX-based bibliography processing as is done with the +amsrefs \cite{ctan:amsrefs} and biblatex \cite{ctan:biblatex} packages.} Entries without this +field, or that have it set to ``no'', will be sorted normally (as head entries). +Of course, bibstyles that do not recognize the ``mcitetail'' field will silently ignore it. + +Thus, for the example used in the introduction, the database entries might look like: +\begin{MYlistblk} +\MYlongcmd +@article{Glashow,|\ + author = "Sheldon Lee Glashow",|\ + title = "Partial-symmetries of Weak Interactions",|\ + journal = "Nucl. Phys.",|\ + volume = "22",|\ + number = "4",|\ + month = feb,|\ + year = "1961",|\ + pages = "579-588"|\ +}|\ +| |\ +@incollection{Salam,|\ + author = "Abdus Salam",|\ + editor = "Nils Svartholm",|\ + title = "Weak and Electromagnetic Interactions",|\ + booktitle = "Elementary Particle Theory",|\ + publisher = "Almquist and Wiksell",|\ + address = "Stockholm",|\ + year = "1968",|\ + pages = "367-377",|\ + mcitetail = "yes"|\ +}|\ +| |\ +@article{Weinberg,|\ + author = "Steven Weinberg",|\ + title = "A Model of Leptons",|\ + journal = "Phys. Rev. Lett.",|\ + volume = "19",|\ + number = "21",|\ + month = nov,|\ + year = "1967",|\ + pages = "1264-1266",|\ + mcitetail = "yes"|\ +}|end +\end{MYlistblk} +The basic idea is for \BibTeX\ to use the sorting key of the head, +but with an appended tail count, as the sorting key for all the tails +of that head. If the bibstyle properly generates unique sorting keys, then the +entries in each group will be kept together and in order despite +the sorting process. For example, apsrmpM.bst uses the following +sort keys for the above three entries: +\begin{MYlistblk} +\MYlongcmd +glashow s l 1961 partial symmetries of weak interactions|\ +glashow s l 1961 partial symmetries of weak interactions|_|_0000000001|\ +glashow s l 1961 partial symmetries of weak interactions|_|_0000000002|end +\end{MYlistblk} +The sorting modification to the bibstyle consists of three parts which must be +done in addition to the mciteplus compatibility modifications previously +described. + +First of all, add an ``mcitetail'' field to the list of entry fields (usually +located near the beginning of the bibstyle): +\begin{MYlistblk} +\MYlongcmd +ENTRY|\ + { address|\ + archive|\ + author|\ + booktitle|\ + .|\ + .|\ + key|\ + mcitetail|\ + month|\ + .|\ + .|end +\end{MYlistblk} + +Then, add the following code (which you can cut and paste from \MYsmalltt{mciteplus\_code.txt}) +somewhere near the start of the bibstyle code (after the first ``STRINGS'' +definition(s) is fine): +\begin{MYlistblk} +\MYlongcmd +|% mciteplus mcitetail field and sort key adjust support|\ +INTEGERS {mcitetailcnt is.mcitetail}|\ +STRINGS {mciteheadsortkey}|\ +|% convert the strings "yes" or "no" to |#1 or |#0 respectively|\ +FUNCTION {mciteplus.yes.no.to.int}|\ +{ "l" change.case$ duplicate$|\ + "yes" =|\ + { pop$ |#1 }|\ + { duplicate$ "no" =|\ + { pop$ |#0 }|\ + { "unknown boolean " quote$ * swap$ * quote$ *|\ + " in " * cite$ * warning$|\ + |#0|\ + }|\ + if$|\ + }|\ + if$|\ +}|\ +FUNCTION {mciteplustail.adj.sort.key}|\ +{ mcitetail|\ + empty$|\ + { |#0 'is.mcitetail := }|\ + { mcitetail|\ + mciteplus.yes.no.to.int|\ + 'is.mcitetail :=|\ + }|\ + if$|\ + is.mcitetail|\ + { |#1 mcitetailcnt +|\ + 'mcitetailcnt :=|\ + mciteheadsortkey|\ + "|_|_" *|\ + "000000000"|\ + mcitetailcnt|\ + int.to.str$|\ + *|\ + |#-1 |#10 substring$|\ + *|\ + 'sort.key$ :=|\ + }|\ + { |#0 'mcitetailcnt :=|\ + sort.key$ 'mciteheadsortkey :=|\ + }|\ + if$|\ +}|\ +|% END mciteplus mcitetail field support|end +\end{MYlistblk} + +Lastly, you have to locate the place(s) where the +bibstyle makes the (final) assignment to \MYshortcmd+sort.key$|end\ +(typically of the form \MYshortcmd+'sort.key$| :=|end\ ) before +sorting is performed and add a call to \MYshortcmd+mciteplustail.adj.sort.key|end\ +(which will modify the sort keys of the tails as needed to keep the groups +together) just after it. With apsrmpM.bst, this is at the end of the +\MYshortcmd+FUNCTION {presort}|end: +\begin{MYlistblk} +\MYlongcmd +.|\ +.|\ + 'sort.key$ :=|\ + mciteplustail.adj.sort.key|\ +}|end +\end{MYlistblk} +as well as at the end of \MYshortcmd+FUNCTION {bib.sort.order}|end. + + + + +\section{Advanced Usage} +The vast majority of users will not need to know the details of the internal +operation of mciteplus. However, the following information may be of use to +those who are interested in it or who need to interface other packages to mciteplus. + +Mciteplus consists of two main parts: (1) a part that intercepts and records the +status of entries the user has cited; and (2) a part that acts on this +information when formatting the entries in the bibliography. + +Upon the start of the \MYshortcmd\begin{document}|end, mciteplus stores the original +\MYshortcmd\cite|end\ and \MYshortcmd\nocite|end\ as \MYshortcmd\mciteOrgcite|end\ +and \MYshortcmd\mciteOrgnocite|end, respectively, and replaces the originals with +its own versions. The mciteplus versions of the citation commands: (1) process the citation +list, recording which entries are heads and which are tails; (2) writes out the +citation list to the auxiliary file, much like \MYshortcmd\nocite|end\ does, to ensure +that all the given entries will appear in the bibliography as well as being in the correct +order; and (3) forwards the list of heads in the citation list to the original cite +command. Thus, \LaTeX\ remains unaware that the tail entries were ever cited. + +The second part of mciteplus operates inside the +\MYshortcmd+mcitethebibliography|end\ environment where mciteplus: (1) intercepts +and adjusts the bibliography sample label as needed; (2) forwards to +the original \MYshortcmd+thebibliography|end; and (3) places a wrapper +around \MYshortcmd\bibitem|end, storing the original \MYshortcmd\bibitem|end\ as +\MYshortcmd\mciteOrgbibitem|end. For head entries, the mciteplus +\MYshortcmd\bibitem|end\ behaves in fairly normal fashion and forwards +to the original \MYshortcmd\bibitem|end. However, for tail entries, the +mciteplus \MYshortcmd\bibitem|end, does not forward them to the original +\MYshortcmd\bibitem|end. Thus, the tail entries become part of the +previous entry. To \LaTeX, it is as if the \MYshortcmd\bibitem|end\ of the +tails never happened. + + +\subsection{Tracking ID and Aux. Files} +\label{sec:trackingandaux} +Things get more complicated when a document has more than one bibliography. +To support multiple bibliographies, mciteplus uses a ``tracking ID'' which +is simply an identification string which is unique to each bibliography. +Thus, the same citation key can be used in different ways in different +bibliographies (e.g., serving as a head in one and a tail in another) +without conflict because each instance will be considered different +as their tracking IDs are different.\footnote{Of course, a ``status conflict'' +is still possible for ``overall'' bibliographies.} + +The standard tracking ID is simply the string ``main'' which is carried as: +\begin{MYlistblk} +\MYlongcmd +\def\mcitetrackID{main}|\ +\def\mcitebibtrackID{main}|end +\end{MYlistblk} +the former of which is used by the mciteplus citation commands and the +latter of which is used by the \MYshortcmd+mcitethebibliography|end\ environment. +However, these definitions may be automatically altered depending on the specific +needs of other \LaTeX\ packages that have been loaded +(\MYsecref{sec:externalpackages}). Some packages that provide support for +multiple bibliographies require that the tracking ID be closely coupled +with the individual citation commands. In such cases, mciteplus may not +even refer to \MYshortcmd\mcitetrackID|end\ or \MYshortcmd\mcitebibtrackID|end. + +For the normal part/chapter bibliographies of chapterbib.sty, the tracking ID form +``chapterbib\textit{inputfile}'' is used, where ``\textit{inputfile}'' is +the include file (without the .tex suffix) the given citation occurred in. +The tracking ID of the duplicate bibliographies of chapterbib (produced by +chapterbib's ``duplicate'' package option) is given by ``chapterbib\textit{inputfile}.bbl''. +For the rootbib bibliography (produced by chapterbib's ``rootbib'' package option), +the tracking ID is of the form ``chapterbib\textit{jobname}'', where +``\textit{jobname}'' is the name of the main .tex document file (without the +.tex suffix). + +For multibib.sty, the tracking ID is given by ``multibib\textit{secname}'', where +``\textit{secname}'' is the multibib bibliography section name (as declared +via \MYshortcmd\newcites|end). + +For multibbl.sty, the tracking ID is given by ``multibbl\textit{secname}'', where +``\textit{secname}'' is the multibbl bibliography section name. + +For bibunits.sty, the tracking ID of each bibunit is given by +``bibunits\textit{unitname}'', where ``\textit{unitname}'' is the name of the +auxiliary file of the desired bibunit without the .aux suffix +(e.g., ``bu1'', ``bu2'', etc.). Outside of the bibunits, where the global +bibliography is in effect, the tracking ID of ``main'' is used. + +Likewise, mciteplus must know which auxiliary file(s) to write its citation lists +and bibliography maximum widths and counts to. The standard auxiliary file handles, which +are simply integers that represent files \TeX\ has opened, are defined as: +\begin{MYlistblk} +\MYlongcmd +\def\mciteauxout{\@auxout}|\ +\def\mcitebibauxout{\@mainaux}|end +\end{MYlistblk} +the former of which is used by the mciteplus citation commands and the +latter of which is used by the \MYshortcmd+mcitethebibliography|end\ environment. +As with the tracking ID, these may be altered to support other packages +that have been loaded. Under some packages, such as chapterbib, \LaTeX\ may +reuse the same file handle number during the course of processing the document. +Thus, a given file handle number may not refer to the same file in +different parts of the document. + +Note that mciteplus writes all of its maximum width and count +information to the main auxiliary file even though multiple +auxiliary files may be in use because it is not certain +that the other auxiliary files will be read in during \LaTeX\ runs. +As the tracking ID is written along with the maximum width and count information, +there will be no confusion as to which bibliography the information pertains to. + + +\subsection{Custom Command Wrappers} +\label{sec:customwrappers} +Mciteplus provides two rather complex commands that allow users to define their +own mciteplus citation command wrappers: +\begin{MYlistblk} +\MYlongcmd +\mciteCiteA*{|itshape+aux out|upshape}{|itshape+track ID|upshape}{|itshape+prehandler|upshape}{|itshape+posthandler|upshape}{|itshape+fwd|upshape}*[|itshape+opt1|upshape][|itshape+opt2|upshape]{|itshape+cite list|upshape}|\ +\mciteCiteB*{|itshape+aux out|upshape}{|itshape+track ID|upshape}{|itshape+prehandler|upshape}{|itshape+posthandler|upshape}{|itshape+fwd|upshape}*[|itshape+opt1|upshape][|itshape+opt2|upshape]{|itshape+sec ID|upshape}{|itshape+cite list|upshape}|end +\end{MYlistblk} +Both of these are ``robust'' and can safely be called within footnotes, +etc. The difference between the two is that the ``B'' form supports citation commands +that use two arguments, as is the case with the \MYshortcmd\cite|end\ of +multibbl.sty. \MYshortcmd\mciteCiteA/B|end\ acquires all of the arguments +listed above (the ``*'' and ``[]'' are optional arguments), but those that appear +after the \textit{fwd} argument are forwarded (possibly with modification) +to the command named in the \textit{fwd} argument. The arguments before +\textit{fwd} are only seen and used by \MYshortcmd\mciteCiteA/B|end. + +The meaning of each of the options from left to right is as follows: +\begin{description} +\item[*] The star forms (e.g., \MYshortcmd\mciteCiteA/B*|end) disable automatic +internal processing (via \MYshortcmd\mciteDoList|end\ as discussed below). +The presence of the star form is indicated by the \TeX\ conditional +\MYshortcmd\ifmciteMacroStarForm|end. +\item[\textit{aux out}] The auxiliary file handle number to be used when +writing out the citation list. Use of the special string ``noauxwrite'' will +disable auxiliary writes.\footnote{As will the traditional \TeX\ conditional, +which is defined and used by \LaTeX, \texttt{\mbox{\ZAXbsl if@filesw}}, if it is false.} +This argument is stored in the macro \MYshortcmd\mciteCiteAuxArg|end. +\item[\textit{track ID}] The tracking ID to be used. This argument is +stored in the macro \MYshortcmd\mciteCiteTrackArg|end. +\item[\textit{prehandler}] The user's prehandler code which will be +executed before internal \MYshortcmd\mciteDoList|end\ processing. This +argument is stored in the macro \MYshortcmd\mciteCitePrehandlerArg|end. +The purpose of the prehandler code is to provide the user a way to alter +the arguments as needed before further processing. +\item[\textit{posthandler}] The user's posthandler code which will be +executed after internal \MYshortcmd\mciteDoList|end\ processing. This +argument is stored in the macro \MYshortcmd\mciteCitePosthandlerArg|end. +\item[\textit{fwd}] The citation command the later arguments will be forwarded +to. This argument is stored in the macro \MYshortcmd\mciteCiteFwdArg|end. +\item[*] The star for the star form of the forward command. +The presence of the star form is indicated by the \TeX\ conditional +\MYshortcmd\ifmciteCiteStarFwdArg|end. +\item[\textit{opt1}] The first optional argument of the forwarded citation +command. The presence of this optional argument is +indicated by the \TeX\ conditional \MYshortcmd\ifmciteMacroOptArgI|end. +This argument, if present, is stored in the macro \MYshortcmd\mciteCiteOptArgI|end. +\item[\textit{opt2}] The second optional argument of the forwarded citation +command. The presence of this optional argument is +indicated by the \TeX\ conditional \MYshortcmd\ifmciteMacroOptArgII|end. +This argument, if present, is stored in the macro \MYshortcmd\mciteCiteOptArgII|end. +\item[\textit{sec ID}] Only used for \MYshortcmd\mciteCiteB|end, this +is the first argument of two used by the forwarded citation command. +Under multibbl.sty, this contains the bibliography section name. +This argument is stored in the macro \MYshortcmd\mciteCiteSecIDArg|end. +\item[\textit{cite list}] This is the citation list and is +stored in the macro \MYshortcmd\mciteCiteListArg|end. It is important +to know that \MYshortcmd\mciteCiteListArg|end\ is \emph{not} forwarded +as-is, but rather only after the tails are removed. The forwarded +citation list is the macro \MYshortcmd\mciteFwdCiteListArg|end. +\end{description} +\subsubsection{The MciteDoList Engine} +\label{sec:mcitedolistengine} +After acquiring its arguments, \MYshortcmd\mciteCiteA/B|end\ executes +the prehandler code. This is to allow the prehandler code to alter the +arguments as needed, specifically if the contents of one argument need +to be based on another. For example, under multibbl.sty, the tracking +ID has to be based in part on \MYshortcmd\mciteCiteSecIDArg|end. + +After the prehandler, the \MYshortcmd\mciteDoList|end\ +command, which forms the core engine of mciteplus, is executed: +\begin{MYlistblk} +\MYlongcmd +\mciteDoList{|itshape+aux out|upshape}{|itshape+track ID|upshape}{|itshape+cite list|upshape}|end +\end{MYlistblk} +as: +\begin{MYlistblk} +\MYlongcmd +\mciteDoList{\mciteCiteAuxArg}{\mciteCiteTrackArg}{\mciteCiteListArg}|end +\end{MYlistblk} +\MYshortcmd\mciteDoList|end\ records the status of each of the entries, writes the +citations to the auxiliary file, and then creates \MYshortcmd\mciteheadlist|end\ +which contains only the head entries. A copy of \MYshortcmd\mciteheadlist|end\ +called \MYshortcmd\mciteFwdCiteListArg|end\ is made. This will be +the actual citation list that is forwarded to the \textit{fwd} command. + +Next, \MYshortcmd\mciteExtraDoLists|end\ is +called. This command is normally, just \MYshortcmd\relax|end, but it can be +used to create additional sets of entry status, such as when duplicate/global +bibliographies are being used. + +Then, the user's posthandler code is executed. + +Finally, the forward command is executed with the (rightmost) +\MYshortcmd\mciteCiteA/B|end\ arguments forwarded to it, but +using \MYshortcmd\mciteFwdCiteListArg|end\ for the citation list. + +As a practical example, a standard \MYshortcmd\cite|end\ wrapper can be +created via: +\begin{MYlistblk} +\MYlongcmd +\newcommand{\MYcite}{\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgcite}}|end +\end{MYlistblk} +If \MYshortcmd\MYcite|end\ is invoked as: +\begin{MYlistblk} +\MYlongcmd +\MYcite{Glashow,*Salam,*Weinberg}|end +\end{MYlistblk} +mciteplus will do a: +\begin{MYlistblk} +\MYlongcmd +\mciteCiteA{\mciteCiteAuxArg}{\mciteCiteTrackArg}{\relax}{\relax}{\mciteOrgcite}{\mciteCiteListArg}|end +\end{MYlistblk} +which is the same as: +\begin{MYlistblk} +\MYlongcmd +\mciteCiteA{\mciteauxout}{\mcitetrackID}{\relax}{\relax}{\mciteOrgcite}{Glashow,*Salam,*Weinberg}|end +\end{MYlistblk} +which in turn would call: +\begin{MYlistblk} +\MYlongcmd +\mciteDoList{\mciteauxout}{\mcitetrackID}{Glashow,*Salam,*Weinberg}|end +\end{MYlistblk} +which will create a \MYshortcmd\mciteheadlist|end\ and +\MYshortcmd\mciteFwdCiteListArg|end\ containing ``Glashow'', which +will then be forwarded to the original \LaTeX\ \MYshortcmd\cite|end: +\begin{MYlistblk} +\MYlongcmd +\mciteOrgcite{\mciteFwdCiteListArg}|end +\end{MYlistblk} +which is effectively the same as: +\begin{MYlistblk} +\MYlongcmd +\mciteOrgcite{Glashow}|end +\end{MYlistblk} +Mciteplus carefully builds up the forwarded arguments using token lists +so that the forward cite command isn't even aware that it has been +wrapped within an earlier command. Thus, even cite.sty's automatic +punctuation and spacing adjustments will work as normal. + +Note that command structures that result in ``double calls'' to the miteplus +engine (i.e., a cite command goes through mciteplus and then forwards to +another cite command that also goes through mciteplus) although undesirable, +will still work as intended without error. + +\subsection{Mcitethebibliography Hooks} +\label{sec:mcitethebibliographyhooks} +Mciteplus supplies the macros \MYshortcmd\mciteBIBdecl|end\ and +\MYshortcmd\mciteBIBenddecl|end\ +which are executed at the beginning and ending of the +\MYshortcmd+mcitethebibliography|end\ environment, respectively, before the the normal +\MYshortcmd+thebibliography|end\ environment is begun or ended. By default they are +both defined as macros containing only \MYshortcmd\relax|end, but a +user may redefine them as needed to alter the +\MYshortcmd+mcitethebibliography|end\ environment setup. + +There is also a \MYshortcmd\mcitefwdBIBdecl|end\ which is executed +just after the original \MYshortcmd+thebibliography|end\ has been +started (i.e., forwarded) by \MYshortcmd+mcitethebibliography|end. +This can be used to adjust the setup of \MYshortcmd+thebibliography|end\ +before the first bibliography entry. One potential application is +to sync the \MYshortcmd+thebibliography|end\ counter to +\MYshortcmd+mcitebibitemcount|end. This trick can be used to obtain +continuous numbering of the references under multibbl.sty even though +that package does not normally provide this feature: +\begin{MYlistblk} +\MYlongcmd +\documentclass{article}|\ +\usepackage{multibbl}|\ +\usepackage{mciteplus}|\ +\mciteResetBibitemCountfalse|\ +\renewcommand{\mcitefwdBIBdecl}{\setcounter{enumiv}{\value{mcitebibitemcount}}}|\ +\begin{document}|\ +.|\ +.|end +\end{MYlistblk} + + + + +\section{Use With External Packages} +\label{sec:externalpackages} +Unless the ``nohooks'' option is invoked, mciteplus will automatically +reconfigure itself and hook into the compatible packages it detects. +Mciteplus should be loaded after other packages so that it can detect +the other packages and to ensure that the definitions of the system +cite commands have been finalized before mciteplus installs its +wrappers at the beginning of the document. + +It is not possible to test or list all of the possible interactions +among all the various packages. Remember, just because the packages +below are compatible with mciteplus, does not mean they all are +compatible with each other, even in the absence of mciteplus. Here +are some notes regarding the compatibility +and use of mciteplus with some of the more common \LaTeX\ +bibliography related packages. + + + +\subsection{Bibunits} +\label{sec:bibunits} +Mciteplus is fully compatible with Thorsten Hansen's bibunits +package \cite{ctan:bibunits}. When using the global bibliography via +the ``globalcitecopy'' and/or the star form of \MYshortcmd\cite|end, +beware of the possibility of an mciteplus status (i.e., head or tail) +conflict if the same entry is cited differently in different parts of +the document. + + +\subsection{Chapterbib} +\label{sec:chapterbib} +Mciteplus is fully compatible with Donald Arseneau's chapterbib +package \cite{ctan:chapterbib} including the use of the chapterbib +``duplicate'' and ``rootbib'' package options. \textbf{When using the +``rootbib'' option, be sure and enable mciteplus' +``chapterbibrootbib'' option.} Mciteplus is not able to auto-detect +the rootbib mode of chapterbib directly because when invoking that mode, +the user must run \LaTeX\ a second time without the rootbib option. +For all of these \LaTeX\ runs, keep this mciteplus option enabled (i.e., +as long as there is, or is going to be, a jobname.bbl file under chapterbib). +When using the rootbib option, beware of the possibility of an mciteplus +status (i.e., head or tail) conflict if the same entry is cited differently +in different parts of the document. + + +\subsection{Cite} +\label{sec:cite} +Mciteplus is fully compatible with Donald Arseneau's cite +package \cite{ctan:citesty}, including cite's \MYshortcmd\citen|end, +\MYshortcmd\citenum|end\ and \MYshortcmd\citeonline|end\ +variants. + + +\subsection{Citeref} +\label{sec:citeref} +Mciteplus will work with Bj\"{o}rn Briel and Uni Oldenburg's citeref +package \cite{ctan:citeref}. + + +\subsection{Drftcite} +\label{sec:drftcite} +Mciteplus is fully compatible with Donald Arseneau's +drftcite package \cite{ctan:drftcite}, including drftcite's +\MYshortcmd\citen|end\ variant. To get block aligned entry text +in the bibliography, set the bibitem maximum width form +to use the citation keys drftcite uses for the bibliography labels: +\begin{MYlistblk} +\MYlongcmd +\mciteSetMaxWidthForm{bibitem}{\mciteBibitemArgI}|end +\end{MYlistblk} +which, in turn, will revise the bibliography sample label +accordingly. This is not done automatically by mciteplus because +drftcite does not update the bibliography sample label (even +in the absence of mciteplus). + + +\subsection{Hyperref/Backref} +\label{sec:hyperrefbackref} +Mciteplus should work fine with Sebastian Rahtz and Heiko Oberdiek's +hyperref package \cite{ctan:hyperref} including it's backref option. + +\subsection{Multibbl} +\label{sec:multibbl} +Mciteplus is fully compatible with Apostolos Syropoulos's +multibbl package \cite{ctan:multibbl}. + + +\subsection{Multibib} +\label{sec:multibib} +Mciteplus is fully compatible with Thorsten Hansen's multibib +package \cite{ctan:multibib}. Under mciteplus with natbib, +multibib is patched to support all of natbib's \MYshortcmd\cite|end\ +variants even though the original multibib only supported +\MYshortcmd\citep|end, \MYshortcmd\citet|end, \MYshortcmd\citealp|end\ and +\MYshortcmd\citealt|end. Multibib's internal command name list hook +\MYshortcmd\@mb@citenamelist|end\ is ignored. + + +\subsection{Natbib} +\label{sec:natbib} +Mciteplus is fully compatible with Patrick W. Daly's natbib package +\cite{ctan:natbib} as long as the bibstyle supports both. +All of natbib's \MYshortcmd\cite|end\ variants are supported +including: +\MYshortcmd\citenum|end, +\MYshortcmd\citep|end, \MYshortcmd\Citep|end, \MYshortcmd\citet|end, +\MYshortcmd\Citet|end, \MYshortcmd\citealp|end, \MYshortcmd\Citealp|end, +\MYshortcmd\citealt|end, \MYshortcmd\Citealt|end, \MYshortcmd\citeauthor|end, +\MYshortcmd\Citeauthor|end, \MYshortcmd\citeyear|end, \MYshortcmd\citeyearpar|end, +\MYshortcmd\citepalias|end\ and \MYshortcmd\citetalias|end. + + +\subsection{Notes2bib} +\label{sec:notes2bib} +Mciteplus is fully compatible with Joseph Wright's notes2bib package \cite{ctan:notes2bib}. +However, version 1.3 (January 2008) or later must be used for the notes2bib + ``tail'' or ``head'' options to work with mciteplus. + + +\subsection{REV\TeX} +\label{sec:revtex} +Mciteplus is fully compatible with Arthur Ogawa and David Carlisle's REV\TeX\ (Version 4) +class \cite{ctan:revtex}, including support for end notes in the bibliography. +Note that to support this feature, REV\TeX\ uses its own internal bibliography sample +label and ignores the ones provided by \BibTeX\ and mciteplus. One annoyance is +that REV\TeX\ writes the footnote ``citations'' to the auxiliary file which causes +\BibTeX\ to complain that it can't find these ``entries'' in its database (e.g., +``\texttt{Warning--I didn't find a database entry for "endnote7"}''. To stop this +problem, add the following patch code (which you can cut and paste from \MYsmalltt{mciteplus\_code.txt}) +right after REV\TeX\ is loaded: +\begin{MYlistblk} +\MYlongcmd +|% Patch REVTeX to prevent BibTeX from seeing endnotes as citations|\ +|% Insert just after REVTeX is loaded|\ +\makeatletter|\ +\let\@ORGREVTEXendnotemark\@endnotemark|\ +\let\@ORGREVTEX@makefnmark@cite\@makefnmark@cite|\ +\def\@endnotemark{\bgroup\@fileswfalse\@ORGREVTEXendnotemark\egroup}|\ +\def\@makefnmark@cite{\bgroup\@fileswfalse\@ORGREVTEX@makefnmark@cite\egroup}|\ +\makeatother|end +\end{MYlistblk} + + +\subsection{Partially Supported Packages} +\label{sec:partiallysupportedpackages} + +\noindent\textbf{Footbib:} Eric Domenjoud's footbib package \cite{ctan:footbib} +``peacefully coexists'' with mciteplus in the sense that they do not interact. +At present, an mciteplus compatible bibstyle cannot be used for the footbibliography. + + +\subsection{Incompatible Packages} +\label{sec:incompatiblepackages} +Unfortunately, the following packages are currently known not to work with mciteplus. +Many of them clash with mciteplus on a fundamental level. However, others may be +supported in the future. + +\noindent\textbf{Amsrefs:} David Jones' amsrefs package \cite{ctan:amsrefs}. + +\noindent\textbf{Apacite:} Erik Meijer's apacite package \cite{ctan:apacite}. + +\noindent\textbf{Biblatex:} Philipp Lehman's biblatex package \cite{ctan:biblatex}. +Future versions of biblatex may well offer features like those of mciteplus. + +\noindent\textbf{Bibtopic:} Stefan Ulrich and Pierre Basso's bibtopic package \cite{ctan:bibtopic}. + +\noindent\textbf{Inlinebib:} Ren{\'e} Seindal's inlinebib package \cite{ctan:inlinebib}. + +\noindent\textbf{Jurabib:} Jens Berger's jurabib package \cite{ctan:jurabib}. + +\noindent\textbf{Opcit:} Federico Garcia's opcit package \cite{ctan:opcit}. + +\noindent\textbf{Splitbib:} Nicolas Markey's splitbib package \cite{ctan:splitbib}. + + +\section*{Acknowledgments} +\addcontentsline{toc}{section}{Acknowledgments} +First and foremost, the author would like to thank Joseph Wright. +Joseph beta tested prototype versions as well as provided many +ideas that improved the final architecture of mciteplus. + +Thorsten Ohl's mcite package identified the need for a \LaTeX\ +package that provides this type of bibliography handling and set +the standard for so doing. Although coded differently, mciteplus +uses the same basic approach to the problem (i.e., wrap the +citation command, drop the tails, forward the head list to the +original cite command, and selectively drop items in the +bibliography) as originally implemented in mcite.sty. + + +\newcommand{\BIBdecl}{\addcontentsline{toc}{section}{\refname}} + + + +%\bibliographystyle{IEEEtran} +%\bibliography{mciteplus_doc} + + +% Generated by IEEEtran.bst, version: 1.13 (2008/09/30) +\begin{thebibliography}{10} +\providecommand{\url}[1]{#1} +\csname url@samestyle\endcsname +\providecommand{\newblock}{\relax} +\providecommand{\bibinfo}[2]{#2} +\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax} +\providecommand{\BIBentryALTinterwordstretchfactor}{4} +\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus +\BIBentryALTinterwordstretchfactor\fontdimen3\font minus + \fontdimen4\font\relax} +\providecommand{\BIBforeignlanguage}[2]{{% +\expandafter\ifx\csname l@#1\endcsname\relax +\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}% +\typeout{** loaded for the language `#1'. Using the pattern for}% +\typeout{** the default language instead.}% +\else +\language=\csname l@#1\endcsname +\fi +#2}} +\providecommand{\BIBdecl}{\relax} +\BIBdecl +\renewcommand{\BIBentryALTinterwordstretchfactor}{4} + +\bibitem{ctan:mciteplus} +\BIBentryALTinterwordspacing +M.~Shell. (2013, Sep.) The mciteplus.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/mciteplus/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:mcite} +\BIBentryALTinterwordspacing +T.~Ohl. (1996, Jan.) The mcite.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/mcite/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:revtex} +\BIBentryALTinterwordspacing +A.~Ogawa and D.~Carlisle. (2010, Aug.) The {REV\TeX} package. [Online]. + Available: \url{http://www.ctan.org/tex-archive/macros/latex/contrib/revtex/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:ieeetranbst} +\BIBentryALTinterwordspacing +M.~Shell. (2008, Sep.) The {IEEE}tran {{\BibTeX}} style. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:hyperref} +\BIBentryALTinterwordspacing +S.~Rahtz and H.~Oberdiek. (2012, Nov.) The hyperref.sty package. [Online]. + Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:chapterbib} +\BIBentryALTinterwordspacing +D.~Arseneau. (2010, Sep.) The chapterbib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/cite/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:eqparbox} +\BIBentryALTinterwordspacing +S.~Pakin. (2013, Mar.) The eqparbox.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:alphabst} +\BIBentryALTinterwordspacing +O.~Patashnik. (2010, Dec.) The alpha.bst bibstyle. [Online]. Available: + \url{http://www.ctan.org/tex-archive/biblio/bibtex/base/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:amsrefs} +\BIBentryALTinterwordspacing +M.~Downes and D.~M. Jones. (2013, Mar.) The amsrefs package. [Online]. + Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/amsrefs/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:biblatex} +\BIBentryALTinterwordspacing +P.~Lehman and P.~Kime. (2013, Jul.) The biblatex package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/biblatex} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:bibunits} +\BIBentryALTinterwordspacing +T.~Hansen. (2004, May) The bibunits.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/bibunits/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:citesty} +\BIBentryALTinterwordspacing +D.~Arseneau. (2010, Sep.) The cite.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/cite/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:citeref} +\BIBentryALTinterwordspacing +B.~Briel and U.~Oldenburg. (1999, May) The citeref.sty package. [Online]. + Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/citeref/citeref.sty} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:drftcite} +\BIBentryALTinterwordspacing +D.~Arseneau. (2010, Sep.) The drftcite.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/cite/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:multibbl} +\BIBentryALTinterwordspacing +A.~Syropoulos. (2004, Jul.) The multibbl.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/multibbl/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:multibib} +\BIBentryALTinterwordspacing +T.~Hansen. (2008, Dec.) The multibib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/multibib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:natbib} +\BIBentryALTinterwordspacing +P.~W. Daly. (2010, Sep.) The natbib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:notes2bib} +\BIBentryALTinterwordspacing +J.~Wright. (2013, Jul.) The notes2bib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/notes2bib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:footbib} +\BIBentryALTinterwordspacing +E.~Domenjoud. (2010, Feb.) The footbib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/footbib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:apacite} +\BIBentryALTinterwordspacing +E.~Meijer. (2013, Jul.) The apacite package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/biblio/bibtex/contrib/apacite/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:bibtopic} +\BIBentryALTinterwordspacing +S.~Ulrich and P.~Basso. (2006, Sep.) The bibtopic.sty package. [Online]. + Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/bibtopic/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:inlinebib} +\BIBentryALTinterwordspacing +R.~Seindal. (1999, Jul.) The inlinebib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/biblio/bibtex/contrib/inlinebib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:jurabib} +\BIBentryALTinterwordspacing +J.~Berger. (2004, Jan.) The jurabib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/jurabib/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:opcit} +\BIBentryALTinterwordspacing +F.~Garcia. (2007, Jun.) The opcit.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/opcit/} +\BIBentrySTDinterwordspacing + +\bibitem{ctan:splitbib} +\BIBentryALTinterwordspacing +N.~Markey. (2005, Dec.) The splitbib.sty package. [Online]. Available: + \url{http://www.ctan.org/tex-archive/macros/latex/contrib/splitbib/} +\BIBentrySTDinterwordspacing + +\end{thebibliography} + + + + + +\end{document} -- cgit v1.2.3