elsarticle/elsarticle-num.bst
changeset 0 bc6edeef8717
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/elsarticle/elsarticle-num.bst	Fri Nov 18 16:18:02 2016 +0100
     1.3 @@ -0,0 +1,1517 @@
     1.4 +%% 
     1.5 +%% Copyright 2007, 2008, 2009 Elsevier Ltd
     1.6 +%% 
     1.7 +%% This file is part of the 'Elsarticle Bundle'.
     1.8 +%% ---------------------------------------------
     1.9 +%% 
    1.10 +%% It may be distributed under the conditions of the LaTeX Project Public
    1.11 +%% License, either version 1.2 of this license or (at your option) any
    1.12 +%% later version.  The latest version of this license is in
    1.13 +%%    http://www.latex-project.org/lppl.txt
    1.14 +%% and version 1.2 or later is part of all distributions of LaTeX
    1.15 +%% version 1999/12/01 or later.
    1.16 +%% 
    1.17 +%% The list of all files belonging to the 'Elsarticle Bundle' is
    1.18 +%% given in the file `manifest.txt'.
    1.19 +%% 
    1.20 +%%% Modification of BibTeX style file elsarticle-num.bst
    1.21 +%%% ... by urlbst, version 0.6 (marked with "% urlbst")
    1.22 +%%% See <http://purl.org/nxg/dist/urlbst>
    1.23 +%%% Added webpage entry type, and url and lastchecked fields.
    1.24 +%%% Added eprint support.
    1.25 +%%% Added DOI support.
    1.26 +%%% Added hyperref support.
    1.27 +%%% Original headers follow...
    1.28 +
    1.29 +%%
    1.30 +%% This is file `elsarticle-num.bst',
    1.31 +%% generated with the docstrip utility.
    1.32 +%%
    1.33 +%% The original source files were:
    1.34 +%%
    1.35 +%% 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')
    1.36 +%% After docstrip generation some manual changes were made (SP)
    1.37 +
    1.38 +%% ----------------------------------------
    1.39 +
    1.40 +ENTRY
    1.41 +  { address
    1.42 +    author
    1.43 +    booktitle
    1.44 +    chapter
    1.45 +    edition
    1.46 +    editor
    1.47 +    howpublished
    1.48 +    institution
    1.49 +    journal
    1.50 +    key
    1.51 +    month
    1.52 +    note
    1.53 +    number
    1.54 +    organization
    1.55 +    pages
    1.56 +    publisher
    1.57 +    school
    1.58 +    series
    1.59 +    title
    1.60 +    type
    1.61 +    volume
    1.62 +    year
    1.63 +    eprint % urlbst
    1.64 +    doi % urlbst
    1.65 +    url % urlbst
    1.66 +    lastchecked % urlbst
    1.67 +  }
    1.68 +  {}
    1.69 +  { label }
    1.70 +
    1.71 +INTEGERS { output.state before.all mid.sentence after.sentence after.block }
    1.72 +
    1.73 +STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl openinlinelink closeinlinelink } % urlbst...
    1.74 +INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver }
    1.75 +FUNCTION {init.urlbst.variables}
    1.76 +{
    1.77 +  "Available from: " 'urlintro := % prefix before URL
    1.78 +  "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
    1.79 +  "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
    1.80 +  "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
    1.81 +  "doi:" 'doiprefix :=      % text prefix printed before DOI ref
    1.82 +  #1 'addeprints :=         % 0=no eprints; 1=include eprints
    1.83 +  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
    1.84 +  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
    1.85 +  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
    1.86 +  % the following are internal state variables, not config constants
    1.87 +  #0 'makeinlinelink :=     % state variable managed by setup.inlinelink
    1.88 +  "" 'openinlinelink :=     % ditto
    1.89 +  "" 'closeinlinelink :=    % ditto
    1.90 +}
    1.91 +INTEGERS {
    1.92 +  bracket.state
    1.93 +  outside.brackets
    1.94 +  open.brackets
    1.95 +  within.brackets
    1.96 +  close.brackets
    1.97 +}
    1.98 +FUNCTION {init.state.consts}
    1.99 +{ #0 'outside.brackets := % urlbst
   1.100 +  #1 'open.brackets :=
   1.101 +  #2 'within.brackets :=
   1.102 +  #3 'close.brackets :=
   1.103 +
   1.104 +  #0 'before.all :=
   1.105 +  #1 'mid.sentence :=
   1.106 +  #2 'after.sentence :=
   1.107 +  #3 'after.block :=
   1.108 +}
   1.109 +
   1.110 +STRINGS { s t }
   1.111 +
   1.112 +FUNCTION {output.nonnull.original}
   1.113 +{ 's :=
   1.114 +  output.state mid.sentence =
   1.115 +    { ", " * write$ }
   1.116 +    { output.state after.block =
   1.117 +        { add.period$ write$
   1.118 +          newline$
   1.119 +          "\newblock " write$
   1.120 +        }
   1.121 +        { output.state before.all =
   1.122 +            'write$
   1.123 +            { add.period$ " " * write$ }
   1.124 +          if$
   1.125 +        }
   1.126 +      if$
   1.127 +      mid.sentence 'output.state :=
   1.128 +    }
   1.129 +  if$
   1.130 +  s
   1.131 +}
   1.132 +
   1.133 +FUNCTION {setup.inlinelink}
   1.134 +{ makeinlinelink
   1.135 +    { hrefform #1 = % hypertex
   1.136 +        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
   1.137 +          "\special {html:</a>}" 'closeinlinelink :=
   1.138 +          }
   1.139 +        { hrefform #2 = % hyperref
   1.140 +            { "\href{" url * "}{" * 'openinlinelink :=
   1.141 +              "}" 'closeinlinelink :=
   1.142 +              }
   1.143 +            'skip$
   1.144 +          if$ % hrefform #2 =
   1.145 +        }
   1.146 +      if$ % hrefform #1 =
   1.147 +      #0 'makeinlinelink :=
   1.148 +    }
   1.149 +    'skip$
   1.150 + if$ % makeinlinelink
   1.151 +}
   1.152 +FUNCTION {add.inlinelink}
   1.153 +{ openinlinelink empty$
   1.154 +    'skip$
   1.155 +    { openinlinelink swap$ * closeinlinelink *
   1.156 +      "" 'openinlinelink :=
   1.157 +      }
   1.158 +  if$
   1.159 +}
   1.160 +FUNCTION {output.nonnull}
   1.161 +{ % Save the thing we've been asked to output
   1.162 +  's :=
   1.163 +  % If the bracket-state is close.brackets, then add a close-bracket to
   1.164 +  % what is currently at the top of the stack, and set bracket.state
   1.165 +  % to outside.brackets
   1.166 +  bracket.state close.brackets =
   1.167 +    { "]" *
   1.168 +      outside.brackets 'bracket.state :=
   1.169 +    }
   1.170 +    'skip$
   1.171 +  if$
   1.172 +  bracket.state outside.brackets =
   1.173 +    { % We're outside all brackets -- this is the normal situation.
   1.174 +      % Write out what's currently at the top of the stack, using the
   1.175 +      % original output.nonnull function.
   1.176 +      s
   1.177 +      add.inlinelink
   1.178 +      output.nonnull.original % invoke the original output.nonnull
   1.179 +    }
   1.180 +    { % Still in brackets.  Add open-bracket or (continuation) comma, add the
   1.181 +      % new text (in s) to the top of the stack, and move to the close-brackets
   1.182 +      % state, ready for next time (unless inbrackets resets it).  If we come
   1.183 +      % into this branch, then output.state is carefully undisturbed.
   1.184 +      bracket.state open.brackets =
   1.185 +        { " [" * }
   1.186 +        { ", " * } % bracket.state will be within.brackets
   1.187 +      if$
   1.188 +      s *
   1.189 +      close.brackets 'bracket.state :=
   1.190 +    }
   1.191 +  if$
   1.192 +}
   1.193 +
   1.194 +FUNCTION {inbrackets}
   1.195 +{ bracket.state close.brackets =
   1.196 +    { within.brackets 'bracket.state := } % reset the state: not open nor closed
   1.197 +    { open.brackets 'bracket.state := }
   1.198 +  if$
   1.199 +}
   1.200 +
   1.201 +FUNCTION {format.lastchecked}
   1.202 +{ lastchecked empty$
   1.203 +    { "" }
   1.204 +    { inbrackets "cited " lastchecked * }
   1.205 +  if$
   1.206 +}
   1.207 +
   1.208 +FUNCTION {output}
   1.209 +{ duplicate$ empty$
   1.210 +    'pop$
   1.211 +    'output.nonnull
   1.212 +  if$
   1.213 +}
   1.214 +
   1.215 +FUNCTION {output.check}
   1.216 +{ 't :=
   1.217 +  duplicate$ empty$
   1.218 +    { pop$ "empty " t * " in " * cite$ * warning$ }
   1.219 +    'output.nonnull
   1.220 +  if$
   1.221 +}
   1.222 +
   1.223 +FUNCTION {fin.entry.original}
   1.224 +{ add.period$
   1.225 +  write$
   1.226 +  newline$
   1.227 +}
   1.228 +
   1.229 +FUNCTION {new.block}
   1.230 +{ output.state before.all =
   1.231 +    'skip$
   1.232 +    { after.block 'output.state := }
   1.233 +  if$
   1.234 +}
   1.235 +
   1.236 +FUNCTION {new.sentence}
   1.237 +{ output.state after.block =
   1.238 +    'skip$
   1.239 +    { output.state before.all =
   1.240 +        'skip$
   1.241 +        { after.sentence 'output.state := }
   1.242 +      if$
   1.243 +    }
   1.244 +  if$
   1.245 +}
   1.246 +
   1.247 +FUNCTION {add.blank}
   1.248 +{  " " * before.all 'output.state :=
   1.249 +}
   1.250 +
   1.251 +FUNCTION {date.block}
   1.252 +{
   1.253 +  add.blank
   1.254 +}
   1.255 +
   1.256 +FUNCTION {not}
   1.257 +{   { #0 }
   1.258 +    { #1 }
   1.259 +  if$
   1.260 +}
   1.261 +
   1.262 +FUNCTION {and}
   1.263 +{   'skip$
   1.264 +    { pop$ #0 }
   1.265 +  if$
   1.266 +}
   1.267 +
   1.268 +FUNCTION {or}
   1.269 +{   { pop$ #1 }
   1.270 +    'skip$
   1.271 +  if$
   1.272 +}
   1.273 +
   1.274 +FUNCTION {new.block.checka}
   1.275 +{ empty$
   1.276 +    'skip$
   1.277 +    'new.block
   1.278 +  if$
   1.279 +}
   1.280 +
   1.281 +FUNCTION {new.block.checkb}
   1.282 +{ empty$
   1.283 +  swap$ empty$
   1.284 +  and
   1.285 +    'skip$
   1.286 +    'new.block
   1.287 +  if$
   1.288 +}
   1.289 +
   1.290 +FUNCTION {new.sentence.checka}
   1.291 +{ empty$
   1.292 +    'skip$
   1.293 +    'new.sentence
   1.294 +  if$
   1.295 +}
   1.296 +
   1.297 +FUNCTION {new.sentence.checkb}
   1.298 +{ empty$
   1.299 +  swap$ empty$
   1.300 +  and
   1.301 +    'skip$
   1.302 +    'new.sentence
   1.303 +  if$
   1.304 +}
   1.305 +
   1.306 +FUNCTION {field.or.null}
   1.307 +{ duplicate$ empty$
   1.308 +    { pop$ "" }
   1.309 +    'skip$
   1.310 +  if$
   1.311 +}
   1.312 +
   1.313 +FUNCTION {emphasize}
   1.314 +{ skip$ }
   1.315 +
   1.316 +FUNCTION {capitalize}
   1.317 +{ "u" change.case$ "t" change.case$ }
   1.318 +
   1.319 +FUNCTION {space.word}
   1.320 +{ " " swap$ * " " * }
   1.321 +
   1.322 + % Here are the language-specific definitions for explicit words.
   1.323 + % Each function has a name bbl.xxx where xxx is the English word.
   1.324 + % The language selected here is ENGLISH
   1.325 +FUNCTION {bbl.and}
   1.326 +{ "and"}
   1.327 +
   1.328 +FUNCTION {bbl.etal}
   1.329 +{ "et~al." }
   1.330 +
   1.331 +FUNCTION {bbl.editors}
   1.332 +{ "Eds." }
   1.333 +
   1.334 +FUNCTION {bbl.editor}
   1.335 +{ "Ed." }
   1.336 +
   1.337 +FUNCTION {bbl.edby}
   1.338 +{ "edited by" }
   1.339 +
   1.340 +FUNCTION {bbl.edition}
   1.341 +{ "Edition" }
   1.342 +
   1.343 +FUNCTION {bbl.volume}
   1.344 +{ "Vol." }
   1.345 +
   1.346 +FUNCTION {bbl.of}
   1.347 +{ "of" }
   1.348 +
   1.349 +FUNCTION {bbl.number}
   1.350 +{ "no." }
   1.351 +
   1.352 +FUNCTION {bbl.nr}
   1.353 +{ "no." }
   1.354 +
   1.355 +FUNCTION {bbl.in}
   1.356 +{ "in" }
   1.357 +
   1.358 +FUNCTION {bbl.pages}
   1.359 +{ "pp." }
   1.360 +
   1.361 +FUNCTION {bbl.page}
   1.362 +{ "p." }
   1.363 +
   1.364 +FUNCTION {bbl.chapter}
   1.365 +{ "Ch." }
   1.366 +
   1.367 +FUNCTION {bbl.techrep}
   1.368 +{ "Tech. Rep." }
   1.369 +
   1.370 +FUNCTION {bbl.mthesis}
   1.371 +{ "Master's thesis" }
   1.372 +
   1.373 +FUNCTION {bbl.phdthesis}
   1.374 +{ "Ph.D. thesis" }
   1.375 +
   1.376 +FUNCTION {bbl.first}
   1.377 +{ "1st" }
   1.378 +
   1.379 +FUNCTION {bbl.second}
   1.380 +{ "2nd" }
   1.381 +
   1.382 +FUNCTION {bbl.third}
   1.383 +{ "3rd" }
   1.384 +
   1.385 +FUNCTION {bbl.fourth}
   1.386 +{ "4th" }
   1.387 +
   1.388 +FUNCTION {bbl.fifth}
   1.389 +{ "5th" }
   1.390 +
   1.391 +FUNCTION {bbl.st}
   1.392 +{ "st" }
   1.393 +
   1.394 +FUNCTION {bbl.nd}
   1.395 +{ "nd" }
   1.396 +
   1.397 +FUNCTION {bbl.rd}
   1.398 +{ "rd" }
   1.399 +
   1.400 +FUNCTION {bbl.th}
   1.401 +{ "th" }
   1.402 +
   1.403 +MACRO {jan} {"Jan."}
   1.404 +
   1.405 +MACRO {feb} {"Feb."}
   1.406 +
   1.407 +MACRO {mar} {"Mar."}
   1.408 +
   1.409 +MACRO {apr} {"Apr."}
   1.410 +
   1.411 +MACRO {may} {"May"}
   1.412 +
   1.413 +MACRO {jun} {"Jun."}
   1.414 +
   1.415 +MACRO {jul} {"Jul."}
   1.416 +
   1.417 +MACRO {aug} {"Aug."}
   1.418 +
   1.419 +MACRO {sep} {"Sep."}
   1.420 +
   1.421 +MACRO {oct} {"Oct."}
   1.422 +
   1.423 +MACRO {nov} {"Nov."}
   1.424 +
   1.425 +MACRO {dec} {"Dec."}
   1.426 +
   1.427 +FUNCTION {eng.ord}
   1.428 +{ duplicate$ "1" swap$ *
   1.429 +  #-2 #1 substring$ "1" =
   1.430 +     { bbl.th * }
   1.431 +     { duplicate$ #-1 #1 substring$
   1.432 +       duplicate$ "1" =
   1.433 +         { pop$ bbl.st * }
   1.434 +         { duplicate$ "2" =
   1.435 +             { pop$ bbl.nd * }
   1.436 +             { "3" =
   1.437 +                 { bbl.rd * }
   1.438 +                 { bbl.th * }
   1.439 +               if$
   1.440 +             }
   1.441 +           if$
   1.442 +          }
   1.443 +       if$
   1.444 +     }
   1.445 +   if$
   1.446 +}
   1.447 +
   1.448 +MACRO {acmcs} {"ACM Comput. Surv."}
   1.449 +
   1.450 +MACRO {acta} {"Acta Inf."}
   1.451 +
   1.452 +MACRO {cacm} {"Commun. ACM"}
   1.453 +
   1.454 +MACRO {ibmjrd} {"IBM J. Res. Dev."}
   1.455 +
   1.456 +MACRO {ibmsj} {"IBM Syst.~J."}
   1.457 +
   1.458 +MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
   1.459 +
   1.460 +MACRO {ieeetc} {"IEEE Trans. Comput."}
   1.461 +
   1.462 +MACRO {ieeetcad}
   1.463 + {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
   1.464 +
   1.465 +MACRO {ipl} {"Inf. Process. Lett."}
   1.466 +
   1.467 +MACRO {jacm} {"J.~ACM"}
   1.468 +
   1.469 +MACRO {jcss} {"J.~Comput. Syst. Sci."}
   1.470 +
   1.471 +MACRO {scp} {"Sci. Comput. Programming"}
   1.472 +
   1.473 +MACRO {sicomp} {"SIAM J. Comput."}
   1.474 +
   1.475 +MACRO {tocs} {"ACM Trans. Comput. Syst."}
   1.476 +
   1.477 +MACRO {tods} {"ACM Trans. Database Syst."}
   1.478 +
   1.479 +MACRO {tog} {"ACM Trans. Gr."}
   1.480 +
   1.481 +MACRO {toms} {"ACM Trans. Math. Softw."}
   1.482 +
   1.483 +MACRO {toois} {"ACM Trans. Office Inf. Syst."}
   1.484 +
   1.485 +MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
   1.486 +
   1.487 +MACRO {tcs} {"Theoretical Comput. Sci."}
   1.488 +
   1.489 +FUNCTION {write.url}
   1.490 +{ url empty$
   1.491 +    { skip$ }
   1.492 +    { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
   1.493 +  if$
   1.494 +}
   1.495 +
   1.496 +INTEGERS { nameptr namesleft numnames }
   1.497 +
   1.498 +FUNCTION {format.names}
   1.499 +{ 's :=
   1.500 +  #1 'nameptr :=
   1.501 +  s num.names$ 'numnames :=
   1.502 +  numnames 'namesleft :=
   1.503 +    { namesleft #0 > }
   1.504 +    { s nameptr
   1.505 +      "{f.~}{vv~}{ll}{, jj}" format.name$
   1.506 +    't :=
   1.507 +      nameptr #1 >
   1.508 +        {
   1.509 +          namesleft #1 >
   1.510 +            { ", " * t * }
   1.511 +            {
   1.512 +              "," *
   1.513 +              s nameptr "{ll}" format.name$ duplicate$ "others" =
   1.514 +                { 't := }
   1.515 +                { pop$ }
   1.516 +              if$
   1.517 +              t "others" =
   1.518 +                {
   1.519 +                  " " * bbl.etal *
   1.520 +                }
   1.521 +                { " " * t * }
   1.522 +              if$
   1.523 +            }
   1.524 +          if$
   1.525 +        }
   1.526 +        't
   1.527 +      if$
   1.528 +      nameptr #1 + 'nameptr :=
   1.529 +      namesleft #1 - 'namesleft :=
   1.530 +    }
   1.531 +  while$
   1.532 +}
   1.533 +FUNCTION {format.names.ed}
   1.534 +{ format.names }
   1.535 +FUNCTION {format.authors}
   1.536 +{ author empty$
   1.537 +    { "" }
   1.538 +    { author format.names }
   1.539 +  if$
   1.540 +}
   1.541 +
   1.542 +FUNCTION {format.editors}
   1.543 +{ editor empty$
   1.544 +    { "" }
   1.545 +    { editor format.names
   1.546 +      editor num.names$ #1 >
   1.547 +        { " (" * bbl.editors * ")" * }
   1.548 +        { " (" * bbl.editor * ")" * }
   1.549 +      if$
   1.550 +    }
   1.551 +  if$
   1.552 +}
   1.553 +
   1.554 +FUNCTION {format.in.editors}
   1.555 +{ editor empty$
   1.556 +    { "" }
   1.557 +    { editor format.names.ed
   1.558 +      editor num.names$ #1 >
   1.559 +        { " (" * bbl.editors * ")" * }
   1.560 +        { " (" * bbl.editor * ")" * }
   1.561 +      if$
   1.562 +    }
   1.563 +  if$
   1.564 +}
   1.565 +
   1.566 +FUNCTION {format.note}
   1.567 +{
   1.568 + note empty$
   1.569 +    { "" }
   1.570 +    { note #1 #1 substring$
   1.571 +      duplicate$ "{" =
   1.572 +        'skip$
   1.573 +        { output.state mid.sentence =
   1.574 +          { "l" }
   1.575 +          { "u" }
   1.576 +        if$
   1.577 +        change.case$
   1.578 +        }
   1.579 +      if$
   1.580 +      note #2 global.max$ substring$ *
   1.581 +    }
   1.582 +  if$
   1.583 +}
   1.584 +
   1.585 +FUNCTION {format.title}
   1.586 +{ title empty$
   1.587 +    { "" }
   1.588 +    { title "t" change.case$
   1.589 +    }
   1.590 +  if$
   1.591 +}
   1.592 +
   1.593 +FUNCTION {output.bibitem.original}
   1.594 +{ newline$
   1.595 +  "\bibitem{" write$
   1.596 +  cite$ write$
   1.597 +  "}" write$
   1.598 +  newline$
   1.599 +  ""
   1.600 +  before.all 'output.state :=
   1.601 +}
   1.602 +
   1.603 +FUNCTION {n.dashify}
   1.604 +{
   1.605 +  't :=
   1.606 +  ""
   1.607 +    { t empty$ not }
   1.608 +    { t #1 #1 substring$ "-" =
   1.609 +        { t #1 #2 substring$ "--" = not
   1.610 +            { "--" *
   1.611 +              t #2 global.max$ substring$ 't :=
   1.612 +            }
   1.613 +            {   { t #1 #1 substring$ "-" = }
   1.614 +                { "-" *
   1.615 +                  t #2 global.max$ substring$ 't :=
   1.616 +                }
   1.617 +              while$
   1.618 +            }
   1.619 +          if$
   1.620 +        }
   1.621 +        { t #1 #1 substring$ *
   1.622 +          t #2 global.max$ substring$ 't :=
   1.623 +        }
   1.624 +      if$
   1.625 +    }
   1.626 +  while$
   1.627 +}
   1.628 +
   1.629 +FUNCTION {word.in}
   1.630 +{ bbl.in
   1.631 +  ":" *
   1.632 +  " " * }
   1.633 +
   1.634 +FUNCTION {format.date}
   1.635 +{ year empty$
   1.636 +    { month empty$
   1.637 +        { "" }
   1.638 +        { "there's a month but no year in " cite$ * warning$
   1.639 +          month
   1.640 +        }
   1.641 +      if$
   1.642 +    }
   1.643 +    { month empty$
   1.644 +        'year
   1.645 +        { month " " * year * }
   1.646 +      if$
   1.647 +    }
   1.648 +  if$
   1.649 +  duplicate$ empty$
   1.650 +    'skip$
   1.651 +    {
   1.652 +      before.all 'output.state :=
   1.653 +    " (" swap$ * ")" *
   1.654 +    }
   1.655 +  if$
   1.656 +}
   1.657 +
   1.658 +FUNCTION{format.year}
   1.659 +{ year duplicate$ empty$
   1.660 +    { "empty year in " cite$ * warning$ pop$ "" }
   1.661 +    { "(" swap$ * ")" * }
   1.662 +  if$
   1.663 +}
   1.664 +
   1.665 +FUNCTION {format.btitle}
   1.666 +{ title
   1.667 +}
   1.668 +
   1.669 +FUNCTION {tie.or.space.connect}
   1.670 +{ duplicate$ text.length$ #3 <
   1.671 +    { "~" }
   1.672 +    { " " }
   1.673 +  if$
   1.674 +  swap$ * *
   1.675 +}
   1.676 +
   1.677 +FUNCTION {either.or.check}
   1.678 +{ empty$
   1.679 +    'pop$
   1.680 +    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
   1.681 +  if$
   1.682 +}
   1.683 +
   1.684 +FUNCTION {format.bvolume}
   1.685 +{ volume empty$
   1.686 +    { "" }
   1.687 +    { bbl.volume volume tie.or.space.connect
   1.688 +      series empty$
   1.689 +        'skip$
   1.690 +        { bbl.of space.word * series emphasize * }
   1.691 +      if$
   1.692 +      "volume and number" number either.or.check
   1.693 +    }
   1.694 +  if$
   1.695 +}
   1.696 +
   1.697 +FUNCTION {format.number.series}
   1.698 +{ volume empty$
   1.699 +    { number empty$
   1.700 +        { series field.or.null }
   1.701 +        { output.state mid.sentence =
   1.702 +            { bbl.number }
   1.703 +            { bbl.number capitalize }
   1.704 +          if$
   1.705 +          number tie.or.space.connect
   1.706 +          series empty$
   1.707 +            { "there's a number but no series in " cite$ * warning$ }
   1.708 +            { bbl.in space.word * series * }
   1.709 +          if$
   1.710 +        }
   1.711 +      if$
   1.712 +    }
   1.713 +    { "" }
   1.714 +  if$
   1.715 +}
   1.716 +
   1.717 +FUNCTION {is.num}
   1.718 +{ chr.to.int$
   1.719 +  duplicate$ "0" chr.to.int$ < not
   1.720 +  swap$ "9" chr.to.int$ > not and
   1.721 +}
   1.722 +
   1.723 +FUNCTION {extract.num}
   1.724 +{ duplicate$ 't :=
   1.725 +  "" 's :=
   1.726 +  { t empty$ not }
   1.727 +  { t #1 #1 substring$
   1.728 +    t #2 global.max$ substring$ 't :=
   1.729 +    duplicate$ is.num
   1.730 +      { s swap$ * 's := }
   1.731 +      { pop$ "" 't := }
   1.732 +    if$
   1.733 +  }
   1.734 +  while$
   1.735 +  s empty$
   1.736 +    'skip$
   1.737 +    { pop$ s }
   1.738 +  if$
   1.739 +}
   1.740 +
   1.741 +FUNCTION {convert.edition}
   1.742 +{ edition extract.num "l" change.case$ 's :=
   1.743 +  s "first" = s "1" = or
   1.744 +    { bbl.first 't := }
   1.745 +    { s "second" = s "2" = or
   1.746 +        { bbl.second 't := }
   1.747 +        { s "third" = s "3" = or
   1.748 +            { bbl.third 't := }
   1.749 +            { s "fourth" = s "4" = or
   1.750 +                { bbl.fourth 't := }
   1.751 +                { s "fifth" = s "5" = or
   1.752 +                    { bbl.fifth 't := }
   1.753 +                    { s #1 #1 substring$ is.num
   1.754 +                        { s eng.ord 't := }
   1.755 +                        { edition 't := }
   1.756 +                      if$
   1.757 +                    }
   1.758 +                  if$
   1.759 +                }
   1.760 +              if$
   1.761 +            }
   1.762 +          if$
   1.763 +        }
   1.764 +      if$
   1.765 +    }
   1.766 +  if$
   1.767 +  t
   1.768 +}
   1.769 +
   1.770 +FUNCTION {format.edition}
   1.771 +{ edition empty$
   1.772 +    { "" }
   1.773 +    { output.state mid.sentence =
   1.774 +        { convert.edition "l" change.case$ " " * bbl.edition * }
   1.775 +        { convert.edition "t" change.case$ " " * bbl.edition * }
   1.776 +      if$
   1.777 +    }
   1.778 +  if$
   1.779 +}
   1.780 +
   1.781 +INTEGERS { multiresult }
   1.782 +
   1.783 +FUNCTION {multi.page.check}
   1.784 +{ 't :=
   1.785 +  #0 'multiresult :=
   1.786 +    { multiresult not
   1.787 +      t empty$ not
   1.788 +      and
   1.789 +    }
   1.790 +    { t #1 #1 substring$
   1.791 +      duplicate$ "-" =
   1.792 +      swap$ duplicate$ "," =
   1.793 +      swap$ "+" =
   1.794 +      or or
   1.795 +        { #1 'multiresult := }
   1.796 +        { t #2 global.max$ substring$ 't := }
   1.797 +      if$
   1.798 +    }
   1.799 +  while$
   1.800 +  multiresult
   1.801 +}
   1.802 +
   1.803 +FUNCTION {format.pages}
   1.804 +{ pages empty$
   1.805 +    { "" }
   1.806 +    { pages multi.page.check
   1.807 +        { bbl.pages pages n.dashify tie.or.space.connect }
   1.808 +        { bbl.page pages tie.or.space.connect }
   1.809 +      if$
   1.810 +    }
   1.811 +  if$
   1.812 +}
   1.813 +
   1.814 +FUNCTION {format.journal.pages}
   1.815 +{ pages empty$
   1.816 +    'skip$
   1.817 +    { duplicate$ empty$
   1.818 +        { pop$ format.pages }
   1.819 +        {
   1.820 +          " " *
   1.821 +          format.year * " " *
   1.822 +          pages n.dashify *
   1.823 +        }
   1.824 +      if$
   1.825 +    }
   1.826 +  if$
   1.827 +}
   1.828 +
   1.829 +FUNCTION {format.vol.num.pages}
   1.830 +{
   1.831 +  % volume field.or.null
   1.832 +  " "
   1.833 +  volume empty$
   1.834 +    { pop$ "" }
   1.835 +    { volume * }
   1.836 +  if$
   1.837 +  number empty$
   1.838 +    'skip$
   1.839 +    {
   1.840 +      "~(" number * ")" * *
   1.841 +      volume empty$
   1.842 +        { "there's a number but no volume in " cite$ * warning$ }
   1.843 +        'skip$
   1.844 +      if$
   1.845 +    }
   1.846 +  if$
   1.847 +}
   1.848 +
   1.849 +FUNCTION {format.chapter.pages}
   1.850 +{ chapter empty$
   1.851 +    { "" }
   1.852 +    { type empty$
   1.853 +        { bbl.chapter }
   1.854 +        { type "l" change.case$ }
   1.855 +      if$
   1.856 +      chapter tie.or.space.connect
   1.857 +    }
   1.858 +  if$
   1.859 +}
   1.860 +
   1.861 +FUNCTION {format.in.ed.booktitle}
   1.862 +{ booktitle empty$
   1.863 +    { "" }
   1.864 +    { editor empty$
   1.865 +        { word.in booktitle * }
   1.866 +        { word.in format.in.editors * ", " *
   1.867 +          booktitle * }
   1.868 +      if$
   1.869 +    }
   1.870 +  if$
   1.871 +}
   1.872 +
   1.873 +FUNCTION {empty.misc.check}
   1.874 +{ author empty$ title empty$ howpublished empty$
   1.875 +  month empty$ year empty$ note empty$
   1.876 +  and and and and and
   1.877 +    { "all relevant fields are empty in " cite$ * warning$ }
   1.878 +    'skip$
   1.879 +  if$
   1.880 +}
   1.881 +
   1.882 +FUNCTION {format.thesis.type}
   1.883 +{ type empty$
   1.884 +    'skip$
   1.885 +    { pop$
   1.886 +      type "t" change.case$
   1.887 +    }
   1.888 +  if$
   1.889 +}
   1.890 +
   1.891 +FUNCTION {format.tr.number}
   1.892 +{ type empty$
   1.893 +    { bbl.techrep }
   1.894 +    'type
   1.895 +  if$
   1.896 +  number empty$
   1.897 +    { "t" change.case$ }
   1.898 +    { number tie.or.space.connect }
   1.899 +  if$
   1.900 +}
   1.901 +
   1.902 +FUNCTION {format.article.crossref}
   1.903 +{
   1.904 +  key empty$
   1.905 +    { journal empty$
   1.906 +        { "need key or journal for " cite$ * " to crossref " * crossref *
   1.907 +          warning$
   1.908 +          ""
   1.909 +        }
   1.910 +        { word.in journal emphasize * }
   1.911 +      if$
   1.912 +    }
   1.913 +    { word.in key * " " *}
   1.914 +  if$
   1.915 +  " \cite{" * crossref * "}" *
   1.916 +}
   1.917 +
   1.918 +FUNCTION {format.crossref.editor}
   1.919 +{ editor #1 "{vv~}{ll}" format.name$
   1.920 +  editor num.names$ duplicate$
   1.921 +  #2 >
   1.922 +    { pop$
   1.923 +      " " * bbl.etal *
   1.924 +    }
   1.925 +    { #2 <
   1.926 +        'skip$
   1.927 +        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
   1.928 +            {
   1.929 +              " " * bbl.etal *
   1.930 +            }
   1.931 +            { bbl.and space.word * editor #2 "{vv~}{ll}" format.name$
   1.932 +              * }
   1.933 +          if$
   1.934 +        }
   1.935 +      if$
   1.936 +    }
   1.937 +  if$
   1.938 +}
   1.939 +
   1.940 +FUNCTION {format.book.crossref}
   1.941 +{ volume empty$
   1.942 +    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
   1.943 +      word.in
   1.944 +    }
   1.945 +    { bbl.volume volume tie.or.space.connect
   1.946 +      bbl.of space.word *
   1.947 +    }
   1.948 +  if$
   1.949 +  editor empty$
   1.950 +  editor field.or.null author field.or.null =
   1.951 +  or
   1.952 +    { key empty$
   1.953 +        { series empty$
   1.954 +            { "need editor, key, or series for " cite$ * " to crossref " *
   1.955 +              crossref * warning$
   1.956 +              "" *
   1.957 +            }
   1.958 +            { series emphasize * }
   1.959 +          if$
   1.960 +        }
   1.961 +        { key * }
   1.962 +      if$
   1.963 +    }
   1.964 +    { format.crossref.editor * }
   1.965 +  if$
   1.966 +  " \cite{" * crossref * "}" *
   1.967 +}
   1.968 +
   1.969 +FUNCTION {format.incoll.inproc.crossref}
   1.970 +{
   1.971 +  editor empty$
   1.972 +  editor field.or.null author field.or.null =
   1.973 +  or
   1.974 +    { key empty$
   1.975 +        { booktitle empty$
   1.976 +            { "need editor, key, or booktitle for " cite$ * " to crossref " *
   1.977 +              crossref * warning$
   1.978 +              ""
   1.979 +            }
   1.980 +            { word.in booktitle * }
   1.981 +          if$
   1.982 +        }
   1.983 +        { word.in key * " " *}
   1.984 +      if$
   1.985 +    }
   1.986 +    { word.in format.crossref.editor * " " *}
   1.987 +  if$
   1.988 +  " \cite{" * crossref * "}" *
   1.989 +}
   1.990 +
   1.991 +FUNCTION {format.org.or.pub}
   1.992 +{ 't :=
   1.993 +  ""
   1.994 +  year empty$
   1.995 +    { "empty year in " cite$ * warning$ }
   1.996 +    'skip$
   1.997 +  if$
   1.998 +  address empty$ t empty$ and
   1.999 +  year empty$ and
  1.1000 +    'skip$
  1.1001 +    {
  1.1002 +      t empty$
  1.1003 +        { address empty$
  1.1004 +          'skip$
  1.1005 +          { address * }
  1.1006 +          if$
  1.1007 +        }
  1.1008 +        { t *
  1.1009 +          address empty$
  1.1010 +            'skip$
  1.1011 +            { ", " * address * }
  1.1012 +          if$
  1.1013 +        }
  1.1014 +      if$
  1.1015 +      year empty$
  1.1016 +        'skip$
  1.1017 +        { t empty$ address empty$ and
  1.1018 +            'skip$
  1.1019 +            { ", " * }
  1.1020 +          if$
  1.1021 +          year *
  1.1022 +        }
  1.1023 +      if$
  1.1024 +    }
  1.1025 +  if$
  1.1026 +}
  1.1027 +
  1.1028 +FUNCTION {format.publisher.address}
  1.1029 +{ publisher empty$
  1.1030 +    { "empty publisher in " cite$ * warning$
  1.1031 +      ""
  1.1032 +    }
  1.1033 +    { publisher }
  1.1034 +  if$
  1.1035 +  format.org.or.pub
  1.1036 +}
  1.1037 +
  1.1038 +FUNCTION {format.organization.address}
  1.1039 +{ organization empty$
  1.1040 +    { "" }
  1.1041 +    { organization }
  1.1042 +  if$
  1.1043 +  format.org.or.pub
  1.1044 +}
  1.1045 +
  1.1046 +FUNCTION {make.href.null}
  1.1047 +{
  1.1048 +  pop$
  1.1049 +}
  1.1050 +FUNCTION {make.href.hypertex}
  1.1051 +{
  1.1052 +  "\special {html:<a href=" quote$ *
  1.1053 +  swap$ * quote$ * "> }" * swap$ *
  1.1054 +  "\special {html:</a>}" *
  1.1055 +}
  1.1056 +FUNCTION {make.href.hyperref}
  1.1057 +{
  1.1058 +  "\href {" swap$ * "} {\path{" * swap$ * "}}" *
  1.1059 +}
  1.1060 +FUNCTION {make.href}
  1.1061 +{ hrefform #2 =
  1.1062 +    'make.href.hyperref      % hrefform = 2
  1.1063 +    { hrefform #1 =
  1.1064 +        'make.href.hypertex  % hrefform = 1
  1.1065 +        'make.href.null      % hrefform = 0 (or anything else)
  1.1066 +      if$
  1.1067 +    }
  1.1068 +  if$
  1.1069 +}
  1.1070 +
  1.1071 +FUNCTION {format.url}
  1.1072 +{ inlinelinks #1 = url empty$ or
  1.1073 +   { "" }
  1.1074 +   { hrefform #1 =
  1.1075 +       { % special case -- add HyperTeX specials
  1.1076 +         urlintro "\url{" url * "}" * url make.href.hypertex * }
  1.1077 +       { urlintro "\url{" * url * "}" * }
  1.1078 +     if$
  1.1079 +   }
  1.1080 +  if$
  1.1081 +}
  1.1082 +
  1.1083 +FUNCTION {format.eprint}
  1.1084 +{ eprint empty$
  1.1085 +    { "" }
  1.1086 +    { eprintprefix eprint * eprinturl eprint * make.href }
  1.1087 +  if$
  1.1088 +}
  1.1089 +
  1.1090 +FUNCTION {format.doi}
  1.1091 +{ doi empty$
  1.1092 +    { "" }
  1.1093 +    { doiprefix doi * doiurl doi * make.href }
  1.1094 +  if$
  1.1095 +}
  1.1096 +
  1.1097 +FUNCTION {output.url}
  1.1098 +{ url empty$
  1.1099 +    'skip$
  1.1100 +    { new.block
  1.1101 +      format.url output
  1.1102 +      format.lastchecked output
  1.1103 +    }
  1.1104 +  if$
  1.1105 +}
  1.1106 +
  1.1107 +FUNCTION {output.web.refs}
  1.1108 +{
  1.1109 +  new.block
  1.1110 +  output.url
  1.1111 +  addeprints eprint empty$ not and
  1.1112 +    { format.eprint output.nonnull }
  1.1113 +    'skip$
  1.1114 +  if$
  1.1115 +  adddoiresolver doi empty$ not and
  1.1116 +    { format.doi output.nonnull }
  1.1117 +    'skip$
  1.1118 +  if$
  1.1119 +}
  1.1120 +
  1.1121 +FUNCTION {output.bibitem}
  1.1122 +{ outside.brackets 'bracket.state :=
  1.1123 +  output.bibitem.original
  1.1124 +  inlinelinks url empty$ not and
  1.1125 +    { #1 'makeinlinelink := }
  1.1126 +    { #0 'makeinlinelink := }
  1.1127 +  if$
  1.1128 +}
  1.1129 +
  1.1130 +FUNCTION {fin.entry}
  1.1131 +{ output.web.refs  % urlbst
  1.1132 +  makeinlinelink       % ooops, it appears we didn't have a title for inlinelink
  1.1133 +    { setup.inlinelink % add some artificial link text here, as a fallback
  1.1134 +      "[link]" output.nonnull }
  1.1135 +    'skip$
  1.1136 +  if$
  1.1137 +  bracket.state close.brackets = % urlbst
  1.1138 +    { "]" * }
  1.1139 +    'skip$
  1.1140 +  if$
  1.1141 +  fin.entry.original
  1.1142 +}
  1.1143 +
  1.1144 +FUNCTION {webpage}
  1.1145 +{ output.bibitem
  1.1146 +  author empty$
  1.1147 +    { editor empty$
  1.1148 +        'skip$  % author and editor both optional
  1.1149 +        { format.editors output.nonnull }
  1.1150 +      if$
  1.1151 +    }
  1.1152 +    { editor empty$
  1.1153 +        { format.authors output.nonnull }
  1.1154 +        { "can't use both author and editor fields in " cite$ * warning$ }
  1.1155 +      if$
  1.1156 +    }
  1.1157 +  if$
  1.1158 +  new.block
  1.1159 +  title empty$ 'skip$ 'setup.inlinelink if$
  1.1160 +  format.title "title" output.check
  1.1161 +  inbrackets "online" output
  1.1162 +  new.block
  1.1163 +  year empty$
  1.1164 +    'skip$
  1.1165 +    { format.date "year" output.check }
  1.1166 +  if$
  1.1167 +  % We don't need to output the URL details ('lastchecked' and 'url'),
  1.1168 +  % because fin.entry does that for us, using output.web.refs.  The only
  1.1169 +  % reason we would want to put them here is if we were to decide that
  1.1170 +  % they should go in front of the rather miscellaneous information in 'note'.
  1.1171 +  new.block
  1.1172 +  note output
  1.1173 +  fin.entry
  1.1174 +}
  1.1175 +
  1.1176 +FUNCTION {article}
  1.1177 +{ output.bibitem
  1.1178 +  format.authors "author" output.check
  1.1179 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1180 +  format.title "title" output.check
  1.1181 +  crossref missing$
  1.1182 +    { journal
  1.1183 +      "journal" output.check
  1.1184 +      % add.blank
  1.1185 +  before.all 'output.state :=
  1.1186 +      format.vol.num.pages output
  1.1187 +    }
  1.1188 +    { format.article.crossref output.nonnull
  1.1189 +      format.pages output
  1.1190 +    }
  1.1191 +  if$
  1.1192 +  format.journal.pages
  1.1193 +  format.note output
  1.1194 +  fin.entry
  1.1195 +  write.url
  1.1196 +}
  1.1197 +
  1.1198 +FUNCTION {book}
  1.1199 +{ output.bibitem
  1.1200 +  author empty$
  1.1201 +    { format.editors "author and editor" output.check
  1.1202 +    }
  1.1203 +    { format.authors output.nonnull
  1.1204 +      crossref missing$
  1.1205 +        { "author and editor" editor either.or.check }
  1.1206 +        'skip$
  1.1207 +      if$
  1.1208 +    }
  1.1209 +  if$
  1.1210 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1211 +  format.btitle "title" output.check
  1.1212 +  crossref missing$
  1.1213 +    { format.edition output
  1.1214 +      format.bvolume output
  1.1215 +      format.number.series output
  1.1216 +      format.publisher.address output
  1.1217 +    }
  1.1218 +    {
  1.1219 +      format.book.crossref output.nonnull
  1.1220 +    }
  1.1221 +  if$
  1.1222 +  format.note output
  1.1223 +  fin.entry
  1.1224 +  write.url
  1.1225 +}
  1.1226 +
  1.1227 +FUNCTION {booklet}
  1.1228 +{ output.bibitem
  1.1229 +  format.authors output
  1.1230 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1231 +  format.title "title" output.check
  1.1232 +  howpublished output
  1.1233 +  address output
  1.1234 +  format.note output
  1.1235 +  format.date output
  1.1236 +  fin.entry
  1.1237 +  write.url
  1.1238 +}
  1.1239 +
  1.1240 +FUNCTION {inbook}
  1.1241 +{ output.bibitem
  1.1242 +  author empty$
  1.1243 +    { format.editors "author and editor" output.check
  1.1244 +    }
  1.1245 +    { format.authors output.nonnull
  1.1246 +      crossref missing$
  1.1247 +        { "author and editor" editor either.or.check }
  1.1248 +        'skip$
  1.1249 +      if$
  1.1250 +    }
  1.1251 +  if$
  1.1252 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1253 +  format.btitle "title" output.check
  1.1254 +  crossref missing$
  1.1255 +    {
  1.1256 +      format.edition output
  1.1257 +      format.bvolume output
  1.1258 +      format.number.series output
  1.1259 +      format.publisher.address output
  1.1260 +      format.chapter.pages "chapter and pages" output.check
  1.1261 +    }
  1.1262 +    {
  1.1263 +      format.chapter.pages "chapter and pages" output.check
  1.1264 +      format.book.crossref output.nonnull
  1.1265 +    }
  1.1266 +  if$
  1.1267 +  format.pages "pages" output.check
  1.1268 +  format.note output
  1.1269 +  fin.entry
  1.1270 +  write.url
  1.1271 +}
  1.1272 +
  1.1273 +FUNCTION {incollection}
  1.1274 +{ output.bibitem
  1.1275 +  format.authors "author" output.check
  1.1276 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1277 +  format.title "title" output.check
  1.1278 +  crossref missing$
  1.1279 +    { format.in.ed.booktitle "booktitle" output.check
  1.1280 +      format.edition output
  1.1281 +      format.bvolume output
  1.1282 +      format.number.series output
  1.1283 +      format.publisher.address output
  1.1284 +      format.chapter.pages output
  1.1285 +    }
  1.1286 +    { format.incoll.inproc.crossref output.nonnull
  1.1287 +      format.chapter.pages output
  1.1288 +    }
  1.1289 +  if$
  1.1290 +  format.pages "pages" output.check
  1.1291 +  format.note output
  1.1292 +  fin.entry
  1.1293 +  write.url
  1.1294 +}
  1.1295 +
  1.1296 +FUNCTION {inproceedings}
  1.1297 +{ output.bibitem
  1.1298 +  format.authors "author" output.check
  1.1299 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1300 +  format.title "title" output.check
  1.1301 +  crossref missing$
  1.1302 +    { format.in.ed.booktitle "booktitle" output.check
  1.1303 +      format.edition output
  1.1304 +      format.bvolume output
  1.1305 +      format.number.series output
  1.1306 +      publisher empty$
  1.1307 +        { format.organization.address output }
  1.1308 +        { organization output
  1.1309 +          format.publisher.address output
  1.1310 +        }
  1.1311 +      if$
  1.1312 +    }
  1.1313 +    { format.incoll.inproc.crossref output.nonnull
  1.1314 +    }
  1.1315 +  if$
  1.1316 +  format.pages "pages" output.check
  1.1317 +  format.note output
  1.1318 +  fin.entry
  1.1319 +  write.url
  1.1320 +}
  1.1321 +
  1.1322 +FUNCTION {conference} { inproceedings }
  1.1323 +
  1.1324 +FUNCTION {manual}
  1.1325 +{ output.bibitem
  1.1326 +  author empty$
  1.1327 +    { organization empty$
  1.1328 +        'skip$
  1.1329 +        { organization output.nonnull
  1.1330 +          address output
  1.1331 +        }
  1.1332 +      if$
  1.1333 +    }
  1.1334 +    { format.authors output.nonnull }
  1.1335 +  if$
  1.1336 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1337 +  format.btitle "title" output.check
  1.1338 +  author empty$
  1.1339 +    { organization empty$
  1.1340 +    {
  1.1341 +          address output
  1.1342 +        }
  1.1343 +        'skip$
  1.1344 +      if$
  1.1345 +    }
  1.1346 +    {
  1.1347 +      organization output
  1.1348 +      address output
  1.1349 +    }
  1.1350 +  if$
  1.1351 +  format.edition output
  1.1352 +  format.note output
  1.1353 +  format.date output
  1.1354 +  fin.entry
  1.1355 +  write.url
  1.1356 +}
  1.1357 +
  1.1358 +FUNCTION {mastersthesis}
  1.1359 +{ output.bibitem
  1.1360 +  format.authors "author" output.check
  1.1361 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1362 +  format.title "title" output.check
  1.1363 +  bbl.mthesis format.thesis.type output.nonnull
  1.1364 +  school "school" output.check
  1.1365 +  address output
  1.1366 +  format.note output
  1.1367 +  format.date "year" output.check
  1.1368 +  fin.entry
  1.1369 +  write.url
  1.1370 +}
  1.1371 +
  1.1372 +FUNCTION {misc}
  1.1373 +{ output.bibitem
  1.1374 +  format.authors output
  1.1375 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1376 +  format.title output
  1.1377 +  howpublished output
  1.1378 +  format.note output
  1.1379 +  format.date output
  1.1380 +  fin.entry
  1.1381 +  write.url
  1.1382 +  empty.misc.check
  1.1383 +}
  1.1384 +
  1.1385 +FUNCTION {phdthesis}
  1.1386 +{ output.bibitem
  1.1387 +  format.authors "author" output.check
  1.1388 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1389 +  format.title "title" output.check
  1.1390 +  bbl.phdthesis format.thesis.type output.nonnull
  1.1391 +  school "school" output.check
  1.1392 +  address output
  1.1393 +  format.note output
  1.1394 +  format.date "year" output.check
  1.1395 +  fin.entry
  1.1396 +  write.url
  1.1397 +}
  1.1398 +
  1.1399 +FUNCTION {proceedings}
  1.1400 +{ output.bibitem
  1.1401 +  editor empty$
  1.1402 +    { organization output }
  1.1403 +    { format.editors output.nonnull }
  1.1404 +  if$
  1.1405 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1406 +  format.btitle "title" output.check
  1.1407 +  format.bvolume output
  1.1408 +  format.number.series output
  1.1409 +  editor empty$
  1.1410 +    { publisher empty$
  1.1411 +        'skip$
  1.1412 +        {
  1.1413 +          format.publisher.address output
  1.1414 +        }
  1.1415 +      if$
  1.1416 +    }
  1.1417 +    { publisher empty$
  1.1418 +        {
  1.1419 +          format.organization.address output }
  1.1420 +        {
  1.1421 +          organization output
  1.1422 +          format.publisher.address output
  1.1423 +        }
  1.1424 +      if$
  1.1425 +     }
  1.1426 +  if$
  1.1427 +  format.note output
  1.1428 +  fin.entry
  1.1429 +  write.url
  1.1430 +}
  1.1431 +
  1.1432 +FUNCTION {techreport}
  1.1433 +{ output.bibitem
  1.1434 +  format.authors "author" output.check
  1.1435 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1436 +  format.title "title" output.check
  1.1437 +  format.tr.number output.nonnull
  1.1438 +  institution "institution" output.check
  1.1439 +  address output
  1.1440 +  format.note output
  1.1441 +  format.date "year" output.check
  1.1442 +  fin.entry
  1.1443 +  write.url
  1.1444 +}
  1.1445 +
  1.1446 +FUNCTION {unpublished}
  1.1447 +{ output.bibitem
  1.1448 +  format.authors "author" output.check
  1.1449 +  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
  1.1450 +  format.title "title" output.check
  1.1451 +  format.note "note" output.check
  1.1452 +  format.date output
  1.1453 +  fin.entry
  1.1454 +  write.url
  1.1455 +}
  1.1456 +
  1.1457 +FUNCTION {default.type} { misc }
  1.1458 +
  1.1459 +READ
  1.1460 +
  1.1461 +STRINGS { longest.label }
  1.1462 +
  1.1463 +INTEGERS { number.label longest.label.width }
  1.1464 +
  1.1465 +FUNCTION {initialize.longest.label}
  1.1466 +{ "" 'longest.label :=
  1.1467 +  #1 'number.label :=
  1.1468 +  #0 'longest.label.width :=
  1.1469 +}
  1.1470 +
  1.1471 +FUNCTION {longest.label.pass}
  1.1472 +{ number.label int.to.str$ 'label :=
  1.1473 +  number.label #1 + 'number.label :=
  1.1474 +  label width$ longest.label.width >
  1.1475 +    { label 'longest.label :=
  1.1476 +      label width$ 'longest.label.width :=
  1.1477 +    }
  1.1478 +    'skip$
  1.1479 +  if$
  1.1480 +}
  1.1481 +
  1.1482 +EXECUTE {initialize.longest.label}
  1.1483 +
  1.1484 +ITERATE {longest.label.pass}
  1.1485 +
  1.1486 +FUNCTION {begin.bib}
  1.1487 +{ preamble$ empty$
  1.1488 +    'skip$
  1.1489 +    { preamble$ write$ newline$ }
  1.1490 +  if$
  1.1491 +  "\begin{thebibliography}{"  longest.label  * "}" *
  1.1492 +  write$ newline$
  1.1493 +  "\expandafter\ifx\csname url\endcsname\relax"
  1.1494 +  write$ newline$
  1.1495 +  "  \def\url#1{\texttt{#1}}\fi"
  1.1496 +  write$ newline$
  1.1497 +  "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
  1.1498 +  write$ newline$
  1.1499 +  "\expandafter\ifx\csname href\endcsname\relax"
  1.1500 +  write$ newline$
  1.1501 +  "  \def\href#1#2{#2} \def\path#1{#1}\fi"
  1.1502 +  write$ newline$
  1.1503 +}
  1.1504 +
  1.1505 +EXECUTE {begin.bib}
  1.1506 +
  1.1507 +EXECUTE {init.urlbst.variables}
  1.1508 +EXECUTE {init.state.consts}
  1.1509 +
  1.1510 +ITERATE {call.type$}
  1.1511 +
  1.1512 +FUNCTION {end.bib}
  1.1513 +{ newline$
  1.1514 +  "\end{thebibliography}" write$ newline$
  1.1515 +}
  1.1516 +
  1.1517 +EXECUTE {end.bib}
  1.1518 +%% End of customized bst file
  1.1519 +%%
  1.1520 +%% End of file `elsarticle-num.bst'.