2 %% This is file `model1a-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: model1a-num-names.bst 207 2012-10-22 07:29:13Z rishi $
18 %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-1a/model1a-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 =
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 { "\textit{" 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}
239 MACRO {jan} {"January"}
241 MACRO {feb} {"February"}
243 MACRO {mar} {"March"}
245 MACRO {apr} {"April"}
253 MACRO {aug} {"August"}
255 MACRO {sep} {"September"}
257 MACRO {oct} {"October"}
259 MACRO {nov} {"November"}
261 MACRO {dec} {"December"}
263 MACRO {acmcs} {"ACM Comput. Surv."}
265 MACRO {acta} {"Acta Inf."}
267 MACRO {cacm} {"Commun. ACM"}
269 MACRO {ibmjrd} {"IBM J. Res. Dev."}
271 MACRO {ibmsj} {"IBM Syst.~J."}
273 MACRO {ieeese} {"IEEE Trans. Software Eng."}
275 MACRO {ieeetc} {"IEEE Trans. Comput."}
278 {"IEEE Trans. Comput. Aid. Des."}
280 MACRO {ipl} {"Inf. Process. Lett."}
282 MACRO {jacm} {"J.~ACM"}
284 MACRO {jcss} {"J.~Comput. Syst. Sci."}
286 MACRO {scp} {"Sci. Comput. Program."}
288 MACRO {sicomp} {"SIAM J. Comput."}
290 MACRO {tocs} {"ACM Trans. Comput. Syst."}
292 MACRO {tods} {"ACM Trans. Database Syst."}
294 MACRO {tog} {"ACM Trans. Graphic."}
296 MACRO {toms} {"ACM Trans. Math. Software"}
298 MACRO {toois} {"ACM Trans. Office Inf. Syst."}
300 MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."}
302 MACRO {tcs} {"Theor. Comput. Sci."}
304 FUNCTION {bibinfo.check}
316 "\bibinfo{" swap$ * "}{" * swap$ * "}" *
322 FUNCTION {bibinfo.warn}
326 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
331 swap$ "empty " swap$ * " in " * cite$ * warning$
341 INTEGERS { nameptr namesleft numnames }
343 FUNCTION {format.names}
345 duplicate$ empty$ 'skip$ {
349 s num.names$ 'numnames :=
350 numnames 'namesleft :=
353 "{f.~}{vv~}{ll}{, jj}"
355 bibinfo bibinfo.check
363 s nameptr "{ll}" format.name$ duplicate$ "others" =
378 nameptr #1 + 'nameptr :=
379 namesleft #1 - 'namesleft :=
384 FUNCTION {format.names.ed}
389 FUNCTION {format.key}
391 { key field.or.null }
396 FUNCTION {format.authors}
397 { author "author" format.names
398 duplicate$ empty$ 'skip$
399 { collaboration "collaboration" bibinfo.check
400 duplicate$ empty$ 'skip$
401 { " (" swap$ * ")" * }
408 FUNCTION {get.bbl.editor}
409 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
411 FUNCTION {format.editors}
412 { editor "editor" format.names duplicate$ empty$ 'skip$
422 FUNCTION {format.note}
426 { note #1 #1 substring$
429 { output.state mid.sentence =
436 note #2 global.max$ substring$ * "note" bibinfo.check
441 FUNCTION {format.title}
443 duplicate$ empty$ 'skip$
446 "title" bibinfo.check
449 FUNCTION {format.full.names}
453 s num.names$ 'numnames :=
454 numnames 'namesleft :=
457 "{vv~}{ll}" format.name$
464 s nameptr "{ll}" format.name$ duplicate$ "others" =
486 nameptr #1 + 'nameptr :=
487 namesleft #1 - 'namesleft :=
492 FUNCTION {author.editor.key.full}
496 { cite$ #1 #3 substring$ }
500 { editor format.full.names }
503 { author format.full.names }
507 FUNCTION {author.key.full}
510 { cite$ #1 #3 substring$ }
514 { author format.full.names }
518 FUNCTION {editor.key.full}
521 { cite$ #1 #3 substring$ }
525 { editor format.full.names }
529 FUNCTION {make.full.names}
533 'author.editor.key.full
534 { type$ "proceedings" =
542 FUNCTION {output.bibitem}
546 ")" make.full.names duplicate$ short.list =
555 before.all 'output.state :=
563 { t #1 #1 substring$ "-" =
564 { t #1 #2 substring$ "--" = not
566 t #2 global.max$ substring$ 't :=
568 { { t #1 #1 substring$ "-" = }
570 t #2 global.max$ substring$ 't :=
576 { t #1 #1 substring$ *
577 t #2 global.max$ substring$ 't :=
589 FUNCTION {format.date}
590 { year "year" bibinfo.check duplicate$ empty$
592 "empty year in " cite$ * "; set to ????" * warning$
599 FUNCTION{format.year}
600 { year "year" bibinfo.check duplicate$ empty$
601 { "empty year in " cite$ *
612 FUNCTION {format.btitle}
613 { title "title" bibinfo.check
614 duplicate$ empty$ 'skip$
619 FUNCTION {either.or.check}
622 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
625 FUNCTION {format.bvolume}
628 { bbl.volume volume tie.or.space.prefix
629 "volume" bibinfo.check * *
630 series "series" bibinfo.check
631 duplicate$ empty$ 'pop$
632 { swap$ bbl.of space.word * swap$
635 "volume and number" number either.or.check
639 FUNCTION {format.number.series}
642 { series field.or.null }
644 { number "number" bibinfo.check }
645 { output.state mid.sentence =
647 { bbl.number capitalize }
649 number tie.or.space.prefix "number" bibinfo.check * *
651 series "series" bibinfo.check *
661 FUNCTION {format.edition}
662 { edition duplicate$ empty$ 'skip$
664 output.state mid.sentence =
668 "edition" bibinfo.check
673 INTEGERS { multiresult }
674 FUNCTION {multi.page.check}
683 swap$ duplicate$ "," =
686 { #1 'multiresult := }
687 { t #2 global.max$ substring$ 't := }
693 FUNCTION {format.pages}
694 { pages duplicate$ empty$ 'skip$
695 { duplicate$ multi.page.check
705 "pages" bibinfo.check
710 FUNCTION {format.journal.pages}
711 { pages duplicate$ empty$ 'pop$
712 { swap$ duplicate$ empty$
713 { pop$ pop$ format.pages }
718 "pages" bibinfo.check
725 FUNCTION {format.vol.num.pages}
726 { volume field.or.null
727 duplicate$ empty$ 'skip$
729 "volume" bibinfo.check
735 FUNCTION {format.chapter.pages}
740 { type "l" change.case$
744 chapter tie.or.space.prefix
745 "chapter" bibinfo.check
751 FUNCTION {format.booktitle}
753 booktitle "booktitle" bibinfo.check
755 FUNCTION {format.in.ed.booktitle}
756 { format.booktitle duplicate$ empty$ 'skip$
758 editor "editor" format.names.ed duplicate$ empty$ 'pop$
771 FUNCTION {format.thesis.type}
772 { type duplicate$ empty$
775 "t" change.case$ "type" bibinfo.check
779 FUNCTION {format.tr.number}
780 { number "number" bibinfo.check
781 type duplicate$ empty$
786 swap$ duplicate$ empty$
787 { pop$ "t" change.case$ }
788 { tie.or.space.prefix * * }
791 FUNCTION {format.article.crossref}
794 " \cite{" * crossref * "}" *
796 FUNCTION {format.book.crossref}
797 { volume duplicate$ empty$
798 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
802 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
805 " \cite{" * crossref * "}" *
807 FUNCTION {format.incoll.inproc.crossref}
810 " \cite{" * crossref * "}" *
812 FUNCTION {format.org.or.pub}
815 address empty$ t empty$ and
819 { address "address" bibinfo.check *
824 { ", " * address "address" bibinfo.check * }
831 FUNCTION {format.publisher.address}
832 { publisher "publisher" bibinfo.check format.org.or.pub
835 FUNCTION {format.organization.address}
836 { organization "organization" bibinfo.check format.org.or.pub
840 {url duplicate$ empty$
843 urlprefix "\url{" * swap$ * "}" *
849 {doi duplicate$ empty$
852 doiprefix "\doi{" * swap$ * "}" *
857 FUNCTION {print.eprint}
858 {eprint duplicate$ empty$
861 duplicate$ "\href{http://arxiv.org/abs/" swap$ * "}{\tt arXiv:" * swap$ * "}" *
866 FUNCTION {print.pubmed}
867 {pubmed duplicate$ empty$
870 pubmedprefix "\Pubmed{" * swap$ * "}" *
876 { "%Type = Webpage" write$
878 format.authors "author" output.check
879 author format.key output
882 format.title "title" output.check
884 format.date "year" output.check
888 format.date "year" output.check
890 format.title "title" output.check
900 { "%Type = Article" write$
902 format.authors "author" output.check
903 author format.key output
907 "journal" bibinfo.check
908 "journal" output.check
910 format.vol.num.pages output
912 { format.article.crossref output.nonnull
926 { "%Type = Book" write$
929 { format.editors "author and editor" output.check
930 editor format.key output
932 { format.authors output.nonnull
934 { "author and editor" editor either.or.check }
939 format.btitle "title" output.check
941 { format.bvolume output
942 format.number.series output
943 format.edition output
944 format.publisher.address output
947 format.book.crossref output.nonnull
950 format.date "year" output.check
960 { "%Type = Booklet" write$
962 format.authors output
963 author format.key output
964 format.title "title" output.check
965 howpublished "howpublished" bibinfo.check output
966 address "address" bibinfo.check output
967 format.date "year" output.check
974 { "%Type = Inbook" write$
977 { format.editors "author and editor" output.check
978 editor format.key output
980 { format.authors output.nonnull
982 { "author and editor" editor either.or.check }
987 format.btitle "title" output.check
990 format.bvolume output
991 format.number.series output
992 format.edition output
993 format.publisher.address output
996 format.book.crossref output.nonnull
999 format.date "year" output.check
1000 format.pages "pages" output.check
1010 FUNCTION {incollection}
1011 { "%Type = Incollection" write$
1013 format.authors "author" output.check
1014 author format.key output
1016 { format.in.ed.booktitle "booktitle" output.check
1017 format.bvolume output
1018 format.number.series output
1019 format.publisher.address output
1020 format.edition output
1023 { format.incoll.inproc.crossref output.nonnull
1026 format.pages "pages" output.check
1036 FUNCTION {inproceedings}
1037 { "%Type = Inproceedings" write$
1039 format.authors "author" output.check
1040 author format.key output
1042 { format.in.ed.booktitle "booktitle" output.check
1043 format.bvolume output
1044 format.number.series output
1046 { format.organization.address output }
1047 { organization "organization" bibinfo.check output
1048 format.publisher.address output
1053 { format.incoll.inproc.crossref output.nonnull
1056 format.pages "pages" output.check
1066 FUNCTION {conference} { inproceedings }
1069 { "%Type = Manual" write$
1071 format.authors output
1072 author format.key output
1073 format.btitle "title" output.check
1074 format.edition output
1075 organization "organization" bibinfo.check output
1076 address "address" bibinfo.check output
1077 format.date "year" output.check
1087 FUNCTION {mastersthesis}
1088 { "%Type = Masterthesis" write$
1090 format.authors "author" output.check
1091 author format.key output
1093 "title" output.check
1094 bbl.mthesis format.thesis.type output.nonnull
1095 school "school" bibinfo.warn output
1096 address "address" bibinfo.check output
1097 format.date "year" output.check
1108 { "%Type = Misc" write$
1110 format.authors output
1111 author format.key output
1113 howpublished "howpublished" bibinfo.check output
1114 format.date "year" output.check
1124 FUNCTION {phdthesis}
1125 { "%Type = Phdthesis" write$
1127 format.authors "author" output.check
1128 author format.key output
1130 "title" output.check
1131 bbl.phdthesis format.thesis.type output.nonnull
1132 school "school" bibinfo.warn output
1133 address "address" bibinfo.check output
1134 format.date "year" output.check
1144 FUNCTION {proceedings}
1145 { "%Type = Proceedings" write$
1147 format.editors output
1148 editor format.key output
1149 format.btitle "title" output.check
1150 format.bvolume output
1151 format.number.series output
1153 { format.organization.address output }
1154 { organization "organization" bibinfo.check output
1155 format.publisher.address output
1158 format.date "year" output.check
1168 FUNCTION {techreport}
1169 { "%Type = Techreport" write$
1171 format.authors "author" output.check
1172 author format.key output
1174 "title" output.check
1175 format.tr.number output.nonnull
1176 institution "institution" bibinfo.warn output
1177 address "address" bibinfo.check output
1178 format.date "year" output.check
1188 FUNCTION {unpublished}
1189 { "%Type = Unpublished" write$
1191 format.authors "author" output.check
1192 author format.key output
1193 format.title "title" output.check
1194 format.date "year" output.check
1200 format.note "note" output.check
1204 FUNCTION {default.type} { misc }
1211 FUNCTION {chop.word}
1214 s #1 len substring$ =
1215 { s len #1 + global.max$ substring$ }
1219 FUNCTION {format.lab.names}
1222 s #1 "{vv~}{ll}" format.name$
1223 s num.names$ duplicate$
1230 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1234 { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1243 FUNCTION {author.key.label}
1246 { cite$ #1 #3 substring$ }
1250 { author format.lab.names }
1254 FUNCTION {author.editor.key.label}
1258 { cite$ #1 #3 substring$ }
1262 { editor format.lab.names }
1265 { author format.lab.names }
1269 FUNCTION {editor.key.label}
1272 { cite$ #1 #3 substring$ }
1276 { editor format.lab.names }
1280 FUNCTION {calc.short.authors}
1284 'author.editor.key.label
1285 { type$ "proceedings" =
1294 FUNCTION {calc.label}
1295 { calc.short.authors
1299 year duplicate$ empty$
1301 { purify$ #-1 #4 substring$ }
1307 FUNCTION {sort.format.names}
1311 s num.names$ 'numnames :=
1312 numnames 'namesleft :=
1315 "{ll{ }}{ f{ }}{ jj{ }}"
1320 namesleft #1 = t "others" = and
1327 nameptr #1 + 'nameptr :=
1328 namesleft #1 - 'namesleft :=
1333 FUNCTION {sort.format.title}
1337 "The " #4 t chop.word
1341 #1 global.max$ substring$
1343 FUNCTION {author.sort}
1346 { "to sort, need author or key in " cite$ * warning$
1352 { author sort.format.names }
1355 FUNCTION {author.editor.sort}
1359 { "to sort, need author, editor, or key in " cite$ * warning$
1365 { editor sort.format.names }
1368 { author sort.format.names }
1371 FUNCTION {editor.sort}
1374 { "to sort, need editor or key in " cite$ * warning$
1380 { editor sort.format.names }
1392 { type$ "proceedings" =
1398 #1 entry.max$ substring$
1407 #1 entry.max$ substring$
1413 STRINGS { last.label next.extra }
1414 INTEGERS { last.extra.num number.label }
1415 FUNCTION {initialize.extra.label.stuff}
1416 { #0 int.to.chr$ 'last.label :=
1418 #0 'last.extra.num :=
1421 FUNCTION {forward.pass}
1422 { last.label label =
1423 { last.extra.num #1 + 'last.extra.num :=
1424 last.extra.num int.to.chr$ 'extra.label :=
1426 { "a" chr.to.int$ 'last.extra.num :=
1428 label 'last.label :=
1431 number.label #1 + 'number.label :=
1433 FUNCTION {reverse.pass}
1435 { "a" 'extra.label := }
1438 extra.label 'next.extra :=
1442 { "{\natexlab{" swap$ * "}}" * }
1445 label extra.label * 'label :=
1447 EXECUTE {initialize.extra.label.stuff}
1448 ITERATE {forward.pass}
1449 REVERSE {reverse.pass}
1450 FUNCTION {bib.sort.order}
1454 year field.or.null sortify
1461 #1 entry.max$ substring$
1464 ITERATE {bib.sort.order}
1466 FUNCTION {begin.bib}
1469 { preamble$ write$ newline$ }
1471 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1473 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1475 "\providecommand{\url}[1]{\texttt{#1}}"
1477 "\providecommand{\href}[2]{#2}"
1479 "\providecommand{\path}[1]{#1}"
1481 "\providecommand{\DOIprefix}{doi:}"
1483 "\providecommand{\ArXivprefix}{arXiv:}"
1485 "\providecommand{\URLprefix}{URL: }"
1487 "\providecommand{\Pubmedprefix}{pmid:}"
1489 "\providecommand{\doi}[1]{\href{http://dx.doi.org/#1}{\path{#1}}}"
1491 "\providecommand{\Pubmed}[1]{\href{pmid:#1}{\path{#1}}}"
1493 "\providecommand{\bibinfo}[2]{#2}"
1495 "\ifx\xfnm\relax \def\xfnm[#1]{\unskip,\space#1}\fi"
1499 EXECUTE {init.state.consts}
1500 EXECUTE {init.web.variables}
1501 ITERATE {call.type$}
1504 "\end{thebibliography}" write$ newline$
1507 %% End of customized bst file
1509 %% End of file `model1a-num-names.bst'.
1516 %% a. doi, url, eprint, pmid added
1517 %% b. Bibtype `webpage' defined
1520 %% a. collaboration added.