OpenCores
URL https://opencores.org/ocsvn/funbase_ip_library/funbase_ip_library/trunk

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.communication/] [hibi/] [3.0/] [doc/] [Datasheet/] [Latex/] [IEEEtranS.bst] - Blame information for rev 145

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.