2 %% This is file `model3-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: model3-num-names.bst 211 2012-10-22 07:31:59Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-3/model3-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}
79 FUNCTION {output.nonnull}
81 output.state mid.sentence =
83 { output.state after.block =
88 { output.state before.all =
90 { add.period$ " " * write$ }
94 mid.sentence 'output.state :=
105 FUNCTION {output.check}
108 { pop$ "empty " t * " in " * cite$ * warning$ }
119 { output.state before.all =
121 { after.block 'output.state := }
124 FUNCTION {new.sentence}
125 { output.state after.block =
127 { output.state before.all =
129 { after.sentence 'output.state := }
135 { " " * before.all 'output.state :=
138 FUNCTION {no.blank.or.punct}
139 { "" * before.all 'output.state :=
142 FUNCTION {date.block}
148 FUNCTION {book.date.block}
170 FUNCTION {remove.dots}
175 z #2 global.max$ substring$ 'z :=
176 duplicate$ "." = 'pop$
182 FUNCTION {new.block.checkb}
190 FUNCTION {field.or.null}
199 { "\emph{" swap$ * "}" * }
202 FUNCTION {tie.or.space.prefix}
203 { duplicate$ text.length$ #3 <
210 FUNCTION {capitalize}
211 { "u" change.case$ "t" change.case$ }
213 FUNCTION {space.word}
214 { " " swap$ * " " * }
215 % Here are the language-specific definitions for explicit words.
216 % Each function has a name bbl.xxx where xxx is the English word.
217 % The language selected here is ENGLISH
224 FUNCTION {bbl.editors}
227 FUNCTION {bbl.editor}
233 FUNCTION {bbl.edition}
236 FUNCTION {bbl.volume}
242 FUNCTION {bbl.number}
260 FUNCTION {bbl.chapter}
263 FUNCTION {bbl.techrep}
266 FUNCTION {bbl.mthesis}
267 { "Master's thesis" }
269 FUNCTION {bbl.phdthesis}
272 FUNCTION {close.brace}
299 MACRO {acmcs} {"ACM Comput. Surv."}
301 MACRO {acta} {"Acta Inf."}
303 MACRO {cacm} {"Commun. ACM"}
305 MACRO {ibmjrd} {"IBM J. Res. Dev."}
307 MACRO {ibmsj} {"IBM Syst.~J."}
309 MACRO {ieeese} {"IEEE Trans. Software Eng."}
311 MACRO {ieeetc} {"IEEE Trans. Comput."}
314 {"IEEE Trans. Comput. Aid. Des."}
316 MACRO {ipl} {"Inf. Process. Lett."}
318 MACRO {jacm} {"J.~ACM"}
320 MACRO {jcss} {"J.~Comput. Syst. Sci."}
322 MACRO {scp} {"Sci. Comput. Program."}
324 MACRO {sicomp} {"SIAM J. Comput."}
326 MACRO {tocs} {"ACM Trans. Comput. Syst."}
328 MACRO {tods} {"ACM Trans. Database Syst."}
330 MACRO {tog} {"ACM Trans. Graphic."}
332 MACRO {toms} {"ACM Trans. Math. Software"}
334 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
336 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
338 MACRO {tcs} {"Theor. Comput. Sci."}
340 FUNCTION {bibinfo.check}
352 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
358 FUNCTION {bibinfo.warn}
362 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
367 swap$ "empty " swap$ * " in " * cite$ * warning$
378 INTEGERS { nameptr namesleft numnames }
383 % FUNCTION {format.names}
385 % duplicate$ empty$ 'skip$ {
389 % s num.names$ 'numnames :=
390 % numnames 'namesleft :=
393 % "{vv~}{ll}{ jj}{ f{}}"
396 % bibinfo bibinfo.check
403 % s nameptr "{ll}" format.name$ duplicate$ "others" =
419 % nameptr #1 + 'nameptr :=
420 % namesleft #1 - 'namesleft :=
426 FUNCTION {format.names}
428 duplicate$ empty$ 'skip$ {
432 s num.names$ 'numnames :=
433 numnames 'namesleft :=
436 "{vv~}{ll}{ jj}\xfnm[{ f{.}.}]"
439 bibinfo bibinfo.check
455 s nameptr "{ll}" format.name$ duplicate$ "others" =
470 nameptr #1 + 'nameptr :=
471 namesleft #1 - 'namesleft :=
478 FUNCTION {format.names.ed}
482 FUNCTION {format.key}
484 { key field.or.null }
489 FUNCTION {format.authors}
490 { author "author" format.names
491 duplicate$ empty$ 'skip$
492 { collaboration "collaboration" bibinfo.check
493 duplicate$ empty$ 'skip$
494 { " (" swap$ * ")" * }
500 FUNCTION {get.bbl.editor}
501 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
503 FUNCTION {format.editors}
504 { editor "editor" format.names duplicate$ empty$ 'skip$
513 FUNCTION {format.isbn}
514 { isbn "isbn" bibinfo.check
515 duplicate$ empty$ 'skip$
523 FUNCTION {format.note}
527 { note #1 #1 substring$
530 { output.state mid.sentence =
537 note #2 global.max$ substring$ * "note" bibinfo.check
542 FUNCTION {format.title}
544 duplicate$ empty$ 'skip$
547 "title" bibinfo.check
549 FUNCTION {format.full.names}
553 s num.names$ 'numnames :=
554 numnames 'namesleft :=
557 "{vv~}{ll}" format.name$
572 s nameptr "{ll}" format.name$ duplicate$ "others" =
590 nameptr #1 + 'nameptr :=
591 namesleft #1 - 'namesleft :=
596 FUNCTION {author.editor.key.full}
600 { cite$ #1 #3 substring$ }
604 { editor format.full.names }
607 { author format.full.names }
611 FUNCTION {author.key.full}
614 { cite$ #1 #3 substring$ }
618 { author format.full.names }
622 FUNCTION {editor.key.full}
625 { cite$ #1 #3 substring$ }
629 { editor format.full.names }
633 FUNCTION {make.full.names}
637 'author.editor.key.full
638 { type$ "proceedings" =
646 FUNCTION {output.bibitem}
650 ")" make.full.names duplicate$ short.list =
659 before.all 'output.state :=
667 { t #1 #1 substring$ "-" =
668 { t #1 #2 substring$ "--" = not
670 t #2 global.max$ substring$ 't :=
672 { { t #1 #1 substring$ "-" = }
674 t #2 global.max$ substring$ 't :=
680 { t #1 #1 substring$ *
681 t #2 global.max$ substring$ 't :=
693 FUNCTION {format.date}
694 { year "year" bibinfo.check duplicate$ empty$
696 "empty year in " cite$ * "; set to ????" * warning$
703 FUNCTION {format.btitle}
704 { title "title" bibinfo.check
705 duplicate$ empty$ 'skip$
710 FUNCTION {either.or.check}
713 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
716 FUNCTION {format.bvolume}
719 { bbl.volume volume tie.or.space.prefix
720 "volume" bibinfo.check * *
721 series "series" bibinfo.check
722 duplicate$ empty$ 'pop$
723 { swap$ bbl.of space.word * swap$
726 "volume and number" number either.or.check
730 FUNCTION {format.number.series}
733 { series field.or.null }
735 { number "number" bibinfo.check }
736 { output.state mid.sentence =
738 { bbl.number capitalize }
740 number tie.or.space.prefix "number" bibinfo.check * *
742 series "series" bibinfo.check *
752 FUNCTION {format.edition}
753 { edition duplicate$ empty$ 'skip$
755 output.state mid.sentence =
759 "edition" bibinfo.check
764 INTEGERS { multiresult }
765 FUNCTION {multi.page.check}
774 swap$ duplicate$ "," =
777 { #1 'multiresult := }
778 { t #2 global.max$ substring$ 't := }
785 FUNCTION {format.pages}
786 { pages duplicate$ empty$ 'skip$
787 { duplicate$ multi.page.check
797 "pages" bibinfo.check
802 FUNCTION {format.journal.pages}
803 { pages duplicate$ empty$ 'pop$
804 { swap$ duplicate$ empty$
805 { pop$ pop$ format.pages }
810 "pages" bibinfo.check
817 FUNCTION {format.journal.eid}
818 { eid "eid" bibinfo.check
819 duplicate$ empty$ 'pop$
820 { swap$ duplicate$ empty$ 'skip$
826 numpages empty$ 'skip$
827 { bbl.eidpp numpages tie.or.space.prefix
828 "numpages" bibinfo.check * *
835 FUNCTION {format.vol.num.pages}
836 { volume field.or.null
837 duplicate$ empty$ 'skip$
839 "volume" bibinfo.check
842 number "number" bibinfo.check duplicate$ empty$ 'skip$
844 swap$ duplicate$ empty$
845 { "there's a number but no volume in " cite$ * warning$ }
854 FUNCTION {format.chapter.pages}
859 { type "l" change.case$
863 chapter tie.or.space.prefix
864 "chapter" bibinfo.check
870 FUNCTION {format.booktitle}
872 booktitle "booktitle" bibinfo.check
874 FUNCTION {format.in.ed.booktitle}
875 { format.booktitle duplicate$ empty$ 'skip$
877 editor "editor" format.names.ed duplicate$ empty$ 'pop$
890 FUNCTION {format.thesis.type}
891 { type duplicate$ empty$
894 "t" change.case$ "type" bibinfo.check
898 FUNCTION {format.tr.number}
899 { number "number" bibinfo.check
900 type duplicate$ empty$
905 swap$ duplicate$ empty$
906 { pop$ "t" change.case$ }
907 { tie.or.space.prefix * * }
910 FUNCTION {format.article.crossref}
913 " \cite{" * crossref * "}" *
915 FUNCTION {format.book.crossref}
916 { volume duplicate$ empty$
917 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
922 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
925 " \cite{" * crossref * "}" *
927 FUNCTION {format.incoll.inproc.crossref}
930 " \cite{" * crossref * "}" *
932 FUNCTION {format.org.or.pub}
935 address empty$ t empty$ and
938 address "address" bibinfo.check *
951 FUNCTION {format.publisher.address}
952 { publisher "publisher" bibinfo.check format.org.or.pub
955 FUNCTION {format.organization.address}
956 { organization "organization" bibinfo.check format.org.or.pub
960 {url duplicate$ empty$
963 urlprefix "\url{" * swap$ * "}" *
969 {doi duplicate$ empty$
972 doiprefix "\doi{" * swap$ * "}" *
977 FUNCTION {print.eprint}
978 {eprint duplicate$ empty$
981 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
986 FUNCTION {print.pubmed}
987 {pubmed duplicate$ empty$
990 pubmedprefix "\Pubmed{" * swap$ * "}" *
996 { "%Type = Webpage" write$
998 format.authors "author" output.check
999 author format.key output
1002 format.title "title" output.check
1004 format.date "year" output.check
1008 format.date "year" output.check
1010 format.title "title" output.check
1019 { "%Type = Article" write$
1021 format.authors "author" output.check
1022 author format.key output
1024 format.title "title" output.check
1030 "journal" bibinfo.check
1031 "journal" output.check
1033 format.date "year" output.check
1035 format.vol.num.pages output
1037 { format.article.crossref output.nonnull
1041 { format.journal.pages }
1042 { format.journal.eid }
1054 { "%Type = Book" write$
1057 { format.editors "author and editor" output.check
1058 editor format.key output
1060 { format.authors output.nonnull
1062 { "author and editor" editor either.or.check }
1068 format.btitle "title" output.check
1070 { format.bvolume output
1073 format.number.series output
1074 format.edition output
1075 format.publisher.address output
1079 format.book.crossref output.nonnull
1082 format.date "year" output.check
1094 { "%Type = Booklet" write$
1096 format.authors output
1097 author format.key output
1099 format.title "title" output.check
1101 howpublished "howpublished" bibinfo.check output
1102 address "address" bibinfo.check output
1103 format.date "year" output.check
1115 { "%Type = Inbook" write$
1118 { format.editors "author and editor" output.check
1119 editor format.key output
1121 { format.authors output.nonnull
1123 { "author and editor" editor either.or.check }
1129 format.btitle "title" output.check
1132 format.bvolume output
1133 format.chapter.pages "chapter and pages" output.check
1136 format.number.series output
1137 format.edition output
1138 format.publisher.address output
1141 format.chapter.pages "chapter and pages" output.check
1143 format.book.crossref output.nonnull
1147 { format.isbn output }
1150 format.date "year" output.check
1152 format.pages "pages" output.check
1162 FUNCTION {incollection}
1163 { "%Type = Incollection" write$
1165 format.authors "author" output.check
1166 author format.key output
1168 format.title "title" output.check
1171 { format.in.ed.booktitle "booktitle" output.check
1172 format.bvolume output
1173 format.chapter.pages output
1174 format.edition output
1176 format.number.series output
1177 format.publisher.address output
1180 { format.incoll.inproc.crossref output.nonnull
1181 format.chapter.pages output
1184 format.date "year" output.check
1186 format.pages "pages" output.check
1196 FUNCTION {inproceedings}
1197 { "%Type = Inproceedings" write$
1199 format.authors "author" output.check
1200 author format.key output
1202 format.title "title" output.check
1205 { format.in.ed.booktitle "booktitle" output.check
1206 format.bvolume output
1208 format.number.series output
1210 { format.organization.address output }
1211 { organization "organization" bibinfo.check output
1212 format.publisher.address output
1217 { format.incoll.inproc.crossref output.nonnull
1220 format.date "year" output.check
1222 format.pages "pages" output.check
1232 FUNCTION {conference} { inproceedings }
1235 { "%Type = Manual" write$
1237 format.authors output
1238 author format.key output
1240 format.btitle "title" output.check
1241 format.edition output
1242 organization address new.block.checkb
1243 organization "organization" bibinfo.check output
1244 address "address" bibinfo.check output
1245 format.date "year" output.check
1255 FUNCTION {mastersthesis}
1256 { "%Type = Masterthesis" write$
1258 format.authors "author" output.check
1259 author format.key output
1262 "title" output.check
1264 bbl.mthesis format.thesis.type output.nonnull
1265 school "school" bibinfo.warn output
1266 address "address" bibinfo.check output
1267 format.date "year" output.check
1278 { "%Type = Misc" write$
1280 format.authors output
1281 author format.key output
1285 howpublished "howpublished" bibinfo.check output
1286 format.date "year" output.check
1296 FUNCTION {phdthesis}
1297 { "%Type = Phdthesis" write$
1299 format.authors "author" output.check
1300 author format.key output
1303 "title" output.check
1305 bbl.phdthesis format.thesis.type output.nonnull
1306 school "school" bibinfo.warn output
1307 address "address" bibinfo.check output
1308 format.date "year" output.check
1318 FUNCTION {proceedings}
1319 { "%Type = Proceedings" write$
1321 format.editors output
1322 editor format.key output
1324 format.btitle "title" output.check
1325 format.bvolume output
1327 format.number.series output
1329 { format.organization.address output }
1330 { organization "organization" bibinfo.check output
1331 format.publisher.address output
1334 format.date "year" output.check
1345 FUNCTION {techreport}
1346 { "%Type = Techreport" write$
1348 format.authors "author" output.check
1349 author format.key output
1352 "title" output.check
1354 format.tr.number output.nonnull
1355 institution "institution" bibinfo.warn output
1356 address "address" bibinfo.check output
1357 format.date "year" output.check
1367 FUNCTION {unpublished}
1368 { "%Type = Unpublished" write$
1370 format.authors "author" output.check
1371 author format.key output
1373 format.title "title" output.check
1374 format.date "year" output.check
1380 format.note "note" output.check
1384 FUNCTION {default.type} { misc }
1391 FUNCTION {chop.word}
1394 s #1 len substring$ =
1395 { s len #1 + global.max$ substring$ }
1399 FUNCTION {format.lab.names}
1402 s #1 "{vv~}{ll}" format.name$
1403 s num.names$ duplicate$
1410 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1414 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1423 FUNCTION {author.key.label}
1426 { cite$ #1 #3 substring$ }
1430 { author format.lab.names }
1434 FUNCTION {author.editor.key.label}
1438 { cite$ #1 #3 substring$ }
1442 { editor format.lab.names }
1445 { author format.lab.names }
1449 FUNCTION {editor.key.label}
1452 { cite$ #1 #3 substring$ }
1456 { editor format.lab.names }
1460 FUNCTION {calc.short.authors}
1464 'author.editor.key.label
1465 { type$ "proceedings" =
1474 FUNCTION {calc.label}
1475 { calc.short.authors
1479 year duplicate$ empty$
1481 { purify$ #-1 #4 substring$ }
1487 FUNCTION {sort.format.names}
1491 s num.names$ 'numnames :=
1492 numnames 'namesleft :=
1495 "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1496 % "{vv~}{ll~}{\rd[f.f.]}{jj~}"
1501 namesleft #1 = t "others" = and
1508 nameptr #1 + 'nameptr :=
1509 namesleft #1 - 'namesleft :=
1514 FUNCTION {sort.format.title}
1518 "The " #4 t chop.word
1522 #1 global.max$ substring$
1524 FUNCTION {author.sort}
1527 { "to sort, need author or key in " cite$ * warning$
1533 { author sort.format.names }
1536 FUNCTION {author.editor.sort}
1540 { "to sort, need author, editor, or key in " cite$ * warning$
1546 { editor sort.format.names }
1549 { author sort.format.names }
1552 FUNCTION {editor.sort}
1555 { "to sort, need editor or key in " cite$ * warning$
1561 { editor sort.format.names }
1564 INTEGERS { seq.num }
1568 FUNCTION {int.to.fix}
1569 { "000000000" swap$ int.to.str$ *
1577 seq.num #1 + 'seq.num :=
1587 #1 entry.max$ substring$
1593 STRINGS { last.label next.extra }
1594 INTEGERS { last.extra.num number.label }
1595 FUNCTION {initialize.extra.label.stuff}
1596 { #0 int.to.chr$ 'last.label :=
1598 #0 'last.extra.num :=
1601 FUNCTION {forward.pass}
1602 { last.label label =
1603 { last.extra.num #1 + 'last.extra.num :=
1604 last.extra.num int.to.chr$ 'extra.label :=
1606 { "a" chr.to.int$ 'last.extra.num :=
1608 label 'last.label :=
1611 number.label #1 + 'number.label :=
1613 FUNCTION {reverse.pass}
1615 { "a" 'extra.label := }
1618 extra.label 'next.extra :=
1622 { "{\natexlab{" swap$ * "}}" * }
1625 label extra.label * 'label :=
1627 EXECUTE {initialize.extra.label.stuff}
1628 ITERATE {forward.pass}
1629 REVERSE {reverse.pass}
1630 FUNCTION {bib.sort.order}
1634 year field.or.null sortify
1641 #1 entry.max$ substring$
1644 ITERATE {bib.sort.order}
1646 FUNCTION {begin.bib}
1649 { preamble$ write$ newline$ }
1651 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1653 "\providecommand{\natexlab}[1]{#1}"
1655 "\providecommand{\url}[1]{\texttt{#1}}"
1657 "\providecommand{\href}[2]{#2}"
1659 "\providecommand{\path}[1]{#1}"
1661 "\providecommand{\eprint}[1]{\href{http://arxiv.org/abs/#1}{\path{#1}}}"
1663 "\providecommand{\DOIprefix}{doi:}"
1665 "\providecommand{\ArXivprefix}{arXiv:}"
1667 "\providecommand{\URLprefix}{URL: }"
1669 "\providecommand{\Pubmedprefix}{pmid:}"
1671 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1673 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1675 "\providecommand{\BIBand}{and}"
1677 "\providecommand{\bibinfo}[2]{#2}"
1679 "\ifx\xfnm\undefined \def\xfnm[#1]{\unskip,\space#1}\fi"
1683 EXECUTE {init.state.consts}
1684 EXECUTE {init.web.variables}
1685 ITERATE {call.type$}
1688 "\end{thebibliography}" write$ newline$
1691 %% End of customized bst file
1693 %% End of file `model3-num-names.bst'.
1700 %% a. doi, url, eprint, pmid added
1701 %% b. Bibtype `webpage' defined