2 %% This is file `model1-num-names.bst' (Version 2.0),
4 %% Copyright 2009-2012 Elsevier Ltd
6 %% This file is part of the 'Elsarticle Bundle'.
7 %% ---------------------------------------------
9 %% It may be distributed under the conditions of the LaTeX Project Public
10 %% License, either version 1.2 of this license or (at your option) any
11 %% later version. The latest version of this license is in
12 %% http://www.latex-project.org/lppl.txt
13 %% and version 1.2 or later is part of all distributions of LaTeX
14 %% version 1999/12/01 or later.
16 %% $Id: model1-num-names.bst 206 2012-10-22 07:28:26Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-1/model1-num-names.bst $
52 { label extra.label sort.label short.list }
54 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
56 STRINGS { urlprefix doiprefix eprintprefix pubmedprefix }
58 FUNCTION {init.web.variables}
60 "\URLprefix " 'urlprefix :=
61 "\DOIprefix" 'doiprefix :=
62 "\ArXivprefix " 'eprintprefix :=
63 "\Pubmedprefix " 'pubmedprefix :=
66 FUNCTION {init.state.consts}
73 FUNCTION {output.nonnull}
75 output.state mid.sentence =
77 { output.state after.block =
78 % { add.period$ write$
83 { output.state before.all =
85 { add.period$ " " * write$ }
89 mid.sentence 'output.state :=
100 FUNCTION {output.check}
103 { pop$ "empty " t * " in " * cite$ * warning$ }
114 { output.state before.all =
116 { after.block 'output.state := }
119 FUNCTION {new.sentence}
120 { output.state after.block =
122 { output.state before.all =
124 { after.sentence 'output.state := }
130 { " " * before.all 'output.state :=
133 FUNCTION {date.block}
153 FUNCTION {new.block.checkb}
161 FUNCTION {field.or.null}
170 { "\textit{" swap$ * "}" * }
173 FUNCTION {tie.or.space.prefix}
174 { duplicate$ text.length$ #3 <
181 FUNCTION {capitalize}
182 { "u" change.case$ "t" change.case$ }
184 FUNCTION {space.word}
185 { " " swap$ * " " * }
186 % Here are the language-specific definitions for explicit words.
187 % Each function has a name bbl.xxx where xxx is the English word.
188 % The language selected here is ENGLISH
195 FUNCTION {bbl.editors}
198 FUNCTION {bbl.editor}
204 FUNCTION {bbl.edition}
207 FUNCTION {bbl.volume}
213 FUNCTION {bbl.number}
228 FUNCTION {bbl.chapter}
231 FUNCTION {bbl.techrep}
232 { "Technical Report" }
234 FUNCTION {bbl.mthesis}
235 { "Master's thesis" }
237 FUNCTION {bbl.phdthesis}
240 MACRO {jan} {"January"}
242 MACRO {feb} {"February"}
244 MACRO {mar} {"March"}
246 MACRO {apr} {"April"}
254 MACRO {aug} {"August"}
256 MACRO {sep} {"September"}
258 MACRO {oct} {"October"}
260 MACRO {nov} {"November"}
262 MACRO {dec} {"December"}
264 MACRO {acmcs} {"ACM Comput. Surv."}
266 MACRO {acta} {"Acta Inf."}
268 MACRO {cacm} {"Commun. ACM"}
270 MACRO {ibmjrd} {"IBM J. Res. Dev."}
272 MACRO {ibmsj} {"IBM Syst.~J."}
274 MACRO {ieeese} {"IEEE Trans. Software Eng."}
276 MACRO {ieeetc} {"IEEE Trans. Comput."}
279 {"IEEE Trans. Comput. Aid. Des."}
281 MACRO {ipl} {"Inf. Process. Lett."}
283 MACRO {jacm} {"J.~ACM"}
285 MACRO {jcss} {"J.~Comput. Syst. Sci."}
287 MACRO {scp} {"Sci. Comput. Program."}
289 MACRO {sicomp} {"SIAM J. Comput."}
291 MACRO {tocs} {"ACM Trans. Comput. Syst."}
293 MACRO {tods} {"ACM Trans. Database Syst."}
295 MACRO {tog} {"ACM Trans. Graphic."}
297 MACRO {toms} {"ACM Trans. Math. Software"}
299 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
301 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
303 MACRO {tcs} {"Theor. Comput. Sci."}
305 FUNCTION {bibinfo.check}
317 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
323 FUNCTION {bibinfo.warn}
327 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
332 swap$ "empty " swap$ * " in " * cite$ * warning$
342 INTEGERS { nameptr namesleft numnames }
344 FUNCTION {format.names}
346 duplicate$ empty$ 'skip$ {
350 s num.names$ 'numnames :=
351 numnames 'namesleft :=
354 "{f.~}{vv~}{ll}{, jj}"
356 bibinfo bibinfo.check
364 s nameptr "{ll}" format.name$ duplicate$ "others" =
379 nameptr #1 + 'nameptr :=
380 namesleft #1 - 'namesleft :=
385 FUNCTION {format.names.ed}
389 FUNCTION {format.key}
391 { key field.or.null }
396 %FUNCTION {format.authors}
397 %{ author "author" format.names
400 FUNCTION {format.authors}
401 { author "author" format.names
402 duplicate$ empty$ 'skip$
403 { collaboration "collaboration" bibinfo.check
404 duplicate$ empty$ 'skip$
405 { " (" swap$ * ")" * }
412 FUNCTION {get.bbl.editor}
413 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
415 FUNCTION {format.editors}
416 { editor "editor" format.names duplicate$ empty$ 'skip$
426 FUNCTION {format.note}
430 { note #1 #1 substring$
433 { output.state mid.sentence =
440 note #2 global.max$ substring$ * "note" bibinfo.check
445 FUNCTION {format.title}
447 duplicate$ empty$ 'skip$
450 "title" bibinfo.check
453 FUNCTION {format.full.names}
457 s num.names$ 'numnames :=
458 numnames 'namesleft :=
461 "{vv~}{ll}" format.name$
468 s nameptr "{ll}" format.name$ duplicate$ "others" =
490 nameptr #1 + 'nameptr :=
491 namesleft #1 - 'namesleft :=
496 FUNCTION {author.editor.key.full}
500 { cite$ #1 #3 substring$ }
504 { editor format.full.names }
507 { author format.full.names }
511 FUNCTION {author.key.full}
514 { cite$ #1 #3 substring$ }
518 { author format.full.names }
522 FUNCTION {editor.key.full}
525 { cite$ #1 #3 substring$ }
529 { editor format.full.names }
533 FUNCTION {make.full.names}
537 'author.editor.key.full
538 { type$ "proceedings" =
546 FUNCTION {output.bibitem}
550 ")" make.full.names duplicate$ short.list =
559 before.all 'output.state :=
567 { t #1 #1 substring$ "-" =
568 { t #1 #2 substring$ "--" = not
570 t #2 global.max$ substring$ 't :=
572 { { t #1 #1 substring$ "-" = }
574 t #2 global.max$ substring$ 't :=
580 { t #1 #1 substring$ *
581 t #2 global.max$ substring$ 't :=
593 FUNCTION {format.date}
594 { year "year" bibinfo.check duplicate$ empty$
596 "empty year in " cite$ * "; set to ????" * warning$
603 FUNCTION{format.year}
604 { year "year" bibinfo.check duplicate$ empty$
605 { "empty year in " cite$ *
616 FUNCTION {format.btitle}
617 { title "title" bibinfo.check
618 duplicate$ empty$ 'skip$
623 FUNCTION {either.or.check}
626 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
629 FUNCTION {format.bvolume}
632 { bbl.volume volume tie.or.space.prefix
633 "volume" bibinfo.check * *
634 series "series" bibinfo.check
635 duplicate$ empty$ 'pop$
636 { swap$ bbl.of space.word * swap$
639 "volume and number" number either.or.check
643 FUNCTION {format.number.series}
646 { series field.or.null }
648 { number "number" bibinfo.check }
649 { output.state mid.sentence =
651 { bbl.number capitalize }
653 number tie.or.space.prefix "number" bibinfo.check * *
655 series "series" bibinfo.check *
665 FUNCTION {format.edition}
666 { edition duplicate$ empty$ 'skip$
668 output.state mid.sentence =
672 "edition" bibinfo.check
677 INTEGERS { multiresult }
678 FUNCTION {multi.page.check}
687 swap$ duplicate$ "," =
690 { #1 'multiresult := }
691 { t #2 global.max$ substring$ 't := }
697 FUNCTION {format.pages}
698 { pages duplicate$ empty$ 'skip$
699 { duplicate$ multi.page.check
709 "pages" bibinfo.check
714 FUNCTION {format.journal.pages}
715 { pages duplicate$ empty$ 'pop$
716 { swap$ duplicate$ empty$
717 { pop$ pop$ format.pages }
722 "pages" bibinfo.check
729 FUNCTION {format.vol.num.pages}
730 { volume field.or.null
731 duplicate$ empty$ 'skip$
733 "volume" bibinfo.check
739 FUNCTION {format.chapter.pages}
744 { type "l" change.case$
748 chapter tie.or.space.prefix
749 "chapter" bibinfo.check
755 FUNCTION {format.booktitle}
757 booktitle "booktitle" bibinfo.check
759 FUNCTION {format.in.ed.booktitle}
760 { format.booktitle duplicate$ empty$ 'skip$
762 editor "editor" format.names.ed duplicate$ empty$ 'pop$
775 FUNCTION {format.thesis.type}
776 { type duplicate$ empty$
779 "t" change.case$ "type" bibinfo.check
783 FUNCTION {format.tr.number}
784 { number "number" bibinfo.check
785 type duplicate$ empty$
790 swap$ duplicate$ empty$
791 { pop$ "t" change.case$ }
792 { tie.or.space.prefix * * }
795 FUNCTION {format.article.crossref}
798 " \cite{" * crossref * "}" *
800 FUNCTION {format.book.crossref}
801 { volume duplicate$ empty$
802 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
806 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
809 " \cite{" * crossref * "}" *
811 FUNCTION {format.incoll.inproc.crossref}
814 " \cite{" * crossref * "}" *
816 FUNCTION {format.org.or.pub}
819 address empty$ t empty$ and
823 { address "address" bibinfo.check *
828 { ", " * address "address" bibinfo.check * }
835 FUNCTION {format.publisher.address}
836 { publisher "publisher" bibinfo.check format.org.or.pub
839 FUNCTION {format.organization.address}
840 { organization "organization" bibinfo.check format.org.or.pub
844 {url duplicate$ empty$
847 urlprefix "\url{" * swap$ * "}" *
853 {doi duplicate$ empty$
856 doiprefix "\doi{" * swap$ * "}" *
861 FUNCTION {print.eprint}
862 {eprint duplicate$ empty$
865 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
870 FUNCTION {print.pubmed}
871 {pubmed duplicate$ empty$
874 pubmedprefix "\Pubmed{" * swap$ * "}" *
880 { "%Type = Webpage" write$
882 format.authors "author" output.check
883 author format.key output
886 format.title "title" output.check
888 format.date "year" output.check
892 format.date "year" output.check
894 format.title "title" output.check
904 { "%Type = Article" write$
906 format.authors "author" output.check
907 author format.key output
909 format.title "title" output.check
914 "journal" bibinfo.check
915 "journal" output.check
917 format.vol.num.pages output
919 { format.article.crossref output.nonnull
928 { "%Type = Book" write$
931 { format.editors "author and editor" output.check
932 editor format.key output
934 { format.authors output.nonnull
936 { "author and editor" editor either.or.check }
941 format.btitle "title" output.check
943 { format.bvolume output
944 format.number.series output
945 format.edition output
946 format.publisher.address output
949 format.book.crossref output.nonnull
952 format.date "year" output.check
962 { "%Type = Booklet" write$
964 format.authors output
965 author format.key output
966 format.title "title" output.check
967 howpublished "howpublished" bibinfo.check output
968 address "address" bibinfo.check output
969 format.date "year" output.check
980 { "%Type = Inbook" write$
983 { format.editors "author and editor" output.check
984 editor format.key output
986 { format.authors output.nonnull
988 { "author and editor" editor either.or.check }
993 format.btitle "title" output.check
996 format.bvolume output
997 format.number.series output
998 format.edition output
999 format.publisher.address output
1002 format.book.crossref output.nonnull
1005 format.date "year" output.check
1006 format.pages "pages" output.check
1016 FUNCTION {incollection}
1017 { "%Type = Incollection" write$
1019 format.authors "author" output.check
1020 author format.key output
1022 format.title "title" output.check
1025 { format.in.ed.booktitle "booktitle" output.check
1026 format.bvolume output
1027 format.number.series output
1028 format.edition output
1029 format.publisher.address output
1031 { format.incoll.inproc.crossref output.nonnull
1034 format.date "year" output.check
1035 format.pages "pages" output.check
1044 FUNCTION {inproceedings}
1045 { "%Type = Inproceedings" write$
1047 format.authors "author" output.check
1048 author format.key output
1050 format.title "title" output.check
1053 { format.in.ed.booktitle "booktitle" output.check
1054 format.bvolume output
1055 format.number.series output
1057 { format.organization.address output }
1058 { organization "organization" bibinfo.check output
1059 format.publisher.address output
1063 { format.incoll.inproc.crossref output.nonnull
1067 format.pages "pages" output.check
1076 FUNCTION {conference} { inproceedings }
1078 { "%Type = Manual" write$
1080 format.authors output
1081 author format.key output
1082 format.btitle "title" output.check
1083 format.edition output
1084 organization "organization" bibinfo.check output
1085 address "address" bibinfo.check output
1086 format.date "year" output.check
1096 FUNCTION {mastersthesis}
1097 { "%Type = Masterthesis" write$
1099 format.authors "author" output.check
1100 author format.key output
1102 "title" output.check
1103 bbl.mthesis format.thesis.type output.nonnull
1104 school "school" bibinfo.warn output
1105 address "address" bibinfo.check output
1106 format.date "year" output.check
1117 { "%Type = Misc" write$
1119 format.authors output
1120 author format.key output
1122 howpublished "howpublished" bibinfo.check output
1123 format.date "year" output.check
1132 FUNCTION {phdthesis}
1133 { "%Type = Phdthesis" write$
1135 format.authors "author" output.check
1136 author format.key output
1138 "title" output.check
1139 bbl.phdthesis format.thesis.type output.nonnull
1140 school "school" bibinfo.warn output
1141 address "address" bibinfo.check output
1142 format.date "year" output.check
1152 FUNCTION {proceedings}
1153 { "%Type = Proceedings" write$
1155 format.editors output
1156 editor format.key output
1157 format.btitle "title" output.check
1158 format.bvolume output
1159 format.number.series output
1161 { format.organization.address output }
1162 { organization "organization" bibinfo.check output
1163 format.publisher.address output
1166 format.date "year" output.check
1176 FUNCTION {techreport}
1177 { "%Type = Techreport" write$
1179 format.authors "author" output.check
1180 author format.key output
1182 "title" output.check
1183 format.tr.number output.nonnull
1184 institution "institution" bibinfo.warn output
1185 address "address" bibinfo.check output
1186 format.date "year" output.check
1196 FUNCTION {unpublished}
1197 { "%Type = Unpublished" write$
1199 format.authors "author" output.check
1200 author format.key output
1201 format.title "title" output.check
1202 format.date "year" output.check
1208 format.note "note" output.check
1212 FUNCTION {default.type} { misc }
1219 FUNCTION {chop.word}
1222 s #1 len substring$ =
1223 { s len #1 + global.max$ substring$ }
1227 FUNCTION {format.lab.names}
1230 s #1 "{vv~}{ll}" format.name$
1231 s num.names$ duplicate$
1238 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1242 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1251 FUNCTION {author.key.label}
1254 { cite$ #1 #3 substring$ }
1258 { author format.lab.names }
1262 FUNCTION {author.editor.key.label}
1266 { cite$ #1 #3 substring$ }
1270 { editor format.lab.names }
1273 { author format.lab.names }
1277 FUNCTION {editor.key.label}
1280 { cite$ #1 #3 substring$ }
1284 { editor format.lab.names }
1288 FUNCTION {calc.short.authors}
1292 'author.editor.key.label
1293 { type$ "proceedings" =
1302 FUNCTION {calc.label}
1303 { calc.short.authors
1307 year duplicate$ empty$
1309 { purify$ #-1 #4 substring$ }
1315 FUNCTION {sort.format.names}
1319 s num.names$ 'numnames :=
1320 numnames 'namesleft :=
1323 "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1328 namesleft #1 = t "others" = and
1335 nameptr #1 + 'nameptr :=
1336 namesleft #1 - 'namesleft :=
1341 FUNCTION {sort.format.title}
1345 "The " #4 t chop.word
1349 #1 global.max$ substring$
1351 FUNCTION {author.sort}
1354 { "to sort, need author or key in " cite$ * warning$
1360 { author sort.format.names }
1363 FUNCTION {author.editor.sort}
1367 { "to sort, need author, editor, or key in " cite$ * warning$
1373 { editor sort.format.names }
1376 { author sort.format.names }
1379 FUNCTION {editor.sort}
1382 { "to sort, need editor or key in " cite$ * warning$
1388 { editor sort.format.names }
1400 { type$ "proceedings" =
1406 #1 entry.max$ substring$
1415 #1 entry.max$ substring$
1421 STRINGS { last.label next.extra }
1422 INTEGERS { last.extra.num number.label }
1423 FUNCTION {initialize.extra.label.stuff}
1424 { #0 int.to.chr$ 'last.label :=
1426 #0 'last.extra.num :=
1429 FUNCTION {forward.pass}
1430 { last.label label =
1431 { last.extra.num #1 + 'last.extra.num :=
1432 last.extra.num int.to.chr$ 'extra.label :=
1434 { "a" chr.to.int$ 'last.extra.num :=
1436 label 'last.label :=
1439 number.label #1 + 'number.label :=
1441 FUNCTION {reverse.pass}
1443 { "a" 'extra.label := }
1446 extra.label 'next.extra :=
1450 { "{\natexlab{" swap$ * "}}" * }
1453 label extra.label * 'label :=
1455 EXECUTE {initialize.extra.label.stuff}
1456 ITERATE {forward.pass}
1457 REVERSE {reverse.pass}
1458 FUNCTION {bib.sort.order}
1462 year field.or.null sortify
1469 #1 entry.max$ substring$
1472 ITERATE {bib.sort.order}
1474 FUNCTION {begin.bib}
1477 { preamble$ write$ newline$ }
1479 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1481 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1483 "\providecommand{\url}[1]{\texttt{#1}}"
1485 "\providecommand{\href}[2]{#2}"
1487 "\providecommand{\path}[1]{#1}"
1489 "\providecommand{\DOIprefix}{doi:}"
1491 "\providecommand{\ArXivprefix}{arXiv:}"
1493 "\providecommand{\URLprefix}{URL: }"
1495 "\providecommand{\Pubmedprefix}{pmid:}"
1497 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1499 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1501 "\providecommand{\bibinfo}[2]{#2}"
1503 "\ifx\xfnm\relax \def\xfnm[#1]{\unskip,\space#1}\fi"
1507 EXECUTE {init.state.consts}
1508 EXECUTE {init.web.variables}
1509 ITERATE {call.type$}
1512 "\end{thebibliography}" write$ newline$
1515 %% End of customized bst file
1517 %% End of file `model1-num-names.bst'.
1525 %% a. doi, url, eprint, pmid added
1526 %% b. Bibtype `webpage' defined
1529 %% a. collaboration added.