2 %% This is file `model6-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: model6-num-names.bst 215 2012-10-22 07:34:58Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-6/model6-num-names.bst $
56 { label extra.label sort.label short.list }
58 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
60 STRINGS { urlprefix doiprefix eprintprefix pubmedprefix }
62 FUNCTION {init.web.variables}
64 "\URLprefix " 'urlprefix :=
65 "\DOIprefix" 'doiprefix :=
66 "\ArXivprefix " 'eprintprefix :=
67 "\Pubmedprefix " 'pubmedprefix :=
70 FUNCTION {init.state.consts}
77 FUNCTION {output.nonnull}
79 output.state mid.sentence =
81 { output.state after.block =
86 { output.state before.all =
88 { add.period$ " " * write$ }
92 mid.sentence 'output.state :=
103 FUNCTION {output.check}
106 { pop$ "empty " t * " in " * cite$ * warning$ }
117 { output.state before.all =
119 { after.block 'output.state := }
122 FUNCTION {new.sentence}
123 { output.state after.block =
125 { output.state before.all =
127 { after.sentence 'output.state := }
133 { " " * before.all 'output.state :=
136 FUNCTION {no.blank.or.punct}
137 { "" * before.all 'output.state :=
140 FUNCTION {date.block}
146 FUNCTION {book.date.block}
167 FUNCTION {remove.dots}
172 z #2 global.max$ substring$ 'z :=
173 duplicate$ "." = 'pop$
179 FUNCTION {new.block.checkb}
187 FUNCTION {field.or.null}
196 { "\emph{" swap$ * "}" * }
199 FUNCTION {tie.or.space.prefix}
200 { duplicate$ text.length$ #3 <
207 FUNCTION {capitalize}
208 { "u" change.case$ "t" change.case$ }
210 FUNCTION {space.word}
211 { " " swap$ * " " * }
212 % Here are the language-specific definitions for explicit words.
213 % Each function has a name bbl.xxx where xxx is the English word.
214 % The language selected here is ENGLISH
221 FUNCTION {bbl.editors}
224 FUNCTION {bbl.editor}
230 FUNCTION {bbl.edition}
233 FUNCTION {bbl.volume}
239 FUNCTION {bbl.number}
257 FUNCTION {bbl.chapter}
260 FUNCTION {bbl.techrep}
263 FUNCTION {bbl.mthesis}
264 { "Master's thesis" }
266 FUNCTION {bbl.phdthesis}
269 FUNCTION {close.brace}
296 MACRO {acmcs} {"ACM Comput. Surv."}
298 MACRO {acta} {"Acta Inf."}
300 MACRO {cacm} {"Commun. ACM"}
302 MACRO {ibmjrd} {"IBM J. Res. Dev."}
304 MACRO {ibmsj} {"IBM Syst.~J."}
306 MACRO {ieeese} {"IEEE Trans. Software Eng."}
308 MACRO {ieeetc} {"IEEE Trans. Comput."}
311 {"IEEE Trans. Comput. Aid. Des."}
313 MACRO {ipl} {"Inf. Process. Lett."}
315 MACRO {jacm} {"J.~ACM"}
317 MACRO {jcss} {"J.~Comput. Syst. Sci."}
319 MACRO {scp} {"Sci. Comput. Program."}
321 MACRO {sicomp} {"SIAM J. Comput."}
323 MACRO {tocs} {"ACM Trans. Comput. Syst."}
325 MACRO {tods} {"ACM Trans. Database Syst."}
327 MACRO {tog} {"ACM Trans. Graphic."}
329 MACRO {toms} {"ACM Trans. Math. Software"}
331 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
333 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
335 MACRO {tcs} {"Theor. Comput. Sci."}
337 FUNCTION {bibinfo.check}
349 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
355 FUNCTION {bibinfo.warn}
359 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
364 swap$ "empty " swap$ * " in " * cite$ * warning$
374 INTEGERS { nameptr namesleft numnames }
379 % FUNCTION {format.names}
381 % duplicate$ empty$ 'skip$ {
385 % s num.names$ 'numnames :=
386 % numnames 'namesleft :=
389 % "{vv~}{ll}{ jj}{ f{}}"
392 % bibinfo bibinfo.check
399 % s nameptr "{ll}" format.name$ duplicate$ "others" =
415 % nameptr #1 + 'nameptr :=
416 % namesleft #1 - 'namesleft :=
422 FUNCTION {format.names}
424 duplicate$ empty$ 'skip$ {
428 s num.names$ 'numnames :=
429 numnames 'namesleft :=
432 "{vv~}{ll}{ jj}\xfnm[{ f{.}.}]"
435 bibinfo bibinfo.check
443 s nameptr "{ll}" format.name$ duplicate$ "others" =
458 nameptr #1 + 'nameptr :=
459 namesleft #1 - 'namesleft :=
466 FUNCTION {format.names.ed}
470 FUNCTION {format.key}
472 { key field.or.null }
477 FUNCTION {format.authors}
478 { author "author" format.names
479 duplicate$ empty$ 'skip$
480 { collaboration "collaboration" bibinfo.check
481 duplicate$ empty$ 'skip$
482 { " (" swap$ * ")" * }
488 FUNCTION {get.bbl.editor}
489 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
491 FUNCTION {format.editors}
492 { editor "editor" format.names duplicate$ empty$ 'skip$
501 FUNCTION {format.isbn}
502 { isbn "isbn" bibinfo.check
503 duplicate$ empty$ 'skip$
511 FUNCTION {format.note}
515 { note #1 #1 substring$
518 { output.state mid.sentence =
525 note #2 global.max$ substring$ * "note" bibinfo.check
530 FUNCTION {format.title}
532 duplicate$ empty$ 'skip$
535 "title" bibinfo.check
537 FUNCTION {format.full.names}
541 s num.names$ 'numnames :=
542 numnames 'namesleft :=
545 "{vv~}{ll}" format.name$
552 s nameptr "{ll}" format.name$ duplicate$ "others" =
570 nameptr #1 + 'nameptr :=
571 namesleft #1 - 'namesleft :=
576 FUNCTION {author.editor.key.full}
580 { cite$ #1 #3 substring$ }
584 { editor format.full.names }
587 { author format.full.names }
591 FUNCTION {author.key.full}
594 { cite$ #1 #3 substring$ }
598 { author format.full.names }
602 FUNCTION {editor.key.full}
605 { cite$ #1 #3 substring$ }
609 { editor format.full.names }
613 FUNCTION {make.full.names}
617 'author.editor.key.full
618 { type$ "proceedings" =
626 FUNCTION {output.bibitem}
630 ")" make.full.names duplicate$ short.list =
639 before.all 'output.state :=
647 { t #1 #1 substring$ "-" =
648 { t #1 #2 substring$ "--" = not
650 t #2 global.max$ substring$ 't :=
652 { { t #1 #1 substring$ "-" = }
654 t #2 global.max$ substring$ 't :=
660 { t #1 #1 substring$ *
661 t #2 global.max$ substring$ 't :=
673 FUNCTION {format.date}
674 { year "year" bibinfo.check duplicate$ empty$
676 "empty year in " cite$ * "; set to ????" * warning$
683 FUNCTION {format.btitle}
684 { title "title" bibinfo.check
685 duplicate$ empty$ 'skip$
690 FUNCTION {either.or.check}
693 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
696 FUNCTION {format.bvolume}
699 { bbl.volume volume tie.or.space.prefix
700 "volume" bibinfo.check * *
701 series "series" bibinfo.check
702 duplicate$ empty$ 'pop$
703 { swap$ bbl.of space.word * swap$
706 "volume and number" number either.or.check
710 FUNCTION {format.number.series}
713 { series field.or.null }
715 { number "number" bibinfo.check }
716 { output.state mid.sentence =
718 { bbl.number capitalize }
720 number tie.or.space.prefix "number" bibinfo.check * *
722 series "series" bibinfo.check *
732 FUNCTION {format.edition}
733 { edition duplicate$ empty$ 'skip$
735 output.state mid.sentence =
739 "edition" bibinfo.check
744 INTEGERS { multiresult }
745 FUNCTION {multi.page.check}
754 swap$ duplicate$ "," =
757 { #1 'multiresult := }
758 { t #2 global.max$ substring$ 't := }
764 FUNCTION {format.pages}
765 { pages duplicate$ empty$ 'skip$
766 { duplicate$ multi.page.check
776 "pages" bibinfo.check
781 FUNCTION {format.journal.pages}
782 { pages duplicate$ empty$ 'pop$
783 { swap$ duplicate$ empty$
784 { pop$ pop$ format.pages }
789 "pages" bibinfo.check
796 FUNCTION {format.journal.eid}
797 { eid "eid" bibinfo.check
798 duplicate$ empty$ 'pop$
799 { swap$ duplicate$ empty$ 'skip$
805 numpages empty$ 'skip$
806 { bbl.eidpp numpages tie.or.space.prefix
807 "numpages" bibinfo.check * *
814 FUNCTION {format.vol.num.pages}
815 { volume field.or.null
816 duplicate$ empty$ 'skip$
818 "volume" bibinfo.check
821 number "number" bibinfo.check duplicate$ empty$ 'skip$
823 swap$ duplicate$ empty$
824 { "there's a number but no volume in " cite$ * warning$ }
833 FUNCTION {format.chapter.pages}
838 { type "l" change.case$
842 chapter tie.or.space.prefix
843 "chapter" bibinfo.check
849 FUNCTION {format.booktitle}
851 booktitle "booktitle" bibinfo.check
854 FUNCTION {format.in.ed.booktitle}
855 { format.booktitle duplicate$ empty$ 'skip$
857 editor "editor" format.names.ed duplicate$ empty$ 'pop$
870 FUNCTION {format.thesis.type}
871 { type duplicate$ empty$
874 "t" change.case$ "type" bibinfo.check
878 FUNCTION {format.tr.number}
879 { number "number" bibinfo.check
880 type duplicate$ empty$
885 swap$ duplicate$ empty$
886 { pop$ "t" change.case$ }
887 { tie.or.space.prefix * * }
890 FUNCTION {format.article.crossref}
893 " \cite{" * crossref * "}" *
895 FUNCTION {format.book.crossref}
896 { volume duplicate$ empty$
897 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
902 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
905 " \cite{" * crossref * "}" *
907 FUNCTION {format.incoll.inproc.crossref}
910 " \cite{" * crossref * "}" *
912 FUNCTION {format.org.or.pub}
915 address empty$ t empty$ and
918 address "address" bibinfo.check *
931 FUNCTION {format.publisher.address}
932 { publisher "publisher" bibinfo.check format.org.or.pub
935 FUNCTION {format.organization.address}
936 { organization "organization" bibinfo.check format.org.or.pub
940 {url duplicate$ empty$
943 urlprefix "\url{" * swap$ * "}" *
949 {doi duplicate$ empty$
952 doiprefix "\doi{" * swap$ * "}" *
957 FUNCTION {print.eprint}
958 {eprint duplicate$ empty$
961 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
966 FUNCTION {print.pubmed}
967 {pubmed duplicate$ empty$
970 pubmedprefix "\Pubmed{" * swap$ * "}" *
976 { "%Type = Webpage" write$
978 format.authors "author" output.check
979 author format.key output
982 format.title "title" output.check
984 format.date "year" output.check
988 format.date "year" output.check
990 format.title "title" output.check
999 { "%Type = Article" write$
1001 format.authors "author" output.check
1002 author format.key output
1004 format.title "title" output.check
1010 "journal" bibinfo.check
1012 "journal" output.check
1014 format.date "year" output.check
1016 format.vol.num.pages output
1018 { format.article.crossref output.nonnull
1022 { format.journal.pages }
1023 { format.journal.eid }
1035 { "%Type = Book" write$
1038 { format.editors "author and editor" output.check
1039 editor format.key output
1041 { format.authors output.nonnull
1043 { "author and editor" editor either.or.check }
1049 format.btitle "title" output.check
1051 { format.bvolume output
1054 format.number.series output
1055 format.edition output
1056 format.publisher.address output
1060 format.book.crossref output.nonnull
1063 format.date "year" output.check
1075 { "%Type = Booklet" write$
1077 format.authors output
1078 author format.key output
1080 format.title "title" output.check
1082 howpublished "howpublished" bibinfo.check output
1083 address "address" bibinfo.check output
1084 format.date "year" output.check
1096 { "%Type = Inbook" write$
1099 { format.editors "author and editor" output.check
1100 editor format.key output
1102 { format.authors output.nonnull
1104 { "author and editor" editor either.or.check }
1110 format.btitle "title" output.check
1113 format.bvolume output
1114 format.chapter.pages "chapter and pages" output.check
1117 format.number.series output
1118 format.publisher.address output
1121 format.chapter.pages "chapter and pages" output.check
1123 format.book.crossref output.nonnull
1126 format.edition output
1128 { format.isbn output }
1131 format.date "year" output.check
1133 format.pages "pages" output.check
1143 FUNCTION {incollection}
1144 { "%Type = Incollection" write$
1146 format.authors "author" output.check
1147 author format.key output
1149 format.title "title" output.check
1152 { format.in.ed.booktitle "booktitle" output.check
1153 format.bvolume output
1154 format.chapter.pages output
1156 format.number.series output
1157 format.publisher.address output
1158 format.edition output
1161 { format.incoll.inproc.crossref output.nonnull
1162 format.chapter.pages output
1165 format.date "year" output.check
1167 format.pages "pages" output.check
1177 FUNCTION {inproceedings}
1178 { "%Type = Inproceedings" write$
1180 format.authors "author" output.check
1181 author format.key output
1183 format.title "title" output.check
1186 { format.in.ed.booktitle "booktitle" output.check
1187 format.bvolume output
1189 format.number.series output
1191 { format.organization.address output }
1192 { organization "organization" bibinfo.check output
1193 format.publisher.address output
1198 { format.incoll.inproc.crossref output.nonnull
1201 format.date "year" output.check
1203 format.pages "pages" output.check
1213 FUNCTION {conference} { inproceedings }
1216 { "%Type = Manual" write$
1218 format.authors output
1219 author format.key output
1221 format.btitle "title" output.check
1222 organization address new.block.checkb
1223 organization "organization" bibinfo.check output
1224 address "address" bibinfo.check output
1225 format.edition output
1226 format.date "year" output.check
1236 FUNCTION {mastersthesis}
1237 { "%Type = Mastersthesis" write$
1239 format.authors "author" output.check
1240 author format.key output
1243 "title" output.check
1245 bbl.mthesis format.thesis.type output.nonnull
1246 school "school" bibinfo.warn output
1247 address "address" bibinfo.check output
1248 format.date "year" output.check
1259 { "%Type = Misc" write$
1261 format.authors output
1262 author format.key output
1266 howpublished "howpublished" bibinfo.check output
1267 format.date "year" output.check
1277 FUNCTION {phdthesis}
1278 { "%Type = Phdthesis" write$
1280 format.authors "author" output.check
1281 author format.key output
1284 "title" output.check
1286 bbl.phdthesis format.thesis.type output.nonnull
1287 school "school" bibinfo.warn output
1288 address "address" bibinfo.check output
1289 format.date "year" output.check
1299 FUNCTION {proceedings}
1300 { "%Type = Proceedings" write$
1302 format.editors output
1303 editor format.key output
1305 format.btitle "title" output.check
1306 format.bvolume output
1308 format.number.series output
1310 { format.organization.address output }
1311 { organization "organization" bibinfo.check output
1312 format.publisher.address output
1315 format.date "year" output.check
1326 FUNCTION {techreport}
1327 { "%Type = Techreport" write$
1329 format.authors "author" output.check
1330 author format.key output
1333 "title" output.check
1335 format.tr.number output.nonnull
1336 institution "institution" bibinfo.warn output
1337 address "address" bibinfo.check output
1338 format.date "year" output.check
1348 FUNCTION {unpublished}
1349 { "%Type = Unpublished" write$
1351 format.authors "author" output.check
1352 author format.key output
1354 format.title "title" output.check
1355 format.date "year" output.check
1361 format.note "note" output.check
1365 FUNCTION {default.type} { misc }
1372 FUNCTION {chop.word}
1375 s #1 len substring$ =
1376 { s len #1 + global.max$ substring$ }
1380 FUNCTION {format.lab.names}
1383 s #1 "{vv~}{ll}" format.name$
1384 s num.names$ duplicate$
1391 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1395 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1404 FUNCTION {author.key.label}
1407 { cite$ #1 #3 substring$ }
1411 { author format.lab.names }
1415 FUNCTION {author.editor.key.label}
1419 { cite$ #1 #3 substring$ }
1423 { editor format.lab.names }
1426 { author format.lab.names }
1430 FUNCTION {editor.key.label}
1433 { cite$ #1 #3 substring$ }
1437 { editor format.lab.names }
1441 FUNCTION {calc.short.authors}
1445 'author.editor.key.label
1446 { type$ "proceedings" =
1455 FUNCTION {calc.label}
1456 { calc.short.authors
1460 year duplicate$ empty$
1462 { purify$ #-1 #4 substring$ }
1468 FUNCTION {sort.format.names}
1472 s num.names$ 'numnames :=
1473 numnames 'namesleft :=
1476 "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1477 % "{vv~}{ll~}{\rd[f.f.]}{jj~}"
1482 namesleft #1 = t "others" = and
1489 nameptr #1 + 'nameptr :=
1490 namesleft #1 - 'namesleft :=
1495 FUNCTION {sort.format.title}
1499 "The " #4 t chop.word
1503 #1 global.max$ substring$
1505 FUNCTION {author.sort}
1508 { "to sort, need author or key in " cite$ * warning$
1514 { author sort.format.names }
1517 FUNCTION {author.editor.sort}
1521 { "to sort, need author, editor, or key in " cite$ * warning$
1527 { editor sort.format.names }
1530 { author sort.format.names }
1533 FUNCTION {editor.sort}
1536 { "to sort, need editor or key in " cite$ * warning$
1542 { editor sort.format.names }
1545 INTEGERS { seq.num }
1549 FUNCTION {int.to.fix}
1550 { "000000000" swap$ int.to.str$ *
1558 seq.num #1 + 'seq.num :=
1568 #1 entry.max$ substring$
1574 STRINGS { last.label next.extra }
1575 INTEGERS { last.extra.num number.label }
1576 FUNCTION {initialize.extra.label.stuff}
1577 { #0 int.to.chr$ 'last.label :=
1579 #0 'last.extra.num :=
1582 FUNCTION {forward.pass}
1583 { last.label label =
1584 { last.extra.num #1 + 'last.extra.num :=
1585 last.extra.num int.to.chr$ 'extra.label :=
1587 { "a" chr.to.int$ 'last.extra.num :=
1589 label 'last.label :=
1592 number.label #1 + 'number.label :=
1594 FUNCTION {reverse.pass}
1596 { "a" 'extra.label := }
1599 extra.label 'next.extra :=
1603 { "{\natexlab{" swap$ * "}}" * }
1606 label extra.label * 'label :=
1608 EXECUTE {initialize.extra.label.stuff}
1609 ITERATE {forward.pass}
1610 REVERSE {reverse.pass}
1611 FUNCTION {bib.sort.order}
1615 year field.or.null sortify
1622 #1 entry.max$ substring$
1625 ITERATE {bib.sort.order}
1627 FUNCTION {begin.bib}
1630 { preamble$ write$ newline$ }
1632 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1634 "\providecommand{\natexlab}[1]{#1}"
1636 "\providecommand{\url}[1]{\texttt{#1}}"
1638 "\providecommand{\href}[2]{#2}"
1640 "\providecommand{\path}[1]{#1}"
1642 "\providecommand{\DOIprefix}{doi:}"
1644 "\providecommand{\ArXivprefix}{arXiv:}"
1646 "\providecommand{\URLprefix}{URL: }"
1648 "\providecommand{\Pubmedprefix}{pmid:}"
1650 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1652 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1654 "\providecommand{\BIBand}{and}"
1656 "\providecommand{\bibinfo}[2]{#2}"
1658 "\ifx\xfnm\undefined \def\xfnm[#1]{\unskip,\space#1}\fi"
1660 "\makeatletter\def\@biblabel#1{#1.}\makeatother"
1664 EXECUTE {init.state.consts}
1665 EXECUTE {init.web.variables}
1666 ITERATE {call.type$}
1669 "\end{thebibliography}" write$ newline$
1672 %% End of customized bst file
1680 %% a. doi, url, eprint, pmid added
1681 %% b. Bibtype `webpage' defined
1683 %% End of file `model6-num-names.bst'.