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