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