Debian Codegraph @

texmf-dist/bibtex/bst/mciteplus/IEEEtranM.bst

raw
1 %%
2 %% IEEEtranM.bst
3 %% BibTeX Bibliography Style file
4 %% mciteplus compatible version
5 %% *** Not for normal IEEE work ***
6 %% Version 1.13 (2008/09/30)
7 %%
8 %% Copyright (c) 2003-2008 Michael Shell
9 %%
10 %% Original starting code base and algorithms obtained from the output of
11 %% Patrick W. Daly's makebst package as well as from prior versions of
12 %% IEEE BibTeX styles:
13 %%
14 %% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988)
15 %% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993)
16 %%
17 %% Support site:
18 %% http://www.michaelshell.org/tex/mciteplus/
19 %% http://www.michaelshell.org/tex/ieeetran/bibtex/
20 %%
21 %% For use with BibTeX version 0.99a or later
22 %%
23 %% This is a numerical citation style.
24 %%
25 %%*************************************************************************
26 %% Legal Notice:
27 %% This code is offered as-is without any warranty either expressed or
28 %% implied; without even the implied warranty of MERCHANTABILITY or
29 %% FITNESS FOR A PARTICULAR PURPOSE!
30 %% User assumes all risk.
31 %% In no event shall IEEE or any contributor to this code be liable for
32 %% any damages or losses, including, but not limited to, incidental,
33 %% consequential, or any other damages, resulting from the use or misuse
34 %% of any information contained here.
35 %%
36 %% All comments are the opinions of their respective authors and are not
37 %% necessarily endorsed by the IEEE.
38 %%
39 %% This work is distributed under the LaTeX Project Public License (LPPL)
40 %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
41 %% distributed and modified. A copy of the LPPL, version 1.3, is included
42 %% in the base LaTeX documentation of all distributions of LaTeX released
43 %% 2003/12/01 or later.
44 %% Retain all contribution notices and credits.
45 %% ** Modified files should be clearly indicated as such, including **
46 %% ** renaming them and changing author support contact information. **
47 %%*************************************************************************
48 %
49 % Changelog:
50 %
51 % 1.12 (2008/01/15) initial release
52 %
53 % 1.13 (2008/09/30)
54 % 1. Fixed bug with edition number to ordinal conversion. Thanks to
55 % Michael Roland for reporting this and correcting the algorithm.
56
57
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %%
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61
62 % These are the defaults for the user adjustable controls. The values used
63 % here can be overridden by the user via IEEEtranBSTCTL entry type.
64
65 % NOTE: The recommended LaTeX command to invoke a control entry type is:
66 %
67 %\makeatletter
68 %\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
69 %\def\@bstctlcite[#1]#2{\@bsphack
70 % \@for\@citeb:=#2\do{%
71 % \edef\@citeb{\expandafter\@firstofone\@citeb}%
72 % \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
73 % \@esphack}
74 %\makeatother
75 %
76 % It is called at the start of the document, before the first \cite, like:
77 % \bstctlcite{IEEEexample:BSTcontrol}
78 %
79 % IEEEtran.cls V1.6 and later does provide this command.
80
81
82
83 % #0 turns off the display of the number for articles.
84 % #1 enables
85 FUNCTION {default.is.use.number.for.article} { #1 }
86
87
88 % #0 turns off the display of the paper and type fields in @inproceedings.
89 % #1 enables
90 FUNCTION {default.is.use.paper} { #1 }
91
92
93 % #0 turns off the forced use of "et al."
94 % #1 enables
95 FUNCTION {default.is.forced.et.al} { #0 }
96
97 % The maximum number of names that can be present beyond which an "et al."
98 % usage is forced. Be sure that num.names.shown.with.forced.et.al (below)
99 % is not greater than this value!
100 % Note: There are many instances of references in IEEE journals which have
101 % a very large number of authors as well as instances in which "et al." is
102 % used profusely.
103 FUNCTION {default.max.num.names.before.forced.et.al} { #10 }
104
105 % The number of names that will be shown with a forced "et al.".
106 % Must be less than or equal to max.num.names.before.forced.et.al
107 FUNCTION {default.num.names.shown.with.forced.et.al} { #1 }
108
109
110 % #0 turns off the alternate interword spacing for entries with URLs.
111 % #1 enables
112 FUNCTION {default.is.use.alt.interword.spacing} { #1 }
113
114 % If alternate interword spacing for entries with URLs is enabled, this is
115 % the interword spacing stretch factor that will be used. For example, the
116 % default "4" here means that the interword spacing in entries with URLs can
117 % stretch to four times normal. Does not have to be an integer. Note that
118 % the value specified here can be overridden by the user in their LaTeX
119 % code via a command such as:
120 % "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to
121 % that via the IEEEtranBSTCTL entry type.
122 FUNCTION {default.ALTinterwordstretchfactor} { "4" }
123
124
125 % #0 turns off the "dashification" of repeated (i.e., identical to those
126 % of the previous entry) names. IEEE normally does this.
127 % #1 enables
128 FUNCTION {default.is.dash.repeated.names} { #1 }
129
130
131 % The default name format control string.
132 FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" }
133
134
135 % The default LaTeX font command for the names.
136 FUNCTION {default.name.latex.cmd}{ "" }
137
138
139 % The default URL prefix.
140 FUNCTION {default.name.url.prefix}{ "[Online]. Available:" }
141
142
143 % Other controls that cannot be accessed via IEEEtranBSTCTL entry type.
144
145 % #0 turns off the terminal startup banner/completed message so as to
146 % operate more quietly.
147 % #1 enables
148 FUNCTION {is.print.banners.to.terminal} { #1 }
149
150
151
152
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 %% FILE VERSION AND BANNER %%
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156
157 FUNCTION{bst.file.version} { "1.13" }
158 FUNCTION{bst.file.date} { "2008/09/30" }
159 FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" }
160
161 FUNCTION {banner.message}
162 { is.print.banners.to.terminal
163 { "-- IEEEtranM.bst version" " " * bst.file.version *
164 " (" * bst.file.date * ") " * "by Michael Shell." *
165 top$
166 "-- " bst.file.website *
167 top$
168 "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " and " * quote$ * "mciteplus_doc.pdf" * quote$ * " manuals" *
169 top$
170 " for usage information."
171 top$
172 "** Mciteplus version - not for use with work to be submitted to the IEEE."
173 top$
174 }
175 { skip$ }
176 if$
177 }
178
179 FUNCTION {completed.message}
180 { is.print.banners.to.terminal
181 { ""
182 top$
183 "Done."
184 top$
185 }
186 { skip$ }
187 if$
188 }
189
190
191
192
193 %%%%%%%%%%%%%%%%%%%%%%
194 %% STRING CONSTANTS %%
195 %%%%%%%%%%%%%%%%%%%%%%
196
197 FUNCTION {bbl.and}{ "and" }
198 FUNCTION {bbl.etal}{ "et~al." }
199 FUNCTION {bbl.editors}{ "eds." }
200 FUNCTION {bbl.editor}{ "ed." }
201 FUNCTION {bbl.edition}{ "ed." }
202 FUNCTION {bbl.volume}{ "vol." }
203 FUNCTION {bbl.of}{ "of" }
204 FUNCTION {bbl.number}{ "no." }
205 FUNCTION {bbl.in}{ "in" }
206 FUNCTION {bbl.pages}{ "pp." }
207 FUNCTION {bbl.page}{ "p." }
208 FUNCTION {bbl.chapter}{ "ch." }
209 FUNCTION {bbl.paper}{ "paper" }
210 FUNCTION {bbl.part}{ "pt." }
211 FUNCTION {bbl.patent}{ "Patent" }
212 FUNCTION {bbl.patentUS}{ "U.S." }
213 FUNCTION {bbl.revision}{ "Rev." }
214 FUNCTION {bbl.series}{ "ser." }
215 FUNCTION {bbl.standard}{ "Std." }
216 FUNCTION {bbl.techrep}{ "Tech. Rep." }
217 FUNCTION {bbl.mthesis}{ "Master's thesis" }
218 FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" }
219 FUNCTION {bbl.st}{ "st" }
220 FUNCTION {bbl.nd}{ "nd" }
221 FUNCTION {bbl.rd}{ "rd" }
222 FUNCTION {bbl.th}{ "th" }
223
224
225 % This is the LaTeX spacer that is used when a larger than normal space
226 % is called for (such as just before the address:publisher).
227 FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " }
228
229 % The LaTeX code for dashes that are used to represent repeated names.
230 % Note: Some older IEEE journals used something like
231 % "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along
232 % the baseline. However, IEEE now uses a thinner, above baseline,
233 % six dash long sequence.
234 FUNCTION {repeated.name.dashes} { "------" }
235
236
237
238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239 %% PREDEFINED STRING MACROS %%
240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241
242 MACRO {jan} {"Jan."}
243 MACRO {feb} {"Feb."}
244 MACRO {mar} {"Mar."}
245 MACRO {apr} {"Apr."}
246 MACRO {may} {"May"}
247 MACRO {jun} {"Jun."}
248 MACRO {jul} {"Jul."}
249 MACRO {aug} {"Aug."}
250 MACRO {sep} {"Sep."}
251 MACRO {oct} {"Oct."}
252 MACRO {nov} {"Nov."}
253 MACRO {dec} {"Dec."}
254
255
256
257 %%%%%%%%%%%%%%%%%%
258 %% ENTRY FIELDS %%
259 %%%%%%%%%%%%%%%%%%
260
261 ENTRY
262 { address
263 assignee
264 author
265 booktitle
266 chapter
267 day
268 dayfiled
269 edition
270 editor
271 howpublished
272 institution
273 intype
274 journal
275 key
276 language
277 month
278 monthfiled
279 nationality
280 note
281 number
282 organization
283 pages
284 paper
285 publisher
286 school
287 series
288 revision
289 title
290 type
291 url
292 volume
293 year
294 yearfiled
295 CTLuse_article_number
296 CTLuse_paper
297 CTLuse_forced_etal
298 CTLmax_names_forced_etal
299 CTLnames_show_etal
300 CTLuse_alt_spacing
301 CTLalt_stretch_factor
302 CTLdash_repeated_names
303 CTLname_format_string
304 CTLname_latex_cmd
305 CTLname_url_prefix
306 }
307 {}
308 { label }
309
310
311
312
313 %%%%%%%%%%%%%%%%%%%%%%%
314 %% INTEGER VARIABLES %%
315 %%%%%%%%%%%%%%%%%%%%%%%
316
317 INTEGERS { prev.status.punct this.status.punct punct.std
318 punct.no punct.comma punct.period
319 prev.status.space this.status.space space.std
320 space.no space.normal space.large
321 prev.status.quote this.status.quote quote.std
322 quote.no quote.close
323 prev.status.nline this.status.nline nline.std
324 nline.no nline.newblock
325 status.cap cap.std
326 cap.no cap.yes}
327
328 INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames }
329
330 INTEGERS { is.use.number.for.article
331 is.use.paper
332 is.forced.et.al
333 max.num.names.before.forced.et.al
334 num.names.shown.with.forced.et.al
335 is.use.alt.interword.spacing
336 is.dash.repeated.names}
337
338
339 %%%%%%%%%%%%%%%%%%%%%%
340 %% STRING VARIABLES %%
341 %%%%%%%%%%%%%%%%%%%%%%
342
343 STRINGS { bibinfo
344 longest.label
345 oldname
346 s
347 t
348 ALTinterwordstretchfactor
349 name.format.string
350 name.latex.cmd
351 name.url.prefix}
352
353
354
355
356 %%%%%%%%%%%%%%%%%%%%%%%%%
357 %% LOW LEVEL FUNCTIONS %%
358 %%%%%%%%%%%%%%%%%%%%%%%%%
359
360 FUNCTION {initialize.controls}
361 { default.is.use.number.for.article 'is.use.number.for.article :=
362 default.is.use.paper 'is.use.paper :=
363 default.is.forced.et.al 'is.forced.et.al :=
364 default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al :=
365 default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al :=
366 default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing :=
367 default.is.dash.repeated.names 'is.dash.repeated.names :=
368 default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor :=
369 default.name.format.string 'name.format.string :=
370 default.name.latex.cmd 'name.latex.cmd :=
371 default.name.url.prefix 'name.url.prefix :=
372 }
373
374
375 % This IEEEtran.bst features a very powerful and flexible mechanism for
376 % controlling the capitalization, punctuation, spacing, quotation, and
377 % newlines of the formatted entry fields. (Note: IEEEtran.bst does not need
378 % or use the newline/newblock feature, but it has been implemented for
379 % possible future use.) The output states of IEEEtran.bst consist of
380 % multiple independent attributes and, as such, can be thought of as being
381 % vectors, rather than the simple scalar values ("before.all",
382 % "mid.sentence", etc.) used in most other .bst files.
383 %
384 % The more flexible and complex design used here was motivated in part by
385 % IEEE's rather unusual bibliography style. For example, IEEE ends the
386 % previous field item with a period and large space prior to the publisher
387 % address; the @electronic entry types use periods as inter-item punctuation
388 % rather than the commas used by the other entry types; and URLs are never
389 % followed by periods even though they are the last item in the entry.
390 % Although it is possible to accommodate these features with the conventional
391 % output state system, the seemingly endless exceptions make for convoluted,
392 % unreliable and difficult to maintain code.
393 %
394 % IEEEtran.bst's output state system can be easily understood via a simple
395 % illustration of two most recently formatted entry fields (on the stack):
396 %
397 % CURRENT_ITEM
398 % "PREVIOUS_ITEM
399 %
400 % which, in this example, is to eventually appear in the bibliography as:
401 %
402 % "PREVIOUS_ITEM," CURRENT_ITEM
403 %
404 % It is the job of the output routine to take the previous item off of the
405 % stack (while leaving the current item at the top of the stack), apply its
406 % trailing punctuation (including closing quote marks) and spacing, and then
407 % to write the result to BibTeX's output buffer:
408 %
409 % "PREVIOUS_ITEM,"
410 %
411 % Punctuation (and spacing) between items is often determined by both of the
412 % items rather than just the first one. The presence of quotation marks
413 % further complicates the situation because, in standard English, trailing
414 % punctuation marks are supposed to be contained within the quotes.
415 %
416 % IEEEtran.bst maintains two output state (aka "status") vectors which
417 % correspond to the previous and current (aka "this") items. Each vector
418 % consists of several independent attributes which track punctuation,
419 % spacing, quotation, and newlines. Capitalization status is handled by a
420 % separate scalar because the format routines, not the output routine,
421 % handle capitalization and, therefore, there is no need to maintain the
422 % capitalization attribute for both the "previous" and "this" items.
423 %
424 % When a format routine adds a new item, it copies the current output status
425 % vector to the previous output status vector and (usually) resets the
426 % current (this) output status vector to a "standard status" vector. Using a
427 % "standard status" vector in this way allows us to redefine what we mean by
428 % "standard status" at the start of each entry handler and reuse the same
429 % format routines under the various inter-item separation schemes. For
430 % example, the standard status vector for the @book entry type may use
431 % commas for item separators, while the @electronic type may use periods,
432 % yet both entry handlers exploit many of the exact same format routines.
433 %
434 % Because format routines have write access to the output status vector of
435 % the previous item, they can override the punctuation choices of the
436 % previous format routine! Therefore, it becomes trivial to implement rules
437 % such as "Always use a period and a large space before the publisher." By
438 % pushing the generation of the closing quote mark to the output routine, we
439 % avoid all the problems caused by having to close a quote before having all
440 % the information required to determine what the punctuation should be.
441 %
442 % The IEEEtran.bst output state system can easily be expanded if needed.
443 % For instance, it is easy to add a "space.tie" attribute value if the
444 % bibliography rules mandate that two items have to be joined with an
445 % unbreakable space.
446
447 FUNCTION {initialize.status.constants}
448 { #0 'punct.no :=
449 #1 'punct.comma :=
450 #2 'punct.period :=
451 #0 'space.no :=
452 #1 'space.normal :=
453 #2 'space.large :=
454 #0 'quote.no :=
455 #1 'quote.close :=
456 #0 'cap.no :=
457 #1 'cap.yes :=
458 #0 'nline.no :=
459 #1 'nline.newblock :=
460 }
461
462 FUNCTION {std.status.using.comma}
463 { punct.comma 'punct.std :=
464 space.normal 'space.std :=
465 quote.no 'quote.std :=
466 nline.no 'nline.std :=
467 cap.no 'cap.std :=
468 }
469
470 FUNCTION {std.status.using.period}
471 { punct.period 'punct.std :=
472 space.normal 'space.std :=
473 quote.no 'quote.std :=
474 nline.no 'nline.std :=
475 cap.yes 'cap.std :=
476 }
477
478 FUNCTION {initialize.prev.this.status}
479 { punct.no 'prev.status.punct :=
480 space.no 'prev.status.space :=
481 quote.no 'prev.status.quote :=
482 nline.no 'prev.status.nline :=
483 punct.no 'this.status.punct :=
484 space.no 'this.status.space :=
485 quote.no 'this.status.quote :=
486 nline.no 'this.status.nline :=
487 cap.yes 'status.cap :=
488 }
489
490 FUNCTION {this.status.std}
491 { punct.std 'this.status.punct :=
492 space.std 'this.status.space :=
493 quote.std 'this.status.quote :=
494 nline.std 'this.status.nline :=
495 }
496
497 FUNCTION {cap.status.std}{ cap.std 'status.cap := }
498
499 FUNCTION {this.to.prev.status}
500 { this.status.punct 'prev.status.punct :=
501 this.status.space 'prev.status.space :=
502 this.status.quote 'prev.status.quote :=
503 this.status.nline 'prev.status.nline :=
504 }
505
506
507 FUNCTION {not}
508 { { #0 }
509 { #1 }
510 if$
511 }
512
513 FUNCTION {and}
514 { { skip$ }
515 { pop$ #0 }
516 if$
517 }
518
519 FUNCTION {or}
520 { { pop$ #1 }
521 { skip$ }
522 if$
523 }
524
525
526 % convert the strings "yes" or "no" to #1 or #0 respectively
527 FUNCTION {yes.no.to.int}
528 { "l" change.case$ duplicate$
529 "yes" =
530 { pop$ #1 }
531 { duplicate$ "no" =
532 { pop$ #0 }
533 { "unknown boolean " quote$ * swap$ * quote$ *
534 " in " * cite$ * warning$
535 #0
536 }
537 if$
538 }
539 if$
540 }
541
542
543 % pushes true if the single char string on the stack is in the
544 % range of "0" to "9"
545 FUNCTION {is.num}
546 { chr.to.int$
547 duplicate$ "0" chr.to.int$ < not
548 swap$ "9" chr.to.int$ > not and
549 }
550
551 % multiplies the integer on the stack by a factor of 10
552 FUNCTION {bump.int.mag}
553 { #0 'multiresult :=
554 { duplicate$ #0 > }
555 { #1 -
556 multiresult #10 +
557 'multiresult :=
558 }
559 while$
560 pop$
561 multiresult
562 }
563
564 % converts a single character string on the stack to an integer
565 FUNCTION {char.to.integer}
566 { duplicate$
567 is.num
568 { chr.to.int$ "0" chr.to.int$ - }
569 {"noninteger character " quote$ * swap$ * quote$ *
570 " in integer field of " * cite$ * warning$
571 #0
572 }
573 if$
574 }
575
576 % converts a string on the stack to an integer
577 FUNCTION {string.to.integer}
578 { duplicate$ text.length$ 'namesleft :=
579 #1 'nameptr :=
580 #0 'numnames :=
581 { nameptr namesleft > not }
582 { duplicate$ nameptr #1 substring$
583 char.to.integer numnames bump.int.mag +
584 'numnames :=
585 nameptr #1 +
586 'nameptr :=
587 }
588 while$
589 pop$
590 numnames
591 }
592
593
594
595
596 % The output routines write out the *next* to the top (previous) item on the
597 % stack, adding punctuation and such as needed. Since IEEEtran.bst maintains
598 % the output status for the top two items on the stack, these output
599 % routines have to consider the previous output status (which corresponds to
600 % the item that is being output). Full independent control of punctuation,
601 % closing quote marks, spacing, and newblock is provided.
602 %
603 % "output.nonnull" does not check for the presence of a previous empty
604 % item.
605 %
606 % "output" does check for the presence of a previous empty item and will
607 % remove an empty item rather than outputing it.
608 %
609 % "output.warn" is like "output", but will issue a warning if it detects
610 % an empty item.
611
612 FUNCTION {output.nonnull}
613 { swap$
614 prev.status.punct punct.comma =
615 { "," * }
616 { skip$ }
617 if$
618 prev.status.punct punct.period =
619 { add.period$ }
620 { skip$ }
621 if$
622 prev.status.quote quote.close =
623 { "''" * }
624 { skip$ }
625 if$
626 prev.status.space space.normal =
627 { " " * }
628 { skip$ }
629 if$
630 prev.status.space space.large =
631 { large.space * }
632 { skip$ }
633 if$
634 write$
635 prev.status.nline nline.newblock =
636 { newline$ "\newblock " write$ }
637 { skip$ }
638 if$
639 }
640
641 FUNCTION {output}
642 { duplicate$ empty$
643 'pop$
644 'output.nonnull
645 if$
646 }
647
648 FUNCTION {output.warn}
649 { 't :=
650 duplicate$ empty$
651 { pop$ "empty " t * " in " * cite$ * warning$ }
652 'output.nonnull
653 if$
654 }
655
656
657
658 % mciteplus fin.entry
659 %
660 % pushes true (1), if add.period$ would add a period to the string on the stack
661 % pushes false (0), otherwise
662 % Uses text.length$ to avoid full string comparison and two copies of string.
663 % Requires one copy of string on stack.
664 INTEGERS {would.add.period.textlen}
665 FUNCTION {would.add.period}
666 { duplicate$
667 add.period$
668 text.length$
669 'would.add.period.textlen :=
670 duplicate$
671 text.length$
672 would.add.period.textlen =
673 { #0 }
674 { #1 }
675 if$
676 }
677
678
679 FUNCTION {std.interword.spacing.or.relax}
680 { is.use.alt.interword.spacing
681 { url empty$
682 { "\relax" }
683 {"\BIBentrySTDinterwordspacing"}
684 if$}
685 { "\relax" }
686 if$
687 }
688
689
690 % "fin.entry" is the output routine that handles the last item of the entry
691 % (which will be on the top of the stack when "fin.entry" is called).
692 % This is the mciteplus version which passes the punctuation info on to mciteplus.sty
693 FUNCTION {fin.entry}
694 { this.status.punct punct.no =
695 { #0 }
696 { would.add.period }
697 if$
698 swap$
699 "\relax" * write$ newline$
700 { "\mciteBstWouldAddEndPuncttrue" write$ newline$
701 this.status.quote quote.close =
702 { "\mciteSetBstMidEndSepPunct{'';\space}{.''}{\par" std.interword.spacing.or.relax * "}\relax" * }
703 { "\mciteSetBstMidEndSepPunct{;\space}{.}{\par" std.interword.spacing.or.relax * "}\relax" * }
704 if$
705 }
706 { "\mciteBstWouldAddEndPunctfalse" write$ newline$
707 this.status.quote quote.close =
708 { "\mciteSetBstMidEndSepPunct{'';\space}{''}{\par" std.interword.spacing.or.relax * "}\relax" * }
709 { "\mciteSetBstMidEndSepPunct{~;\space}{}{\par" std.interword.spacing.or.relax * "}\relax" * }
710 if$
711 }
712 if$
713 write$
714 newline$
715 "\EndOfBibitem" write$
716 }
717
718
719
720 FUNCTION {is.last.char.not.punct}
721 { duplicate$
722 "}" * add.period$
723 #-1 #1 substring$ "." =
724 }
725
726 FUNCTION {is.multiple.pages}
727 { 't :=
728 #0 'multiresult :=
729 { multiresult not
730 t empty$ not
731 and
732 }
733 { t #1 #1 substring$
734 duplicate$ "-" =
735 swap$ duplicate$ "," =
736 swap$ "+" =
737 or or
738 { #1 'multiresult := }
739 { t #2 global.max$ substring$ 't := }
740 if$
741 }
742 while$
743 multiresult
744 }
745
746 FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ }
747
748 FUNCTION {emphasize}
749 { duplicate$ empty$
750 { pop$ "" }
751 { "\emph{" swap$ * "}" * }
752 if$
753 }
754
755 FUNCTION {do.name.latex.cmd}
756 { name.latex.cmd
757 empty$
758 { skip$ }
759 { name.latex.cmd "{" * swap$ * "}" * }
760 if$
761 }
762
763 % IEEEtran.bst uses its own \BIBforeignlanguage command which directly
764 % invokes the TeX hyphenation patterns without the need of the Babel
765 % package. Babel does a lot more than switch hyphenation patterns and
766 % its loading can cause unintended effects in many class files (such as
767 % IEEEtran.cls).
768 FUNCTION {select.language}
769 { duplicate$ empty$ 'pop$
770 { language empty$ 'skip$
771 { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * }
772 if$
773 }
774 if$
775 }
776
777 FUNCTION {tie.or.space.prefix}
778 { duplicate$ text.length$ #3 <
779 { "~" }
780 { " " }
781 if$
782 swap$
783 }
784
785 FUNCTION {get.bbl.editor}
786 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
787
788 FUNCTION {space.word}{ " " swap$ * " " * }
789
790
791 % Field Conditioners, Converters, Checkers and External Interfaces
792
793 FUNCTION {empty.field.to.null.string}
794 { duplicate$ empty$
795 { pop$ "" }
796 { skip$ }
797 if$
798 }
799
800 FUNCTION {either.or.check}
801 { empty$
802 { pop$ }
803 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
804 if$
805 }
806
807 FUNCTION {empty.entry.warn}
808 { author empty$ title empty$ howpublished empty$
809 month empty$ year empty$ note empty$ url empty$
810 and and and and and and
811 { "all relevant fields are empty in " cite$ * warning$ }
812 'skip$
813 if$
814 }
815
816
817 % The bibinfo system provides a way for the electronic parsing/acquisition
818 % of a bibliography's contents as is done by ReVTeX. For example, a field
819 % could be entered into the bibliography as:
820 % \bibinfo{volume}{2}
821 % Only the "2" would show up in the document, but the LaTeX \bibinfo command
822 % could do additional things with the information. IEEEtran.bst does provide
823 % a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is
824 % currently not used as the bogus bibinfo functions defined here output the
825 % entry values directly without the \bibinfo wrapper. The bibinfo functions
826 % themselves (and the calls to them) are retained for possible future use.
827 %
828 % bibinfo.check avoids acting on missing fields while bibinfo.warn will
829 % issue a warning message if a missing field is detected. Prior to calling
830 % the bibinfo functions, the user should push the field value and then its
831 % name string, in that order.
832
833 FUNCTION {bibinfo.check}
834 { swap$ duplicate$ missing$
835 { pop$ pop$ "" }
836 { duplicate$ empty$
837 { swap$ pop$ }
838 { swap$ pop$ }
839 if$
840 }
841 if$
842 }
843
844 FUNCTION {bibinfo.warn}
845 { swap$ duplicate$ missing$
846 { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" }
847 { duplicate$ empty$
848 { swap$ "empty " swap$ * " in " * cite$ * warning$ }
849 { swap$ pop$ }
850 if$
851 }
852 if$
853 }
854
855
856 % IEEE separates large numbers with more than 4 digits into groups of
857 % three. IEEE uses a small space to separate these number groups.
858 % Typical applications include patent and page numbers.
859
860 % number of consecutive digits required to trigger the group separation.
861 FUNCTION {large.number.trigger}{ #5 }
862
863 % For numbers longer than the trigger, this is the blocksize of the groups.
864 % The blocksize must be less than the trigger threshold, and 2 * blocksize
865 % must be greater than the trigger threshold (can't do more than one
866 % separation on the initial trigger).
867 FUNCTION {large.number.blocksize}{ #3 }
868
869 % What is actually inserted between the number groups.
870 FUNCTION {large.number.separator}{ "\," }
871
872 % So as to save on integer variables by reusing existing ones, numnames
873 % holds the current number of consecutive digits read and nameptr holds
874 % the number that will trigger an inserted space.
875 FUNCTION {large.number.separate}
876 { 't :=
877 ""
878 #0 'numnames :=
879 large.number.trigger 'nameptr :=
880 { t empty$ not }
881 { t #-1 #1 substring$ is.num
882 { numnames #1 + 'numnames := }
883 { #0 'numnames :=
884 large.number.trigger 'nameptr :=
885 }
886 if$
887 t #-1 #1 substring$ swap$ *
888 t #-2 global.max$ substring$ 't :=
889 numnames nameptr =
890 { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$
891 nameptr large.number.blocksize - #1 + global.max$ substring$
892 large.number.separator swap$ * *
893 nameptr large.number.blocksize - 'numnames :=
894 large.number.blocksize #1 + 'nameptr :=
895 }
896 { skip$ }
897 if$
898 }
899 while$
900 }
901
902 % Converts all single dashes "-" to double dashes "--".
903 FUNCTION {n.dashify}
904 { large.number.separate
905 't :=
906 ""
907 { t empty$ not }
908 { t #1 #1 substring$ "-" =
909 { t #1 #2 substring$ "--" = not
910 { "--" *
911 t #2 global.max$ substring$ 't :=
912 }
913 { { t #1 #1 substring$ "-" = }
914 { "-" *
915 t #2 global.max$ substring$ 't :=
916 }
917 while$
918 }
919 if$
920 }
921 { t #1 #1 substring$ *
922 t #2 global.max$ substring$ 't :=
923 }
924 if$
925 }
926 while$
927 }
928
929
930 % This function detects entries with names that are identical to that of
931 % the previous entry and replaces the repeated names with dashes (if the
932 % "is.dash.repeated.names" user control is nonzero).
933 FUNCTION {name.or.dash}
934 { 's :=
935 oldname empty$
936 { s 'oldname := s }
937 { s oldname =
938 { is.dash.repeated.names
939 { repeated.name.dashes }
940 { s 'oldname := s }
941 if$
942 }
943 { s 'oldname := s }
944 if$
945 }
946 if$
947 }
948
949 % Converts the number string on the top of the stack to
950 % "numerical ordinal form" (e.g., "7" to "7th"). There is
951 % no artificial limit to the upper bound of the numbers as the
952 % two least significant digits determine the ordinal form.
953 FUNCTION {num.to.ordinal}
954 { duplicate$ #-2 #1 substring$ "1" =
955 { bbl.th * }
956 { duplicate$ #-1 #1 substring$ "1" =
957 { bbl.st * }
958 { duplicate$ #-1 #1 substring$ "2" =
959 { bbl.nd * }
960 { duplicate$ #-1 #1 substring$ "3" =
961 { bbl.rd * }
962 { bbl.th * }
963 if$
964 }
965 if$
966 }
967 if$
968 }
969 if$
970 }
971
972 % If the string on the top of the stack begins with a number,
973 % (e.g., 11th) then replace the string with the leading number
974 % it contains. Otherwise retain the string as-is. s holds the
975 % extracted number, t holds the part of the string that remains
976 % to be scanned.
977 FUNCTION {extract.num}
978 { duplicate$ 't :=
979 "" 's :=
980 { t empty$ not }
981 { t #1 #1 substring$
982 t #2 global.max$ substring$ 't :=
983 duplicate$ is.num
984 { s swap$ * 's := }
985 { pop$ "" 't := }
986 if$
987 }
988 while$
989 s empty$
990 'skip$
991 { pop$ s }
992 if$
993 }
994
995 % Converts the word number string on the top of the stack to
996 % Arabic string form. Will be successful up to "tenth".
997 FUNCTION {word.to.num}
998 { duplicate$ "l" change.case$ 's :=
999 s "first" =
1000 { pop$ "1" }
1001 { skip$ }
1002 if$
1003 s "second" =
1004 { pop$ "2" }
1005 { skip$ }
1006 if$
1007 s "third" =
1008 { pop$ "3" }
1009 { skip$ }
1010 if$
1011 s "fourth" =
1012 { pop$ "4" }
1013 { skip$ }
1014 if$
1015 s "fifth" =
1016 { pop$ "5" }
1017 { skip$ }
1018 if$
1019 s "sixth" =
1020 { pop$ "6" }
1021 { skip$ }
1022 if$
1023 s "seventh" =
1024 { pop$ "7" }
1025 { skip$ }
1026 if$
1027 s "eighth" =
1028 { pop$ "8" }
1029 { skip$ }
1030 if$
1031 s "ninth" =
1032 { pop$ "9" }
1033 { skip$ }
1034 if$
1035 s "tenth" =
1036 { pop$ "10" }
1037 { skip$ }
1038 if$
1039 }
1040
1041
1042 % Converts the string on the top of the stack to numerical
1043 % ordinal (e.g., "11th") form.
1044 FUNCTION {convert.edition}
1045 { duplicate$ empty$ 'skip$
1046 { duplicate$ #1 #1 substring$ is.num
1047 { extract.num
1048 num.to.ordinal
1049 }
1050 { word.to.num
1051 duplicate$ #1 #1 substring$ is.num
1052 { num.to.ordinal }
1053 { "edition ordinal word " quote$ * edition * quote$ *
1054 " may be too high (or improper) for conversion" * " in " * cite$ * warning$
1055 }
1056 if$
1057 }
1058 if$
1059 }
1060 if$
1061 }
1062
1063
1064
1065
1066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1067 %% LATEX BIBLIOGRAPHY CODE %%
1068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1069
1070 FUNCTION {start.entry}
1071 { newline$
1072 "\bibitem{" write$
1073 cite$ write$
1074 "}" write$
1075 newline$
1076 ""
1077 initialize.prev.this.status
1078 }
1079
1080 % Here we write out all the LaTeX code that we will need. The most involved
1081 % code sequences are those that control the alternate interword spacing and
1082 % foreign language hyphenation patterns. The heavy use of \providecommand
1083 % gives users a way to override the defaults. Special thanks to Javier Bezos,
1084 % Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all
1085 % the other gurus on comp.text.tex for their help and advice on the topic of
1086 % \selectlanguage, Babel and BibTeX.
1087 FUNCTION {begin.bib}
1088 { "% Generated by IEEEtranM.bst, version: " bst.file.version * " (" * bst.file.date * ")" *
1089 write$ newline$
1090 preamble$ empty$ 'skip$
1091 { preamble$ write$ newline$ }
1092 if$
1093 "\ifx\mcitethebibliography\mciteundefinedmacro"
1094 write$ newline$
1095 "\PackageError{IEEEtranM.bst}{mciteplus.sty has not been loaded}"
1096 write$ newline$
1097 "{This bibstyle requires the use of the mciteplus package.}\fi"
1098 write$ newline$
1099 "\begin{mcitethebibliography}{" longest.label * "}" *
1100 write$ newline$
1101 "\providecommand{\url}[1]{#1}"
1102 write$ newline$
1103 "\csname url@samestyle\endcsname"
1104 write$ newline$
1105 "\providecommand{\newblock}{\relax}"
1106 write$ newline$
1107 "\providecommand{\bibinfo}[2]{#2}"
1108 write$ newline$
1109 "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}"
1110 write$ newline$
1111 "\providecommand{\BIBentryALTinterwordstretchfactor}{"
1112 ALTinterwordstretchfactor * "}" *
1113 write$ newline$
1114 "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus "
1115 write$ newline$
1116 "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}"
1117 write$ newline$
1118 "\providecommand{\BIBforeignlanguage}[2]{{%"
1119 write$ newline$
1120 "\expandafter\ifx\csname l@#1\endcsname\relax"
1121 write$ newline$
1122 "\typeout{** WARNING: IEEEtranM.bst: No hyphenation pattern has been}%"
1123 write$ newline$
1124 "\typeout{** loaded for the language `#1'. Using the pattern for}%"
1125 write$ newline$
1126 "\typeout{** the default language instead.}%"
1127 write$ newline$
1128 "\else"
1129 write$ newline$
1130 "\language=\csname l@#1\endcsname"
1131 write$ newline$
1132 "\fi"
1133 write$ newline$
1134 "#2}}"
1135 write$ newline$
1136 "\providecommand{\BIBdecl}{\relax}"
1137 write$ newline$
1138 "\BIBdecl"
1139 write$ newline$
1140 }
1141
1142 FUNCTION {end.bib}
1143 { newline$ "\end{mcitethebibliography}" write$ newline$ }
1144
1145 FUNCTION {if.url.alt.interword.spacing}
1146 { is.use.alt.interword.spacing
1147 {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ "\relax " write$ } if$}
1148 { skip$ }
1149 if$
1150 }
1151
1152 FUNCTION {if.url.std.interword.spacing}
1153 { is.use.alt.interword.spacing
1154 {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ "\relax " write$ } if$}
1155 { skip$ }
1156 if$
1157 }
1158
1159
1160
1161
1162 %%%%%%%%%%%%%%%%%%%%%%%%
1163 %% LONGEST LABEL PASS %%
1164 %%%%%%%%%%%%%%%%%%%%%%%%
1165
1166 FUNCTION {initialize.longest.label}
1167 { "" 'longest.label :=
1168 #1 'number.label :=
1169 #0 'longest.label.width :=
1170 }
1171
1172 FUNCTION {longest.label.pass}
1173 { type$ "ieeetranbstctl" =
1174 { skip$ }
1175 { number.label int.to.str$ 'label :=
1176 number.label #1 + 'number.label :=
1177 label width$ longest.label.width >
1178 { label 'longest.label :=
1179 label width$ 'longest.label.width :=
1180 }
1181 { skip$ }
1182 if$
1183 }
1184 if$
1185 }
1186
1187
1188
1189
1190 %%%%%%%%%%%%%%%%%%%%%
1191 %% FORMAT HANDLERS %%
1192 %%%%%%%%%%%%%%%%%%%%%
1193
1194 %% Lower Level Formats (used by higher level formats)
1195
1196 FUNCTION {format.address.org.or.pub.date}
1197 { 't :=
1198 ""
1199 year empty$
1200 { "empty year in " cite$ * warning$ }
1201 { skip$ }
1202 if$
1203 address empty$ t empty$ and
1204 year empty$ and month empty$ and
1205 { skip$ }
1206 { this.to.prev.status
1207 this.status.std
1208 cap.status.std
1209 address "address" bibinfo.check *
1210 t empty$
1211 { skip$ }
1212 { punct.period 'prev.status.punct :=
1213 space.large 'prev.status.space :=
1214 address empty$
1215 { skip$ }
1216 { ": " * }
1217 if$
1218 t *
1219 }
1220 if$
1221 year empty$ month empty$ and
1222 { skip$ }
1223 { t empty$ address empty$ and
1224 { skip$ }
1225 { ", " * }
1226 if$
1227 month empty$
1228 { year empty$
1229 { skip$ }
1230 { year "year" bibinfo.check * }
1231 if$
1232 }
1233 { month "month" bibinfo.check *
1234 year empty$
1235 { skip$ }
1236 { " " * year "year" bibinfo.check * }
1237 if$
1238 }
1239 if$
1240 }
1241 if$
1242 }
1243 if$
1244 }
1245
1246
1247 FUNCTION {format.names}
1248 { 'bibinfo :=
1249 duplicate$ empty$ 'skip$ {
1250 this.to.prev.status
1251 this.status.std
1252 's :=
1253 "" 't :=
1254 #1 'nameptr :=
1255 s num.names$ 'numnames :=
1256 numnames 'namesleft :=
1257 { namesleft #0 > }
1258 { s nameptr
1259 name.format.string
1260 format.name$
1261 bibinfo bibinfo.check
1262 't :=
1263 nameptr #1 >
1264 { nameptr num.names.shown.with.forced.et.al #1 + =
1265 numnames max.num.names.before.forced.et.al >
1266 is.forced.et.al and and
1267 { "others" 't :=
1268 #1 'namesleft :=
1269 }
1270 { skip$ }
1271 if$
1272 namesleft #1 >
1273 { ", " * t do.name.latex.cmd * }
1274 { s nameptr "{ll}" format.name$ duplicate$ "others" =
1275 { 't := }
1276 { pop$ }
1277 if$
1278 t "others" =
1279 { " " * bbl.etal emphasize * }
1280 { numnames #2 >
1281 { "," * }
1282 { skip$ }
1283 if$
1284 bbl.and
1285 space.word * t do.name.latex.cmd *
1286 }
1287 if$
1288 }
1289 if$
1290 }
1291 { t do.name.latex.cmd }
1292 if$
1293 nameptr #1 + 'nameptr :=
1294 namesleft #1 - 'namesleft :=
1295 }
1296 while$
1297 cap.status.std
1298 } if$
1299 }
1300
1301
1302
1303
1304 %% Higher Level Formats
1305
1306 %% addresses/locations
1307
1308 FUNCTION {format.address}
1309 { address duplicate$ empty$ 'skip$
1310 { this.to.prev.status
1311 this.status.std
1312 cap.status.std
1313 }
1314 if$
1315 }
1316
1317
1318
1319 %% author/editor names
1320
1321 FUNCTION {format.authors}{ author "author" format.names }
1322
1323 FUNCTION {format.editors}
1324 { editor "editor" format.names duplicate$ empty$ 'skip$
1325 { ", " *
1326 get.bbl.editor
1327 capitalize
1328 *
1329 }
1330 if$
1331 }
1332
1333
1334
1335 %% date
1336
1337 FUNCTION {format.date}
1338 {
1339 month "month" bibinfo.check duplicate$ empty$
1340 year "year" bibinfo.check duplicate$ empty$
1341 { swap$ 'skip$
1342 { this.to.prev.status
1343 this.status.std
1344 cap.status.std
1345 "there's a month but no year in " cite$ * warning$ }
1346 if$
1347 *
1348 }
1349 { this.to.prev.status
1350 this.status.std
1351 cap.status.std
1352 swap$ 'skip$
1353 {
1354 swap$
1355 " " * swap$
1356 }
1357 if$
1358 *
1359 }
1360 if$
1361 }
1362
1363 FUNCTION {format.date.electronic}
1364 { month "month" bibinfo.check duplicate$ empty$
1365 year "year" bibinfo.check duplicate$ empty$
1366 { swap$
1367 { pop$ }
1368 { "there's a month but no year in " cite$ * warning$
1369 pop$ ")" * "(" swap$ *
1370 this.to.prev.status
1371 punct.no 'this.status.punct :=
1372 space.normal 'this.status.space :=
1373 quote.no 'this.status.quote :=
1374 cap.yes 'status.cap :=
1375 }
1376 if$
1377 }
1378 { swap$
1379 { swap$ pop$ ")" * "(" swap$ * }
1380 { "(" swap$ * ", " * swap$ * ")" * }
1381 if$
1382 this.to.prev.status
1383 punct.no 'this.status.punct :=
1384 space.normal 'this.status.space :=
1385 quote.no 'this.status.quote :=
1386 cap.yes 'status.cap :=
1387 }
1388 if$
1389 }
1390
1391
1392
1393 %% edition/title
1394
1395 % Note: IEEE considers the edition to be closely associated with
1396 % the title of a book. So, in IEEEtran.bst the edition is normally handled
1397 % within the formatting of the title. The format.edition function is
1398 % retained here for possible future use.
1399 FUNCTION {format.edition}
1400 { edition duplicate$ empty$ 'skip$
1401 { this.to.prev.status
1402 this.status.std
1403 convert.edition
1404 status.cap
1405 { "t" }
1406 { "l" }
1407 if$ change.case$
1408 "edition" bibinfo.check
1409 "~" * bbl.edition *
1410 cap.status.std
1411 }
1412 if$
1413 }
1414
1415 % This is used to format the booktitle of a conference proceedings.
1416 % Here we use the "intype" field to provide the user a way to
1417 % override the word "in" (e.g., with things like "presented at")
1418 % Use of intype stops the emphasis of the booktitle to indicate that
1419 % we no longer mean the written conference proceedings, but the
1420 % conference itself.
1421 FUNCTION {format.in.booktitle}
1422 { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
1423 { this.to.prev.status
1424 this.status.std
1425 select.language
1426 intype missing$
1427 { emphasize
1428 bbl.in " " *
1429 }
1430 { intype " " * }
1431 if$
1432 swap$ *
1433 cap.status.std
1434 }
1435 if$
1436 }
1437
1438 % This is used to format the booktitle of collection.
1439 % Here the "intype" field is not supported, but "edition" is.
1440 FUNCTION {format.in.booktitle.edition}
1441 { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$
1442 { this.to.prev.status
1443 this.status.std
1444 select.language
1445 emphasize
1446 edition empty$ 'skip$
1447 { ", " *
1448 edition
1449 convert.edition
1450 "l" change.case$
1451 * "~" * bbl.edition *
1452 }
1453 if$
1454 bbl.in " " * swap$ *
1455 cap.status.std
1456 }
1457 if$
1458 }
1459
1460 FUNCTION {format.article.title}
1461 { title duplicate$ empty$ 'skip$
1462 { this.to.prev.status
1463 this.status.std
1464 "t" change.case$
1465 }
1466 if$
1467 "title" bibinfo.check
1468 duplicate$ empty$ 'skip$
1469 { quote.close 'this.status.quote :=
1470 is.last.char.not.punct
1471 { punct.std 'this.status.punct := }
1472 { punct.no 'this.status.punct := }
1473 if$
1474 select.language
1475 "``" swap$ *
1476 cap.status.std
1477 }
1478 if$
1479 }
1480
1481 FUNCTION {format.article.title.electronic}
1482 { title duplicate$ empty$ 'skip$
1483 { this.to.prev.status
1484 this.status.std
1485 cap.status.std
1486 "t" change.case$
1487 }
1488 if$
1489 "title" bibinfo.check
1490 duplicate$ empty$
1491 { skip$ }
1492 { select.language }
1493 if$
1494 }
1495
1496 FUNCTION {format.book.title.edition}
1497 { title "title" bibinfo.check
1498 duplicate$ empty$
1499 { "empty title in " cite$ * warning$ }
1500 { this.to.prev.status
1501 this.status.std
1502 select.language
1503 emphasize
1504 edition empty$ 'skip$
1505 { ", " *
1506 edition
1507 convert.edition
1508 status.cap
1509 { "t" }
1510 { "l" }
1511 if$
1512 change.case$
1513 * "~" * bbl.edition *
1514 }
1515 if$
1516 cap.status.std
1517 }
1518 if$
1519 }
1520
1521 FUNCTION {format.book.title}
1522 { title "title" bibinfo.check
1523 duplicate$ empty$ 'skip$
1524 { this.to.prev.status
1525 this.status.std
1526 cap.status.std
1527 select.language
1528 emphasize
1529 }
1530 if$
1531 }
1532
1533
1534
1535 %% journal
1536
1537 FUNCTION {format.journal}
1538 { journal duplicate$ empty$ 'skip$
1539 { this.to.prev.status
1540 this.status.std
1541 cap.status.std
1542 select.language
1543 emphasize
1544 }
1545 if$
1546 }
1547
1548
1549
1550 %% how published
1551
1552 FUNCTION {format.howpublished}
1553 { howpublished duplicate$ empty$ 'skip$
1554 { this.to.prev.status
1555 this.status.std
1556 cap.status.std
1557 }
1558 if$
1559 }
1560
1561
1562
1563 %% institutions/organization/publishers/school
1564
1565 FUNCTION {format.institution}
1566 { institution duplicate$ empty$ 'skip$
1567 { this.to.prev.status
1568 this.status.std
1569 cap.status.std
1570 }
1571 if$
1572 }
1573
1574 FUNCTION {format.organization}
1575 { organization duplicate$ empty$ 'skip$
1576 { this.to.prev.status
1577 this.status.std
1578 cap.status.std
1579 }
1580 if$
1581 }
1582
1583 FUNCTION {format.address.publisher.date}
1584 { publisher "publisher" bibinfo.warn format.address.org.or.pub.date }
1585
1586 FUNCTION {format.address.publisher.date.nowarn}
1587 { publisher "publisher" bibinfo.check format.address.org.or.pub.date }
1588
1589 FUNCTION {format.address.organization.date}
1590 { organization "organization" bibinfo.check format.address.org.or.pub.date }
1591
1592 FUNCTION {format.school}
1593 { school duplicate$ empty$ 'skip$
1594 { this.to.prev.status
1595 this.status.std
1596 cap.status.std
1597 }
1598 if$
1599 }
1600
1601
1602
1603 %% volume/number/series/chapter/pages
1604
1605 FUNCTION {format.volume}
1606 { volume empty.field.to.null.string
1607 duplicate$ empty$ 'skip$
1608 { this.to.prev.status
1609 this.status.std
1610 bbl.volume
1611 status.cap
1612 { capitalize }
1613 { skip$ }
1614 if$
1615 swap$ tie.or.space.prefix
1616 "volume" bibinfo.check
1617 * *
1618 cap.status.std
1619 }
1620 if$
1621 }
1622
1623 FUNCTION {format.number}
1624 { number empty.field.to.null.string
1625 duplicate$ empty$ 'skip$
1626 { this.to.prev.status
1627 this.status.std
1628 status.cap
1629 { bbl.number capitalize }
1630 { bbl.number }
1631 if$
1632 swap$ tie.or.space.prefix
1633 "number" bibinfo.check
1634 * *
1635 cap.status.std
1636 }
1637 if$
1638 }
1639
1640 FUNCTION {format.number.if.use.for.article}
1641 { is.use.number.for.article
1642 { format.number }
1643 { "" }
1644 if$
1645 }
1646
1647 % IEEE does not seem to tie the series so closely with the volume
1648 % and number as is done in other bibliography styles. Instead the
1649 % series is treated somewhat like an extension of the title.
1650 FUNCTION {format.series}
1651 { series empty$
1652 { "" }
1653 { this.to.prev.status
1654 this.status.std
1655 bbl.series " " *
1656 series "series" bibinfo.check *
1657 cap.status.std
1658 }
1659 if$
1660 }
1661
1662
1663 FUNCTION {format.chapter}
1664 { chapter empty$
1665 { "" }
1666 { this.to.prev.status
1667 this.status.std
1668 type empty$
1669 { bbl.chapter }
1670 { type "l" change.case$
1671 "type" bibinfo.check
1672 }
1673 if$
1674 chapter tie.or.space.prefix
1675 "chapter" bibinfo.check
1676 * *
1677 cap.status.std
1678 }
1679 if$
1680 }
1681
1682
1683 % The intended use of format.paper is for paper numbers of inproceedings.
1684 % The paper type can be overridden via the type field.
1685 % We allow the type to be displayed even if the paper number is absent
1686 % for things like "postdeadline paper"
1687 FUNCTION {format.paper}
1688 { is.use.paper
1689 { paper empty$
1690 { type empty$
1691 { "" }
1692 { this.to.prev.status
1693 this.status.std
1694 type "type" bibinfo.check
1695 cap.status.std
1696 }
1697 if$
1698 }
1699 { this.to.prev.status
1700 this.status.std
1701 type empty$
1702 { bbl.paper }
1703 { type "type" bibinfo.check }
1704 if$
1705 " " * paper
1706 "paper" bibinfo.check
1707 *
1708 cap.status.std
1709 }
1710 if$
1711 }
1712 { "" }
1713 if$
1714 }
1715
1716
1717 FUNCTION {format.pages}
1718 { pages duplicate$ empty$ 'skip$
1719 { this.to.prev.status
1720 this.status.std
1721 duplicate$ is.multiple.pages
1722 {
1723 bbl.pages swap$
1724 n.dashify
1725 }
1726 {
1727 bbl.page swap$
1728 }
1729 if$
1730 tie.or.space.prefix
1731 "pages" bibinfo.check
1732 * *
1733 cap.status.std
1734 }
1735 if$
1736 }
1737
1738
1739
1740 %% technical report number
1741
1742 FUNCTION {format.tech.report.number}
1743 { number "number" bibinfo.check
1744 this.to.prev.status
1745 this.status.std
1746 cap.status.std
1747 type duplicate$ empty$
1748 { pop$
1749 bbl.techrep
1750 }
1751 { skip$ }
1752 if$
1753 "type" bibinfo.check
1754 swap$ duplicate$ empty$
1755 { pop$ }
1756 { tie.or.space.prefix * * }
1757 if$
1758 }
1759
1760
1761
1762 %% note
1763
1764 FUNCTION {format.note}
1765 { note empty$
1766 { "" }
1767 { this.to.prev.status
1768 this.status.std
1769 punct.period 'this.status.punct :=
1770 note #1 #1 substring$
1771 duplicate$ "{" =
1772 { skip$ }
1773 { status.cap
1774 { "u" }
1775 { "l" }
1776 if$
1777 change.case$
1778 }
1779 if$
1780 note #2 global.max$ substring$ * "note" bibinfo.check
1781 cap.yes 'status.cap :=
1782 }
1783 if$
1784 }
1785
1786
1787
1788 %% patent
1789
1790 FUNCTION {format.patent.date}
1791 { this.to.prev.status
1792 this.status.std
1793 year empty$
1794 { monthfiled duplicate$ empty$
1795 { "monthfiled" bibinfo.check pop$ "" }
1796 { "monthfiled" bibinfo.check }
1797 if$
1798 dayfiled duplicate$ empty$
1799 { "dayfiled" bibinfo.check pop$ "" * }
1800 { "dayfiled" bibinfo.check
1801 monthfiled empty$
1802 { "dayfiled without a monthfiled in " cite$ * warning$
1803 *
1804 }
1805 { " " swap$ * * }
1806 if$
1807 }
1808 if$
1809 yearfiled empty$
1810 { "no year or yearfiled in " cite$ * warning$ }
1811 { yearfiled "yearfiled" bibinfo.check
1812 swap$
1813 duplicate$ empty$
1814 { pop$ }
1815 { ", " * swap$ * }
1816 if$
1817 }
1818 if$
1819 }
1820 { month duplicate$ empty$
1821 { "month" bibinfo.check pop$ "" }
1822 { "month" bibinfo.check }
1823 if$
1824 day duplicate$ empty$
1825 { "day" bibinfo.check pop$ "" * }
1826 { "day" bibinfo.check
1827 month empty$
1828 { "day without a month in " cite$ * warning$
1829 *
1830 }
1831 { " " swap$ * * }
1832 if$
1833 }
1834 if$
1835 year "year" bibinfo.check
1836 swap$
1837 duplicate$ empty$
1838 { pop$ }
1839 { ", " * swap$ * }
1840 if$
1841 }
1842 if$
1843 cap.status.std
1844 }
1845
1846 FUNCTION {format.patent.nationality.type.number}
1847 { this.to.prev.status
1848 this.status.std
1849 nationality duplicate$ empty$
1850 { "nationality" bibinfo.warn pop$ "" }
1851 { "nationality" bibinfo.check
1852 duplicate$ "l" change.case$ "united states" =
1853 { pop$ bbl.patentUS }
1854 { skip$ }
1855 if$
1856 " " *
1857 }
1858 if$
1859 type empty$
1860 { bbl.patent "type" bibinfo.check }
1861 { type "type" bibinfo.check }
1862 if$
1863 *
1864 number duplicate$ empty$
1865 { "number" bibinfo.warn pop$ }
1866 { "number" bibinfo.check
1867 large.number.separate
1868 swap$ " " * swap$ *
1869 }
1870 if$
1871 cap.status.std
1872 }
1873
1874
1875
1876 %% standard
1877
1878 FUNCTION {format.organization.institution.standard.type.number}
1879 { this.to.prev.status
1880 this.status.std
1881 organization duplicate$ empty$
1882 { pop$
1883 institution duplicate$ empty$
1884 { "institution" bibinfo.warn }
1885 { "institution" bibinfo.warn " " * }
1886 if$
1887 }
1888 { "organization" bibinfo.warn " " * }
1889 if$
1890 type empty$
1891 { bbl.standard "type" bibinfo.check }
1892 { type "type" bibinfo.check }
1893 if$
1894 *
1895 number duplicate$ empty$
1896 { "number" bibinfo.check pop$ }
1897 { "number" bibinfo.check
1898 large.number.separate
1899 swap$ " " * swap$ *
1900 }
1901 if$
1902 cap.status.std
1903 }
1904
1905 FUNCTION {format.revision}
1906 { revision empty$
1907 { "" }
1908 { this.to.prev.status
1909 this.status.std
1910 bbl.revision
1911 revision tie.or.space.prefix
1912 "revision" bibinfo.check
1913 * *
1914 cap.status.std
1915 }
1916 if$
1917 }
1918
1919
1920 %% thesis
1921
1922 FUNCTION {format.master.thesis.type}
1923 { this.to.prev.status
1924 this.status.std
1925 type empty$
1926 {
1927 bbl.mthesis
1928 }
1929 {
1930 type "type" bibinfo.check
1931 }
1932 if$
1933 cap.status.std
1934 }
1935
1936 FUNCTION {format.phd.thesis.type}
1937 { this.to.prev.status
1938 this.status.std
1939 type empty$
1940 {
1941 bbl.phdthesis
1942 }
1943 {
1944 type "type" bibinfo.check
1945 }
1946 if$
1947 cap.status.std
1948 }
1949
1950
1951
1952 %% URL
1953
1954 FUNCTION {format.url}
1955 { url empty$
1956 { "" }
1957 { this.to.prev.status
1958 this.status.std
1959 cap.yes 'status.cap :=
1960 name.url.prefix " " *
1961 "\url{" * url * "}" *
1962 punct.no 'this.status.punct :=
1963 punct.period 'prev.status.punct :=
1964 space.normal 'this.status.space :=
1965 space.normal 'prev.status.space :=
1966 quote.no 'this.status.quote :=
1967 }
1968 if$
1969 }
1970
1971
1972
1973
1974 %%%%%%%%%%%%%%%%%%%%
1975 %% ENTRY HANDLERS %%
1976 %%%%%%%%%%%%%%%%%%%%
1977
1978
1979 % Note: In many journals, IEEE (or the authors) tend not to show the number
1980 % for articles, so the display of the number is controlled here by the
1981 % switch "is.use.number.for.article"
1982 FUNCTION {article}
1983 { std.status.using.comma
1984 start.entry
1985 if.url.alt.interword.spacing
1986 format.authors "author" output.warn
1987 name.or.dash
1988 format.article.title "title" output.warn
1989 format.journal "journal" bibinfo.check "journal" output.warn
1990 format.volume output
1991 format.number.if.use.for.article output
1992 format.pages output
1993 format.date "year" output.warn
1994 format.note output
1995 format.url output
1996 fin.entry
1997 % if.url.std.interword.spacing
1998 }
1999
2000 FUNCTION {book}
2001 { std.status.using.comma
2002 start.entry
2003 if.url.alt.interword.spacing
2004 author empty$
2005 { format.editors "author and editor" output.warn }
2006 { format.authors output.nonnull }
2007 if$
2008 name.or.dash
2009 format.book.title.edition output
2010 format.series output
2011 author empty$
2012 { skip$ }
2013 { format.editors output }
2014 if$
2015 format.address.publisher.date output
2016 format.volume output
2017 format.number output
2018 format.note output
2019 format.url output
2020 fin.entry
2021 % if.url.std.interword.spacing
2022 }
2023
2024 FUNCTION {booklet}
2025 { std.status.using.comma
2026 start.entry
2027 if.url.alt.interword.spacing
2028 format.authors output
2029 name.or.dash
2030 format.article.title "title" output.warn
2031 format.howpublished "howpublished" bibinfo.check output
2032 format.organization "organization" bibinfo.check output
2033 format.address "address" bibinfo.check output
2034 format.date output
2035 format.note output
2036 format.url output
2037 fin.entry
2038 % if.url.std.interword.spacing
2039 }
2040
2041 FUNCTION {electronic}
2042 { std.status.using.period
2043 start.entry
2044 if.url.alt.interword.spacing
2045 format.authors output
2046 name.or.dash
2047 format.date.electronic output
2048 format.article.title.electronic output
2049 format.howpublished "howpublished" bibinfo.check output
2050 format.organization "organization" bibinfo.check output
2051 format.address "address" bibinfo.check output
2052 format.note output
2053 format.url output
2054 fin.entry
2055 empty.entry.warn
2056 % if.url.std.interword.spacing
2057 }
2058
2059 FUNCTION {inbook}
2060 { std.status.using.comma
2061 start.entry
2062 if.url.alt.interword.spacing
2063 author empty$
2064 { format.editors "author and editor" output.warn }
2065 { format.authors output.nonnull }
2066 if$
2067 name.or.dash
2068 format.book.title.edition output
2069 format.series output
2070 format.address.publisher.date output
2071 format.volume output
2072 format.number output
2073 format.chapter output
2074 format.pages output
2075 format.note output
2076 format.url output
2077 fin.entry
2078 % if.url.std.interword.spacing
2079 }
2080
2081 FUNCTION {incollection}
2082 { std.status.using.comma
2083 start.entry
2084 if.url.alt.interword.spacing
2085 format.authors "author" output.warn
2086 name.or.dash
2087 format.article.title "title" output.warn
2088 format.in.booktitle.edition "booktitle" output.warn
2089 format.series output
2090 format.editors output
2091 format.address.publisher.date.nowarn output
2092 format.volume output
2093 format.number output
2094 format.chapter output
2095 format.pages output
2096 format.note output
2097 format.url output
2098 fin.entry
2099 % if.url.std.interword.spacing
2100 }
2101
2102 FUNCTION {inproceedings}
2103 { std.status.using.comma
2104 start.entry
2105 if.url.alt.interword.spacing
2106 format.authors "author" output.warn
2107 name.or.dash
2108 format.article.title "title" output.warn
2109 format.in.booktitle "booktitle" output.warn
2110 format.series output
2111 format.editors output
2112 format.volume output
2113 format.number output
2114 publisher empty$
2115 { format.address.organization.date output }
2116 { format.organization "organization" bibinfo.check output
2117 format.address.publisher.date output
2118 }
2119 if$
2120 format.paper output
2121 format.pages output
2122 format.note output
2123 format.url output
2124 fin.entry
2125 % if.url.std.interword.spacing
2126 }
2127
2128 FUNCTION {manual}
2129 { std.status.using.comma
2130 start.entry
2131 if.url.alt.interword.spacing
2132 format.authors output
2133 name.or.dash
2134 format.book.title.edition "title" output.warn
2135 format.howpublished "howpublished" bibinfo.check output
2136 format.organization "organization" bibinfo.check output
2137 format.address "address" bibinfo.check output
2138 format.date output
2139 format.note output
2140 format.url output
2141 fin.entry
2142 % if.url.std.interword.spacing
2143 }
2144
2145 FUNCTION {mastersthesis}
2146 { std.status.using.comma
2147 start.entry
2148 if.url.alt.interword.spacing
2149 format.authors "author" output.warn
2150 name.or.dash
2151 format.article.title "title" output.warn
2152 format.master.thesis.type output.nonnull
2153 format.school "school" bibinfo.warn output
2154 format.address "address" bibinfo.check output
2155 format.date "year" output.warn
2156 format.note output
2157 format.url output
2158 fin.entry
2159 % if.url.std.interword.spacing
2160 }
2161
2162 FUNCTION {misc}
2163 { std.status.using.comma
2164 start.entry
2165 if.url.alt.interword.spacing
2166 format.authors output
2167 name.or.dash
2168 format.article.title output
2169 format.howpublished "howpublished" bibinfo.check output
2170 format.organization "organization" bibinfo.check output
2171 format.address "address" bibinfo.check output
2172 format.pages output
2173 format.date output
2174 format.note output
2175 format.url output
2176 fin.entry
2177 empty.entry.warn
2178 % if.url.std.interword.spacing
2179 }
2180
2181 FUNCTION {patent}
2182 { std.status.using.comma
2183 start.entry
2184 if.url.alt.interword.spacing
2185 format.authors output
2186 name.or.dash
2187 format.article.title output
2188 format.patent.nationality.type.number output
2189 format.patent.date output
2190 format.note output
2191 format.url output
2192 fin.entry
2193 empty.entry.warn
2194 % if.url.std.interword.spacing
2195 }
2196
2197 FUNCTION {periodical}
2198 { std.status.using.comma
2199 start.entry
2200 if.url.alt.interword.spacing
2201 format.editors output
2202 name.or.dash
2203 format.book.title "title" output.warn
2204 format.series output
2205 format.volume output
2206 format.number output
2207 format.organization "organization" bibinfo.check output
2208 format.date "year" output.warn
2209 format.note output
2210 format.url output
2211 fin.entry
2212 % if.url.std.interword.spacing
2213 }
2214
2215 FUNCTION {phdthesis}
2216 { std.status.using.comma
2217 start.entry
2218 if.url.alt.interword.spacing
2219 format.authors "author" output.warn
2220 name.or.dash
2221 format.article.title "title" output.warn
2222 format.phd.thesis.type output.nonnull
2223 format.school "school" bibinfo.warn output
2224 format.address "address" bibinfo.check output
2225 format.date "year" output.warn
2226 format.note output
2227 format.url output
2228 fin.entry
2229 % if.url.std.interword.spacing
2230 }
2231
2232 FUNCTION {proceedings}
2233 { std.status.using.comma
2234 start.entry
2235 if.url.alt.interword.spacing
2236 format.editors output
2237 name.or.dash
2238 format.book.title "title" output.warn
2239 format.series output
2240 format.volume output
2241 format.number output
2242 publisher empty$
2243 { format.address.organization.date output }
2244 { format.organization "organization" bibinfo.check output
2245 format.address.publisher.date output
2246 }
2247 if$
2248 format.note output
2249 format.url output
2250 fin.entry
2251 % if.url.std.interword.spacing
2252 }
2253
2254 FUNCTION {standard}
2255 { std.status.using.comma
2256 start.entry
2257 if.url.alt.interword.spacing
2258 format.authors output
2259 name.or.dash
2260 format.book.title "title" output.warn
2261 format.howpublished "howpublished" bibinfo.check output
2262 format.organization.institution.standard.type.number output
2263 format.revision output
2264 format.date output
2265 format.note output
2266 format.url output
2267 fin.entry
2268 % if.url.std.interword.spacing
2269 }
2270
2271 FUNCTION {techreport}
2272 { std.status.using.comma
2273 start.entry
2274 if.url.alt.interword.spacing
2275 format.authors "author" output.warn
2276 name.or.dash
2277 format.article.title "title" output.warn
2278 format.howpublished "howpublished" bibinfo.check output
2279 format.institution "institution" bibinfo.warn output
2280 format.address "address" bibinfo.check output
2281 format.tech.report.number output.nonnull
2282 format.date "year" output.warn
2283 format.note output
2284 format.url output
2285 fin.entry
2286 % if.url.std.interword.spacing
2287 }
2288
2289 FUNCTION {unpublished}
2290 { std.status.using.comma
2291 start.entry
2292 if.url.alt.interword.spacing
2293 format.authors "author" output.warn
2294 name.or.dash
2295 format.article.title "title" output.warn
2296 format.date output
2297 format.note "note" output.warn
2298 format.url output
2299 fin.entry
2300 % if.url.std.interword.spacing
2301 }
2302
2303
2304 % The special entry type which provides the user interface to the
2305 % BST controls
2306 FUNCTION {IEEEtranBSTCTL}
2307 { is.print.banners.to.terminal
2308 { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." *
2309 top$
2310 }
2311 { skip$ }
2312 if$
2313 CTLuse_article_number
2314 empty$
2315 { skip$ }
2316 { CTLuse_article_number
2317 yes.no.to.int
2318 'is.use.number.for.article :=
2319 }
2320 if$
2321 CTLuse_paper
2322 empty$
2323 { skip$ }
2324 { CTLuse_paper
2325 yes.no.to.int
2326 'is.use.paper :=
2327 }
2328 if$
2329 CTLuse_forced_etal
2330 empty$
2331 { skip$ }
2332 { CTLuse_forced_etal
2333 yes.no.to.int
2334 'is.forced.et.al :=
2335 }
2336 if$
2337 CTLmax_names_forced_etal
2338 empty$
2339 { skip$ }
2340 { CTLmax_names_forced_etal
2341 string.to.integer
2342 'max.num.names.before.forced.et.al :=
2343 }
2344 if$
2345 CTLnames_show_etal
2346 empty$
2347 { skip$ }
2348 { CTLnames_show_etal
2349 string.to.integer
2350 'num.names.shown.with.forced.et.al :=
2351 }
2352 if$
2353 CTLuse_alt_spacing
2354 empty$
2355 { skip$ }
2356 { CTLuse_alt_spacing
2357 yes.no.to.int
2358 'is.use.alt.interword.spacing :=
2359 }
2360 if$
2361 CTLalt_stretch_factor
2362 empty$
2363 { skip$ }
2364 { CTLalt_stretch_factor
2365 'ALTinterwordstretchfactor :=
2366 "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
2367 ALTinterwordstretchfactor * "}" *
2368 write$ newline$
2369 }
2370 if$
2371 CTLdash_repeated_names
2372 empty$
2373 { skip$ }
2374 { CTLdash_repeated_names
2375 yes.no.to.int
2376 'is.dash.repeated.names :=
2377 }
2378 if$
2379 CTLname_format_string
2380 empty$
2381 { skip$ }
2382 { CTLname_format_string
2383 'name.format.string :=
2384 }
2385 if$
2386 CTLname_latex_cmd
2387 empty$
2388 { skip$ }
2389 { CTLname_latex_cmd
2390 'name.latex.cmd :=
2391 }
2392 if$
2393 CTLname_url_prefix
2394 missing$
2395 { skip$ }
2396 { CTLname_url_prefix
2397 'name.url.prefix :=
2398 }
2399 if$
2400
2401
2402 num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
2403 { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
2404 max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
2405 }
2406 { skip$ }
2407 if$
2408 }
2409
2410
2411 %%%%%%%%%%%%%%%%%%%
2412 %% ENTRY ALIASES %%
2413 %%%%%%%%%%%%%%%%%%%
2414 FUNCTION {conference}{inproceedings}
2415 FUNCTION {online}{electronic}
2416 FUNCTION {internet}{electronic}
2417 FUNCTION {webpage}{electronic}
2418 FUNCTION {www}{electronic}
2419 FUNCTION {default.type}{misc}
2420
2421
2422
2423 %%%%%%%%%%%%%%%%%%
2424 %% MAIN PROGRAM %%
2425 %%%%%%%%%%%%%%%%%%
2426
2427 READ
2428
2429 EXECUTE {initialize.controls}
2430 EXECUTE {initialize.status.constants}
2431 EXECUTE {banner.message}
2432
2433 EXECUTE {initialize.longest.label}
2434 ITERATE {longest.label.pass}
2435
2436 EXECUTE {begin.bib}
2437 ITERATE {call.type$}
2438 EXECUTE {end.bib}
2439
2440 EXECUTE{completed.message}
2441
2442
2443 %% That's all folks, mds.