2 %% This is file `model5-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: model5-names.bst 214 2012-10-22 07:34:19Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-5/model5-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 =
82 { output.state before.all =
84 { add.period$ " " * write$ }
88 mid.sentence 'output.state :=
99 FUNCTION {output.check}
102 { pop$ "empty " t * " in " * cite$ * warning$ }
113 { output.state before.all =
115 { after.block 'output.state := }
118 FUNCTION {new.sentence}
119 { output.state after.block =
121 { output.state before.all =
123 { after.sentence 'output.state := }
129 { " " * before.all 'output.state :=
132 FUNCTION {date.block}
152 FUNCTION {new.block.checkb}
160 FUNCTION {field.or.null}
169 { "{\it " swap$ * "\/}" * }
172 FUNCTION {tie.or.space.prefix}
173 { duplicate$ text.length$ #3 <
180 FUNCTION {capitalize}
181 { "u" change.case$ "t" change.case$ }
183 FUNCTION {space.word}
184 { " " swap$ * " " * }
185 % Here are the language-specific definitions for explicit words.
186 % Each function has a name bbl.xxx where xxx is the English word.
187 % The language selected here is ENGLISH
194 FUNCTION {bbl.editors}
197 FUNCTION {bbl.editor}
203 FUNCTION {bbl.edition}
206 FUNCTION {bbl.volume}
212 FUNCTION {bbl.number}
227 FUNCTION {bbl.chapter}
230 FUNCTION {bbl.techrep}
231 { "Technical Report" }
233 FUNCTION {bbl.mthesis}
234 { "Master's thesis" }
236 FUNCTION {bbl.phdthesis}
242 FUNCTION {bbl.second}
248 FUNCTION {bbl.fourth}
266 MACRO {jan} {"January"}
268 MACRO {feb} {"February"}
270 MACRO {mar} {"March"}
272 MACRO {apr} {"April"}
280 MACRO {aug} {"August"}
282 MACRO {sep} {"September"}
284 MACRO {oct} {"October"}
286 MACRO {nov} {"November"}
288 MACRO {dec} {"December"}
291 { duplicate$ "1" swap$ *
292 #-2 #1 substring$ "1" =
294 { duplicate$ #-1 #1 substring$
311 MACRO {acmcs} {"ACM Comput. Surv."}
313 MACRO {acta} {"Acta Inf."}
315 MACRO {cacm} {"Commun. ACM"}
317 MACRO {ibmjrd} {"IBM J. Res. Dev."}
319 MACRO {ibmsj} {"IBM Syst.~J."}
321 MACRO {ieeese} {"IEEE Trans. Software Eng."}
323 MACRO {ieeetc} {"IEEE Trans. Comput."}
326 {"IEEE Trans. Comput. Aid. Des."}
328 MACRO {ipl} {"Inf. Process. Lett."}
330 MACRO {jacm} {"J.~ACM"}
332 MACRO {jcss} {"J.~Comput. Syst. Sci."}
334 MACRO {scp} {"Sci. Comput. Program."}
336 MACRO {sicomp} {"SIAM J. Comput."}
338 MACRO {tocs} {"ACM Trans. Comput. Syst."}
340 MACRO {tods} {"ACM Trans. Database Syst."}
342 MACRO {tog} {"ACM Trans. Graphic."}
344 MACRO {toms} {"ACM Trans. Math. Software"}
346 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
348 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
350 MACRO {tcs} {"Theor. Comput. Sci."}
352 FUNCTION {bibinfo.check}
364 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
370 FUNCTION {bibinfo.warn}
374 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
379 swap$ "empty " swap$ * " in " * cite$ * warning$
389 INTEGERS { nameptr namesleft numnames }
391 FUNCTION {format.names}
393 duplicate$ empty$ 'skip$ {
397 s num.names$ 'numnames :=
398 numnames 'namesleft :=
401 "{vv~}{ll}{, f.}{, jj}"
403 bibinfo bibinfo.check
420 s nameptr "{ll}" format.name$ duplicate$ "others" =
438 nameptr #1 + 'nameptr :=
439 namesleft #1 - 'namesleft :=
444 FUNCTION {format.names.ed}
447 duplicate$ empty$ 'skip$ {
451 s num.names$ 'numnames :=
452 numnames 'namesleft :=
455 "{f.~}{vv~}{ll}{, jj}"
457 bibinfo bibinfo.check
464 s nameptr "{ll}" format.name$ duplicate$ "others" =
483 nameptr #1 + 'nameptr :=
484 namesleft #1 - 'namesleft :=
489 FUNCTION {format.key}
491 { key field.or.null }
496 FUNCTION {format.authors}
497 { author "author" format.names
498 duplicate$ empty$ 'skip$
499 { collaboration "collaboration" bibinfo.check
500 duplicate$ empty$ 'skip$
501 { " (" swap$ * ")" * }
509 FUNCTION {get.bbl.editor}
510 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
512 FUNCTION {format.editors}
513 { editor "editor" format.names 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$
574 s nameptr "{ll}" format.name$ duplicate$ "others" =
592 nameptr #1 + 'nameptr :=
593 namesleft #1 - 'namesleft :=
598 FUNCTION {author.editor.key.full}
602 { cite$ #1 #3 substring$ }
606 { editor format.full.names }
609 { author format.full.names }
613 FUNCTION {author.key.full}
616 { cite$ #1 #3 substring$ }
620 { author format.full.names }
624 FUNCTION {editor.key.full}
627 { cite$ #1 #3 substring$ }
631 { editor format.full.names }
635 FUNCTION {make.full.names}
639 'author.editor.key.full
640 { type$ "proceedings" =
648 FUNCTION {output.bibitem}
652 ")" make.full.names duplicate$ short.list =
661 before.all 'output.state :=
669 { t #1 #1 substring$ "-" =
670 { t #1 #2 substring$ "--" = not
672 t #2 global.max$ substring$ 't :=
674 { { t #1 #1 substring$ "-" = }
676 t #2 global.max$ substring$ 't :=
682 { t #1 #1 substring$ *
683 t #2 global.max$ substring$ 't :=
695 FUNCTION {format.date}
696 { year "year" bibinfo.check duplicate$ empty$
702 before.all 'output.state :=
705 FUNCTION {format.btitle}
706 { title "title" bibinfo.check
707 duplicate$ empty$ 'skip$
713 FUNCTION {either.or.check}
716 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
719 FUNCTION {format.bvolume}
722 { bbl.volume volume tie.or.space.prefix
723 "volume" bibinfo.check * *
724 series "series" bibinfo.check
725 duplicate$ empty$ 'pop$
726 { swap$ bbl.of space.word * swap$
729 "volume and number" number either.or.check
733 FUNCTION {format.number.series}
736 { series field.or.null }
738 { number "number" bibinfo.check }
739 { output.state mid.sentence =
741 { bbl.number capitalize }
743 number tie.or.space.prefix "number" bibinfo.check * *
745 series "series" bibinfo.check *
756 duplicate$ "0" chr.to.int$ < not
757 swap$ "9" chr.to.int$ > not and
760 FUNCTION {extract.num}
765 t #2 global.max$ substring$ 't :=
778 FUNCTION {convert.edition}
779 { extract.num "l" change.case$ 's :=
780 s "first" = s "1" = or
782 { s "second" = s "2" = or
784 { s "third" = s "3" = or
786 { s "fourth" = s "4" = or
788 { s "fifth" = s "5" = or
790 { s #1 #1 substring$ is.num
807 FUNCTION {format.edition}
808 { edition duplicate$ empty$ 'skip$
811 output.state mid.sentence =
815 "edition" bibinfo.check
821 INTEGERS { multiresult }
822 FUNCTION {multi.page.check}
831 swap$ duplicate$ "," =
834 { #1 'multiresult := }
835 { t #2 global.max$ substring$ 't := }
841 FUNCTION {format.pages}
842 { pages duplicate$ empty$ 'skip$
843 { duplicate$ multi.page.check
853 "pages" bibinfo.check
860 FUNCTION {format.journal.pages}
861 { pages duplicate$ empty$ 'pop$
862 { swap$ duplicate$ empty$
863 { pop$ pop$ format.pages }
868 "pages" bibinfo.check
875 FUNCTION {format.vol.num.pages}
876 { volume field.or.null
877 duplicate$ empty$ 'skip$
879 "volume" bibinfo.check
886 FUNCTION {format.chapter.pages}
891 { type "l" change.case$
895 chapter tie.or.space.prefix
896 "chapter" bibinfo.check
900 { ". " * format.pages * }
906 FUNCTION {format.booktitle}
908 booktitle "booktitle" bibinfo.check
911 FUNCTION {format.in.ed.booktitle}
912 { format.booktitle duplicate$ empty$ 'skip$
914 editor "editor" format.names.ed duplicate$ empty$ 'pop$
927 FUNCTION {format.thesis.type}
928 { type duplicate$ empty$
931 "t" change.case$ "type" bibinfo.check
935 FUNCTION {format.tr.number}
936 { number "number" bibinfo.check
937 type duplicate$ empty$
942 swap$ duplicate$ empty$
943 { pop$ "t" change.case$ }
944 { tie.or.space.prefix * * }
947 FUNCTION {format.article.crossref}
950 " \cite{" * crossref * "}" *
952 FUNCTION {format.book.crossref}
953 { volume duplicate$ empty$
954 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
959 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
962 " \cite{" * crossref * "}" *
964 FUNCTION {format.incoll.inproc.crossref}
967 " \cite{" * crossref * "}" *
969 FUNCTION {format.org.or.pub}
972 address empty$ t empty$ and
975 address "address" bibinfo.check *
988 FUNCTION {format.publisher.address}
989 { publisher "publisher" bibinfo.check format.org.or.pub
992 FUNCTION {format.organization.address}
993 { organization "organization" bibinfo.check format.org.or.pub
997 {url duplicate$ empty$
1000 urlprefix "\url{" * swap$ * "}" *
1005 FUNCTION {print.doi}
1006 {doi duplicate$ empty$
1009 doiprefix "\doi{" * swap$ * "}" *
1014 FUNCTION {print.eprint}
1015 {eprint duplicate$ empty$
1018 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
1023 FUNCTION {print.pubmed}
1024 {pubmed duplicate$ empty$
1027 pubmedprefix "\Pubmed{" * swap$ * "}" *
1033 { "%Type = Webpage" write$
1035 format.authors "author" output.check
1036 author format.key output
1039 format.title "title" output.check
1041 format.date "year" output.check
1045 format.date "year" output.check
1047 format.title "title" output.check
1056 { "%Type = Article" write$
1058 format.authors "author" output.check
1059 author format.key output
1060 format.date "year" output.check
1062 format.title "title" output.check
1067 "journal" bibinfo.check
1069 "journal" output.check
1071 format.vol.num.pages output
1073 { format.article.crossref output.nonnull
1087 { "%Type = Book" write$
1090 { format.editors "author and editor" output.check
1091 editor format.key output
1093 { format.authors output.nonnull
1095 { "author and editor" editor either.or.check }
1100 format.date "year" output.check
1102 format.btitle "title" output.check
1104 { format.bvolume output
1107 format.number.series output
1108 format.edition output
1110 format.publisher.address output
1114 format.book.crossref output.nonnull
1127 { "%Type = booklet" write$
1129 format.authors output
1130 author format.key output
1131 format.date "year" output.check
1133 format.title "title" output.check
1135 howpublished "howpublished" bibinfo.check output
1136 address "address" bibinfo.check output
1147 { "%Type = Inbook" write$
1149 format.authors "author" output.check
1150 author format.key output
1151 format.date "year" output.check
1153 format.title "title" output.check
1156 { format.in.ed.booktitle "booktitle" output.check
1157 format.number.series output
1158 format.chapter.pages output
1160 format.publisher.address output
1161 format.bvolume output
1163 format.edition output
1165 { format.incoll.inproc.crossref output.nonnull
1178 FUNCTION {incollection}
1179 { "%Type = Incollection" write$
1181 format.authors "author" output.check
1182 author format.key output
1183 format.date "year" output.check
1185 format.title "title" output.check
1188 { format.in.ed.booktitle "booktitle" output.check
1189 format.number.series output
1190 format.chapter.pages output
1192 format.publisher.address output
1193 format.bvolume output
1195 format.edition output
1197 { format.incoll.inproc.crossref output.nonnull
1209 FUNCTION {inproceedings}
1210 { "%Type = Inproceedings" write$
1212 format.authors "author" output.check
1213 author format.key output
1214 format.date "year" output.check
1216 format.title "title" output.check
1219 { format.in.ed.booktitle "booktitle" output.check
1220 format.number.series output
1224 { format.organization.address output }
1225 { organization "organization" bibinfo.check output
1226 format.publisher.address output
1229 format.bvolume output
1231 { format.incoll.inproc.crossref output.nonnull
1243 FUNCTION {conference} { inproceedings }
1246 { "%Type = Manual" write$
1248 format.authors output
1249 author format.key output
1250 format.date "year" output.check
1252 format.btitle "title" output.check
1253 organization address new.block.checkb
1254 organization "organization" bibinfo.check output
1255 address "address" bibinfo.check output
1256 format.edition output
1266 FUNCTION {mastersthesis}
1267 { "%Type = Masterthesis" write$
1269 format.authors "author" output.check
1270 author format.key output
1271 format.date "year" output.check
1274 "title" output.check
1276 bbl.mthesis format.thesis.type output.nonnull
1277 school "school" bibinfo.warn output
1278 address "address" bibinfo.check output
1289 { "%Type = Misc" write$
1291 format.authors output
1292 author format.key output
1293 format.date "year" output.check
1297 howpublished "howpublished" bibinfo.check output
1307 FUNCTION {phdthesis}
1308 { "%Type = Phdthesis" write$
1310 format.authors "author" output.check
1311 author format.key output
1312 format.date "year" output.check
1315 "title" output.check
1317 bbl.phdthesis format.thesis.type output.nonnull
1318 school "school" bibinfo.warn output
1319 address "address" bibinfo.check output
1329 FUNCTION {proceedings}
1330 { "%Type = Proceedings" write$
1332 format.editors output
1333 editor format.key output
1334 format.date "year" output.check
1336 format.btitle "title" output.check
1337 format.bvolume output
1339 format.number.series output
1341 { format.organization.address output }
1342 { organization "organization" bibinfo.check output
1343 format.publisher.address output
1355 FUNCTION {techreport}
1356 { "%Type = Techreport" write$
1358 format.authors "author" output.check
1359 author format.key output
1360 format.date "year" output.check
1363 "title" output.check
1365 format.tr.number output.nonnull
1366 institution "institution" bibinfo.warn output
1367 address "address" bibinfo.check output
1377 FUNCTION {unpublished}
1378 { "%Type = Unpublished" write$
1380 format.authors "author" output.check
1381 author format.key output
1382 format.date "year" output.check
1384 format.title "title" output.check
1390 format.note "note" output.check
1394 FUNCTION {default.type} { misc }
1401 FUNCTION {chop.word}
1404 s #1 len substring$ =
1405 { s len #1 + global.max$ substring$ }
1409 FUNCTION {format.lab.names}
1412 s #1 "{vv~}{ll}" format.name$
1413 s num.names$ duplicate$
1420 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1424 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1433 FUNCTION {author.key.label}
1436 { cite$ #1 #3 substring$ }
1440 { author format.lab.names }
1444 FUNCTION {author.editor.key.label}
1448 { cite$ #1 #3 substring$ }
1452 { editor format.lab.names }
1455 { author format.lab.names }
1459 FUNCTION {editor.key.label}
1462 { cite$ #1 #3 substring$ }
1466 { editor format.lab.names }
1470 FUNCTION {calc.short.authors}
1474 'author.editor.key.label
1475 { type$ "proceedings" =
1484 FUNCTION {calc.label}
1485 { calc.short.authors
1489 year duplicate$ empty$
1490 short.list key field.or.null = or
1498 FUNCTION {sort.format.names}
1502 s num.names$ 'numnames :=
1503 numnames 'namesleft :=
1506 "{ll{ }}{ f{ }}{ jj{ }}"
1521 namesleft #1 = t "others" = and
1528 nameptr #1 + 'nameptr :=
1529 namesleft #1 - 'namesleft :=
1534 FUNCTION {sort.format.title}
1538 "The " #4 t chop.word
1542 #1 global.max$ substring$
1544 FUNCTION {author.sort}
1547 { "to sort, need author or key in " cite$ * warning$
1553 { author sort.format.names }
1556 FUNCTION {author.editor.sort}
1560 { "to sort, need author, editor, or key in " cite$ * warning$
1566 { editor sort.format.names }
1569 { author sort.format.names }
1572 FUNCTION {editor.sort}
1575 { "to sort, need editor or key in " cite$ * warning$
1581 { editor sort.format.names }
1593 { type$ "proceedings" =
1599 #1 entry.max$ substring$
1608 #1 entry.max$ substring$
1614 STRINGS { last.label next.extra }
1615 INTEGERS { last.extra.num number.label }
1616 FUNCTION {initialize.extra.label.stuff}
1617 { #0 int.to.chr$ 'last.label :=
1619 #0 'last.extra.num :=
1622 FUNCTION {forward.pass}
1623 { last.label label =
1624 { last.extra.num #1 + 'last.extra.num :=
1625 last.extra.num int.to.chr$ 'extra.label :=
1627 { "a" chr.to.int$ 'last.extra.num :=
1629 label 'last.label :=
1632 number.label #1 + 'number.label :=
1634 FUNCTION {reverse.pass}
1636 { "a" 'extra.label := }
1639 extra.label 'next.extra :=
1643 { "{\natexlab{" swap$ * "}}" * }
1646 label extra.label * 'label :=
1648 EXECUTE {initialize.extra.label.stuff}
1649 ITERATE {forward.pass}
1650 REVERSE {reverse.pass}
1651 FUNCTION {bib.sort.order}
1655 year field.or.null sortify
1662 #1 entry.max$ substring$
1665 ITERATE {bib.sort.order}
1667 FUNCTION {begin.bib}
1670 { preamble$ write$ newline$ }
1672 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1674 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1676 "\providecommand{\url}[1]{\texttt{#1}}"
1678 "\providecommand{\href}[2]{#2}"
1680 "\providecommand{\path}[1]{#1}"
1682 "\providecommand{\DOIprefix}{doi:}"
1684 "\providecommand{\ArXivprefix}{arXiv:}"
1686 "\providecommand{\URLprefix}{URL: }"
1688 "\providecommand{\Pubmedprefix}{pmid:}"
1690 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1692 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1694 "\providecommand{\bibinfo}[2]{#2}"
1696 "\ifx\xfnm\relax \def\xfnm[#1]{\unskip,\space#1}\fi"
1700 EXECUTE {init.state.consts}
1701 EXECUTE {init.web.variables}
1702 ITERATE {call.type$}
1705 "\end{thebibliography}" write$ newline$
1708 %% End of customized bst file
1710 %% End of file `model5-names.bst'.
1717 %% a. doi, url, eprint, pmid added
1718 %% b. Bibtype `webpage' defined
1721 %% a. collaboration added.