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: alpar@0: %%------------------------------------------------------------------- alpar@0: %% This bibliography style file is intended for texts in ENGLISH alpar@0: %% This is an author-year citation style bibliography. As such, it is alpar@0: %% non-standard LaTeX, and requires a special package file alpar@0: %% to function properly. alpar@0: %% Such a package is natbib.sty by Patrick W. Daly alpar@0: %% The form of the \bibitem entries is alpar@0: %% \bibitem[Jones et al.(1990)]{key}... alpar@0: %% \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... alpar@0: %% The essential feature is that the label (the part in brackets) consists alpar@0: %% of the author names, as they should appear in the citation, with the year alpar@0: %% in parentheses following. There must be no space before the opening alpar@0: %% parenthesis! alpar@0: %% With natbib v5.3, a full list of authors may also follow the year. alpar@0: %% In natbib.sty, it is possible to define the type of enclosures that is alpar@0: %% really wanted (brackets or parentheses), but in either case, there must alpar@0: %% be parentheses in the label. alpar@0: %% The \cite command functions as follows: alpar@0: %% \citet{key} ==>> Jones et al. (1990) alpar@0: %% \citet*{key} ==>> Jones, Baker, and Smith (1990) alpar@0: %% \citep{key} ==>> (Jones et al., 1990) alpar@0: %% \citep*{key} ==>> (Jones, Baker, and Smith, 1990) alpar@0: %% \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) alpar@0: %% \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) alpar@0: %% \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) alpar@0: %% \citeauthor{key} ==>> Jones et al. alpar@0: %% \citeauthor*{key} ==>> Jones, Baker, and Smith alpar@0: %% \citeyear{key} ==>> 1990 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: url alpar@0: volume alpar@0: year alpar@0: } alpar@0: {} alpar@0: { label extra.label sort.label short.list } alpar@0: alpar@0: INTEGERS { output.state before.all mid.sentence after.sentence after.block } alpar@0: alpar@0: FUNCTION {init.state.consts} 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} 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 {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} 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: %%SP 2003/07/25 alpar@0: %% No longer used alpar@0: FUNCTION {add.blank} alpar@0: { " " * before.all 'output.state := alpar@0: } alpar@0: alpar@0: FUNCTION {date.block} alpar@0: { alpar@0: new.sentence 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.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 {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: "{vv~}{ll}{, jj}{, f.}" 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.key} alpar@0: { empty$ alpar@0: { key field.or.null } alpar@0: { "" } alpar@0: if$ alpar@0: } alpar@0: 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 {format.full.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: "{vv~}{ll}" format.name$ alpar@0: 't := alpar@0: nameptr #1 > alpar@0: { alpar@0: namesleft #1 > alpar@0: { ", " * t * } alpar@0: { alpar@0: numnames #2 > alpar@0: { "," * } alpar@0: 'skip$ alpar@0: if$ 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: { bbl.and alpar@0: space.word * t * alpar@0: } 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: alpar@0: FUNCTION {author.editor.key.full} alpar@0: { author empty$ alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { editor format.full.names } alpar@0: if$ alpar@0: } alpar@0: { author format.full.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {author.key.full} alpar@0: { author empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { author format.full.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {editor.key.full} alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { editor format.full.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {make.full.names} alpar@0: { type$ "book" = alpar@0: type$ "inbook" = alpar@0: or alpar@0: 'author.editor.key.full alpar@0: { type$ "proceedings" = alpar@0: 'editor.key.full alpar@0: 'author.key.full alpar@0: if$ alpar@0: } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {output.bibitem} alpar@0: { newline$ alpar@0: "\bibitem[{" write$ alpar@0: label write$ alpar@0: ")" make.full.names duplicate$ short.list = alpar@0: { pop$ } alpar@0: { * } alpar@0: if$ alpar@0: "}]{" * 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 capitalize alpar@0: ":" * alpar@0: " " * } alpar@0: alpar@0: FUNCTION {format.date} alpar@0: { year duplicate$ empty$ alpar@0: { "empty year in " cite$ * "; set to ????" * warning$ alpar@0: pop$ "????" } alpar@0: 'skip$ alpar@0: if$ alpar@0: month empty$ alpar@0: 'skip$ alpar@0: { month alpar@0: " " * swap$ * alpar@0: } alpar@0: if$ alpar@0: extra.label * alpar@0: before.all 'output.state := alpar@0: ", " swap$ * 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: pages n.dashify * alpar@0: } alpar@0: if$ alpar@0: } alpar@0: if$ alpar@0: } alpar@0: alpar@0: %%SP 2001/01/23 alpar@0: %% Only used in articles alpar@0: FUNCTION {format.vol.num.pages} alpar@0: { alpar@0: %%SP 2001/01/23 alpar@0: %% Add the leading space only if there is a volume 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 {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: word.in alpar@0: " \cite{" * crossref * "}" * 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 capitalize alpar@0: volume tie.or.space.connect alpar@0: bbl.of space.word * alpar@0: } alpar@0: if$ alpar@0: " \cite{" * crossref * "}" * alpar@0: } alpar@0: alpar@0: FUNCTION {format.incoll.inproc.crossref} alpar@0: { alpar@0: word.in alpar@0: " \cite{" * crossref * "}" * alpar@0: } alpar@0: alpar@0: FUNCTION {format.org.or.pub} alpar@0: { 't := alpar@0: "" alpar@0: address empty$ t 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: } 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 {article} alpar@0: { output.bibitem alpar@0: format.authors "author" output.check alpar@0: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence alpar@0: crossref missing$ alpar@0: { journal alpar@0: "journal" output.check alpar@0: %%SP 2001/01/23 alpar@0: %% Add the space in format.vol.num.pages 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: editor format.key output 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: format.date "year" output.check alpar@0: date.block alpar@0: format.btitle "title" output.check alpar@0: crossref missing$ alpar@0: { format.edition output alpar@0: new.sentence alpar@0: format.bvolume output alpar@0: format.number.series output alpar@0: new.sentence alpar@0: format.publisher.address output alpar@0: } alpar@0: { alpar@0: new.sentence 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence alpar@0: howpublished output alpar@0: address output alpar@0: format.note 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: editor format.key output 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: format.date "year" output.check alpar@0: date.block alpar@0: format.btitle "title" output.check alpar@0: crossref missing$ alpar@0: { alpar@0: format.edition output alpar@0: new.sentence alpar@0: format.bvolume output alpar@0: format.number.series output alpar@0: new.sentence 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: new.sentence 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence alpar@0: crossref missing$ alpar@0: { format.in.ed.booktitle "booktitle" output.check alpar@0: format.edition output alpar@0: new.sentence alpar@0: format.bvolume output alpar@0: format.number.series output alpar@0: new.sentence 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence alpar@0: crossref missing$ alpar@0: { format.in.ed.booktitle "booktitle" output.check alpar@0: format.edition output alpar@0: new.sentence alpar@0: format.bvolume output alpar@0: format.number.series output alpar@0: new.sentence 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: %%SP 2001/01/23 alpar@0: %% format.pages output alpar@0: } alpar@0: { format.incoll.inproc.crossref output.nonnull alpar@0: %%SP 2001/01/23 alpar@0: %% format.pages output alpar@0: } alpar@0: if$ alpar@0: %%SP 2001/01/23 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: format.authors output alpar@0: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.btitle "title" output.check alpar@0: new.sentence alpar@0: organization output alpar@0: address output alpar@0: format.edition output alpar@0: format.note 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence 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: 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title output alpar@0: new.sentence alpar@0: howpublished output alpar@0: format.note output alpar@0: fin.entry alpar@0: write.url alpar@0: } alpar@0: alpar@0: FUNCTION {phdthesis} alpar@0: { output.bibitem alpar@0: format.authors "author" output.check alpar@0: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence 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: fin.entry alpar@0: write.url alpar@0: } alpar@0: alpar@0: FUNCTION {proceedings} alpar@0: { output.bibitem alpar@0: format.editors output alpar@0: editor format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.btitle "title" output.check alpar@0: new.sentence alpar@0: format.bvolume output alpar@0: format.number.series output alpar@0: new.sentence 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: 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: new.sentence alpar@0: format.tr.number output.nonnull alpar@0: institution "institution" output.check alpar@0: address output alpar@0: format.note output 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: author format.key output alpar@0: format.date "year" output.check alpar@0: date.block alpar@0: format.title "title" output.check alpar@0: format.note "note" output.check 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: FUNCTION {sortify} alpar@0: { purify$ alpar@0: "l" change.case$ alpar@0: } alpar@0: alpar@0: INTEGERS { len } alpar@0: alpar@0: FUNCTION {chop.word} alpar@0: { 's := alpar@0: 'len := alpar@0: s #1 len substring$ = alpar@0: { s len #1 + global.max$ substring$ } alpar@0: 's alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {format.lab.names} alpar@0: { 's := alpar@0: s #1 "{vv~}{ll}" format.name$ alpar@0: s num.names$ duplicate$ alpar@0: #2 > alpar@0: { pop$ alpar@0: " " * bbl.etal * alpar@0: } alpar@0: { #2 < alpar@0: 'skip$ alpar@0: { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = alpar@0: { alpar@0: " " * bbl.etal * alpar@0: } alpar@0: { bbl.and space.word * s #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 {author.key.label} alpar@0: { author empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { author format.lab.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {author.editor.key.label} alpar@0: { author empty$ alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { editor format.lab.names } alpar@0: if$ alpar@0: } alpar@0: { author format.lab.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {editor.key.label} alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { cite$ #1 #3 substring$ } alpar@0: 'key alpar@0: if$ alpar@0: } alpar@0: { editor format.lab.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {calc.short.authors} alpar@0: { type$ "book" = alpar@0: type$ "inbook" = alpar@0: or alpar@0: 'author.editor.key.label alpar@0: { type$ "proceedings" = alpar@0: 'editor.key.label alpar@0: 'author.key.label alpar@0: if$ alpar@0: } alpar@0: if$ alpar@0: 'short.list := alpar@0: } alpar@0: alpar@0: FUNCTION {calc.label} alpar@0: { calc.short.authors alpar@0: short.list alpar@0: "(" alpar@0: * alpar@0: year duplicate$ empty$ alpar@0: { pop$ "????" } alpar@0: 'skip$ alpar@0: if$ alpar@0: * alpar@0: 'label := alpar@0: } alpar@0: alpar@0: FUNCTION {sort.format.names} alpar@0: { 's := alpar@0: #1 'nameptr := alpar@0: "" alpar@0: s num.names$ 'numnames := alpar@0: numnames 'namesleft := alpar@0: { namesleft #0 > } alpar@0: { s nameptr alpar@0: "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" alpar@0: format.name$ 't := alpar@0: nameptr #1 > alpar@0: { alpar@0: " " * alpar@0: namesleft #1 = t "others" = and alpar@0: { "zzzzz" * } alpar@0: { t sortify * } alpar@0: if$ alpar@0: } alpar@0: { t sortify * } alpar@0: if$ alpar@0: nameptr #1 + 'nameptr := alpar@0: namesleft #1 - 'namesleft := alpar@0: } alpar@0: while$ alpar@0: } alpar@0: alpar@0: FUNCTION {sort.format.title} alpar@0: { 't := alpar@0: "A " #2 alpar@0: "An " #3 alpar@0: "The " #4 t chop.word alpar@0: chop.word alpar@0: chop.word alpar@0: sortify alpar@0: #1 global.max$ substring$ alpar@0: } alpar@0: alpar@0: FUNCTION {author.sort} alpar@0: { author empty$ alpar@0: { key empty$ alpar@0: { "to sort, need author or key in " cite$ * warning$ alpar@0: "" alpar@0: } alpar@0: { key sortify } alpar@0: if$ alpar@0: } alpar@0: { author sort.format.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {author.editor.sort} alpar@0: { author empty$ alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { "to sort, need author, editor, or key in " cite$ * warning$ alpar@0: "" alpar@0: } alpar@0: { key sortify } alpar@0: if$ alpar@0: } alpar@0: { editor sort.format.names } alpar@0: if$ alpar@0: } alpar@0: { author sort.format.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {editor.sort} alpar@0: { editor empty$ alpar@0: { key empty$ alpar@0: { "to sort, need editor or key in " cite$ * warning$ alpar@0: "" alpar@0: } alpar@0: { key sortify } alpar@0: if$ alpar@0: } alpar@0: { editor sort.format.names } alpar@0: if$ alpar@0: } alpar@0: alpar@0: FUNCTION {presort} alpar@0: { calc.label alpar@0: label sortify alpar@0: " " alpar@0: * alpar@0: type$ "book" = alpar@0: type$ "inbook" = alpar@0: or alpar@0: 'author.editor.sort alpar@0: { type$ "proceedings" = alpar@0: 'editor.sort alpar@0: 'author.sort alpar@0: if$ alpar@0: } alpar@0: if$ alpar@0: #1 entry.max$ substring$ alpar@0: 'sort.label := alpar@0: sort.label alpar@0: * alpar@0: " " alpar@0: * alpar@0: title field.or.null alpar@0: sort.format.title alpar@0: * alpar@0: #1 entry.max$ substring$ alpar@0: 'sort.key$ := alpar@0: } alpar@0: alpar@0: ITERATE {presort} alpar@0: alpar@0: SORT alpar@0: alpar@0: STRINGS { last.label next.extra } alpar@0: alpar@0: INTEGERS { last.extra.num number.label } alpar@0: alpar@0: FUNCTION {initialize.extra.label.stuff} alpar@0: { #0 int.to.chr$ 'last.label := alpar@0: "" 'next.extra := alpar@0: #0 'last.extra.num := alpar@0: #0 'number.label := alpar@0: } alpar@0: alpar@0: FUNCTION {forward.pass} alpar@0: { last.label label = alpar@0: { last.extra.num #1 + 'last.extra.num := alpar@0: last.extra.num int.to.chr$ 'extra.label := alpar@0: } alpar@0: { "a" chr.to.int$ 'last.extra.num := alpar@0: "" 'extra.label := alpar@0: label 'last.label := alpar@0: } alpar@0: if$ alpar@0: number.label #1 + 'number.label := alpar@0: } alpar@0: alpar@0: FUNCTION {reverse.pass} alpar@0: { next.extra "b" = alpar@0: { "a" 'extra.label := } alpar@0: 'skip$ alpar@0: if$ alpar@0: extra.label 'next.extra := alpar@0: extra.label alpar@0: duplicate$ empty$ alpar@0: 'skip$ alpar@0: { "{\natexlab{" swap$ * "}}" * } alpar@0: if$ alpar@0: 'extra.label := alpar@0: label extra.label * 'label := alpar@0: } alpar@0: alpar@0: EXECUTE {initialize.extra.label.stuff} alpar@0: alpar@0: ITERATE {forward.pass} alpar@0: alpar@0: REVERSE {reverse.pass} alpar@0: alpar@0: FUNCTION {bib.sort.order} alpar@0: { sort.label alpar@0: " " alpar@0: * alpar@0: year field.or.null sortify alpar@0: * alpar@0: " " alpar@0: * alpar@0: title field.or.null alpar@0: sort.format.title alpar@0: * alpar@0: #1 entry.max$ substring$ alpar@0: 'sort.key$ := alpar@0: } alpar@0: alpar@0: ITERATE {bib.sort.order} alpar@0: alpar@0: SORT 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}{" number.label int.to.str$ * "}" * alpar@0: write$ newline$ alpar@0: "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" 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: } alpar@0: alpar@0: EXECUTE {begin.bib} alpar@0: 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-harv.bst'.