comparison bibtex/IEEEtranN.bst @ 0:8319d82cab07

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