2 %% Copyright 2007, 2008, 2009 Elsevier Ltd
4 %% This file is part of the 'Elsarticle Bundle'.
5 %% ---------------------------------------------
7 %% It may be distributed under the conditions of the LaTeX Project Public
8 %% License, either version 1.2 of this license or (at your option) any
9 %% later version. The latest version of this license is in
10 %% http://www.latex-project.org/lppl.txt
11 %% and version 1.2 or later is part of all distributions of LaTeX
12 %% version 1999/12/01 or later.
14 %% The list of all files belonging to the 'Elsarticle Bundle' is
15 %% given in the file `manifest.txt'.
18 %%-------------------------------------------------------------------
19 %% This bibliography style file is intended for texts in ENGLISH
20 %% This is an author-year citation style bibliography. As such, it is
21 %% non-standard LaTeX, and requires a special package file
22 %% to function properly.
23 %% Such a package is natbib.sty by Patrick W. Daly
24 %% The form of the \bibitem entries is
25 %% \bibitem[Jones et al.(1990)]{key}...
26 %% \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
27 %% The essential feature is that the label (the part in brackets) consists
28 %% of the author names, as they should appear in the citation, with the year
29 %% in parentheses following. There must be no space before the opening
31 %% With natbib v5.3, a full list of authors may also follow the year.
32 %% In natbib.sty, it is possible to define the type of enclosures that is
33 %% really wanted (brackets or parentheses), but in either case, there must
34 %% be parentheses in the label.
35 %% The \cite command functions as follows:
36 %% \citet{key} ==>> Jones et al. (1990)
37 %% \citet*{key} ==>> Jones, Baker, and Smith (1990)
38 %% \citep{key} ==>> (Jones et al., 1990)
39 %% \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
40 %% \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
41 %% \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
42 %% \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32)
43 %% \citeauthor{key} ==>> Jones et al.
44 %% \citeauthor*{key} ==>> Jones, Baker, and Smith
45 %% \citeyear{key} ==>> 1990
46 %%---------------------------------------------------------------------
74 { label extra.label sort.label short.list }
76 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
78 FUNCTION {init.state.consts}
87 FUNCTION {output.nonnull}
89 output.state mid.sentence =
91 { output.state after.block =
96 { output.state before.all =
98 { add.period$ " " * write$ }
102 mid.sentence 'output.state :=
115 FUNCTION {output.check}
118 { pop$ "empty " t * " in " * cite$ * warning$ }
130 { output.state before.all =
132 { after.block 'output.state := }
136 FUNCTION {new.sentence}
137 { output.state after.block =
139 { output.state before.all =
141 { after.sentence 'output.state := }
150 { " " * before.all 'output.state :=
153 FUNCTION {date.block}
176 FUNCTION {new.block.checkb}
185 FUNCTION {field.or.null}
195 FUNCTION {capitalize}
196 { "u" change.case$ "t" change.case$ }
198 FUNCTION {space.word}
199 { " " swap$ * " " * }
201 %% Here are the language-specific definitions for explicit words.
202 %% Each function has a name bbl.xxx where xxx is the English word.
203 %% The language selected here is ENGLISH
210 FUNCTION {bbl.editors}
213 FUNCTION {bbl.editor}
219 FUNCTION {bbl.edition}
222 FUNCTION {bbl.volume}
228 FUNCTION {bbl.number}
243 FUNCTION {bbl.chapter}
246 FUNCTION {bbl.techrep}
249 FUNCTION {bbl.mthesis}
250 { "Master's thesis" }
252 FUNCTION {bbl.phdthesis}
258 FUNCTION {bbl.second}
264 FUNCTION {bbl.fourth}
307 { duplicate$ "1" swap$ *
308 #-2 #1 substring$ "1" =
310 { duplicate$ #-1 #1 substring$
327 MACRO {acmcs} {"ACM Comput. Surv."}
329 MACRO {acta} {"Acta Inf."}
331 MACRO {cacm} {"Commun. ACM"}
333 MACRO {ibmjrd} {"IBM J. Res. Dev."}
335 MACRO {ibmsj} {"IBM Syst.~J."}
337 MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
339 MACRO {ieeetc} {"IEEE Trans. Comput."}
342 {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
344 MACRO {ipl} {"Inf. Process. Lett."}
346 MACRO {jacm} {"J.~ACM"}
348 MACRO {jcss} {"J.~Comput. Syst. Sci."}
350 MACRO {scp} {"Sci. Comput. Programming"}
352 MACRO {sicomp} {"SIAM J. Comput."}
354 MACRO {tocs} {"ACM Trans. Comput. Syst."}
356 MACRO {tods} {"ACM Trans. Database Syst."}
358 MACRO {tog} {"ACM Trans. Gr."}
360 MACRO {toms} {"ACM Trans. Math. Softw."}
362 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
364 MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
366 MACRO {tcs} {"Theoretical Comput. Sci."}
371 { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
375 INTEGERS { nameptr namesleft numnames }
377 FUNCTION {format.names}
380 s num.names$ 'numnames :=
381 numnames 'namesleft :=
384 "{vv~}{ll}{, jj}{, f.}" format.name$
392 s nameptr "{ll}" format.name$ duplicate$ "others" =
407 nameptr #1 + 'nameptr :=
408 namesleft #1 - 'namesleft :=
412 FUNCTION {format.names.ed}
414 FUNCTION {format.key}
416 { key field.or.null }
421 FUNCTION {format.authors}
424 { author format.names }
428 FUNCTION {format.editors}
431 { editor format.names
432 editor num.names$ #1 >
433 { " (" * bbl.editors * ")" * }
434 { " (" * bbl.editor * ")" * }
440 FUNCTION {format.in.editors}
443 { editor format.names.ed
444 editor num.names$ #1 >
445 { " (" * bbl.editors * ")" * }
446 { " (" * bbl.editor * ")" * }
452 FUNCTION {format.note}
456 { note #1 #1 substring$
459 { output.state mid.sentence =
466 note #2 global.max$ substring$ *
471 FUNCTION {format.title}
474 { title "t" change.case$
479 FUNCTION {format.full.names}
482 s num.names$ 'numnames :=
483 numnames 'namesleft :=
486 "{vv~}{ll}" format.name$
497 s nameptr "{ll}" format.name$ duplicate$ "others" =
514 nameptr #1 + 'nameptr :=
515 namesleft #1 - 'namesleft :=
520 FUNCTION {author.editor.key.full}
524 { cite$ #1 #3 substring$ }
528 { editor format.full.names }
531 { author format.full.names }
535 FUNCTION {author.key.full}
538 { cite$ #1 #3 substring$ }
542 { author format.full.names }
546 FUNCTION {editor.key.full}
549 { cite$ #1 #3 substring$ }
553 { editor format.full.names }
557 FUNCTION {make.full.names}
561 'author.editor.key.full
562 { type$ "proceedings" =
570 FUNCTION {output.bibitem}
574 ")" make.full.names duplicate$ short.list =
583 before.all 'output.state :=
591 { t #1 #1 substring$ "-" =
592 { t #1 #2 substring$ "--" = not
594 t #2 global.max$ substring$ 't :=
596 { { t #1 #1 substring$ "-" = }
598 t #2 global.max$ substring$ 't :=
604 { t #1 #1 substring$ *
605 t #2 global.max$ substring$ 't :=
617 FUNCTION {format.date}
618 { year duplicate$ empty$
619 { "empty year in " cite$ * "; set to ????" * warning$
630 before.all 'output.state :=
634 FUNCTION {format.btitle}
638 FUNCTION {tie.or.space.connect}
639 { duplicate$ text.length$ #3 <
646 FUNCTION {either.or.check}
649 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
653 FUNCTION {format.bvolume}
656 { bbl.volume volume tie.or.space.connect
659 { bbl.of space.word * series emphasize * }
661 "volume and number" number either.or.check
666 FUNCTION {format.number.series}
669 { series field.or.null }
670 { output.state mid.sentence =
672 { bbl.number capitalize }
674 number tie.or.space.connect
676 { "there's a number but no series in " cite$ * warning$ }
677 { bbl.in space.word * series * }
688 duplicate$ "0" chr.to.int$ < not
689 swap$ "9" chr.to.int$ > not and
692 FUNCTION {extract.num}
697 t #2 global.max$ substring$ 't :=
710 FUNCTION {convert.edition}
711 { edition extract.num "l" change.case$ 's :=
712 s "first" = s "1" = or
714 { s "second" = s "2" = or
716 { s "third" = s "3" = or
718 { s "fourth" = s "4" = or
720 { s "fifth" = s "5" = or
722 { s #1 #1 substring$ is.num
739 FUNCTION {format.edition}
742 { output.state mid.sentence =
743 { convert.edition "l" change.case$ " " * bbl.edition * }
744 { convert.edition "t" change.case$ " " * bbl.edition * }
750 INTEGERS { multiresult }
752 FUNCTION {multi.page.check}
761 swap$ duplicate$ "," =
764 { #1 'multiresult := }
765 { t #2 global.max$ substring$ 't := }
772 FUNCTION {format.pages}
775 { pages multi.page.check
776 { bbl.pages pages n.dashify tie.or.space.connect }
777 { bbl.page pages tie.or.space.connect }
783 FUNCTION {format.journal.pages}
787 { pop$ format.pages }
798 %% Only used in articles
799 FUNCTION {format.vol.num.pages}
802 %% Add the leading space only if there is a volume
803 %% volume field.or.null
812 "~(" number * ")" * *
814 { "there's a number but no volume in " cite$ * warning$ }
821 FUNCTION {format.chapter.pages}
826 { type "l" change.case$ }
828 chapter tie.or.space.connect
833 FUNCTION {format.in.ed.booktitle}
837 { word.in booktitle * }
838 { word.in format.in.editors * ", " *
845 FUNCTION {format.thesis.type}
849 type "t" change.case$
854 FUNCTION {format.tr.number}
861 { number tie.or.space.connect }
865 FUNCTION {format.article.crossref}
868 " \cite{" * crossref * "}" *
871 FUNCTION {format.book.crossref}
873 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
876 { bbl.volume capitalize
877 volume tie.or.space.connect
881 " \cite{" * crossref * "}" *
884 FUNCTION {format.incoll.inproc.crossref}
887 " \cite{" * crossref * "}" *
890 FUNCTION {format.org.or.pub}
893 address empty$ t empty$ and
913 FUNCTION {format.publisher.address}
915 { "empty publisher in " cite$ * warning$
923 FUNCTION {format.organization.address}
924 { organization empty$
933 format.authors "author" output.check
934 author format.key output
935 format.date "year" output.check
937 format.title "title" output.check
941 "journal" output.check
943 %% Add the space in format.vol.num.pages
945 before.all 'output.state :=
946 format.vol.num.pages output
948 { format.article.crossref output.nonnull
961 { format.editors "author and editor" output.check
962 editor format.key output
964 { format.authors output.nonnull
966 { "author and editor" editor either.or.check }
971 format.date "year" output.check
973 format.btitle "title" output.check
975 { format.edition output
977 format.bvolume output
978 format.number.series output
980 format.publisher.address output
984 format.book.crossref output.nonnull
994 format.authors output
995 author format.key output
996 format.date "year" output.check
998 format.title "title" output.check
1010 { format.editors "author and editor" output.check
1011 editor format.key output
1013 { format.authors output.nonnull
1015 { "author and editor" editor either.or.check }
1020 format.date "year" output.check
1022 format.btitle "title" output.check
1025 format.edition output
1027 format.bvolume output
1028 format.number.series output
1030 format.publisher.address output
1031 format.chapter.pages "chapter and pages" output.check
1034 format.chapter.pages "chapter and pages" output.check
1036 format.book.crossref output.nonnull
1039 format.pages "pages" output.check
1045 FUNCTION {incollection}
1047 format.authors "author" output.check
1048 author format.key output
1049 format.date "year" output.check
1051 format.title "title" output.check
1054 { format.in.ed.booktitle "booktitle" output.check
1055 format.edition output
1057 format.bvolume output
1058 format.number.series output
1060 format.publisher.address output
1061 format.chapter.pages output
1063 { format.incoll.inproc.crossref output.nonnull
1064 format.chapter.pages output
1067 format.pages "pages" output.check
1073 FUNCTION {inproceedings}
1075 format.authors "author" output.check
1076 author format.key output
1077 format.date "year" output.check
1079 format.title "title" output.check
1082 { format.in.ed.booktitle "booktitle" output.check
1083 format.edition output
1085 format.bvolume output
1086 format.number.series output
1089 { format.organization.address output }
1090 { organization output
1091 format.publisher.address output
1095 %% format.pages output
1097 { format.incoll.inproc.crossref output.nonnull
1099 %% format.pages output
1103 format.pages "pages" output.check
1109 FUNCTION {conference} { inproceedings }
1113 format.authors output
1114 author format.key output
1115 format.date "year" output.check
1117 format.btitle "title" output.check
1121 format.edition output
1127 FUNCTION {mastersthesis}
1129 format.authors "author" output.check
1130 author format.key output
1131 format.date "year" output.check
1133 format.title "title" output.check
1135 bbl.mthesis format.thesis.type output.nonnull
1136 school "school" output.check
1145 format.authors output
1146 author format.key output
1147 format.date "year" output.check
1157 FUNCTION {phdthesis}
1159 format.authors "author" output.check
1160 author format.key output
1161 format.date "year" output.check
1163 format.title "title" output.check
1165 bbl.phdthesis format.thesis.type output.nonnull
1166 school "school" output.check
1173 FUNCTION {proceedings}
1175 format.editors output
1176 editor format.key output
1177 format.date "year" output.check
1179 format.btitle "title" output.check
1181 format.bvolume output
1182 format.number.series output
1185 { format.organization.address output }
1186 { organization output
1187 format.publisher.address output
1195 FUNCTION {techreport}
1197 format.authors "author" output.check
1198 author format.key output
1199 format.date "year" output.check
1201 format.title "title" output.check
1203 format.tr.number output.nonnull
1204 institution "institution" output.check
1211 FUNCTION {unpublished}
1213 format.authors "author" output.check
1214 author format.key output
1215 format.date "year" output.check
1217 format.title "title" output.check
1218 format.note "note" output.check
1223 FUNCTION {default.type} { misc }
1234 FUNCTION {chop.word}
1237 s #1 len substring$ =
1238 { s len #1 + global.max$ substring$ }
1243 FUNCTION {format.lab.names}
1245 s #1 "{vv~}{ll}" format.name$
1246 s num.names$ duplicate$
1253 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1257 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1266 FUNCTION {author.key.label}
1269 { cite$ #1 #3 substring$ }
1273 { author format.lab.names }
1277 FUNCTION {author.editor.key.label}
1281 { cite$ #1 #3 substring$ }
1285 { editor format.lab.names }
1288 { author format.lab.names }
1292 FUNCTION {editor.key.label}
1295 { cite$ #1 #3 substring$ }
1299 { editor format.lab.names }
1303 FUNCTION {calc.short.authors}
1307 'author.editor.key.label
1308 { type$ "proceedings" =
1317 FUNCTION {calc.label}
1318 { calc.short.authors
1322 year duplicate$ empty$
1330 FUNCTION {sort.format.names}
1334 s num.names$ 'numnames :=
1335 numnames 'namesleft :=
1338 "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1343 namesleft #1 = t "others" = and
1350 nameptr #1 + 'nameptr :=
1351 namesleft #1 - 'namesleft :=
1356 FUNCTION {sort.format.title}
1360 "The " #4 t chop.word
1364 #1 global.max$ substring$
1367 FUNCTION {author.sort}
1370 { "to sort, need author or key in " cite$ * warning$
1376 { author sort.format.names }
1380 FUNCTION {author.editor.sort}
1384 { "to sort, need author, editor, or key in " cite$ * warning$
1390 { editor sort.format.names }
1393 { author sort.format.names }
1397 FUNCTION {editor.sort}
1400 { "to sort, need editor or key in " cite$ * warning$
1406 { editor sort.format.names }
1419 { type$ "proceedings" =
1425 #1 entry.max$ substring$
1434 #1 entry.max$ substring$
1442 STRINGS { last.label next.extra }
1444 INTEGERS { last.extra.num number.label }
1446 FUNCTION {initialize.extra.label.stuff}
1447 { #0 int.to.chr$ 'last.label :=
1449 #0 'last.extra.num :=
1453 FUNCTION {forward.pass}
1454 { last.label label =
1455 { last.extra.num #1 + 'last.extra.num :=
1456 last.extra.num int.to.chr$ 'extra.label :=
1458 { "a" chr.to.int$ 'last.extra.num :=
1460 label 'last.label :=
1463 number.label #1 + 'number.label :=
1466 FUNCTION {reverse.pass}
1468 { "a" 'extra.label := }
1471 extra.label 'next.extra :=
1475 { "{\natexlab{" swap$ * "}}" * }
1478 label extra.label * 'label :=
1481 EXECUTE {initialize.extra.label.stuff}
1483 ITERATE {forward.pass}
1485 REVERSE {reverse.pass}
1487 FUNCTION {bib.sort.order}
1491 year field.or.null sortify
1498 #1 entry.max$ substring$
1502 ITERATE {bib.sort.order}
1506 FUNCTION {begin.bib}
1509 { preamble$ write$ newline$ }
1511 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1513 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1515 "\expandafter\ifx\csname url\endcsname\relax"
1517 " \def\url#1{\texttt{#1}}\fi"
1519 "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
1525 EXECUTE {init.state.consts}
1527 ITERATE {call.type$}
1531 "\end{thebibliography}" write$ newline$
1535 %% End of customized bst file
1537 %% End of file `elsarticle-harv.bst'.