~ubuntu-branches/ubuntu/trusty/r-cran-rcpparmadillo/trusty-proposed

« back to all changes in this revision

Viewing changes to vignettes/elsarticle-harv.bst

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2013-08-12 19:10:20 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20130812191020-4i0swxrz8v6i503v
Tags: 0.3.910.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% This is file `elsarticle-harv.bst',
 
3
%% 
 
4
%% Copyright 2007, 2008, 2009 Elsevier Ltd
 
5
%% 
 
6
%% This file is part of the 'Elsarticle Bundle'.
 
7
%% ---------------------------------------------
 
8
%% 
 
9
%% It may be distributed under the conditions of the LaTeX Project Public
 
10
%% License, either version 1.2 of this license or (at your option) any
 
11
%% later version.  The latest version of this license is in
 
12
%%    http://www.latex-project.org/lppl.txt
 
13
%% and version 1.2 or later is part of all distributions of LaTeX
 
14
%% version 1999/12/01 or later.
 
15
%% 
 
16
%% The list of all files belonging to the 'Elsarticle Bundle' is
 
17
%% given in the file `manifest.txt'.
 
18
%% 
 
19
%%
 
20
%% $Id: elsarticle.cls,v 1.20 2008-10-13 04:24:12 cvr Exp $
 
21
%%
 
22
%%
 
23
 %%-------------------------------------------------------------------
 
24
 %% This bibliography style file is intended for texts in ENGLISH
 
25
 %% This is an author-year citation style bibliography. As such, it is
 
26
 %% non-standard LaTeX, and requires a special package file
 
27
 %% to function properly.
 
28
 %% Such a package is    natbib.sty   by Patrick W. Daly
 
29
 %% The form of the \bibitem entries is
 
30
 %%   \bibitem[Jones et al.(1990)]{key}...
 
31
 %%   \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
 
32
 %% The essential feature is that the label (the part in brackets) consists
 
33
 %% of the author names, as they should appear in the citation, with the year
 
34
 %% in parentheses following. There must be no space before the opening
 
35
 %% parenthesis!
 
36
 %% With natbib v5.3, a full list of authors may also follow the year.
 
37
 %% In natbib.sty, it is possible to define the type of enclosures that is
 
38
 %% really wanted (brackets or parentheses), but in either case, there must
 
39
 %% be parentheses in the label.
 
40
 %% The \cite command functions as follows:
 
41
 %%   \citet{key} ==>>                Jones et al. (1990)
 
42
 %%   \citet*{key} ==>>               Jones, Baker, and Smith (1990)
 
43
 %%   \citep{key} ==>>                (Jones et al., 1990)
 
44
 %%   \citep*{key} ==>>               (Jones, Baker, and Smith, 1990)
 
45
 %%   \citep[chap. 2]{key} ==>>       (Jones et al., 1990, chap. 2)
 
46
 %%   \citep[e.g.][]{key} ==>>        (e.g. Jones et al., 1990)
 
47
 %%   \citep[e.g.][p. 32]{key} ==>>   (e.g. Jones et al., p. 32)
 
48
 %%   \citeauthor{key} ==>>           Jones et al.
 
49
 %%   \citeauthor*{key} ==>>          Jones, Baker, and Smith
 
50
 %%   \citeyear{key} ==>>             1990
 
51
 %%---------------------------------------------------------------------
 
52
 
 
53
ENTRY
 
54
  { address
 
55
    author
 
56
    booktitle
 
57
    chapter
 
58
    edition
 
59
    editor
 
60
    howpublished
 
61
    institution
 
62
    journal
 
63
    key
 
64
    month
 
65
    note
 
66
    number
 
67
    organization
 
68
    pages
 
69
    publisher
 
70
    school
 
71
    series
 
72
    title
 
73
    type
 
74
    url
 
75
    volume
 
76
    year
 
77
  }
 
78
  {}
 
79
  { label extra.label sort.label short.list }
 
80
 
 
81
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
 
82
 
 
83
FUNCTION {init.state.consts}
 
84
{ #0 'before.all :=
 
85
  #1 'mid.sentence :=
 
86
  #2 'after.sentence :=
 
87
  #3 'after.block :=
 
88
}
 
89
 
 
90
STRINGS { s t }
 
91
 
 
92
FUNCTION {output.nonnull}
 
93
{ 's :=
 
94
  output.state mid.sentence =
 
95
    { ", " * write$ }
 
96
    { output.state after.block =
 
97
        { add.period$ write$
 
98
          newline$
 
99
          "\newblock " write$
 
100
        }
 
101
        { output.state before.all =
 
102
            'write$
 
103
            { add.period$ " " * write$ }
 
104
          if$
 
105
        }
 
106
      if$
 
107
      mid.sentence 'output.state :=
 
108
    }
 
109
  if$
 
110
  s
 
111
}
 
112
 
 
113
FUNCTION {output}
 
114
{ duplicate$ empty$
 
115
    'pop$
 
116
    'output.nonnull
 
117
  if$
 
118
}
 
119
 
 
120
FUNCTION {output.check}
 
121
{ 't :=
 
122
  duplicate$ empty$
 
123
    { pop$ "empty " t * " in " * cite$ * warning$ }
 
124
    'output.nonnull
 
125
  if$
 
126
}
 
127
 
 
128
FUNCTION {fin.entry}
 
129
{ add.period$
 
130
  write$
 
131
  newline$
 
132
}
 
133
 
 
134
FUNCTION {new.block}
 
