1 %% File: `plainnat.bst'
2 %% A modification of `plain.bst' for use with natbib package
4 %% Copyright 1993-2007 Patrick W Daly
5 %% Max-Planck-Institut f\"ur Sonnensystemforschung
7 %% D-37191 Katlenburg-Lindau
9 %% E-mail: daly@mps.mpg.de
11 %% This program can be redistributed and/or modified under the terms
12 %% of the LaTeX Project Public License Distributed from CTAN
13 %% archives in directory macros/latex/base/lppl.txt; either
14 %% version 1 of the License, or any later version.
16 % Version and source file information:
17 % \ProvidesFile{natbst.mbs}[2007/11/26 1.93 (PWD)]
19 % BibTeX `plainnat' family
20 % version 0.99b for BibTeX versions 0.99a or later,
21 % for LaTeX versions 2.09 and 2e.
23 % For use with the `natbib.sty' package; emulates the corresponding
24 % member of the `plain' family, but with author-year citations.
26 % With version 6.0 of `natbib.sty', it may also be used for numerical
27 % citations, while retaining the commands \citeauthor, \citefullauthor,
28 % and \citeyear to print the corresponding information.
30 % For version 7.0 of `natbib.sty', the KEY field replaces missing
31 % authors/editors, and the date is left blank in \bibitem.
33 % Includes field EID for the sequence/citation number of electronic journals
34 % which is used instead of page numbers.
36 % Includes fields ISBN and ISSN.
38 % Includes field URL for Internet addresses.
40 % Includes field DOI for Digital Object Idenfifiers.
42 % Works best with the url.sty package of Donald Arseneau.
44 % Works with identical authors and year are further sorted by
45 % citation key, to preserve any natural sequence.
77 { label extra.label sort.label short.list }
79 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
81 FUNCTION {init.state.consts}
90 FUNCTION {output.nonnull}
92 output.state mid.sentence =
94 { output.state after.block =
99 { output.state before.all =
101 { add.period$ " " * write$ }
105 mid.sentence 'output.state :=
118 FUNCTION {output.check}
121 { pop$ "empty " t * " in " * cite$ * warning$ }
133 { output.state before.all =
135 { after.block 'output.state := }
139 FUNCTION {new.sentence}
140 { output.state after.block =
142 { output.state before.all =
144 { after.sentence 'output.state := }
168 FUNCTION {new.block.checka}
175 FUNCTION {new.block.checkb}
184 FUNCTION {new.sentence.checka}
191 FUNCTION {new.sentence.checkb}
200 FUNCTION {field.or.null}
210 { "\emph{" swap$ * "}" * }
214 FUNCTION {embolden} %% FUNCTION added by AK
217 { "{\bf " swap$ * "}" * }
221 FUNCTION {scshape} %% FUNCTION added by AK
224 { "{\sc " swap$ * "}" * }
228 INTEGERS { nameptr namesleft numnames }
230 FUNCTION {format.names}
233 s num.names$ 'numnames :=
234 numnames 'namesleft :=
236 { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := %% {ff~}{vv~}{ll}{, jj} changed to {vv~}{ll}{, jj}{, f.} by AK
241 { "" * } %% { "," * } changed to { "" * } by AK (on suggestion by MK)
245 { " a~kol." * } %% et~al. changed to a~kol. by AK
246 { " {\rm a} " * t * } %% and changed to {\rm a} by AK
253 nameptr #1 + 'nameptr :=
254 namesleft #1 - 'namesleft :=
259 FUNCTION {format.key}
261 { key field.or.null }
266 FUNCTION {format.authors}
269 { author format.names scshape} %% scshape added by AK
273 FUNCTION {format.editors}
276 { editor format.names scshape %% scshape added by AK
277 editor num.names$ #1 >
285 FUNCTION {format.isbn}
288 { new.block "ISBN " isbn * }
292 FUNCTION {format.issn}
295 { new.block "ISSN " issn * }
299 FUNCTION {format.url}
302 { new.block "URL \url{" url * "}" * }
306 FUNCTION {format.doi}
309 { new.block "\doi{" doi * "}" * }
313 FUNCTION {format.title}
316 { title "t" change.case$ }
320 FUNCTION {format.full.names}
323 s num.names$ 'numnames :=
324 numnames 'namesleft :=
327 "{vv~}{ll}" format.name$ 't :=
334 { "" * } %% { "," * } changed to { "" * } by AK (on suggestion by MK)
338 { " a~kol." * } %% et~al. changed to a~kol. by AK
339 { " a " * t * } %% and changed to a by AK
346 nameptr #1 + 'nameptr :=
347 namesleft #1 - 'namesleft :=
352 FUNCTION {author.editor.full}
356 { editor format.full.names }
359 { author format.full.names }
363 FUNCTION {author.full}
366 { author format.full.names }
370 FUNCTION {editor.full}
373 { editor format.full.names }
377 FUNCTION {make.full.names}
382 { type$ "proceedings" =
390 FUNCTION {output.bibitem}
394 ")" make.full.names duplicate$ short.list =
403 before.all 'output.state :=
410 { t #1 #1 substring$ "-" =
411 { t #1 #2 substring$ "--" = not
413 t #2 global.max$ substring$ 't :=
415 { { t #1 #1 substring$ "-" = }
417 t #2 global.max$ substring$ 't :=
423 { t #1 #1 substring$ *
424 t #2 global.max$ substring$ 't :=
431 FUNCTION {format.date}
432 { year duplicate$ empty$
433 { "empty year in " cite$ * warning$
446 %%% Non-successful atempt to change the function format.date to produce year in brackets
447 %FUNCTION {format.date}
448 %{ year duplicate$ empty$
449 % { "empty year in " cite$ * warning$
452 % " (" * year * %% 'skip$ replaced by { "(" * year * } by AK
461 % extra.label * ")" * %% extra.label * changed to extra.label * ")" * by AK
464 FUNCTION {output.year.check} %% function added by AK
465 { year empty$ %% It replaces original format.date on most places below
466 { "empty year in " cite$ * warning$ }
468 " (" year * extra.label * ")" *
469 mid.sentence 'output.state :=
474 FUNCTION {format.btitle}
478 FUNCTION {tie.or.space.connect}
479 { duplicate$ text.length$ #3 <
486 FUNCTION {either.or.check}
489 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
493 FUNCTION {format.bvolume}
496 { "volume" volume tie.or.space.connect
499 { " of " * series emphasize * }
501 "volume and number" number either.or.check
506 FUNCTION {format.number.series}
509 { series field.or.null }
510 { output.state mid.sentence =
514 number tie.or.space.connect
516 { "there's a number but no series in " cite$ * warning$ }
517 { " in " * series * }
526 FUNCTION {format.edition}
529 { output.state mid.sentence =
530 { edition "l" change.case$ " edition" * }
531 { edition "t" change.case$ " edition" * }
537 INTEGERS { multiresult }
539 FUNCTION {multi.page.check}
548 swap$ duplicate$ "," =
551 { #1 'multiresult := }
552 { t #2 global.max$ substring$ 't := }
559 FUNCTION {format.pages}
562 { pages multi.page.check
563 { "pages" pages n.dashify tie.or.space.connect }
564 { "page" pages tie.or.space.connect }
570 FUNCTION {format.eid}
573 { "art." eid tie.or.space.connect }
577 FUNCTION {format.vol.num.pages}
578 { volume field.or.null embolden %% embolden added by AK
581 { "\penalty0 (" number * ")" * *
583 { "there's a number but no volume in " cite$ * warning$ }
591 { pop$ format.pages }
592 { ", \penalty0 " * pages n.dashify * } %% { ":\penalty0 " * pages n.dashify * } changed to { ", \penalty0 " * pages n.dashify * } by AK
598 FUNCTION {format.vol.num.eid}
599 { volume field.or.null
602 { "\penalty0 (" number * ")" * *
604 { "there's a number but no volume in " cite$ * warning$ }
613 { ":\penalty0 " * eid * }
619 FUNCTION {format.chapter.pages}
624 { type "l" change.case$ }
626 chapter tie.or.space.connect
629 { ", " * format.pages * }
635 FUNCTION {format.in.ed.booktitle}
639 { "In " booktitle emphasize * }
640 { "In " format.editors * ", " * booktitle emphasize * }
646 FUNCTION {empty.misc.check}
647 { author empty$ title empty$ howpublished empty$
648 month empty$ year empty$ note empty$
651 { "all relevant fields are empty in " cite$ * warning$ }
656 FUNCTION {format.thesis.type}
660 type "t" change.case$
665 FUNCTION {format.tr.number}
667 { "Technical Report" }
672 { number tie.or.space.connect }
676 FUNCTION {format.article.crossref}
679 { "need key or journal for " cite$ * " to crossref " * crossref *
683 { "In \emph{" journal * "}" * }
688 " \citet{" * crossref * "}" *
691 FUNCTION {format.book.crossref}
693 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
696 { "Volume" volume tie.or.space.connect
701 editor field.or.null author field.or.null =
705 { "need editor, key, or series for " cite$ * " to crossref " *
709 { "\emph{" * series * "}" * }
717 " \citet{" * crossref * "}" *
720 FUNCTION {format.incoll.inproc.crossref}
722 editor field.or.null author field.or.null =
726 { "need editor, key, or booktitle for " cite$ * " to crossref " *
730 { "In \emph{" booktitle * "}" * }
738 " \citet{" * crossref * "}" *
743 format.authors "author" output.check
744 author format.key output
745 new.block %% added by AK
746 %format.date "year" output.check %% added by AK, commented later on
747 output.year.check %% added by AK as replacement of format.date
749 format.title "title" output.check
752 { journal emphasize "journal" output.check
754 { format.vol.num.pages output }
755 { format.vol.num.eid output }
757 %% format.date "year" output.check %% commented by AK
759 { format.article.crossref output.nonnull
761 { format.pages output }
762 { format.eid output }
777 { format.editors "author and editor" output.check
778 editor format.key output
780 { format.authors output.nonnull
782 { "author and editor" editor either.or.check }
787 new.block %% added by AK
788 %format.date "year" output.check %% added by AK, commented later on
789 output.year.check %% added by AK as replacement of format.date
791 format.btitle "title" output.check
793 { format.bvolume output
795 format.number.series output
797 publisher "publisher" output.check
801 format.book.crossref output.nonnull
804 format.edition output
805 %% format.date "year" output.check %% commented by AK
816 format.authors output
817 author format.key output
818 new.block %% added by AK
819 %format.date "year" output.check %% added by AK, commented later on
820 output.year.check %% added by AK as replacement of format.date
822 format.title "title" output.check
823 howpublished address new.block.checkb
826 %format.date output %% commented by AK
838 { format.editors "author and editor" output.check
839 editor format.key output
841 { format.authors output.nonnull
843 { "author and editor" editor either.or.check }
848 new.block %% added by AK
849 %format.date "year" output.check %% added by AK, commented later on
850 output.year.check %% added by AK as replacement of format.date
852 format.btitle "title" output.check
854 { format.bvolume output
855 format.chapter.pages "chapter and pages" output.check
857 format.number.series output
859 publisher "publisher" output.check
862 { format.chapter.pages "chapter and pages" output.check
864 format.book.crossref output.nonnull
867 format.edition output
868 %format.date "year" output.check %% commented by AK
877 FUNCTION {incollection}
879 format.authors "author" output.check
880 author format.key output
881 new.block %% added by AK
882 %format.date "year" output.check %% added by AK, commented later on
883 output.year.check %% added by AK as replacement of format.date
885 format.title "title" output.check
888 { format.in.ed.booktitle "booktitle" output.check
889 format.bvolume output
890 format.number.series output
891 format.chapter.pages output
893 publisher "publisher" output.check
895 format.edition output
896 %format.date "year" output.check %% commented by AK
898 { format.incoll.inproc.crossref output.nonnull
899 format.chapter.pages output
910 FUNCTION {inproceedings}
912 format.authors "author" output.check
913 author format.key output
914 new.block %% added by AK
915 %format.date "year" output.check %% added by AK, commented later on
916 output.year.check %% added by AK as replacement of format.date
918 format.title "title" output.check
921 { format.in.ed.booktitle "booktitle" output.check
922 format.bvolume output
923 format.number.series output
926 { organization publisher new.sentence.checkb
929 %format.date "year" output.check %% commented by AK
931 { address output.nonnull
932 format.date "year" output.check
939 { format.incoll.inproc.crossref output.nonnull
951 FUNCTION {conference} { inproceedings }
955 format.authors output
956 author format.key output
957 new.block %% added by AK
958 %format.date "year" output.check %% added by AK, commented later on
959 output.year.check %% added by AK as replacement of format.date
961 format.btitle "title" output.check
962 organization address new.block.checkb
965 format.edition output
966 %format.date output %% added by AK
973 FUNCTION {mastersthesis}
975 format.authors "author" output.check
976 author format.key output
977 new.block %% added by AK
978 %format.date "year" output.check %% added by AK, commented later on
979 output.year.check %% added by AK as replacement of format.date
981 format.title "title" output.check
983 "Master's thesis" format.thesis.type output.nonnull
984 school "school" output.check
986 %format.date "year" output.check %% added by AK
995 format.authors output
996 author format.key output
997 new.block %% added by AK
998 %format.date "year" output.check %% added by AK, commented later on
999 output.year.check %% added by AK as replacement of format.date
1000 new.block %% added by AK
1001 title howpublished new.block.checkb
1003 howpublished new.block.checka
1005 %format.date output %% commented by AK
1014 FUNCTION {phdthesis}
1016 format.authors "author" output.check
1017 author format.key output
1018 new.block %% added by AK
1019 %format.date "year" output.check %% added by AK, commented later on
1020 output.year.check %% added by AK as replacement of format.date
1022 format.btitle "title" output.check
1024 "PhD thesis" format.thesis.type output.nonnull
1025 school "school" output.check
1027 %format.date "year" output.check %% commented by AK
1034 FUNCTION {proceedings}
1036 format.editors output
1037 editor format.key output
1038 new.block %% added by AK
1039 %format.date "year" output.check %% added by AK, commented later on
1040 output.year.check %% added by AK as replacement of format.date
1042 format.btitle "title" output.check
1043 format.bvolume output
1044 format.number.series output
1046 %format.date "year" output.check %% commented by AK
1058 FUNCTION {techreport}
1060 format.authors "author" output.check
1061 author format.key output
1062 new.block %% added by AK
1063 %format.date "year" output.check %% added by AK, commented later on
1064 output.year.check %% added by AK as replacement of format.date
1066 format.title "title" output.check
1068 format.tr.number output.nonnull
1069 institution "institution" output.check
1071 %format.date "year" output.check %% commented by AK
1078 FUNCTION {unpublished}
1080 format.authors "author" output.check
1081 author format.key output
1082 new.block %% added by AK
1083 %format.date "year" output.check %% added by AK, commented later on
1084 output.year.check %% added by AK as replacement of format.date
1086 format.title "title" output.check
1088 note "note" output.check
1089 %format.date output %% commented by AK
1094 FUNCTION {default.type} { misc }
1097 MACRO {jan} {"January"}
1099 MACRO {feb} {"February"}
1101 MACRO {mar} {"March"}
1103 MACRO {apr} {"April"}
1107 MACRO {jun} {"June"}
1109 MACRO {jul} {"July"}
1111 MACRO {aug} {"August"}
1113 MACRO {sep} {"September"}
1115 MACRO {oct} {"October"}
1117 MACRO {nov} {"November"}
1119 MACRO {dec} {"December"}
1123 MACRO {acmcs} {"ACM Computing Surveys"}
1125 MACRO {acta} {"Acta Informatica"}
1127 MACRO {cacm} {"Communications of the ACM"}
1129 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1131 MACRO {ibmsj} {"IBM Systems Journal"}
1133 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1135 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1138 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1140 MACRO {ipl} {"Information Processing Letters"}
1142 MACRO {jacm} {"Journal of the ACM"}
1144 MACRO {jcss} {"Journal of Computer and System Sciences"}
1146 MACRO {scp} {"Science of Computer Programming"}
1148 MACRO {sicomp} {"SIAM Journal on Computing"}
1150 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1152 MACRO {tods} {"ACM Transactions on Database Systems"}
1154 MACRO {tog} {"ACM Transactions on Graphics"}
1156 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1158 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1160 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1162 MACRO {tcs} {"Theoretical Computer Science"}
1174 FUNCTION {chop.word}
1177 s #1 len substring$ =
1178 { s len #1 + global.max$ substring$ }
1183 FUNCTION {format.lab.names}
1185 s #1 "{vv~}{ll}" format.name$
1186 s num.names$ duplicate$
1188 { pop$ " a~kol." * } %% originally et~al.
1191 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1192 { " a~kol." * } %% AK change
1193 { " a " * s #2 "{vv~}{ll}" format.name$ * } %% AK change
1201 FUNCTION {author.key.label}
1204 { cite$ #1 #3 substring$ }
1208 { author format.lab.names }
1212 FUNCTION {author.editor.key.label}
1216 { cite$ #1 #3 substring$ }
1220 { editor format.lab.names }
1223 { author format.lab.names }
1227 FUNCTION {author.key.organization.label}
1230 { organization empty$
1231 { cite$ #1 #3 substring$ }
1232 { "The " #4 organization chop.word #3 text.prefix$ }
1238 { author format.lab.names }
1242 FUNCTION {editor.key.organization.label}
1245 { organization empty$
1246 { cite$ #1 #3 substring$ }
1247 { "The " #4 organization chop.word #3 text.prefix$ }
1253 { editor format.lab.names }
1257 FUNCTION {calc.short.authors}
1261 'author.editor.key.label
1262 { type$ "proceedings" =
1263 'editor.key.organization.label
1265 'author.key.organization.label
1275 FUNCTION {calc.label}
1276 { calc.short.authors
1280 year duplicate$ empty$
1281 short.list key field.or.null = or
1289 FUNCTION {sort.format.names}
1293 s num.names$ 'numnames :=
1294 numnames 'namesleft :=
1297 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1301 namesleft #1 = t "others" = and
1303 { numnames #2 > nameptr #2 = and
1304 { "zz" * year field.or.null * " " * }
1313 nameptr #1 + 'nameptr :=
1314 namesleft #1 - 'namesleft :=
1319 FUNCTION {sort.format.title}
1323 "The " #4 t chop.word
1327 #1 global.max$ substring$
1330 FUNCTION {author.sort}
1333 { "to sort, need author or key in " cite$ * warning$
1339 { author sort.format.names }
1343 FUNCTION {author.editor.sort}
1347 { "to sort, need author, editor, or key in " cite$ * warning$
1353 { editor sort.format.names }
1356 { author sort.format.names }
1360 FUNCTION {author.organization.sort}
1362 { organization empty$
1364 { "to sort, need author, organization, or key in " cite$ * warning$
1370 { "The " #4 organization chop.word sortify }
1373 { author sort.format.names }
1377 FUNCTION {editor.organization.sort}
1379 { organization empty$
1381 { "to sort, need editor, organization, or key in " cite$ * warning$
1387 { "The " #4 organization chop.word sortify }
1390 { editor sort.format.names }
1404 { type$ "proceedings" =
1405 'editor.organization.sort
1407 'author.organization.sort
1416 year field.or.null sortify
1422 #1 entry.max$ substring$
1425 #1 entry.max$ substring$
1433 STRINGS { longest.label last.label next.extra }
1435 INTEGERS { longest.label.width last.extra.num number.label }
1437 FUNCTION {initialize.longest.label}
1438 { "" 'longest.label :=
1439 #0 int.to.chr$ 'last.label :=
1441 #0 'longest.label.width :=
1442 #0 'last.extra.num :=
1446 FUNCTION {forward.pass}
1447 { last.label label =
1448 { last.extra.num #1 + 'last.extra.num :=
1449 last.extra.num int.to.chr$ 'extra.label :=
1451 { "a" chr.to.int$ 'last.extra.num :=
1453 label 'last.label :=
1456 number.label #1 + 'number.label :=
1459 FUNCTION {reverse.pass}
1461 { "a" 'extra.label := }
1464 extra.label 'next.extra :=
1468 { "{\natexlab{" swap$ * "}}" * }
1471 label extra.label * 'label :=
1474 EXECUTE {initialize.longest.label}
1476 ITERATE {forward.pass}
1478 REVERSE {reverse.pass}
1480 FUNCTION {bib.sort.order}
1481 { sort.label 'sort.key$ :=
1484 ITERATE {bib.sort.order}
1488 FUNCTION {begin.bib}
1491 { preamble$ write$ newline$ }
1493 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1495 "\providecommand{\natexlab}[1]{#1}"
1497 "\providecommand{\url}[1]{\texttt{#1}}"
1499 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1501 " \providecommand{\doi}[1]{doi: #1}\else"
1503 " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1509 EXECUTE {init.state.consts}
1511 ITERATE {call.type$}
1515 "\end{thebibliography}" write$ newline$