comparison bibtex/IEEEtranSN.bst @ 0:c0d36568602d

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