135
{ output.state before.all =
 
136
    'skip$
 
137
    { after.block 'output.state := }
 
138
  if$
 
139
}
 
140
 
 
141
FUNCTION {new.sentence}
 
142
{ output.state after.block =
 
143
    'skip$
 
144
    { output.state before.all =
 
145
        'skip$
 
146
        { after.sentence 'output.state := }
 
147
      if$
 
148
    }
 
149
  if$
 
150
}
 
151
 
 
152
%%SP 2003/07/25
 
153
%% No longer used
 
154
FUNCTION {add.blank}
 
155
{  " " * before.all 'output.state :=
 
156
}
 
157
 
 
158
FUNCTION {date.block}
 
159
{
 
160
  new.sentence
 
161
}
 
162
 
 
163
FUNCTION {not}
 
164
{   { #0 }
 
165
    { #1 }
 
166
  if$
 
167
}
 
168
 
 
169
FUNCTION {and}
 
170
{   'skip$
 
171
    { pop$ #0 }
 
172
  if$
 
173
}
 
174
 
 
175
FUNCTION {or}
 
176
{   { pop$ #1 }
 
177
    'skip$
 
178
  if$
 
179
}
 
180
 
 
181
FUNCTION {new.block.checkb}
 
182
{ empty$
 
183
  swap$ empty$
 
184
  and
 
185
    'skip$
 
186
    'new.block
 
187
  if$
 
188
}
 
189
 
 
190
FUNCTION {field.or.null}
 
191
{ duplicate$ empty$
 
192
    { pop$ "" }
 
193
    'skip$
 
194
  if$
 
195
}
 
196
 
 
197
FUNCTION {emphasize}
 
198
{ skip$ }
 
199
 
 
200
FUNCTION {capitalize}
 
201
{ "u" change.case$ "t" change.case$ }
 
202
 
 
203
FUNCTION {space.word}
 
204
{ " " swap$ * " " * }
 
205
 
 
206
 %% Here are the language-specific definitions for explicit words.
 
207
 %% Each function has a name bbl.xxx where xxx is the English word.
 
208
 %% The language selected here is ENGLISH
 
209
FUNCTION {bbl.and}
 
210
{ "and"}
 
211
 
 
212
FUNCTION {bbl.etal}
 
213
{ "et~al." }
 
214
 
 
215
FUNCTION {bbl.editors}
 
216
{ "Eds." }
 
217
 
 
218
FUNCTION {bbl.editor}
 
219
{ "Ed." }
 
220
 
 
221
FUNCTION {bbl.edby}
 
222
{ "edited by" }
 
223
 
 
224
FUNCTION {bbl.edition}
 
225
{ "Edition" }
 
226
 
 
227
FUNCTION {bbl.volume}
 
228
{ "Vol." }
 
229
 
 
230
FUNCTION {bbl.of}
 
231
{ "of" }
 
232
 
 
233
FUNCTION {bbl.number}
 
234
{ "no." }
 
235
 
 
236
FUNCTION {bbl.nr}
 
237
{ "no." }
 
238
 
 
239
FUNCTION {bbl.in}
 
240
{ "in" }
 
241
 
 
242
FUNCTION {bbl.pages}
 
243
{ "pp." }
 
244
 
 
245
FUNCTION {bbl.page}
 
246
{ "p." }
 
247
 
 
248
FUNCTION {bbl.chapter}
 
249
{ "Ch." }
 
250
 
 
251
FUNCTION {bbl.techrep}
 
252
{ "Tech. Rep." }
 
253
 
 
254
FUNCTION {bbl.mthesis}
 
255
{ "Master's thesis" }
 
256
 
 
257
FUNCTION {bbl.phdthesis}
 
258
{ "Ph.D. thesis" }
 
259
 
 
260
FUNCTION {bbl.first}
 
261
{ "1st" }
 
262
 
 
263
FUNCTION {bbl.second}
 
264
{ "2nd" }
 
265
 
 
266
FUNCTION {bbl.third}
 
267
{ "3rd" }
 
268
 
 
269
FUNCTION {bbl.fourth}
 
270
{ "4th" }
 
271
 
 
272
FUNCTION {bbl.fifth}
 
273
{ "5th" }
 
274
 
 
275
FUNCTION {bbl.st}
 
276
{ "st" }
 
277
 
 
278
FUNCTION {bbl.nd}
 
279
{ "nd" }
 
280
 
 
281
FUNCTION {bbl.rd}
 
282
{ "rd" }
 
283
 
 
284
FUNCTION {bbl.th}
 
285
{ "th" }
 
286
 
 
287
MACRO {jan} {"Jan."}
 
288
 
 
289
MACRO {feb} {"Feb."}
 
290
 
 
291
MACRO {mar} {"Mar."}
 
292
 
 
293
MACRO {apr} {"Apr."}
 
294
 
 
295
MACRO {may} {"May"}
 
296
 
 
297
MACRO {jun} {"Jun."}
 
298
 
 
299
MACRO {jul} {"Jul."}
 
300
 
 
301
MACRO {aug} {"Aug."}
 
302
 
 
303
MACRO {sep} {"Sep."}
 
304
 
 
305
MACRO {oct} {"Oct."}
 
306
 
 
307
MACRO {nov} {"Nov."}
 
308
 
 
309
MACRO {dec} {"Dec."}
 
310
 
 
311
FUNCTION {eng.ord}
 
312
{ duplicate$ "1" swap$ *
 
313
  #-2 #1 substring$ "1" =
 
314
     { bbl.th * }
 
315
     { duplicate$ #-1 #1 substring$
 
316
       duplicate$ "1" =
 
317
         { pop$ bbl.st * }
 
318
         { duplicate$ "2" =
 
319
             { pop$ bbl.nd * }
 
320
             { "3" =
 
321
                 { bbl.rd * }
 
322
                 { bbl.th * }
 
323
               if$
 
324
             }
 
325
           if$
 
326
          }
 
327
       if$
 
328
     }
 
329
   if$
 
330
}
 
331
 
 
332
MACRO {acmcs} {"ACM Comput. Surv."}
 
333
 
 
334
MACRO {acta} {"Acta Inf."}
 
335
 
 
336
MACRO {cacm} {"Commun. ACM"}
 
337
 
 
338
MACRO {ibmjrd} {"IBM J. Res. Dev."}
 
339
 
 
340
MACRO {ibmsj} {"IBM Syst.~J."}
 
341
 
 
342
MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
 
343
 
 
344
MACRO {ieeetc} {"IEEE Trans. Comput."}
 
345
 
 
346
MACRO {ieeetcad}
 
347
 {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
 
348
 
 
349
MACRO {ipl} {"Inf. Process. Lett."}
 
350
 
 
351
MACRO {jacm} {"J.~ACM"}
 
352
 
 
353
MACRO {jcss} {"J.~Comput. Syst. Sci."}
 
354
 
 
355
MACRO {scp} {"Sci. Comput. Programming"}
 
356
 
 
357
MACRO {sicomp} {"SIAM J. Comput."}
 
358
 
 
359
MACRO {tocs} {"ACM Trans. Comput. Syst."}
 
360
 
 
361
MACRO {tods} {"ACM Trans. Database Syst."}
 
362
 
 
363
MACRO {tog} {"ACM Trans. Gr."}
 
364
 
 
365
MACRO {toms} {"ACM Trans. Math. Softw."}
 
366
 
 
367
MACRO {toois} {"ACM Trans. Office Inf. Syst."}
 
368
 
 
369
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
 
370
 
 
371
MACRO {tcs} {"Theoretical Comput. Sci."}
 
372
 
 
373
FUNCTION {write.url}
 
374
{ url empty$
 
375
    { skip$ }
 
376
    { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
 
377
  if$
 
378
}
 
379
 
 
380
INTEGERS { nameptr namesleft numnames }
 
381
 
 
382
FUNCTION {format.names}
 
383
{ 's :=
 
384
  #1 'nameptr :=
 
385
  s num.names$ 'numnames :=
 
386
  numnames 'namesleft :=
 
387
    { namesleft #0 > }
 
388
    { s nameptr
 
389
      "{vv~}{ll}{, jj}{, f.}" format.name$
 
390
    't :=
 
391
      nameptr #1 >
 
392
        {
 
393
          namesleft #1 >
 
394
            { ", " * t * }
 
395
            {
 
396
              "," *
 
397
              s nameptr "{ll}" format.name$ duplicate$ "others" =
 
398
                { 't := }
 
399
                { pop$ }
 
400
              if$
 
401
              t "others" =
 
402
                {
 
403
                  " " * bbl.etal *
 
404
                }
 
405
                { " " * t * }
 
406
              if$
 
407
            }
 
408
          if$
 
409
        }
 
410
        't
 
411
      if$
 
412
      nameptr #1 + 'nameptr :=
 
413
      namesleft #1 - 'namesleft :=
 
414
    }
 
415
  while$
 
416
}
 
417
FUNCTION {format.names.ed}
 
418
{ format.names }
 
419
FUNCTION {format.key}
 
420
{ empty$
 
421
    { key field.or.null }
 
422
    { "" }
 
423
  if$
 
424
}
 
425
 
 
426
FUNCTION {format.authors}
 
427
{ author empty$
 
428
    { "" }
 
429
    { author format.names }
 
430
  if$
 
431
}
 
432
 
 
433
FUNCTION {format.editors}
 
434
{ editor empty$
 
435
    { "" }
 
436
    { editor format.names
 
437
      editor num.names$ #1 >
 
438
        { " (" * bbl.editors * ")" * }
 
439
        { " (" * bbl.editor * ")" * }
 
440
      if$
 
441
    }
 
442
  if$
 
443
}
 
444
 
 
445
FUNCTION {format.in.editors}
 
446
{ editor empty$
 
447
    { "" }
 
448
    { editor format.names.ed
 
449
      editor num.names$ #1 >
 
450
        { " (" * bbl.editors * ")" * }
 
451
        { " (" * bbl.editor * ")" * }
 
452
      if$
 
453
    }
 
454
  if$
 
455
}
 
456
 
 
457
FUNCTION {format.note}
 
458
{
 
459
 note empty$
 
460
    { "" }
 
461
    { note #1 #1 substring$
 
462
      duplicate$ "{" =
 
463
        'skip$
 
464
        { output.state mid.sentence =
 
465
          { "l" }
 
466
          { "u" }
 
467
        if$
 
468
        change.case$
 
469
        }
 
470
      if$
 
471
      note #2 global.max$ substring$ *
 
472
    }
 
473
  if$
 
474
}
 
475
 
 
476
FUNCTION {format.title}
 
477
{ title empty$
 
478
    { "" }
 
479
    { title "t" change.case$
 
480
    }
 
481
  if$
 
482
}
 
483
 
 
484
FUNCTION {format.full.names}
 
485
{'s :=
 
486
  #1 'nameptr :=
 
487
  s num.names$ 'numnames :=
 
488
  numnames 'namesleft :=
 
489
    { namesleft #0 > }
 
490
    { s nameptr
 
491
      "{vv~}{ll}" format.name$
 
492
      't :=
 
493
      nameptr #1 >
 
494
        {
 
495
          namesleft #1 >
 
496
            { ", " * t * }
 
497
            {
 
498
              numnames #2 >
 
499
                { "," * }
 
500
                'skip$
 
501
              if$
 
502
              s nameptr "{ll}" format.name$ duplicate$ "others" =
 
503
                { 't := }
 
504
                { pop$ }
 
505
              if$
 
506
              t "others" =
 
507
                {
 
508
                  " " * bbl.etal *
 
509
                }
 
510
                { bbl.and
 
511
                  space.word * t *
 
512
                }
 
513
              if$
 
514
            }
 
515
          if$
 
516
        }
 
517
        't
 
518
      if$
 
519
      nameptr #1 + 'nameptr :=
 
520
      namesleft #1 - 'namesleft :=
 
521
    }
 
522
  while$
 
523
}
 
524
 
 
525
FUNCTION {author.editor.key.full}
 
526
{ author empty$
 
527
    { editor empty$
 
528
        { key empty$
 
529
            { cite$ #1 #3 substring$ }
 
530
            'key
 
531
          if$
 
532
        }
 
533
        { editor format.full.names }
 
534
      if$
 
535
    }
 
536
    { author format.full.names }
 
537
  if$
 
538
}
 
539
 
 
540
FUNCTION {author.key.full}
 
541
{ author empty$
 
542
    { key empty$
 
543
         { cite$ #1 #3 substring$ }
 
544
          'key
 
545
      if$
 
546
    }
 
547
    { author format.full.names }
 
548
  if$
 
549
}
 
550
 
 
551
FUNCTION {editor.key.full}
 
552
{ editor empty$
 
553
    { key empty$
 
554
         { cite$ #1 #3 substring$ }
 
555
          'key
 
556
      if$
 
557
    }
 
558
    { editor format.full.names }
 
559
  if$
 
560
}
 
561
 
 
562
FUNCTION {make.full.names}
 
563
{ type$ "book" =
 
564
  type$ "inbook" =
 
565
  or
 
566
    'author.editor.key.full
 
567
    { type$ "proceedings" =
 
568
        'editor.key.full
 
569
        'author.key.full
 
570
      if$
 
571
    }
 
572
  if$
 
573
}
 
574
 
 
575
FUNCTION {output.bibitem}
 
576
{ newline$
 
577
  "\bibitem[{" write$
 
578
  label write$
 
579
  ")" make.full.names duplicate$ short.list =
 
580
     { pop$ }
 
581
     { * }
 
582
   if$
 
583
  "}]{" * write$
 
584
  cite$ write$
 
585
  "}" write$
 
586
  newline$
 
587
  ""
 
588
  before.all 'output.state :=
 
589
}
 
590
 
 
591
FUNCTION {n.dashify}
 
592
{
 
593
  't :=
 
594
  ""
 
595
    { t empty$ not }
 
596
    { t #1 #1 substring$ "-" =
 
597
        { t #1 #2 substring$ "--" = not
 
598
            { "--" *
 
599
              t #2 global.max$ substring$ 't :=
 
600
            }
 
601
            {   { t #1 #1 substring$ "-" = }
 
602
                { "-" *
 
603
                  t #2 global.max$ substring$ 't :=
 
604
                }
 
605
              while$
 
606
            }
 
607
          if$
 
608
        }
 
609
        { t #1 #1 substring$ *
 
610
          t #2 global.max$ substring$ 't :=
 
611
        }
 
612
      if$
 
613
    }
 
614
  while$
 
615
}
 
616
 
 
617
FUNCTION {word.in}
 
618
{ bbl.in capitalize
 
619
  ":" *
 
620
  " " * }
 
621
 
 
622
FUNCTION {format.date}
 
623
{ year duplicate$ empty$
 
624
    { "empty year in " cite$ * "; set to ????" * warning$
 
625
       pop$ "????" }
 
626
    'skip$
 
627
  if$
 
628
  month empty$
 
629
    'skip$
 
630
    { month
 
631
      " " * swap$ *
 
632
    }
 
633
  if$
 
634
  extra.label *
 
635
  before.all 'output.state :=
 
636
  ", " swap$ *
 
637
}
 
638
 
 
639
FUNCTION {format.btitle}
 
640
{ title
 
641
}
 
642
 
 
643
FUNCTION {tie.or.space.connect}
 
644
{ duplicate$ text.length$ #3 <
 
645
    { "~" }
 
646
    { " " }
 
647
  if$
 
648
  swap$ * *
 
649
}
 
650
 
 
651
FUNCTION {either.or.check}
 
652
{ empty$
 
653
    'pop$
 
654
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
 
655
  if$
 
656
}
 
657
 
 
658
FUNCTION {format.bvolume}
 
659
{ volume empty$
 
660
    { "" }
 
661
    { bbl.volume volume tie.or.space.connect
 
662
      series empty$
 
663
        'skip$
 
664
        { bbl.of space.word * series emphasize * }
 
665
      if$
 
666
      "volume and number" number either.or.check
 
667
    }
 
668
  if$
 
669
}
 
670
 
 
671
FUNCTION {format.number.series}
 
672
{ volume empty$
 
673
    { number empty$
 
674
        { series field.or.null }
 
675
        { output.state mid.sentence =
 
676
            { bbl.number }
 
677
            { bbl.number capitalize }
 
678
          if$
 
679
          number tie.or.space.connect
 
680
          series empty$
 
681
            { "there's a number but no series in " cite$ * warning$ }
 
682
            { bbl.in space.word * series * }
 
683
          if$
 
684
        }
 
685
      if$
 
686
    }
 
687
    { "" }
 
688
  if$
 
689
}
 
690
 
 
691
FUNCTION {is.num}
 
692
{ chr.to.int$
 
693
  duplicate$ "0" chr.to.int$ < not
 
694
  swap$ "9" chr.to.int$ > not and
 
695
}
 
696
 
 
697
FUNCTION {extract.num}
 
698
{ duplicate$ 't :=
 
699
  "" 's :=
 
700
  { t empty$ not }
 
701
  { t #1 #1 substring$
 
702
    t #2 global.max$ substring$ 't :=
 
703
    duplicate$ is.num
 
704
      { s swap$ * 's := }
 
705
      { pop$ "" 't := }
 
706
    if$
 
707
  }
 
708
  while$
 
709
  s empty$
 
710
    'skip$
 
711
    { pop$ s }
 
712
  if$
 
713
}
 
714
 
 
715
FUNCTION {convert.edition}
 
716
{ edition extract.num "l" change.case$ 's :=
 
717
  s "first" = s "1" = or
 
718
    { bbl.first 't := }
 
719
    { s "second" = s "2" = or
 
720
        { bbl.second 't := }
 
721
        { s "third" = s "3" = or
 
722
            { bbl.third 't := }
 
723
            { s "fourth" = s "4" = or
 
724
                { bbl.fourth 't := }
 
725
                { s "fifth" = s "5" = or
 
726
                    { bbl.fifth 't := }
 
727
                    { s #1 #1 substring$ is.num
 
728
                        { s eng.ord 't := }
 
729
                        { edition 't := }
 
730
                      if$
 
731
                    }
 
732
                  if$
 
733
                }
 
734
              if$
 
735
            }
 
736
          if$
 
737
        }
 
738
      if$
 
739
    }
 
740
  if$
 
741
  t
 
742
}
 
743
 
 
744
FUNCTION {format.edition}
 
745
{ edition empty$
 
746
    { "" }
 
747
    { output.state mid.sentence =
 
748
        { convert.edition "l" change.case$ " " * bbl.edition * }
 
749
        { convert.edition "t" change.case$ " " * bbl.edition * }
 
750
      if$
 
751
    }
 
752
  if$
 
753
}
 
754
 
 
755
INTEGERS { multiresult }
 
756
 
 
757
FUNCTION {multi.page.check}
 
758
{ 't :=
 
759
  #0 'multiresult :=
 
760
    { multiresult not
 
761
      t empty$ not
 
762
      and
 
763
    }
 
764
    { t #1 #1 substring$
 
765
      duplicate$ "-" =
 
766
      swap$ duplicate$ "," =
 
767
      swap$ "+" =
 
768
      or or
 
769
        { #1 'multiresult := }
 
770
        { t #2 global.max$ substring$ 't := }
 
771
      if$
 
772
    }
 
773
  while$
 
774
  multiresult
 
775
}
 
776
 
 
777
FUNCTION {format.pages}
 
778
{ pages empty$
 
779
    { "" }
 
780
    { pages multi.page.check
 
781
        { bbl.pages pages n.dashify tie.or.space.connect }
 
782
        { bbl.page pages tie.or.space.connect }
 
783
      if$
 
784
    }
 
785
  if$
 
786
}
 
787
 
 
788
FUNCTION {format.journal.pages}
 
789
{ pages empty$
 
790
    'skip$
 
791
    { duplicate$ empty$
 
792
        { pop$ format.pages }
 
793
        {
 
794
          ", " *
 
795
          pages n.dashify *
 
796
        }
 
797
      if$
 
798
    }
 
799
  if$
 
800
}
 
801
 
 
802
%%SP 2001/01/23
 
803
%% Only used in articles
 
804
FUNCTION {format.vol.num.pages}
 
805
{
 
806
%%SP 2001/01/23
 
807
%% Add the leading space only if there is a volume
 
808
  %% volume field.or.null
 
809
  " "
 
810
  volume empty$
 
811
    { pop$ "" }
 
812
    { volume * }
 
813
  if$
 
814
  number empty$
 
815
    'skip$
 
816
    {
 
817
      "~(" number * ")" * *
 
818
      volume empty$
 
819
        { "there's a number but no volume in " cite$ * warning$ }
 
820
        'skip$
 
821
      if$
 
822
    }
 
823
  if$
 
824
}
 
825
 
 
826
FUNCTION {format.chapter.pages}
 
827
{ chapter empty$
 
828
    { "" }
 
829
    { type empty$
 
830
        { bbl.chapter }
 
831
        { type "l" change.case$ }
 
832
      if$
 
833
      chapter tie.or.space.connect
 
834
    }
 
835
  if$
 
836
}
 
837
 
 
838
FUNCTION {format.in.ed.booktitle}
 
839
{ booktitle empty$
 
840
    { "" }
 
841
    { editor empty$
 
842
        { word.in booktitle * }
 
843
        { word.in format.in.editors * ", " *
 
844
          booktitle * }
 
845
      if$
 
846
    }
 
847
  if$
 
848
}
 
849
 
 
850
FUNCTION {format.thesis.type}
 
851
{ type empty$
 
852
    'skip$
 
853
    { pop$
 
854
      type "t" change.case$
 
855
    }
 
856
  if$
 
857
}
 
858
 
 
859
FUNCTION {format.tr.number}
 
860
{ type empty$
 
861
    { bbl.techrep }
 
862
    'type
 
863
  if$
 
864
  number empty$
 
865
    { "t" change.case$ }
 
866
    { number tie.or.space.connect }
 
867
  if$
 
868
}
 
869
 
 
870
FUNCTION {format.article.crossref}
 
871
{
 
872
  word.in
 
873
  " \cite{" * crossref * "}" *
 
874
}
 
875
 
 
876
FUNCTION {format.book.crossref}
 
877
{ volume empty$
 
878
    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
 
879
      word.in
 
880
    }
 
881
    { bbl.volume capitalize
 
882
      volume tie.or.space.connect
 
883
      bbl.of space.word *
 
884
    }
 
885
  if$
 
886
  " \cite{" * crossref * "}" *
 
887
}
 
888
 
 
889
FUNCTION {format.incoll.inproc.crossref}
 
890
{
 
891
  word.in
 
892
  " \cite{" * crossref * "}" *
 
893
}
 
894
 
 
895
FUNCTION {format.org.or.pub}
 
896
{ 't :=
 
897
  ""
 
898
  address empty$ t empty$ and
 
899
    'skip$
 
900
    {
 
901
      t empty$
 
902
        { address empty$
 
903
          'skip$
 
904
          { address * }
 
905
          if$
 
906
        }
 
907
        { t *
 
908
          address empty$
 
909
            'skip$
 
910
            { ", " * address * }
 
911
          if$
 
912
        }
 
913
      if$
 
914
    }
 
915
  if$
 
916
}
 
917
 
 
918
FUNCTION {format.publisher.address}
 
919
{ publisher empty$
 
920
    { "empty publisher in " cite$ * warning$
 
921
      ""
 
922
    }
 
923
    { publisher }
 
924
  if$
 
925
  format.org.or.pub
 
926
}
 
927
 
 
928
FUNCTION {format.organization.address}
 
929
{ organization empty$
 
930
    { "" }
 
931
    { organization }
 
932
  if$
 
933
  format.org.or.pub
 
934
}
 
935
 
 
936
FUNCTION {article}
 
937
{ output.bibitem
 
938
  format.authors "author" output.check
 
939
  author format.key output
 
940
  format.date "year" output.check
 
941
  date.block
 
942
  format.title "title" output.check
 
943
  new.sentence
 
944
  crossref missing$
 
945
    { journal
 
946
      "journal" output.check
 
947
%%SP 2001/01/23
 
948
%% Add the space in format.vol.num.pages
 
949
      %% add.blank
 
950
  before.all 'output.state :=
 
951
      format.vol.num.pages output
 
952
    }
 
953
    { format.article.crossref output.nonnull
 
954
      format.pages output
 
955
    }
 
956
  if$
 
957
  format.journal.pages
 
958
  format.note output
 
959
  fin.entry
 
960
  write.url
 
961
}
 
962
 
 
963
FUNCTION {book}
 
964
{ output.bibitem
 
965
  author empty$
 
966
    { format.editors "author and editor" output.check
 
967
      editor format.key output
 
968
    }
 
969
    { format.authors output.nonnull
 
970
      crossref missing$
 
971
        { "author and editor" editor either.or.check }
 
972
        'skip$
 
973
      if$
 
974
    }
 
975
  if$
 
976
  format.date "year" output.check
 
977
  date.block
 
978
  format.btitle "title" output.check
 
979
  crossref missing$
 
980
    { format.edition output
 
981
      new.sentence
 
982
  format.bvolume output
 
983
      format.number.series output
 
984
      new.sentence
 
985
      format.publisher.address output
 
986
    }
 
987
    {
 
988
  new.sentence
 
989
      format.book.crossref output.nonnull
 
990
    }
 
991
  if$
 
992
  format.note output
 
993
  fin.entry
 
994
  write.url
 
995
}
 
996
 
 
997
FUNCTION {booklet}
 
998
{ output.bibitem
 
999
  format.authors output
 
1000
  author format.key output
 
1001
  format.date "year" output.check
 
1002
  date.block
 
1003
  format.title "title" output.check
 
1004
  new.sentence
 
1005
  howpublished output
 
1006
  address output
 
1007
  format.note output
 
1008
  fin.entry
 
1009
  write.url
 
1010
}
 
1011
 
 
1012
FUNCTION {inbook}
 
1013
{ output.bibitem
 
1014
  author empty$
 
1015
    { format.editors "author and editor" output.check
 
1016
      editor format.key output
 
1017
    }
 
1018
    { format.authors output.nonnull
 
1019
      crossref missing$
 
1020
        { "author and editor" editor either.or.check }
 
1021
        'skip$
 
1022
      if$
 
1023
    }
 
1024
  if$
 
1025
  format.date "year" output.check
 
1026
  date.block
 
1027
  format.btitle "title" output.check
 
1028
  crossref missing$
 
1029
    {
 
1030
      format.edition output
 
1031
      new.sentence
 
1032
      format.bvolume output
 
1033
      format.number.series output
 
1034
      new.sentence
 
1035
      format.publisher.address output
 
1036
      format.chapter.pages "chapter and pages" output.check
 
1037
    }
 
1038
    {
 
1039
      format.chapter.pages "chapter and pages" output.check
 
1040
  new.sentence
 
1041
      format.book.crossref output.nonnull
 
1042
    }
 
1043
  if$
 
1044
  format.pages "pages" output.check
 
1045
  format.note output
 
1046
  fin.entry
 
1047
  write.url
 
1048
}
 
1049
 
 
1050
FUNCTION {incollection}
 
1051
{ output.bibitem
 
1052
  format.authors "author" output.check
 
1053
  author format.key output
 
1054
  format.date "year" output.check
 
1055
  date.block
 
1056
  format.title "title" output.check
 
1057
  new.sentence
 
1058
  crossref missing$
 
1059
    { format.in.ed.booktitle "booktitle" output.check
 
1060
      format.edition output
 
1061
      new.sentence
 
1062
      format.bvolume output
 
1063
      format.number.series output
 
1064
      new.sentence
 
1065
      format.publisher.address output
 
1066
      format.chapter.pages output
 
1067
    }
 
1068
    { format.incoll.inproc.crossref output.nonnull
 
1069
      format.chapter.pages output
 
1070
    }
 
1071
  if$
 
1072
  format.pages "pages" output.check
 
1073
  format.note output
 
1074
  fin.entry
 
1075
  write.url
 
1076
}
 
1077
 
 
1078
FUNCTION {inproceedings}
 
1079
{ output.bibitem
 
1080
  format.authors "author" output.check
 
1081
  author format.key output
 
1082
  format.date "year" output.check
 
1083
  date.block
 
1084
  format.title "title" output.check
 
1085
  new.sentence
 
1086
  crossref missing$
 
1087
    { format.in.ed.booktitle "booktitle" output.check
 
1088
      format.edition output
 
1089
      new.sentence
 
1090
      format.bvolume output
 
1091
      format.number.series output
 
1092
      new.sentence
 
1093
      publisher empty$
 
1094
        { format.organization.address output }
 
1095
        { organization output
 
1096
          format.publisher.address output
 
1097
        }
 
1098
      if$
 
1099
%%SP 2001/01/23
 
1100
%%      format.pages output
 
1101
    }
 
1102
    { format.incoll.inproc.crossref output.nonnull
 
1103
%%SP 2001/01/23
 
1104
%%      format.pages output
 
1105
    }
 
1106
  if$
 
1107
%%SP 2001/01/23
 
1108
  format.pages "pages" output.check
 
1109
  format.note output
 
1110
  fin.entry
 
1111
  write.url
 
1112
}
 
1113
 
 
1114
FUNCTION {conference} { inproceedings }
 
1115
 
 
1116
FUNCTION {manual}
 
1117
{ output.bibitem
 
1118
  format.authors output
 
1119
  author format.key output
 
1120
  format.date "year" output.check
 
1121
  date.block
 
1122
  format.btitle "title" output.check
 
1123
  new.sentence
 
1124
  organization output
 
1125
  address output
 
1126
  format.edition output
 
1127
  format.note output
 
1128
  fin.entry
 
1129
  write.url
 
1130
}
 
1131
 
 
1132
FUNCTION {mastersthesis}
 
1133
{ output.bibitem
 
1134
  format.authors "author" output.check
 
1135
  author format.key output
 
1136
  format.date "year" output.check
 
1137
  date.block
 
1138
  format.title "title" output.check
 
1139
  new.sentence
 
1140
  bbl.mthesis format.thesis.type output.nonnull
 
1141
  school "school" output.check
 
1142
  address output
 
1143
  format.note output
 
1144
  fin.entry
 
1145
  write.url
 
1146
}
 
1147
 
 
1148
FUNCTION {misc}
 
1149
{ output.bibitem
 
1150
  format.authors output
 
1151
  author format.key output
 
1152
  format.date "year" output.check
 
1153
  date.block
 
1154
  format.title output
 
1155
  new.sentence
 
1156
  howpublished output
 
1157
  format.note output
 
1158
  fin.entry
 
1159
  write.url
 
1160
}
 
1161
 
 
1162
FUNCTION {phdthesis}
 
1163
{ output.bibitem
 
1164
  format.authors "author" output.check
 
1165
  author format.key output
 
1166
  format.date "year" output.check
 
1167
  date.block
 
1168
  format.title "title" output.check
 
1169
  new.sentence
 
1170
  bbl.phdthesis format.thesis.type output.nonnull
 
1171
  school "school" output.check
 
1172
  address output
 
1173
  format.note output
 
1174
  fin.entry
 
1175
  write.url
 
1176
}
 
1177
 
 
1178
FUNCTION {proceedings}
 
1179
{ output.bibitem
 
1180
  format.editors output
 
1181
  editor format.key output
 
1182
  format.date "year" output.check
 
1183
  date.block
 
1184
  format.btitle "title" output.check
 
1185
  new.sentence
 
1186
  format.bvolume output
 
1187
  format.number.series output
 
1188
  new.sentence
 
1189
  publisher empty$
 
1190
    { format.organization.address output }
 
1191
    { organization output
 
1192
      format.publisher.address output
 
1193
    }
 
1194
  if$
 
1195
  format.note output
 
1196
  fin.entry
 
1197
  write.url
 
1198
}
 
1199
 
 
1200
FUNCTION {techreport}
 
1201
{ output.bibitem
 
1202
  format.authors "author" output.check
 
1203
  author format.key output
 
1204
  format.date "year" output.check
 
1205
  date.block
 
1206
  format.title "title" output.check
 
1207
  new.sentence
 
1208
  format.tr.number output.nonnull
 
1209
  institution "institution" output.check
 
1210
  address output
 
1211
  format.note output
 
1212
  fin.entry
 
1213
  write.url
 
1214
}
 
1215
 
 
1216
FUNCTION {unpublished}
 
1217
{ output.bibitem
 
1218
  format.authors "author" output.check
 
1219
  author format.key output
 
1220
  format.date "year" output.check
 
1221
  date.block
 
1222
  format.title "title" output.check
 
1223
  format.note "note" output.check
 
1224
  fin.entry
 
1225
  write.url
 
1226
}
 
1227
 
 
1228
FUNCTION {default.type} { misc }
 
1229
 
 
1230
READ
 
1231
 
 
1232
FUNCTION {sortify}
 
1233
{ purify$
 
1234
  "l" change.case$
 
1235
}
 
1236
 
 
1237
INTEGERS { len }
 
1238
 
 
1239
FUNCTION {chop.word}
 
1240
{ 's :=
 
1241
  'len :=
 
1242
  s #1 len substring$ =
 
1243
    { s len #1 + global.max$ substring$ }
 
1244
    's
 
1245
  if$
 
1246
}
 
1247
 
 
1248
FUNCTION {format.lab.names}
 
1249
{ 's :=
 
1250
  s #1 "{vv~}{ll}" format.name$
 
1251
  s num.names$ duplicate$
 
1252
  #2 >
 
1253
    { pop$
 
1254
      " " * bbl.etal *
 
1255
    }
 
1256
    { #2 <
 
1257
        'skip$
 
1258
        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
 
1259
            {
 
1260
              " " * bbl.etal *
 
1261
            }
 
1262
            { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
 
1263
              * }
 
1264
          if$
 
1265
        }
 
1266
      if$
 
1267
    }
 
1268
  if$
 
1269
}
 
1270
 
 
1271
FUNCTION {author.key.label}
 
1272
{ author empty$
 
1273
    { key empty$
 
1274
        { cite$ #1 #3 substring$ }
 
1275
        'key
 
1276
      if$
 
1277
    }
 
1278
    { author format.lab.names }
 
1279
  if$
 
1280
}
 
1281
 
 
1282
FUNCTION {author.editor.key.label}
 
1283
{ author empty$
 
1284
    { editor empty$
 
1285
        { key empty$
 
1286
            { cite$ #1 #3 substring$ }
 
1287
            'key
 
1288
          if$
 
1289
        }
 
1290
        { editor format.lab.names }
 
1291
      if$
 
1292
    }
 
1293
    { author format.lab.names }
 
1294
  if$
 
1295
}
 
1296
 
 
1297
FUNCTION {editor.key.label}
 
1298
{ editor empty$
 
1299
    { key empty$
 
1300
        { cite$ #1 #3 substring$ }
 
1301
        'key
 
1302
      if$
 
1303
    }
 
1304
    { editor format.lab.names }
 
1305
  if$
 
1306
}
 
1307
 
 
1308
FUNCTION {calc.short.authors}
 
1309
{ type$ "book" =
 
1310
  type$ "inbook" =
 
1311
  or
 
1312
    'author.editor.key.label
 
1313
    { type$ "proceedings" =
 
1314
        'editor.key.label
 
1315
        'author.key.label
 
1316
      if$
 
1317
    }
 
1318
  if$
 
1319
  'short.list :=
 
1320
}
 
1321
 
 
1322
FUNCTION {calc.label}
 
1323
{ calc.short.authors
 
1324
  short.list
 
1325
  "("
 
1326
  *
 
1327
  year duplicate$ empty$
 
1328
     { pop$ "????" }
 
1329
     'skip$
 
1330
  if$
 
1331
  *
 
1332
  'label :=
 
1333
}
 
1334
 
 
1335
FUNCTION {sort.format.names}
 
1336
{ 's :=
 
1337
  #1 'nameptr :=
 
1338
  ""
 
1339
  s num.names$ 'numnames :=
 
1340
  numnames 'namesleft :=
 
1341
    { namesleft #0 > }
 
1342
    { s nameptr
 
1343
      "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}"
 
1344
      format.name$ 't :=
 
1345
      nameptr #1 >
 
1346
        {
 
1347
          "   "  *
 
1348
          namesleft #1 = t "others" = and
 
1349
            { "zzzzz" * }
 
1350
            { t sortify * }
 
1351
          if$
 
1352
        }
 
1353
        { t sortify * }
 
1354
      if$
 
1355
      nameptr #1 + 'nameptr :=
 
1356
      namesleft #1 - 'namesleft :=
 
1357
    }
 
1358
  while$
 
1359
}
 
1360
 
 
1361
FUNCTION {sort.format.title}
 
1362
{ 't :=
 
1363
  "A " #2
 
1364
    "An " #3
 
1365
      "The " #4 t chop.word
 
1366
    chop.word
 
1367
  chop.word
 
1368
  sortify
 
1369
  #1 global.max$ substring$
 
1370
}
 
1371
 
 
1372
FUNCTION {author.sort}
 
1373
{ author empty$
 
1374
    { key empty$
 
1375
        { "to sort, need author or key in " cite$ * warning$
 
1376
          ""
 
1377
        }
 
1378
        { key sortify }
 
1379
      if$
 
1380
    }
 
1381
    { author sort.format.names }
 
1382
  if$
 
1383
}
 
1384
 
 
1385
FUNCTION {author.editor.sort}
 
1386
{ author empty$
 
1387
    { editor empty$
 
1388
        { key empty$
 
1389
            { "to sort, need author, editor, or key in " cite$ * warning$
 
1390
              ""
 
1391
            }
 
1392
            { key sortify }
 
1393
          if$
 
1394
        }
 
1395
        { editor sort.format.names }
 
1396
      if$
 
1397
    }
 
1398
    { author sort.format.names }
 
1399
  if$
 
1400
}
 
1401
 
 
1402
FUNCTION {editor.sort}
 
1403
{ editor empty$
 
1404
    { key empty$
 
1405
        { "to sort, need editor or key in " cite$ * warning$
 
1406
          ""
 
1407
        }
 
1408
        { key sortify }
 
1409
      if$
 
1410
    }
 
1411
    { editor sort.format.names }
 
1412
  if$
 
1413
}
 
1414
 
 
1415
FUNCTION {presort}
 
1416
{ calc.label
 
1417
  label sortify
 
1418
  "    "
 
1419
  *
 
1420
  type$ "book" =
 
1421
  type$ "inbook" =
 
1422
  or
 
1423
    'author.editor.sort
 
1424
    { type$ "proceedings" =
 
1425
        'editor.sort
 
1426
        'author.sort
 
1427
      if$
 
1428
    }
 
1429
  if$
 
1430
  #1 entry.max$ substring$
 
1431
  'sort.label :=
 
1432
  sort.label
 
1433
  *
 
1434
  "    "
 
1435
  *
 
1436
  title field.or.null
 
1437
  sort.format.title
 
1438
  *
 
1439
  #1 entry.max$ substring$
 
1440
  'sort.key$ :=
 
1441
}
 
1442
 
 
1443
ITERATE {presort}
 
1444
 
 
1445
SORT
 
1446
 
 
1447
STRINGS { last.label next.extra }
 
1448
 
 
1449
INTEGERS { last.extra.num number.label }
 
1450
 
 
1451
FUNCTION {initialize.extra.label.stuff}
 
1452
{ #0 int.to.chr$ 'last.label :=
 
1453
  "" 'next.extra :=
 
1454
  #0 'last.extra.num :=
 
1455
  #0 'number.label :=
 
1456
}
 
1457
 
 
1458
FUNCTION {forward.pass}
 
1459
{ last.label label =
 
1460
    { last.extra.num #1 + 'last.extra.num :=
 
1461
      last.extra.num int.to.chr$ 'extra.label :=
 
1462
    }
 
1463
    { "a" chr.to.int$ 'last.extra.num :=
 
1464
      "" 'extra.label :=
 
1465
      label 'last.label :=
 
1466
    }
 
1467
  if$
 
1468
  number.label #1 + 'number.label :=
 
1469
}
 
1470
 
 
1471
FUNCTION {reverse.pass}
 
1472
{ next.extra "b" =
 
1473
    { "a" 'extra.label := }
 
1474
    'skip$
 
1475
  if$
 
1476
  extra.label 'next.extra :=
 
1477
  extra.label
 
1478
  duplicate$ empty$
 
1479
    'skip$
 
1480
    { "{\natexlab{" swap$ * "}}" * }
 
1481
  if$
 
1482
  'extra.label :=
 
1483
  label extra.label * 'label :=
 
1484
}
 
1485
 
 
1486
EXECUTE {initialize.extra.label.stuff}
 
1487
 
 
1488
ITERATE {forward.pass}
 
1489
 
 
1490
REVERSE {reverse.pass}
 
1491
 
 
1492
FUNCTION {bib.sort.order}
 
1493
{ sort.label
 
1494
  "    "
 
1495
  *
 
1496
  year field.or.null sortify
 
1497
  *
 
1498
  "    "
 
1499
  *
 
1500
  title field.or.null
 
1501
  sort.format.title
 
1502
  *
 
1503
  #1 entry.max$ substring$
 
1504
  'sort.key$ :=
 
1505
}
 
1506
 
 
1507
ITERATE {bib.sort.order}
 
1508
 
 
1509
SORT
 
1510
 
 
1511
FUNCTION {begin.bib}
 
1512
{ preamble$ empty$
 
1513
    'skip$
 
1514
    { preamble$ write$ newline$ }
 
1515
  if$
 
1516
  "\begin{thebibliography}{" number.label int.to.str$ * "}" *
 
1517
  write$ newline$
 
1518
  "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
 
1519
  write$ newline$
 
1520
  "\expandafter\ifx\csname url\endcsname\relax"
 
1521
  write$ newline$
 
1522
  "  \def\url#1{\texttt{#1}}\fi"
 
1523
  write$ newline$
 
1524
  "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
 
1525
  write$ newline$
 
1526
}
 
1527
 
 
1528
EXECUTE {begin.bib}
 
1529
 
 
1530
EXECUTE {init.state.consts}
 
1531
 
 
1532
ITERATE {call.type$}
 
1533
 
 
1534
FUNCTION {end.bib}
 
1535
{ newline$
 
1536
  "\end{thebibliography}" write$ newline$
 
1537
}
 
1538
 
 
1539
EXECUTE {end.bib}
 
1540
%% End of customized bst file
 
1541
%%
 
1542
%% End of file `elsarticle-harv.bst'.