Debian Codegraph @

texmf-dist/bibtex/bst/ieeetran/IEEEtran.bst

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