
alpar@0: %% 
alpar@0: %% Copyright 2007, 2008, 2009 Elsevier Ltd
alpar@0: %% 
alpar@0: %% This file is part of the 'Elsarticle Bundle'.
alpar@0: %% ---------------------------------------------
alpar@0: %% 
alpar@0: %% It may be distributed under the conditions of the LaTeX Project Public
alpar@0: %% License, either version 1.2 of this license or (at your option) any
alpar@0: %% later version.  The latest version of this license is in
alpar@0: %%    http://www.latex-project.org/lppl.txt
alpar@0: %% and version 1.2 or later is part of all distributions of LaTeX
alpar@0: %% version 1999/12/01 or later.
alpar@0: %% 
alpar@0: %% The list of all files belonging to the 'Elsarticle Bundle' is
alpar@0: %% given in the file `manifest.txt'.
alpar@0: %% 
alpar@0: %%% Modification of BibTeX style file elsarticle-num.bst
alpar@0: %%% ... by urlbst, version 0.6 (marked with "% urlbst")
alpar@0: %%% See <http://purl.org/nxg/dist/urlbst>
alpar@0: %%% Added webpage entry type, and url and lastchecked fields.
alpar@0: %%% Added eprint support.
alpar@0: %%% Added DOI support.
alpar@0: %%% Added hyperref support.
alpar@0: %%% Original headers follow...
alpar@0: 
alpar@0: %%
alpar@0: %% This is file `elsarticle-num.bst',
alpar@0: %% generated with the docstrip utility.
alpar@0: %%
alpar@0: %% The original source files were:
alpar@0: %%
alpar@0: %% 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: %% After docstrip generation some manual changes were made (SP)
alpar@0: 
alpar@0: %% ----------------------------------------
alpar@0: 
alpar@0: ENTRY
alpar@0:   { address
alpar@0:     author
alpar@0:     booktitle
alpar@0:     chapter
alpar@0:     edition
alpar@0:     editor
alpar@0:     howpublished
alpar@0:     institution
alpar@0:     journal
alpar@0:     key
alpar@0:     month
alpar@0:     note
alpar@0:     number
alpar@0:     organization
alpar@0:     pages
alpar@0:     publisher
alpar@0:     school
alpar@0:     series
alpar@0:     title
alpar@0:     type
alpar@0:     volume
alpar@0:     year
alpar@0:     eprint % urlbst
alpar@0:     doi % urlbst
alpar@0:     url % urlbst
alpar@0:     lastchecked % urlbst
alpar@0:   }
alpar@0:   {}
alpar@0:   { label }
alpar@0: 
alpar@0: INTEGERS { output.state before.all mid.sentence after.sentence after.block }
alpar@0: 
alpar@0: STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl openinlinelink closeinlinelink } % urlbst...
alpar@0: INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver }
alpar@0: FUNCTION {init.urlbst.variables}
alpar@0: {
alpar@0:   "Available from: " 'urlintro := % prefix before URL
alpar@0:   "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
alpar@0:   "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
alpar@0:   "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
alpar@0:   "doi:" 'doiprefix :=      % text prefix printed before DOI ref
alpar@0:   #1 'addeprints :=         % 0=no eprints; 1=include eprints
alpar@0:   #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
alpar@0:   #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
alpar@0:   #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
alpar@0:   % the following are internal state variables, not config constants
alpar@0:   #0 'makeinlinelink :=     % state variable managed by setup.inlinelink
alpar@0:   "" 'openinlinelink :=     % ditto
alpar@0:   "" 'closeinlinelink :=    % ditto
alpar@0: }
alpar@0: INTEGERS {
alpar@0:   bracket.state
alpar@0:   outside.brackets
alpar@0:   open.brackets
alpar@0:   within.brackets
alpar@0:   close.brackets
alpar@0: }
alpar@0: FUNCTION {init.state.consts}
alpar@0: { #0 'outside.brackets := % urlbst
alpar@0:   #1 'open.brackets :=
alpar@0:   #2 'within.brackets :=
alpar@0:   #3 'close.brackets :=
alpar@0: 
alpar@0:   #0 'before.all :=
alpar@0:   #1 'mid.sentence :=
alpar@0:   #2 'after.sentence :=
alpar@0:   #3 'after.block :=
alpar@0: }
alpar@0: 
alpar@0: STRINGS { s t }
alpar@0: 
alpar@0: FUNCTION {output.nonnull.original}
alpar@0: { 's :=
alpar@0:   output.state mid.sentence =
alpar@0:     { ", " * write$ }
alpar@0:     { output.state after.block =
alpar@0:         { add.period$ write$
alpar@0:           newline$
alpar@0:           "\newblock " write$
alpar@0:         }
alpar@0:         { output.state before.all =
alpar@0:             'write$
alpar@0:             { add.period$ " " * write$ }
alpar@0:           if$
alpar@0:         }
alpar@0:       if$
alpar@0:       mid.sentence 'output.state :=
alpar@0:     }
alpar@0:   if$
alpar@0:   s
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {setup.inlinelink}
alpar@0: { makeinlinelink
alpar@0:     { hrefform #1 = % hypertex
alpar@0:         { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
alpar@0:           "\special {html:</a>}" 'closeinlinelink :=
alpar@0:           }
alpar@0:         { hrefform #2 = % hyperref
alpar@0:             { "\href{" url * "}{" * 'openinlinelink :=
alpar@0:               "}" 'closeinlinelink :=
alpar@0:               }
alpar@0:             'skip$
alpar@0:           if$ % hrefform #2 =
alpar@0:         }
alpar@0:       if$ % hrefform #1 =
alpar@0:       #0 'makeinlinelink :=
alpar@0:     }
alpar@0:     'skip$
alpar@0:  if$ % makeinlinelink
alpar@0: }
alpar@0: FUNCTION {add.inlinelink}
alpar@0: { openinlinelink empty$
alpar@0:     'skip$
alpar@0:     { openinlinelink swap$ * closeinlinelink *
alpar@0:       "" 'openinlinelink :=
alpar@0:       }
alpar@0:   if$
alpar@0: }
alpar@0: FUNCTION {output.nonnull}
alpar@0: { % Save the thing we've been asked to output
alpar@0:   's :=
alpar@0:   % If the bracket-state is close.brackets, then add a close-bracket to
alpar@0:   % what is currently at the top of the stack, and set bracket.state
alpar@0:   % to outside.brackets
alpar@0:   bracket.state close.brackets =
alpar@0:     { "]" *
alpar@0:       outside.brackets 'bracket.state :=
alpar@0:     }
alpar@0:     'skip$
alpar@0:   if$
alpar@0:   bracket.state outside.brackets =
alpar@0:     { % We're outside all brackets -- this is the normal situation.
alpar@0:       % Write out what's currently at the top of the stack, using the
alpar@0:       % original output.nonnull function.
alpar@0:       s
alpar@0:       add.inlinelink
alpar@0:       output.nonnull.original % invoke the original output.nonnull
alpar@0:     }
alpar@0:     { % Still in brackets.  Add open-bracket or (continuation) comma, add the
alpar@0:       % new text (in s) to the top of the stack, and move to the close-brackets
alpar@0:       % state, ready for next time (unless inbrackets resets it).  If we come
alpar@0:       % into this branch, then output.state is carefully undisturbed.
alpar@0:       bracket.state open.brackets =
alpar@0:         { " [" * }
alpar@0:         { ", " * } % bracket.state will be within.brackets
alpar@0:       if$
alpar@0:       s *
alpar@0:       close.brackets 'bracket.state :=
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {inbrackets}
alpar@0: { bracket.state close.brackets =
alpar@0:     { within.brackets 'bracket.state := } % reset the state: not open nor closed
alpar@0:     { open.brackets 'bracket.state := }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.lastchecked}
alpar@0: { lastchecked empty$
alpar@0:     { "" }
alpar@0:     { inbrackets "cited " lastchecked * }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output}
alpar@0: { duplicate$ empty$
alpar@0:     'pop$
alpar@0:     'output.nonnull
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output.check}
alpar@0: { 't :=
alpar@0:   duplicate$ empty$
alpar@0:     { pop$ "empty " t * " in " * cite$ * warning$ }
alpar@0:     'output.nonnull
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {fin.entry.original}
alpar@0: { add.period$
alpar@0:   write$
alpar@0:   newline$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.block}
alpar@0: { output.state before.all =
alpar@0:     'skip$
alpar@0:     { after.block 'output.state := }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.sentence}
alpar@0: { output.state after.block =
alpar@0:     'skip$
alpar@0:     { output.state before.all =
alpar@0:         'skip$
alpar@0:         { after.sentence 'output.state := }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {add.blank}
alpar@0: {  " " * before.all 'output.state :=
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {date.block}
alpar@0: {
alpar@0:   add.blank
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {not}
alpar@0: {   { #0 }
alpar@0:     { #1 }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {and}
alpar@0: {   'skip$
alpar@0:     { pop$ #0 }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {or}
alpar@0: {   { pop$ #1 }
alpar@0:     'skip$
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.block.checka}
alpar@0: { empty$
alpar@0:     'skip$
alpar@0:     'new.block
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.block.checkb}
alpar@0: { empty$
alpar@0:   swap$ empty$
alpar@0:   and
alpar@0:     'skip$
alpar@0:     'new.block
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.sentence.checka}
alpar@0: { empty$
alpar@0:     'skip$
alpar@0:     'new.sentence
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {new.sentence.checkb}
alpar@0: { empty$
alpar@0:   swap$ empty$
alpar@0:   and
alpar@0:     'skip$
alpar@0:     'new.sentence
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {field.or.null}
alpar@0: { duplicate$ empty$
alpar@0:     { pop$ "" }
alpar@0:     'skip$
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {emphasize}
alpar@0: { skip$ }
alpar@0: 
alpar@0: FUNCTION {capitalize}
alpar@0: { "u" change.case$ "t" change.case$ }
alpar@0: 
alpar@0: FUNCTION {space.word}
alpar@0: { " " swap$ * " " * }
alpar@0: 
alpar@0:  % Here are the language-specific definitions for explicit words.
alpar@0:  % Each function has a name bbl.xxx where xxx is the English word.
alpar@0:  % The language selected here is ENGLISH
alpar@0: FUNCTION {bbl.and}
alpar@0: { "and"}
alpar@0: 
alpar@0: FUNCTION {bbl.etal}
alpar@0: { "et~al." }
alpar@0: 
alpar@0: FUNCTION {bbl.editors}
alpar@0: { "Eds." }
alpar@0: 
alpar@0: FUNCTION {bbl.editor}
alpar@0: { "Ed." }
alpar@0: 
alpar@0: FUNCTION {bbl.edby}
alpar@0: { "edited by" }
alpar@0: 
alpar@0: FUNCTION {bbl.edition}
alpar@0: { "Edition" }
alpar@0: 
alpar@0: FUNCTION {bbl.volume}
alpar@0: { "Vol." }
alpar@0: 
alpar@0: FUNCTION {bbl.of}
alpar@0: { "of" }
alpar@0: 
alpar@0: FUNCTION {bbl.number}
alpar@0: { "no." }
alpar@0: 
alpar@0: FUNCTION {bbl.nr}
alpar@0: { "no." }
alpar@0: 
alpar@0: FUNCTION {bbl.in}
alpar@0: { "in" }
alpar@0: 
alpar@0: FUNCTION {bbl.pages}
alpar@0: { "pp." }
alpar@0: 
alpar@0: FUNCTION {bbl.page}
alpar@0: { "p." }
alpar@0: 
alpar@0: FUNCTION {bbl.chapter}
alpar@0: { "Ch." }
alpar@0: 
alpar@0: FUNCTION {bbl.techrep}
alpar@0: { "Tech. Rep." }
alpar@0: 
alpar@0: FUNCTION {bbl.mthesis}
alpar@0: { "Master's thesis" }
alpar@0: 
alpar@0: FUNCTION {bbl.phdthesis}
alpar@0: { "Ph.D. thesis" }
alpar@0: 
alpar@0: FUNCTION {bbl.first}
alpar@0: { "1st" }
alpar@0: 
alpar@0: FUNCTION {bbl.second}
alpar@0: { "2nd" }
alpar@0: 
alpar@0: FUNCTION {bbl.third}
alpar@0: { "3rd" }
alpar@0: 
alpar@0: FUNCTION {bbl.fourth}
alpar@0: { "4th" }
alpar@0: 
alpar@0: FUNCTION {bbl.fifth}
alpar@0: { "5th" }
alpar@0: 
alpar@0: FUNCTION {bbl.st}
alpar@0: { "st" }
alpar@0: 
alpar@0: FUNCTION {bbl.nd}
alpar@0: { "nd" }
alpar@0: 
alpar@0: FUNCTION {bbl.rd}
alpar@0: { "rd" }
alpar@0: 
alpar@0: FUNCTION {bbl.th}
alpar@0: { "th" }
alpar@0: 
alpar@0: MACRO {jan} {"Jan."}
alpar@0: 
alpar@0: MACRO {feb} {"Feb."}
alpar@0: 
alpar@0: MACRO {mar} {"Mar."}
alpar@0: 
alpar@0: MACRO {apr} {"Apr."}
alpar@0: 
alpar@0: MACRO {may} {"May"}
alpar@0: 
alpar@0: MACRO {jun} {"Jun."}
alpar@0: 
alpar@0: MACRO {jul} {"Jul."}
alpar@0: 
alpar@0: MACRO {aug} {"Aug."}
alpar@0: 
alpar@0: MACRO {sep} {"Sep."}
alpar@0: 
alpar@0: MACRO {oct} {"Oct."}
alpar@0: 
alpar@0: MACRO {nov} {"Nov."}
alpar@0: 
alpar@0: MACRO {dec} {"Dec."}
alpar@0: 
alpar@0: FUNCTION {eng.ord}
alpar@0: { duplicate$ "1" swap$ *
alpar@0:   #-2 #1 substring$ "1" =
alpar@0:      { bbl.th * }
alpar@0:      { duplicate$ #-1 #1 substring$
alpar@0:        duplicate$ "1" =
alpar@0:          { pop$ bbl.st * }
alpar@0:          { duplicate$ "2" =
alpar@0:              { pop$ bbl.nd * }
alpar@0:              { "3" =
alpar@0:                  { bbl.rd * }
alpar@0:                  { bbl.th * }
alpar@0:                if$
alpar@0:              }
alpar@0:            if$
alpar@0:           }
alpar@0:        if$
alpar@0:      }
alpar@0:    if$
alpar@0: }
alpar@0: 
alpar@0: MACRO {acmcs} {"ACM Comput. Surv."}
alpar@0: 
alpar@0: MACRO {acta} {"Acta Inf."}
alpar@0: 
alpar@0: MACRO {cacm} {"Commun. ACM"}
alpar@0: 
alpar@0: MACRO {ibmjrd} {"IBM J. Res. Dev."}
alpar@0: 
alpar@0: MACRO {ibmsj} {"IBM Syst.~J."}
alpar@0: 
alpar@0: MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
alpar@0: 
alpar@0: MACRO {ieeetc} {"IEEE Trans. Comput."}
alpar@0: 
alpar@0: MACRO {ieeetcad}
alpar@0:  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
alpar@0: 
alpar@0: MACRO {ipl} {"Inf. Process. Lett."}
alpar@0: 
alpar@0: MACRO {jacm} {"J.~ACM"}
alpar@0: 
alpar@0: MACRO {jcss} {"J.~Comput. Syst. Sci."}
alpar@0: 
alpar@0: MACRO {scp} {"Sci. Comput. Programming"}
alpar@0: 
alpar@0: MACRO {sicomp} {"SIAM J. Comput."}
alpar@0: 
alpar@0: MACRO {tocs} {"ACM Trans. Comput. Syst."}
alpar@0: 
alpar@0: MACRO {tods} {"ACM Trans. Database Syst."}
alpar@0: 
alpar@0: MACRO {tog} {"ACM Trans. Gr."}
alpar@0: 
alpar@0: MACRO {toms} {"ACM Trans. Math. Softw."}
alpar@0: 
alpar@0: MACRO {toois} {"ACM Trans. Office Inf. Syst."}
alpar@0: 
alpar@0: MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
alpar@0: 
alpar@0: MACRO {tcs} {"Theoretical Comput. Sci."}
alpar@0: 
alpar@0: FUNCTION {write.url}
alpar@0: { url empty$
alpar@0:     { skip$ }
alpar@0:     { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: INTEGERS { nameptr namesleft numnames }
alpar@0: 
alpar@0: FUNCTION {format.names}
alpar@0: { 's :=
alpar@0:   #1 'nameptr :=
alpar@0:   s num.names$ 'numnames :=
alpar@0:   numnames 'namesleft :=
alpar@0:     { namesleft #0 > }
alpar@0:     { s nameptr
alpar@0:       "{f.~}{vv~}{ll}{, jj}" format.name$
alpar@0:     't :=
alpar@0:       nameptr #1 >
alpar@0:         {
alpar@0:           namesleft #1 >
alpar@0:             { ", " * t * }
alpar@0:             {
alpar@0:               "," *
alpar@0:               s nameptr "{ll}" format.name$ duplicate$ "others" =
alpar@0:                 { 't := }
alpar@0:                 { pop$ }
alpar@0:               if$
alpar@0:               t "others" =
alpar@0:                 {
alpar@0:                   " " * bbl.etal *
alpar@0:                 }
alpar@0:                 { " " * t * }
alpar@0:               if$
alpar@0:             }
alpar@0:           if$
alpar@0:         }
alpar@0:         't
alpar@0:       if$
alpar@0:       nameptr #1 + 'nameptr :=
alpar@0:       namesleft #1 - 'namesleft :=
alpar@0:     }
alpar@0:   while$
alpar@0: }
alpar@0: FUNCTION {format.names.ed}
alpar@0: { format.names }
alpar@0: FUNCTION {format.authors}
alpar@0: { author empty$
alpar@0:     { "" }
alpar@0:     { author format.names }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.editors}
alpar@0: { editor empty$
alpar@0:     { "" }
alpar@0:     { editor format.names
alpar@0:       editor num.names$ #1 >
alpar@0:         { " (" * bbl.editors * ")" * }
alpar@0:         { " (" * bbl.editor * ")" * }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.in.editors}
alpar@0: { editor empty$
alpar@0:     { "" }
alpar@0:     { editor format.names.ed
alpar@0:       editor num.names$ #1 >
alpar@0:         { " (" * bbl.editors * ")" * }
alpar@0:         { " (" * bbl.editor * ")" * }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.note}
alpar@0: {
alpar@0:  note empty$
alpar@0:     { "" }
alpar@0:     { note #1 #1 substring$
alpar@0:       duplicate$ "{" =
alpar@0:         'skip$
alpar@0:         { output.state mid.sentence =
alpar@0:           { "l" }
alpar@0:           { "u" }
alpar@0:         if$
alpar@0:         change.case$
alpar@0:         }
alpar@0:       if$
alpar@0:       note #2 global.max$ substring$ *
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.title}
alpar@0: { title empty$
alpar@0:     { "" }
alpar@0:     { title "t" change.case$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output.bibitem.original}
alpar@0: { newline$
alpar@0:   "\bibitem{" write$
alpar@0:   cite$ write$
alpar@0:   "}" write$
alpar@0:   newline$
alpar@0:   ""
alpar@0:   before.all 'output.state :=
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {n.dashify}
alpar@0: {
alpar@0:   't :=
alpar@0:   ""
alpar@0:     { t empty$ not }
alpar@0:     { t #1 #1 substring$ "-" =
alpar@0:         { t #1 #2 substring$ "--" = not
alpar@0:             { "--" *
alpar@0:               t #2 global.max$ substring$ 't :=
alpar@0:             }
alpar@0:             {   { t #1 #1 substring$ "-" = }
alpar@0:                 { "-" *
alpar@0:                   t #2 global.max$ substring$ 't :=
alpar@0:                 }
alpar@0:               while$
alpar@0:             }
alpar@0:           if$
alpar@0:         }
alpar@0:         { t #1 #1 substring$ *
alpar@0:           t #2 global.max$ substring$ 't :=
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:   while$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {word.in}
alpar@0: { bbl.in
alpar@0:   ":" *
alpar@0:   " " * }
alpar@0: 
alpar@0: FUNCTION {format.date}
alpar@0: { year empty$
alpar@0:     { month empty$
alpar@0:         { "" }
alpar@0:         { "there's a month but no year in " cite$ * warning$
alpar@0:           month
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:     { month empty$
alpar@0:         'year
alpar@0:         { month " " * year * }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0:   duplicate$ empty$
alpar@0:     'skip$
alpar@0:     {
alpar@0:       before.all 'output.state :=
alpar@0:     " (" swap$ * ")" *
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION{format.year}
alpar@0: { year duplicate$ empty$
alpar@0:     { "empty year in " cite$ * warning$ pop$ "" }
alpar@0:     { "(" swap$ * ")" * }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.btitle}
alpar@0: { title
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {tie.or.space.connect}
alpar@0: { duplicate$ text.length$ #3 <
alpar@0:     { "~" }
alpar@0:     { " " }
alpar@0:   if$
alpar@0:   swap$ * *
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {either.or.check}
alpar@0: { empty$
alpar@0:     'pop$
alpar@0:     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.bvolume}
alpar@0: { volume empty$
alpar@0:     { "" }
alpar@0:     { bbl.volume volume tie.or.space.connect
alpar@0:       series empty$
alpar@0:         'skip$
alpar@0:         { bbl.of space.word * series emphasize * }
alpar@0:       if$
alpar@0:       "volume and number" number either.or.check
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.number.series}
alpar@0: { volume empty$
alpar@0:     { number empty$
alpar@0:         { series field.or.null }
alpar@0:         { output.state mid.sentence =
alpar@0:             { bbl.number }
alpar@0:             { bbl.number capitalize }
alpar@0:           if$
alpar@0:           number tie.or.space.connect
alpar@0:           series empty$
alpar@0:             { "there's a number but no series in " cite$ * warning$ }
alpar@0:             { bbl.in space.word * series * }
alpar@0:           if$
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:     { "" }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {is.num}
alpar@0: { chr.to.int$
alpar@0:   duplicate$ "0" chr.to.int$ < not
alpar@0:   swap$ "9" chr.to.int$ > not and
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {extract.num}
alpar@0: { duplicate$ 't :=
alpar@0:   "" 's :=
alpar@0:   { t empty$ not }
alpar@0:   { t #1 #1 substring$
alpar@0:     t #2 global.max$ substring$ 't :=
alpar@0:     duplicate$ is.num
alpar@0:       { s swap$ * 's := }
alpar@0:       { pop$ "" 't := }
alpar@0:     if$
alpar@0:   }
alpar@0:   while$
alpar@0:   s empty$
alpar@0:     'skip$
alpar@0:     { pop$ s }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {convert.edition}
alpar@0: { edition extract.num "l" change.case$ 's :=
alpar@0:   s "first" = s "1" = or
alpar@0:     { bbl.first 't := }
alpar@0:     { s "second" = s "2" = or
alpar@0:         { bbl.second 't := }
alpar@0:         { s "third" = s "3" = or
alpar@0:             { bbl.third 't := }
alpar@0:             { s "fourth" = s "4" = or
alpar@0:                 { bbl.fourth 't := }
alpar@0:                 { s "fifth" = s "5" = or
alpar@0:                     { bbl.fifth 't := }
alpar@0:                     { s #1 #1 substring$ is.num
alpar@0:                         { s eng.ord 't := }
alpar@0:                         { edition 't := }
alpar@0:                       if$
alpar@0:                     }
alpar@0:                   if$
alpar@0:                 }
alpar@0:               if$
alpar@0:             }
alpar@0:           if$
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0:   t
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.edition}
alpar@0: { edition empty$
alpar@0:     { "" }
alpar@0:     { output.state mid.sentence =
alpar@0:         { convert.edition "l" change.case$ " " * bbl.edition * }
alpar@0:         { convert.edition "t" change.case$ " " * bbl.edition * }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: INTEGERS { multiresult }
alpar@0: 
alpar@0: FUNCTION {multi.page.check}
alpar@0: { 't :=
alpar@0:   #0 'multiresult :=
alpar@0:     { multiresult not
alpar@0:       t empty$ not
alpar@0:       and
alpar@0:     }
alpar@0:     { t #1 #1 substring$
alpar@0:       duplicate$ "-" =
alpar@0:       swap$ duplicate$ "," =
alpar@0:       swap$ "+" =
alpar@0:       or or
alpar@0:         { #1 'multiresult := }
alpar@0:         { t #2 global.max$ substring$ 't := }
alpar@0:       if$
alpar@0:     }
alpar@0:   while$
alpar@0:   multiresult
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.pages}
alpar@0: { pages empty$
alpar@0:     { "" }
alpar@0:     { pages multi.page.check
alpar@0:         { bbl.pages pages n.dashify tie.or.space.connect }
alpar@0:         { bbl.page pages tie.or.space.connect }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.journal.pages}
alpar@0: { pages empty$
alpar@0:     'skip$
alpar@0:     { duplicate$ empty$
alpar@0:         { pop$ format.pages }
alpar@0:         {
alpar@0:           " " *
alpar@0:           format.year * " " *
alpar@0:           pages n.dashify *
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.vol.num.pages}
alpar@0: {
alpar@0:   % volume field.or.null
alpar@0:   " "
alpar@0:   volume empty$
alpar@0:     { pop$ "" }
alpar@0:     { volume * }
alpar@0:   if$
alpar@0:   number empty$
alpar@0:     'skip$
alpar@0:     {
alpar@0:       "~(" number * ")" * *
alpar@0:       volume empty$
alpar@0:         { "there's a number but no volume in " cite$ * warning$ }
alpar@0:         'skip$
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.chapter.pages}
alpar@0: { chapter empty$
alpar@0:     { "" }
alpar@0:     { type empty$
alpar@0:         { bbl.chapter }
alpar@0:         { type "l" change.case$ }
alpar@0:       if$
alpar@0:       chapter tie.or.space.connect
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.in.ed.booktitle}
alpar@0: { booktitle empty$
alpar@0:     { "" }
alpar@0:     { editor empty$
alpar@0:         { word.in booktitle * }
alpar@0:         { word.in format.in.editors * ", " *
alpar@0:           booktitle * }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {empty.misc.check}
alpar@0: { author empty$ title empty$ howpublished empty$
alpar@0:   month empty$ year empty$ note empty$
alpar@0:   and and and and and
alpar@0:     { "all relevant fields are empty in " cite$ * warning$ }
alpar@0:     'skip$
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.thesis.type}
alpar@0: { type empty$
alpar@0:     'skip$
alpar@0:     { pop$
alpar@0:       type "t" change.case$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.tr.number}
alpar@0: { type empty$
alpar@0:     { bbl.techrep }
alpar@0:     'type
alpar@0:   if$
alpar@0:   number empty$
alpar@0:     { "t" change.case$ }
alpar@0:     { number tie.or.space.connect }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.article.crossref}
alpar@0: {
alpar@0:   key empty$
alpar@0:     { journal empty$
alpar@0:         { "need key or journal for " cite$ * " to crossref " * crossref *
alpar@0:           warning$
alpar@0:           ""
alpar@0:         }
alpar@0:         { word.in journal emphasize * }
alpar@0:       if$
alpar@0:     }
alpar@0:     { word.in key * " " *}
alpar@0:   if$
alpar@0:   " \cite{" * crossref * "}" *
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.crossref.editor}
alpar@0: { editor #1 "{vv~}{ll}" format.name$
alpar@0:   editor num.names$ duplicate$
alpar@0:   #2 >
alpar@0:     { pop$
alpar@0:       " " * bbl.etal *
alpar@0:     }
alpar@0:     { #2 <
alpar@0:         'skip$
alpar@0:         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
alpar@0:             {
alpar@0:               " " * bbl.etal *
alpar@0:             }
alpar@0:             { bbl.and space.word * editor #2 "{vv~}{ll}" format.name$
alpar@0:               * }
alpar@0:           if$
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.book.crossref}
alpar@0: { volume empty$
alpar@0:     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
alpar@0:       word.in
alpar@0:     }
alpar@0:     { bbl.volume volume tie.or.space.connect
alpar@0:       bbl.of space.word *
alpar@0:     }
alpar@0:   if$
alpar@0:   editor empty$
alpar@0:   editor field.or.null author field.or.null =
alpar@0:   or
alpar@0:     { key empty$
alpar@0:         { series empty$
alpar@0:             { "need editor, key, or series for " cite$ * " to crossref " *
alpar@0:               crossref * warning$
alpar@0:               "" *
alpar@0:             }
alpar@0:             { series emphasize * }
alpar@0:           if$
alpar@0:         }
alpar@0:         { key * }
alpar@0:       if$
alpar@0:     }
alpar@0:     { format.crossref.editor * }
alpar@0:   if$
alpar@0:   " \cite{" * crossref * "}" *
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.incoll.inproc.crossref}
alpar@0: {
alpar@0:   editor empty$
alpar@0:   editor field.or.null author field.or.null =
alpar@0:   or
alpar@0:     { key empty$
alpar@0:         { booktitle empty$
alpar@0:             { "need editor, key, or booktitle for " cite$ * " to crossref " *
alpar@0:               crossref * warning$
alpar@0:               ""
alpar@0:             }
alpar@0:             { word.in booktitle * }
alpar@0:           if$
alpar@0:         }
alpar@0:         { word.in key * " " *}
alpar@0:       if$
alpar@0:     }
alpar@0:     { word.in format.crossref.editor * " " *}
alpar@0:   if$
alpar@0:   " \cite{" * crossref * "}" *
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.org.or.pub}
alpar@0: { 't :=
alpar@0:   ""
alpar@0:   year empty$
alpar@0:     { "empty year in " cite$ * warning$ }
alpar@0:     'skip$
alpar@0:   if$
alpar@0:   address empty$ t empty$ and
alpar@0:   year empty$ and
alpar@0:     'skip$
alpar@0:     {
alpar@0:       t empty$
alpar@0:         { address empty$
alpar@0:           'skip$
alpar@0:           { address * }
alpar@0:           if$
alpar@0:         }
alpar@0:         { t *
alpar@0:           address empty$
alpar@0:             'skip$
alpar@0:             { ", " * address * }
alpar@0:           if$
alpar@0:         }
alpar@0:       if$
alpar@0:       year empty$
alpar@0:         'skip$
alpar@0:         { t empty$ address empty$ and
alpar@0:             'skip$
alpar@0:             { ", " * }
alpar@0:           if$
alpar@0:           year *
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.publisher.address}
alpar@0: { publisher empty$
alpar@0:     { "empty publisher in " cite$ * warning$
alpar@0:       ""
alpar@0:     }
alpar@0:     { publisher }
alpar@0:   if$
alpar@0:   format.org.or.pub
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.organization.address}
alpar@0: { organization empty$
alpar@0:     { "" }
alpar@0:     { organization }
alpar@0:   if$
alpar@0:   format.org.or.pub
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {make.href.null}
alpar@0: {
alpar@0:   pop$
alpar@0: }
alpar@0: FUNCTION {make.href.hypertex}
alpar@0: {
alpar@0:   "\special {html:<a href=" quote$ *
alpar@0:   swap$ * quote$ * "> }" * swap$ *
alpar@0:   "\special {html:</a>}" *
alpar@0: }
alpar@0: FUNCTION {make.href.hyperref}
alpar@0: {
alpar@0:   "\href {" swap$ * "} {\path{" * swap$ * "}}" *
alpar@0: }
alpar@0: FUNCTION {make.href}
alpar@0: { hrefform #2 =
alpar@0:     'make.href.hyperref      % hrefform = 2
alpar@0:     { hrefform #1 =
alpar@0:         'make.href.hypertex  % hrefform = 1
alpar@0:         'make.href.null      % hrefform = 0 (or anything else)
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.url}
alpar@0: { inlinelinks #1 = url empty$ or
alpar@0:    { "" }
alpar@0:    { hrefform #1 =
alpar@0:        { % special case -- add HyperTeX specials
alpar@0:          urlintro "\url{" url * "}" * url make.href.hypertex * }
alpar@0:        { urlintro "\url{" * url * "}" * }
alpar@0:      if$
alpar@0:    }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.eprint}
alpar@0: { eprint empty$
alpar@0:     { "" }
alpar@0:     { eprintprefix eprint * eprinturl eprint * make.href }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {format.doi}
alpar@0: { doi empty$
alpar@0:     { "" }
alpar@0:     { doiprefix doi * doiurl doi * make.href }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output.url}
alpar@0: { url empty$
alpar@0:     'skip$
alpar@0:     { new.block
alpar@0:       format.url output
alpar@0:       format.lastchecked output
alpar@0:     }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output.web.refs}
alpar@0: {
alpar@0:   new.block
alpar@0:   output.url
alpar@0:   addeprints eprint empty$ not and
alpar@0:     { format.eprint output.nonnull }
alpar@0:     'skip$
alpar@0:   if$
alpar@0:   adddoiresolver doi empty$ not and
alpar@0:     { format.doi output.nonnull }
alpar@0:     'skip$
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {output.bibitem}
alpar@0: { outside.brackets 'bracket.state :=
alpar@0:   output.bibitem.original
alpar@0:   inlinelinks url empty$ not and
alpar@0:     { #1 'makeinlinelink := }
alpar@0:     { #0 'makeinlinelink := }
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {fin.entry}
alpar@0: { output.web.refs  % urlbst
alpar@0:   makeinlinelink       % ooops, it appears we didn't have a title for inlinelink
alpar@0:     { setup.inlinelink % add some artificial link text here, as a fallback
alpar@0:       "[link]" output.nonnull }
alpar@0:     'skip$
alpar@0:   if$
alpar@0:   bracket.state close.brackets = % urlbst
alpar@0:     { "]" * }
alpar@0:     'skip$
alpar@0:   if$
alpar@0:   fin.entry.original
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {webpage}
alpar@0: { output.bibitem
alpar@0:   author empty$
alpar@0:     { editor empty$
alpar@0:         'skip$  % author and editor both optional
alpar@0:         { format.editors output.nonnull }
alpar@0:       if$
alpar@0:     }
alpar@0:     { editor empty$
alpar@0:         { format.authors output.nonnull }
alpar@0:         { "can't use both author and editor fields in " cite$ * warning$ }
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0:   new.block
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$
alpar@0:   format.title "title" output.check
alpar@0:   inbrackets "online" output
alpar@0:   new.block
alpar@0:   year empty$
alpar@0:     'skip$
alpar@0:     { format.date "year" output.check }
alpar@0:   if$
alpar@0:   % We don't need to output the URL details ('lastchecked' and 'url'),
alpar@0:   % because fin.entry does that for us, using output.web.refs.  The only
alpar@0:   % reason we would want to put them here is if we were to decide that
alpar@0:   % they should go in front of the rather miscellaneous information in 'note'.
alpar@0:   new.block
alpar@0:   note output
alpar@0:   fin.entry
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {article}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   crossref missing$
alpar@0:     { journal
alpar@0:       "journal" output.check
alpar@0:       % add.blank
alpar@0:   before.all 'output.state :=
alpar@0:       format.vol.num.pages output
alpar@0:     }
alpar@0:     { format.article.crossref output.nonnull
alpar@0:       format.pages output
alpar@0:     }
alpar@0:   if$
alpar@0:   format.journal.pages
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {book}
alpar@0: { output.bibitem
alpar@0:   author empty$
alpar@0:     { format.editors "author and editor" output.check
alpar@0:     }
alpar@0:     { format.authors output.nonnull
alpar@0:       crossref missing$
alpar@0:         { "author and editor" editor either.or.check }
alpar@0:         'skip$
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.btitle "title" output.check
alpar@0:   crossref missing$
alpar@0:     { format.edition output
alpar@0:       format.bvolume output
alpar@0:       format.number.series output
alpar@0:       format.publisher.address output
alpar@0:     }
alpar@0:     {
alpar@0:       format.book.crossref output.nonnull
alpar@0:     }
alpar@0:   if$
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {booklet}
alpar@0: { output.bibitem
alpar@0:   format.authors output
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   howpublished output
alpar@0:   address output
alpar@0:   format.note output
alpar@0:   format.date output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {inbook}
alpar@0: { output.bibitem
alpar@0:   author empty$
alpar@0:     { format.editors "author and editor" output.check
alpar@0:     }
alpar@0:     { format.authors output.nonnull
alpar@0:       crossref missing$
alpar@0:         { "author and editor" editor either.or.check }
alpar@0:         'skip$
alpar@0:       if$
alpar@0:     }
alpar@0:   if$
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.btitle "title" output.check
alpar@0:   crossref missing$
alpar@0:     {
alpar@0:       format.edition output
alpar@0:       format.bvolume output
alpar@0:       format.number.series output
alpar@0:       format.publisher.address output
alpar@0:       format.chapter.pages "chapter and pages" output.check
alpar@0:     }
alpar@0:     {
alpar@0:       format.chapter.pages "chapter and pages" output.check
alpar@0:       format.book.crossref output.nonnull
alpar@0:     }
alpar@0:   if$
alpar@0:   format.pages "pages" output.check
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {incollection}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   crossref missing$
alpar@0:     { format.in.ed.booktitle "booktitle" output.check
alpar@0:       format.edition output
alpar@0:       format.bvolume output
alpar@0:       format.number.series output
alpar@0:       format.publisher.address output
alpar@0:       format.chapter.pages output
alpar@0:     }
alpar@0:     { format.incoll.inproc.crossref output.nonnull
alpar@0:       format.chapter.pages output
alpar@0:     }
alpar@0:   if$
alpar@0:   format.pages "pages" output.check
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {inproceedings}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   crossref missing$
alpar@0:     { format.in.ed.booktitle "booktitle" output.check
alpar@0:       format.edition output
alpar@0:       format.bvolume output
alpar@0:       format.number.series output
alpar@0:       publisher empty$
alpar@0:         { format.organization.address output }
alpar@0:         { organization output
alpar@0:           format.publisher.address output
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:     { format.incoll.inproc.crossref output.nonnull
alpar@0:     }
alpar@0:   if$
alpar@0:   format.pages "pages" output.check
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {conference} { inproceedings }
alpar@0: 
alpar@0: FUNCTION {manual}
alpar@0: { output.bibitem
alpar@0:   author empty$
alpar@0:     { organization empty$
alpar@0:         'skip$
alpar@0:         { organization output.nonnull
alpar@0:           address output
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:     { format.authors output.nonnull }
alpar@0:   if$
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.btitle "title" output.check
alpar@0:   author empty$
alpar@0:     { organization empty$
alpar@0:     {
alpar@0:           address output
alpar@0:         }
alpar@0:         'skip$
alpar@0:       if$
alpar@0:     }
alpar@0:     {
alpar@0:       organization output
alpar@0:       address output
alpar@0:     }
alpar@0:   if$
alpar@0:   format.edition output
alpar@0:   format.note output
alpar@0:   format.date output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {mastersthesis}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   bbl.mthesis format.thesis.type output.nonnull
alpar@0:   school "school" output.check
alpar@0:   address output
alpar@0:   format.note output
alpar@0:   format.date "year" output.check
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {misc}
alpar@0: { output.bibitem
alpar@0:   format.authors output
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title output
alpar@0:   howpublished output
alpar@0:   format.note output
alpar@0:   format.date output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0:   empty.misc.check
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {phdthesis}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   bbl.phdthesis format.thesis.type output.nonnull
alpar@0:   school "school" output.check
alpar@0:   address output
alpar@0:   format.note output
alpar@0:   format.date "year" output.check
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {proceedings}
alpar@0: { output.bibitem
alpar@0:   editor empty$
alpar@0:     { organization output }
alpar@0:     { format.editors output.nonnull }
alpar@0:   if$
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.btitle "title" output.check
alpar@0:   format.bvolume output
alpar@0:   format.number.series output
alpar@0:   editor empty$
alpar@0:     { publisher empty$
alpar@0:         'skip$
alpar@0:         {
alpar@0:           format.publisher.address output
alpar@0:         }
alpar@0:       if$
alpar@0:     }
alpar@0:     { publisher empty$
alpar@0:         {
alpar@0:           format.organization.address output }
alpar@0:         {
alpar@0:           organization output
alpar@0:           format.publisher.address output
alpar@0:         }
alpar@0:       if$
alpar@0:      }
alpar@0:   if$
alpar@0:   format.note output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {techreport}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   format.tr.number output.nonnull
alpar@0:   institution "institution" output.check
alpar@0:   address output
alpar@0:   format.note output
alpar@0:   format.date "year" output.check
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {unpublished}
alpar@0: { output.bibitem
alpar@0:   format.authors "author" output.check
alpar@0:   title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
alpar@0:   format.title "title" output.check
alpar@0:   format.note "note" output.check
alpar@0:   format.date output
alpar@0:   fin.entry
alpar@0:   write.url
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {default.type} { misc }
alpar@0: 
alpar@0: READ
alpar@0: 
alpar@0: STRINGS { longest.label }
alpar@0: 
alpar@0: INTEGERS { number.label longest.label.width }
alpar@0: 
alpar@0: FUNCTION {initialize.longest.label}
alpar@0: { "" 'longest.label :=
alpar@0:   #1 'number.label :=
alpar@0:   #0 'longest.label.width :=
alpar@0: }
alpar@0: 
alpar@0: FUNCTION {longest.label.pass}
alpar@0: { number.label int.to.str$ 'label :=
alpar@0:   number.label #1 + 'number.label :=
alpar@0:   label width$ longest.label.width >
alpar@0:     { label 'longest.label :=
alpar@0:       label width$ 'longest.label.width :=
alpar@0:     }
alpar@0:     'skip$
alpar@0:   if$
alpar@0: }
alpar@0: 
alpar@0: EXECUTE {initialize.longest.label}
alpar@0: 
alpar@0: ITERATE {longest.label.pass}
alpar@0: 
alpar@0: FUNCTION {begin.bib}
alpar@0: { preamble$ empty$
alpar@0:     'skip$
alpar@0:     { preamble$ write$ newline$ }
alpar@0:   if$
alpar@0:   "\begin{thebibliography}{"  longest.label  * "}" *
alpar@0:   write$ newline$
alpar@0:   "\expandafter\ifx\csname url\endcsname\relax"
alpar@0:   write$ newline$
alpar@0:   "  \def\url#1{\texttt{#1}}\fi"
alpar@0:   write$ newline$
alpar@0:   "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
alpar@0:   write$ newline$
alpar@0:   "\expandafter\ifx\csname href\endcsname\relax"
alpar@0:   write$ newline$
alpar@0:   "  \def\href#1#2{#2} \def\path#1{#1}\fi"
alpar@0:   write$ newline$
alpar@0: }
alpar@0: 
alpar@0: EXECUTE {begin.bib}
alpar@0: 
alpar@0: EXECUTE {init.urlbst.variables}
alpar@0: EXECUTE {init.state.consts}
alpar@0: 
alpar@0: ITERATE {call.type$}
alpar@0: 
alpar@0: FUNCTION {end.bib}
alpar@0: { newline$
alpar@0:   "\end{thebibliography}" write$ newline$
alpar@0: }
alpar@0: 
alpar@0: EXECUTE {end.bib}
alpar@0: %% End of customized bst file
alpar@0: %%
alpar@0: %% End of file `elsarticle-num.bst'.




