2
%% This is file `elsarticle-num.bst',
3
%% generated with the docstrip utility.
5
%% The original source files were:
7
%% elsarticle.dtx (with options: `num')
9
%% Copyright 2007, 2008 Elsevier Ltd.
11
%% This file is part of the 'Elsarticle Bundle'.
12
%% -------------------------------------------
14
%% It may be distributed under the conditions of the LaTeX Project Public
15
%% License, either version 1.2 of this license or (at your option) any
16
%% later version. The latest version of this license is in
17
%% http://www.latex-project.org/lppl.txt
18
%% and version 1.2 or later is part of all distributions of LaTeX
19
%% version 1999/12/01 or later.
21
%% The list of all files belonging to the 'Elsarticle Bundle' is
22
%% given in the file `manifest.txt'.
24
%%% Modification of BibTeX style file elsarticle-num.bst
25
%%% ... by urlbst, version 0.6 (marked with "% urlbst")
26
%%% See <http://purl.org/nxg/dist/urlbst>
27
%%% Added webpage entry type, and url and lastchecked fields.
28
%%% Added eprint support.
29
%%% Added DOI support.
30
%%% Added hyperref support.
31
%%% Original headers follow...
34
%% This is file `elsarticle-num.bst',
35
%% generated with the docstrip utility.
37
%% The original source files were:
39
%% 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')
40
%% After docstrip generation some manual changes were made (SP)
42
%% ----------------------------------------
75
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
77
STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl openinlinelink closeinlinelink } % urlbst...
78
INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver }
79
FUNCTION {init.urlbst.variables}
81
"Available from: " 'urlintro := % prefix before URL
82
"http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
83
"arXiv:" 'eprintprefix := % text prefix printed before eprint ref
84
"http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
85
"doi:" 'doiprefix := % text prefix printed before DOI ref
86
#1 'addeprints := % 0=no eprints; 1=include eprints
87
#1 'adddoiresolver := % 0=no DOI resolver; 1=include it
88
#2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
89
#1 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles
90
% the following are internal state variables, not config constants
91
#0 'makeinlinelink := % state variable managed by setup.inlinelink
92
"" 'openinlinelink := % ditto
93
"" 'closeinlinelink := % ditto
102
FUNCTION {init.state.consts}
103
{ #0 'outside.brackets := % urlbst
105
#2 'within.brackets :=
106
#3 'close.brackets :=
110
#2 'after.sentence :=
116
FUNCTION {output.nonnull.original}
118
output.state mid.sentence =
120
{ output.state after.block =
125
{ output.state before.all =
127
{ add.period$ " " * write$ }
131
mid.sentence 'output.state :=
137
FUNCTION {setup.inlinelink}
139
{ hrefform #1 = % hypertex
140
{ "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
141
"\special {html:</a>}" 'closeinlinelink :=
143
{ hrefform #2 = % hyperref
144
{ "\href{" url * "}{" * 'openinlinelink :=
145
"}" 'closeinlinelink :=
151
#0 'makeinlinelink :=
156
FUNCTION {add.inlinelink}
157
{ openinlinelink empty$
159
{ openinlinelink swap$ * closeinlinelink *
160
"" 'openinlinelink :=
164
FUNCTION {output.nonnull}
165
{ % Save the thing we've been asked to output
167
% If the bracket-state is close.brackets, then add a close-bracket to
168
% what is currently at the top of the stack, and set bracket.state
169
% to outside.brackets
170
bracket.state close.brackets =
172
outside.brackets 'bracket.state :=
176
bracket.state outside.brackets =
177
{ % We're outside all brackets -- this is the normal situation.
178
% Write out what's currently at the top of the stack, using the
179
% original output.nonnull function.
182
output.nonnull.original % invoke the original output.nonnull
184
{ % Still in brackets. Add open-bracket or (continuation) comma, add the
185
% new text (in s) to the top of the stack, and move to the close-brackets
186
% state, ready for next time (unless inbrackets resets it). If we come
187
% into this branch, then output.state is carefully undisturbed.
188
bracket.state open.brackets =
190
{ ", " * } % bracket.state will be within.brackets
193
close.brackets 'bracket.state :=
198
FUNCTION {inbrackets}
199
{ bracket.state close.brackets =
200
{ within.brackets 'bracket.state := } % reset the state: not open nor closed
201
{ open.brackets 'bracket.state := }
205
FUNCTION {format.lastchecked}
208
{ inbrackets "cited " lastchecked * }
219
FUNCTION {output.check}
222
{ pop$ "empty " t * " in " * cite$ * warning$ }
227
FUNCTION {fin.entry.original}
234
{ output.state before.all =
236
{ after.block 'output.state := }
240
FUNCTION {new.sentence}
241
{ output.state after.block =
243
{ output.state before.all =
245
{ after.sentence 'output.state := }
252
{ " " * before.all 'output.state :=
255
FUNCTION {date.block}
278
FUNCTION {new.block.checka}
285
FUNCTION {new.block.checkb}
294
FUNCTION {new.sentence.checka}
301
FUNCTION {new.sentence.checkb}
310
FUNCTION {field.or.null}
320
FUNCTION {capitalize}
321
{ "u" change.case$ "t" change.case$ }
323
FUNCTION {space.word}
324
{ " " swap$ * " " * }
326
% Here are the language-specific definitions for explicit words.
327
% Each function has a name bbl.xxx where xxx is the English word.
328
% The language selected here is ENGLISH
335
FUNCTION {bbl.editors}
338
FUNCTION {bbl.editor}
344
FUNCTION {bbl.edition}
347
FUNCTION {bbl.volume}
353
FUNCTION {bbl.number}
368
FUNCTION {bbl.chapter}
371
FUNCTION {bbl.techrep}
374
FUNCTION {bbl.mthesis}
375
{ "Master's thesis" }
377
FUNCTION {bbl.phdthesis}
383
FUNCTION {bbl.second}
389
FUNCTION {bbl.fourth}
432
{ duplicate$ "1" swap$ *
433
#-2 #1 substring$ "1" =
435
{ duplicate$ #-1 #1 substring$
452
MACRO {acmcs} {"ACM Comput. Surv."}
454
MACRO {acta} {"Acta Inf."}
456
MACRO {cacm} {"Commun. ACM"}
458
MACRO {ibmjrd} {"IBM J. Res. Dev."}
460
MACRO {ibmsj} {"IBM Syst.~J."}
462
MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
464
MACRO {ieeetc} {"IEEE Trans. Comput."}
467
{"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
469
MACRO {ipl} {"Inf. Process. Lett."}
471
MACRO {jacm} {"J.~ACM"}
473
MACRO {jcss} {"J.~Comput. Syst. Sci."}
475
MACRO {scp} {"Sci. Comput. Programming"}
477
MACRO {sicomp} {"SIAM J. Comput."}
479
MACRO {tocs} {"ACM Trans. Comput. Syst."}
481
MACRO {tods} {"ACM Trans. Database Syst."}
483
MACRO {tog} {"ACM Trans. Gr."}
485
MACRO {toms} {"ACM Trans. Math. Softw."}
487
MACRO {toois} {"ACM Trans. Office Inf. Syst."}
489
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
491
MACRO {tcs} {"Theoretical Comput. Sci."}
496
{ "\newline\urlprefix\url{" url * "}" * write$ newline$ }
500
INTEGERS { nameptr namesleft numnames }
502
FUNCTION {format.names}
505
s num.names$ 'numnames :=
506
numnames 'namesleft :=
509
"{f.~}{vv~}{ll}{, jj}" format.name$
517
s nameptr "{ll}" format.name$ duplicate$ "others" =
532
nameptr #1 + 'nameptr :=
533
namesleft #1 - 'namesleft :=
537
FUNCTION {format.names.ed}
539
FUNCTION {format.authors}
542
{ author format.names }
546
FUNCTION {format.editors}
549
{ editor format.names
550
editor num.names$ #1 >
551
{ " (" * bbl.editors * ")" * }
552
{ " (" * bbl.editor * ")" * }
558
FUNCTION {format.in.editors}
561
{ editor format.names.ed
562
editor num.names$ #1 >
563
{ " (" * bbl.editors * ")" * }
564
{ " (" * bbl.editor * ")" * }
570
FUNCTION {format.note}
574
{ note #1 #1 substring$
577
{ output.state mid.sentence =
584
note #2 global.max$ substring$ *
589
FUNCTION {format.title}
592
{ title "t" change.case$
597
FUNCTION {output.bibitem.original}
604
before.all 'output.state :=
612
{ t #1 #1 substring$ "-" =
613
{ t #1 #2 substring$ "--" = not
615
t #2 global.max$ substring$ 't :=
617
{ { t #1 #1 substring$ "-" = }
619
t #2 global.max$ substring$ 't :=
625
{ t #1 #1 substring$ *
626
t #2 global.max$ substring$ 't :=
638
FUNCTION {format.date}
642
{ "there's a month but no year in " cite$ * warning$
649
{ month " " * year * }
656
before.all 'output.state :=
662
FUNCTION{format.year}
663
{ year duplicate$ empty$
664
{ "empty year in " cite$ * warning$ pop$ "" }
665
{ "(" swap$ * ")" * }
669
FUNCTION {format.btitle}
673
FUNCTION {tie.or.space.connect}
674
{ duplicate$ text.length$ #3 <
681
FUNCTION {either.or.check}
684
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
688
FUNCTION {format.bvolume}
691
{ bbl.volume volume tie.or.space.connect
694
{ bbl.of space.word * series emphasize * }
696
"volume and number" number either.or.check
701
FUNCTION {format.number.series}
704
{ series field.or.null }
705
{ output.state mid.sentence =
707
{ bbl.number capitalize }
709
number tie.or.space.connect
711
{ "there's a number but no series in " cite$ * warning$ }
712
{ bbl.in space.word * series * }
723
duplicate$ "0" chr.to.int$ < not
724
swap$ "9" chr.to.int$ > not and
727
FUNCTION {extract.num}
732
t #2 global.max$ substring$ 't :=
745
FUNCTION {convert.edition}
746
{ edition extract.num "l" change.case$ 's :=
747
s "first" = s "1" = or
749
{ s "second" = s "2" = or
751
{ s "third" = s "3" = or
753
{ s "fourth" = s "4" = or
755
{ s "fifth" = s "5" = or
757
{ s #1 #1 substring$ is.num
774
FUNCTION {format.edition}
777
{ output.state mid.sentence =
778
{ convert.edition "l" change.case$ " " * bbl.edition * }
779
{ convert.edition "t" change.case$ " " * bbl.edition * }
785
INTEGERS { multiresult }
787
FUNCTION {multi.page.check}
796
swap$ duplicate$ "," =
799
{ #1 'multiresult := }
800
{ t #2 global.max$ substring$ 't := }
807
FUNCTION {format.pages}
810
{ pages multi.page.check
811
{ bbl.pages pages n.dashify tie.or.space.connect }
812
{ bbl.page pages tie.or.space.connect }
818
FUNCTION {format.journal.pages}
822
{ pop$ format.pages }
833
FUNCTION {format.vol.num.pages}
835
% volume field.or.null
844
"~(" number * ")" * *
846
{ "there's a number but no volume in " cite$ * warning$ }
853
FUNCTION {format.chapter.pages}
858
{ type "l" change.case$ }
860
chapter tie.or.space.connect
865
FUNCTION {format.in.ed.booktitle}
869
{ word.in booktitle * }
870
{ word.in format.in.editors * ", " *
877
FUNCTION {empty.misc.check}
878
{ author empty$ title empty$ howpublished empty$
879
month empty$ year empty$ note empty$
881
{ "all relevant fields are empty in " cite$ * warning$ }
886
FUNCTION {format.thesis.type}
890
type "t" change.case$
895
FUNCTION {format.tr.number}
902
{ number tie.or.space.connect }
906
FUNCTION {format.article.crossref}
910
{ "need key or journal for " cite$ * " to crossref " * crossref *
914
{ word.in journal emphasize * }
917
{ word.in key * " " *}
919
" \cite{" * crossref * "}" *
922
FUNCTION {format.crossref.editor}
923
{ editor #1 "{vv~}{ll}" format.name$
924
editor num.names$ duplicate$
931
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
935
{ bbl.and space.word * editor #2 "{vv~}{ll}" format.name$
944
FUNCTION {format.book.crossref}
946
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
949
{ bbl.volume volume tie.or.space.connect
954
editor field.or.null author field.or.null =
958
{ "need editor, key, or series for " cite$ * " to crossref " *
962
{ series emphasize * }
968
{ format.crossref.editor * }
970
" \cite{" * crossref * "}" *
973
FUNCTION {format.incoll.inproc.crossref}
976
editor field.or.null author field.or.null =
980
{ "need editor, key, or booktitle for " cite$ * " to crossref " *
984
{ word.in booktitle * }
987
{ word.in key * " " *}
990
{ word.in format.crossref.editor * " " *}
992
" \cite{" * crossref * "}" *
995
FUNCTION {format.org.or.pub}
999
{ "empty year in " cite$ * warning$ }
1002
address empty$ t empty$ and
1015
{ ", " * address * }
1021
{ t empty$ address empty$ and
1032
FUNCTION {format.publisher.address}
1034
{ "empty publisher in " cite$ * warning$
1042
FUNCTION {format.organization.address}
1043
{ organization empty$
1050
FUNCTION {make.href.null}
1054
FUNCTION {make.href.hypertex}
1056
"\special {html:<a href=" quote$ *
1057
swap$ * quote$ * "> }" * swap$ *
1058
"\special {html:</a>}" *
1060
FUNCTION {make.href.hyperref}
1062
"\href {" swap$ * "} {\path{" * swap$ * "}}" *
1064
FUNCTION {make.href}
1066
'make.href.hyperref % hrefform = 2
1068
'make.href.hypertex % hrefform = 1
1069
'make.href.null % hrefform = 0 (or anything else)
1075
FUNCTION {format.url}
1076
{ inlinelinks #1 = url empty$ or
1079
{ % special case -- add HyperTeX specials
1080
urlintro "\url{" url * "}" * url make.href.hypertex * }
1081
{ urlintro "\url{" * url * "}" * }
1087
FUNCTION {format.eprint}
1090
{ eprintprefix eprint * eprinturl eprint * make.href }
1094
FUNCTION {format.doi}
1097
{ doiprefix doi * doiurl doi * make.href }
1101
FUNCTION {output.url}
1106
format.lastchecked output
1111
FUNCTION {output.web.refs}
1115
addeprints eprint empty$ not and
1116
{ format.eprint output.nonnull }
1119
adddoiresolver doi empty$ not and
1120
{ format.doi output.nonnull }
1125
FUNCTION {output.bibitem}
1126
{ outside.brackets 'bracket.state :=
1127
output.bibitem.original
1128
inlinelinks url empty$ not and
1129
{ #1 'makeinlinelink := }
1130
{ #0 'makeinlinelink := }
1134
FUNCTION {fin.entry}
1135
{ output.web.refs % urlbst
1136
makeinlinelink % ooops, it appears we didn't have a title for inlinelink
1137
{ setup.inlinelink % add some artificial link text here, as a fallback
1138
"[link]" output.nonnull }
1141
bracket.state close.brackets = % urlbst
1152
'skip$ % author and editor both optional
1153
{ format.editors output.nonnull }
1157
{ format.authors output.nonnull }
1158
{ "can't use both author and editor fields in " cite$ * warning$ }
1163
title empty$ 'skip$ 'setup.inlinelink if$
1164
format.title "title" output.check
1165
inbrackets "online" output
1169
{ format.date "year" output.check }
1171
% We don't need to output the URL details ('lastchecked' and 'url'),
1172
% because fin.entry does that for us, using output.web.refs. The only
1173
% reason we would want to put them here is if we were to decide that
1174
% they should go in front of the rather miscellaneous information in 'note'.
1182
format.authors "author" output.check
1183
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1184
format.title "title" output.check
1187
"journal" output.check
1189
before.all 'output.state :=
1190
format.vol.num.pages output
1192
{ format.article.crossref output.nonnull
1196
format.journal.pages
1205
{ format.editors "author and editor" output.check
1207
{ format.authors output.nonnull
1209
{ "author and editor" editor either.or.check }
1214
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1215
format.btitle "title" output.check
1217
{ format.edition output
1218
format.bvolume output
1219
format.number.series output
1220
format.publisher.address output
1223
format.book.crossref output.nonnull
1233
format.authors output
1234
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1235
format.title "title" output.check
1247
{ format.editors "author and editor" output.check
1249
{ format.authors output.nonnull
1251
{ "author and editor" editor either.or.check }
1256
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1257
format.btitle "title" output.check
1260
format.edition output
1261
format.bvolume output
1262
format.number.series output
1263
format.publisher.address output
1264
format.chapter.pages "chapter and pages" output.check
1267
format.chapter.pages "chapter and pages" output.check
1268
format.book.crossref output.nonnull
1271
format.pages "pages" output.check
1277
FUNCTION {incollection}
1279
format.authors "author" output.check
1280
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1281
format.title "title" output.check
1283
{ format.in.ed.booktitle "booktitle" output.check
1284
format.edition output
1285
format.bvolume output
1286
format.number.series output
1287
format.publisher.address output
1288
format.chapter.pages output
1290
{ format.incoll.inproc.crossref output.nonnull
1291
format.chapter.pages output
1294
format.pages "pages" output.check
1300
FUNCTION {inproceedings}
1302
format.authors "author" output.check
1303
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1304
format.title "title" output.check
1306
{ format.in.ed.booktitle "booktitle" output.check
1307
format.edition output
1308
format.bvolume output
1309
format.number.series output
1311
{ format.organization.address output }
1312
{ organization output
1313
format.publisher.address output
1317
{ format.incoll.inproc.crossref output.nonnull
1320
format.pages "pages" output.check
1326
FUNCTION {conference} { inproceedings }
1331
{ organization empty$
1333
{ organization output.nonnull
1338
{ format.authors output.nonnull }
1340
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1341
format.btitle "title" output.check
1343
{ organization empty$
1355
format.edition output
1362
FUNCTION {mastersthesis}
1364
format.authors "author" output.check
1365
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1366
format.title "title" output.check
1367
bbl.mthesis format.thesis.type output.nonnull
1368
school "school" output.check
1371
format.date "year" output.check
1378
format.authors output
1379
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1389
FUNCTION {phdthesis}
1391
format.authors "author" output.check
1392
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1393
format.title "title" output.check
1394
bbl.phdthesis format.thesis.type output.nonnull
1395
school "school" output.check
1398
format.date "year" output.check
1403
FUNCTION {proceedings}
1406
{ organization output }
1407
{ format.editors output.nonnull }
1409
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1410
format.btitle "title" output.check
1411
format.bvolume output
1412
format.number.series output
1417
format.publisher.address output
1423
format.organization.address output }
1426
format.publisher.address output
1436
FUNCTION {techreport}
1438
format.authors "author" output.check
1439
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1440
format.title "title" output.check
1441
format.tr.number output.nonnull
1442
institution "institution" output.check
1445
format.date "year" output.check
1450
FUNCTION {unpublished}
1452
format.authors "author" output.check
1453
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1454
format.title "title" output.check
1455
format.note "note" output.check
1461
FUNCTION {default.type} { misc }
1465
STRINGS { longest.label }
1467
INTEGERS { number.label longest.label.width }
1469
FUNCTION {initialize.longest.label}
1470
{ "" 'longest.label :=
1472
#0 'longest.label.width :=
1475
FUNCTION {longest.label.pass}
1476
{ number.label int.to.str$ 'label :=
1477
number.label #1 + 'number.label :=
1478
label width$ longest.label.width >
1479
{ label 'longest.label :=
1480
label width$ 'longest.label.width :=
1486
EXECUTE {initialize.longest.label}
1488
ITERATE {longest.label.pass}
1490
FUNCTION {begin.bib}
1493
{ preamble$ write$ newline$ }
1495
"\begin{thebibliography}{" longest.label * "}" *
1497
"\expandafter\ifx\csname url\endcsname\relax"
1499
" \def\url#1{\texttt{#1}}\fi"
1501
"\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
1503
"\expandafter\ifx\csname href\endcsname\relax"
1505
" \def\href#1#2{#2} \def\path#1{#1}\fi"
1511
EXECUTE {init.urlbst.variables}
1512
EXECUTE {init.state.consts}
1514
ITERATE {call.type$}
1518
"\end{thebibliography}" write$ newline$
1522
%% End of customized bst file
1524
%% End of file `elsarticle-num.bst'.