Debian Codegraph @

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

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