Debian Codegraph @

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

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