2 %% This is file `model4-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: model4-names.bst 213 2012-10-22 07:33:47Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-4/model4-names.bst $
53 { label extra.label sort.label short.list }
55 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
57 STRINGS { urlprefix doiprefix eprintprefix pubmedprefix }
59 FUNCTION {init.web.variables}
61 "\URLprefix " 'urlprefix :=
62 "\DOIprefix" 'doiprefix :=
63 "\ArXivprefix " 'eprintprefix :=
64 "\Pubmedprefix " 'pubmedprefix :=
67 FUNCTION {init.state.consts}
74 FUNCTION {output.nonnull}
76 output.state mid.sentence =
78 { output.state after.block =
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 {no.blank.or.punct}
134 { "" * before.all 'output.state :=
137 FUNCTION {date.block}
159 FUNCTION {remove.dots}
164 z #2 global.max$ substring$ 'z :=
165 duplicate$ "." = 'pop$
171 FUNCTION {new.block.checkb}
179 FUNCTION {field.or.null}
188 { "\textit{" swap$ * "}" * }
191 FUNCTION {tie.or.space.prefix}
192 { duplicate$ text.length$ #3 <
199 FUNCTION {capitalize}
200 { "u" change.case$ "t" change.case$ }
202 FUNCTION {space.word}
203 { " " swap$ * " " * }
204 % Here are the language-specific definitions for explicit words.
205 % Each function has a name bbl.xxx where xxx is the English word.
206 % The language selected here is ENGLISH
213 FUNCTION {bbl.editors}
216 FUNCTION {bbl.editor}
222 FUNCTION {bbl.edition}
225 FUNCTION {bbl.volume}
231 FUNCTION {bbl.number}
246 FUNCTION {bbl.chapter}
249 FUNCTION {bbl.techrep}
250 { "Technical Report" }
252 FUNCTION {bbl.mthesis}
253 { "Master's thesis" }
255 FUNCTION {bbl.phdthesis}
261 FUNCTION {bbl.second}
267 FUNCTION {bbl.fourth}
285 MACRO {jan} {"January"}
287 MACRO {feb} {"February"}
289 MACRO {mar} {"March"}
291 MACRO {apr} {"April"}
299 MACRO {aug} {"August"}
301 MACRO {sep} {"September"}
303 MACRO {oct} {"October"}
305 MACRO {nov} {"November"}
307 MACRO {dec} {"December"}
310 { duplicate$ "1" swap$ *
311 #-2 #1 substring$ "1" =
313 { duplicate$ #-1 #1 substring$
330 MACRO {acmcs} {"ACM Comput. Surv."}
332 MACRO {acta} {"Acta Inf."}
334 MACRO {cacm} {"Commun. ACM"}
336 MACRO {ibmjrd} {"IBM J. Res. Dev."}
338 MACRO {ibmsj} {"IBM Syst.~J."}
340 MACRO {ieeese} {"IEEE Trans. Software Eng."}
342 MACRO {ieeetc} {"IEEE Trans. Comput."}
345 {"IEEE Trans. Comput. Aid. Des."}
347 MACRO {ipl} {"Inf. Process. Lett."}
349 MACRO {jacm} {"J.~ACM"}
351 MACRO {jcss} {"J.~Comput. Syst. Sci."}
353 MACRO {scp} {"Sci. Comput. Program."}
355 MACRO {sicomp} {"SIAM J. Comput."}
357 MACRO {tocs} {"ACM Trans. Comput. Syst."}
359 MACRO {tods} {"ACM Trans. Database Syst."}
361 MACRO {tog} {"ACM Trans. Graphic."}
363 MACRO {toms} {"ACM Trans. Math. Software"}
365 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
367 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
369 MACRO {tcs} {"Theor. Comput. Sci."}
371 FUNCTION {bibinfo.check}
383 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
389 FUNCTION {bibinfo.warn}
393 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
398 swap$ "empty " swap$ * " in " * cite$ * warning$
408 INTEGERS { nameptr namesleft numnames }
410 FUNCTION {format.names}
412 duplicate$ empty$ 'skip$ {
416 s num.names$ 'numnames :=
417 numnames 'namesleft :=
420 "{vv~}{ll}{ jj}\xfnm[{ f{.}.}]"
423 bibinfo bibinfo.check
431 s nameptr "{ll}" format.name$ duplicate$ "others" =
446 nameptr #1 + 'nameptr :=
447 namesleft #1 - 'namesleft :=
452 FUNCTION {format.names.ed}
456 FUNCTION {format.key}
458 { key field.or.null }
463 FUNCTION {format.authors}
464 { author "author" format.names
465 duplicate$ empty$ 'skip$
466 { collaboration "collaboration" bibinfo.check
467 duplicate$ empty$ 'skip$
468 { " (" swap$ * ")" * }
475 FUNCTION {get.bbl.editor}
476 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
478 FUNCTION {format.editors}
479 { editor "editor" format.names duplicate$ empty$ 'skip$
488 FUNCTION {format.note}
492 { note #1 #1 substring$
495 { output.state mid.sentence =
502 note #2 global.max$ substring$ * "note" bibinfo.check
507 FUNCTION {format.title}
509 duplicate$ empty$ 'skip$
512 "title" bibinfo.check
514 FUNCTION {format.full.names}
518 s num.names$ 'numnames :=
519 numnames 'namesleft :=
522 "{vv~}{ll}" format.name$
529 s nameptr "{ll}" format.name$ duplicate$ "others" =
547 nameptr #1 + 'nameptr :=
548 namesleft #1 - 'namesleft :=
553 FUNCTION {author.editor.key.full}
557 { cite$ #1 #3 substring$ }
561 { editor format.full.names }
564 { author format.full.names }
568 FUNCTION {author.key.full}
571 { cite$ #1 #3 substring$ }
575 { author format.full.names }
579 FUNCTION {editor.key.full}
582 { cite$ #1 #3 substring$ }
586 { editor format.full.names }
590 FUNCTION {make.full.names}
594 'author.editor.key.full
595 { type$ "proceedings" =
603 FUNCTION {output.bibitem}
607 ")" make.full.names duplicate$ short.list =
616 before.all 'output.state :=
624 { t #1 #1 substring$ "-" =
625 { t #1 #2 substring$ "--" = not
627 t #2 global.max$ substring$ 't :=
629 { { t #1 #1 substring$ "-" = }
631 t #2 global.max$ substring$ 't :=
637 { t #1 #1 substring$ *
638 t #2 global.max$ substring$ 't :=
650 FUNCTION {format.date}
651 { year "year" bibinfo.check duplicate$ empty$
658 FUNCTION {format.btitle}
659 { title "title" bibinfo.check
660 duplicate$ empty$ 'skip$
665 FUNCTION {either.or.check}
668 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
671 FUNCTION {format.bvolume}
674 { bbl.volume volume tie.or.space.prefix
675 "volume" bibinfo.check * *
676 series "series" bibinfo.check
677 duplicate$ empty$ 'pop$
678 { swap$ bbl.of space.word * swap$
681 "volume and number" number either.or.check
685 FUNCTION {format.number.series}
688 { series field.or.null }
689 { output.state mid.sentence =
691 { bbl.number capitalize }
693 number tie.or.space.prefix "number" bibinfo.check * *
695 { "there's a number but no series in " cite$ * warning$ }
696 { bbl.in space.word *
697 series "series" bibinfo.check *
708 duplicate$ "0" chr.to.int$ < not
709 swap$ "9" chr.to.int$ > not and
712 FUNCTION {extract.num}
717 t #2 global.max$ substring$ 't :=
730 FUNCTION {convert.edition}
731 { extract.num "l" change.case$ 's :=
732 s "first" = s "1" = or
734 { s "second" = s "2" = or
736 { s "third" = s "3" = or
738 { s "fourth" = s "4" = or
740 { s "fifth" = s "5" = or
742 { s #1 #1 substring$ is.num
759 FUNCTION {format.edition}
760 { edition duplicate$ empty$ 'skip$
763 output.state mid.sentence =
767 "edition" bibinfo.check
772 INTEGERS { multiresult }
773 FUNCTION {multi.page.check}
782 swap$ duplicate$ "," =
785 { #1 'multiresult := }
786 { t #2 global.max$ substring$ 't := }
792 FUNCTION {format.pages}
793 { pages duplicate$ empty$ 'skip$
794 { duplicate$ multi.page.check
804 "pages" bibinfo.check
809 FUNCTION {format.journal.pages}
810 { pages duplicate$ empty$ 'pop$
811 { swap$ duplicate$ empty$
812 { pop$ pop$ format.pages }
817 "pages" bibinfo.check
824 FUNCTION {format.vol.num.pages}
825 { volume field.or.null
826 duplicate$ empty$ 'skip$
828 "volume" bibinfo.check
831 number "number" bibinfo.check duplicate$ empty$ 'skip$
833 swap$ duplicate$ empty$
834 { "there's a number but no volume in " cite$ * warning$ }
843 FUNCTION {format.chapter.pages}
848 { type "l" change.case$
852 chapter tie.or.space.prefix
853 "chapter" bibinfo.check
859 FUNCTION {format.booktitle}
861 booktitle "booktitle" bibinfo.check
863 FUNCTION {format.in.ed.booktitle}
864 { format.booktitle duplicate$ empty$ 'skip$
866 editor "editor" format.names.ed duplicate$ empty$ 'pop$
879 FUNCTION {format.thesis.type}
880 { type duplicate$ empty$
883 "t" change.case$ "type" bibinfo.check
887 FUNCTION {format.tr.number}
888 { number "number" bibinfo.check
889 type duplicate$ empty$
894 swap$ duplicate$ empty$
895 { pop$ "t" change.case$ }
896 { tie.or.space.prefix * * }
899 FUNCTION {format.article.crossref}
902 " \cite{" * crossref * "}" *
904 FUNCTION {format.book.crossref}
905 { volume duplicate$ empty$
906 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
911 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
914 " \cite{" * crossref * "}" *
916 FUNCTION {format.incoll.inproc.crossref}
919 " \cite{" * crossref * "}" *
921 FUNCTION {format.org.or.pub}
924 address empty$ t empty$ and
927 address "address" bibinfo.check *
940 FUNCTION {format.publisher.address}
941 { publisher "publisher" bibinfo.check format.org.or.pub
944 FUNCTION {format.organization.address}
945 { organization "organization" bibinfo.check format.org.or.pub
949 {url duplicate$ empty$
952 urlprefix "\url{" * swap$ * "}" *
958 {doi duplicate$ empty$
961 doiprefix "\doi{" * swap$ * "}" *
966 FUNCTION {print.eprint}
967 {eprint duplicate$ empty$
970 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
975 FUNCTION {print.pubmed}
976 {pubmed duplicate$ empty$
979 pubmedprefix "\Pubmed{" * swap$ * "}" *
984 FUNCTION {book.date.block}
990 FUNCTION {inbook.date.block}
997 { "%Type = Webpage" write$
999 format.authors "author" output.check
1000 author format.key output
1003 format.title "title" output.check
1005 format.date "year" output.check
1009 format.date "year" output.check
1011 format.title "title" output.check
1021 { "%Type = Article" write$
1023 format.authors "author" output.check
1024 author format.key output
1026 format.title "title" output.check
1032 "journal" bibinfo.check
1033 "journal" output.check
1035 format.date "year" output.check
1037 format.vol.num.pages output
1039 { format.article.crossref output.nonnull
1042 format.journal.pages
1053 { "%Type = Book" write$
1056 { format.editors "author and editor" output.check
1057 editor format.key output
1059 { format.authors output.nonnull
1061 { "author and editor" editor either.or.check }
1067 format.btitle "title" output.check
1069 format.edition output
1071 { format.bvolume output
1073 format.number.series output
1075 format.publisher.address output
1079 format.book.crossref output.nonnull
1084 format.date "year" output.check
1095 { "%Type = Booklet" write$
1097 format.authors output
1098 author format.key output
1100 format.title "title" output.check
1102 howpublished "howpublished" bibinfo.check output
1103 address "address" bibinfo.check output
1104 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.publisher.address output
1133 format.bvolume output
1135 format.number.series output
1140 format.book.crossref output.nonnull
1143 format.edition output
1144 format.pages "pages" output.check
1154 FUNCTION {incollection}
1155 { "%Type = Incollection" write$
1157 format.authors "author" output.check
1158 author format.key output
1160 format.title "title" output.check
1163 { format.in.ed.booktitle "booktitle" output.check
1166 { format.organization.address output }
1167 { organization "organization" bibinfo.check output
1168 format.publisher.address output
1171 format.bvolume output
1172 format.number.series output
1173 format.edition output
1175 { format.incoll.inproc.crossref output.nonnull
1178 format.date "year" output.check
1180 format.pages "pages" output.check
1190 FUNCTION {inproceedings}
1191 { "%Type = Inproceedings" write$
1193 format.authors "author" output.check
1194 author format.key output
1196 format.title "title" output.check
1199 { format.in.ed.booktitle "booktitle" output.check
1202 { format.organization.address output }
1203 { organization "organization" bibinfo.check output
1204 format.publisher.address output
1207 format.bvolume output
1208 format.number.series output
1210 { format.incoll.inproc.crossref output.nonnull
1213 format.date "year" output.check
1215 format.pages "pages" output.check
1225 FUNCTION {conference} { inproceedings }
1228 { "%Type = Manual" write$
1230 format.authors output
1231 author format.key output
1233 format.btitle "title" output.check
1234 organization address new.block.checkb
1235 organization "organization" bibinfo.check output
1236 address "address" bibinfo.check output
1237 format.edition output
1238 format.date "year" output.check
1240 format.pages "pages" output.check
1250 FUNCTION {mastersthesis}
1251 { "%Type = Masterthesis" write$
1253 format.authors "author" output.check
1254 author format.key output
1257 "title" output.check
1259 bbl.mthesis format.thesis.type output.nonnull
1260 school "school" bibinfo.warn output
1261 address "address" bibinfo.check output
1262 format.date "year" output.check
1273 { "%Type = Misc" write$
1275 format.authors output
1276 author format.key output
1280 howpublished "howpublished" bibinfo.check output
1281 format.date "year" output.check
1291 FUNCTION {phdthesis}
1292 { "%Type = Phdthesis" write$
1294 format.authors "author" output.check
1295 author format.key output
1298 "title" output.check
1300 bbl.phdthesis format.thesis.type output.nonnull
1301 school "school" bibinfo.warn output
1302 address "address" bibinfo.check output
1303 format.date "year" output.check
1313 FUNCTION {proceedings}
1314 { "%Type = Proceedings" write$
1316 format.editors output
1317 editor format.key output
1319 format.btitle "title" output.check
1320 format.bvolume output
1321 format.number.series output
1324 { format.organization.address output }
1325 { organization "organization" bibinfo.check output
1326 format.publisher.address output
1329 format.date "year" output.check
1339 FUNCTION {techreport}
1340 { "%Type = Techreport" write$
1342 format.authors "author" output.check
1343 author format.key output
1346 "title" output.check
1348 format.tr.number output.nonnull
1349 institution "institution" bibinfo.warn output
1350 address "address" bibinfo.check output
1351 format.date "year" output.check
1361 FUNCTION {unpublished}
1362 { "%Type = Unpublished" write$
1364 format.authors "author" output.check
1365 author format.key output
1367 format.title "title" output.check
1368 format.date "year" output.check
1374 format.note "note" output.check
1378 FUNCTION {default.type} { misc }
1385 FUNCTION {chop.word}
1388 s #1 len substring$ =
1389 { s len #1 + global.max$ substring$ }
1393 FUNCTION {format.lab.names}
1396 s #1 "{vv~}{ll}" format.name$
1397 s num.names$ duplicate$
1404 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1408 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1417 FUNCTION {author.key.label}
1420 { cite$ #1 #3 substring$ }
1424 { author format.lab.names }
1428 FUNCTION {author.editor.key.label}
1432 { cite$ #1 #3 substring$ }
1436 { editor format.lab.names }
1439 { author format.lab.names }
1443 FUNCTION {editor.key.label}
1446 { cite$ #1 #3 substring$ }
1450 { editor format.lab.names }
1454 FUNCTION {calc.short.authors}
1458 'author.editor.key.label
1459 { type$ "proceedings" =
1468 FUNCTION {calc.label}
1469 { calc.short.authors
1473 year duplicate$ empty$
1474 short.list key field.or.null = or
1482 FUNCTION {sort.format.names}
1486 s num.names$ 'numnames :=
1487 numnames 'namesleft :=
1490 "{ll{ }}{ f{ }}{ jj{ }}"
1495 namesleft #1 = t "others" = and
1502 nameptr #1 + 'nameptr :=
1503 namesleft #1 - 'namesleft :=
1508 FUNCTION {sort.format.title}
1512 "The " #4 t chop.word
1516 #1 global.max$ substring$
1518 FUNCTION {author.sort}
1521 { "to sort, need author or key in " cite$ * warning$
1527 { author sort.format.names }
1530 FUNCTION {author.editor.sort}
1534 { "to sort, need author, editor, or key in " cite$ * warning$
1540 { editor sort.format.names }
1543 { author sort.format.names }
1546 FUNCTION {editor.sort}
1549 { "to sort, need editor or key in " cite$ * warning$
1555 { editor sort.format.names }
1567 { type$ "proceedings" =
1573 #1 entry.max$ substring$
1582 #1 entry.max$ substring$
1588 STRINGS { last.label next.extra }
1589 INTEGERS { last.extra.num number.label }
1590 FUNCTION {initialize.extra.label.stuff}
1591 { #0 int.to.chr$ 'last.label :=
1593 #0 'last.extra.num :=
1596 FUNCTION {forward.pass}
1597 { last.label label =
1598 { last.extra.num #1 + 'last.extra.num :=
1599 last.extra.num int.to.chr$ 'extra.label :=
1601 { "a" chr.to.int$ 'last.extra.num :=
1603 label 'last.label :=
1606 number.label #1 + 'number.label :=
1608 FUNCTION {reverse.pass}
1610 { "a" 'extra.label := }
1613 extra.label 'next.extra :=
1617 { "{\natexlab{" swap$ * "}}" * }
1620 label extra.label * 'label :=
1622 EXECUTE {initialize.extra.label.stuff}
1623 ITERATE {forward.pass}
1624 REVERSE {reverse.pass}
1625 FUNCTION {bib.sort.order}
1629 year field.or.null sortify
1636 #1 entry.max$ substring$
1639 ITERATE {bib.sort.order}
1641 FUNCTION {begin.bib}
1644 { preamble$ write$ newline$ }
1646 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1648 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1650 "\providecommand{\url}[1]{\texttt{#1}}"
1652 "\providecommand{\href}[2]{#2}"
1654 "\providecommand{\path}[1]{#1}"
1656 "\providecommand{\DOIprefix}{doi:}"
1658 "\providecommand{\ArXivprefix}{arXiv:}"
1660 "\providecommand{\URLprefix}{URL: }"
1662 "\providecommand{\Pubmedprefix}{pmid:}"
1664 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1666 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1668 "\providecommand{\bibinfo}[2]{#2}"
1670 "\ifx\xfnm\undefined \def\xfnm[#1]{\unskip,\space#1}\fi"
1674 EXECUTE {init.state.consts}
1675 EXECUTE {init.web.variables}
1676 ITERATE {call.type$}
1679 "\end{thebibliography}" write$ newline$
1682 %% End of customized bst file
1690 %% a. doi, url, eprint, pmid added
1691 %% b. Bibtype `webpage' defined
1694 %% a. collaboration added.
1696 %% End of file `model4-names.bst'.