Debian Codegraph @

texmf-dist/doc/latex/confproc/example/IEEEtran.bst

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