Debian Codegraph @

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

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