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 { "\textit{" swap$ * "}" * }
214 INTEGERS { nameptr namesleft numnames }
216 FUNCTION {format.names}
219 s num.names$ 'numnames :=
220 numnames 'namesleft :=
222 { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
236 s nameptr "{ll}" format.name$ duplicate$ "others" =
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 }
273 FUNCTION {format.editors}
276 { editor format.names
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.pdf}
302 { new.block "[\biburl{" pdf * "}]" * }
306 FUNCTION {format.doi}
309 { new.block "\doi{" doi * "}" * }
313 FUNCTION {format.title}
320 FUNCTION {format.full.names}
323 s num.names$ 'numnames :=
324 numnames 'namesleft :=
327 "{vv~}{ll}" format.name$ 't :=
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 FUNCTION {format.btitle}
450 FUNCTION {tie.or.space.connect}
451 { duplicate$ text.length$ #3 <
458 FUNCTION {either.or.check}
461 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
465 FUNCTION {format.bvolume}
468 { "volume" volume tie.or.space.connect
471 { " of " * series emphasize * }
473 "volume and number" number either.or.check
478 FUNCTION {format.number.series}
481 { series field.or.null }
482 { output.state mid.sentence =
486 number tie.or.space.connect
488 { "there's a number but no series in " cite$ * warning$ }
489 { " in " * series * }
498 FUNCTION {format.edition}
501 { output.state mid.sentence =
502 { edition "l" change.case$ " edition" * }
503 { edition "t" change.case$ " edition" * }
509 INTEGERS { multiresult }
511 FUNCTION {multi.page.check}
520 swap$ duplicate$ "," =
523 { #1 'multiresult := }
524 { t #2 global.max$ substring$ 't := }
531 FUNCTION {format.pages}
534 { pages multi.page.check
535 { "pages" pages n.dashify tie.or.space.connect }
536 { "page" pages tie.or.space.connect }
542 FUNCTION {format.eid}
545 { "art." eid tie.or.space.connect }
549 FUNCTION {format.vol.num.pages}
550 { volume field.or.null
553 { "\penalty0 (" number * ")" * *
555 { "there's a number but no volume in " cite$ * warning$ }
563 { pop$ format.pages }
564 { ":\penalty0 " * pages n.dashify * }
570 FUNCTION {format.vol.num.eid}
571 { volume field.or.null
574 { "\penalty0 (" number * ")" * *
576 { "there's a number but no volume in " cite$ * warning$ }
585 { ":\penalty0 " * eid * }
591 FUNCTION {format.chapter.pages}
596 { type "l" change.case$ }
598 chapter tie.or.space.connect
601 { ", " * format.pages * }
607 FUNCTION {format.in.ed.booktitle}
611 { "In " booktitle emphasize * }
612 { "In " format.editors * ", " * booktitle emphasize * }
618 FUNCTION {empty.misc.check}
619 { author empty$ title empty$ howpublished empty$
620 month empty$ year empty$ note empty$
623 { "all relevant fields are empty in " cite$ * warning$ }
628 FUNCTION {format.thesis.type}
632 type "t" change.case$
637 FUNCTION {format.tr.number}
639 { "Technical Report" }
644 { number tie.or.space.connect }
648 FUNCTION {format.article.crossref}
651 { "need key or journal for " cite$ * " to crossref " * crossref *
655 { "In \emph{" journal * "}" * }
660 " \citet{" * crossref * "}" *
663 FUNCTION {format.book.crossref}
665 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
668 { "Volume" volume tie.or.space.connect
673 editor field.or.null author field.or.null =
677 { "need editor, key, or series for " cite$ * " to crossref " *
681 { "\emph{" * series * "}" * }
689 " \citet{" * crossref * "}" *
692 FUNCTION {format.incoll.inproc.crossref}
694 editor field.or.null author field.or.null =
698 { "need editor, key, or booktitle for " cite$ * " to crossref " *
702 { "In \emph{" booktitle * "}" * }
710 " \citet{" * crossref * "}" *
715 format.authors "author" output.check
716 author format.key output
718 format.title "title" output.check
721 { journal emphasize "journal" output.check
723 { format.vol.num.pages output }
724 { format.vol.num.eid output }
726 format.date "year" output.check
728 { format.article.crossref output.nonnull
730 { format.pages output }
731 { format.eid output }
746 { format.editors "author and editor" output.check
747 editor format.key output
749 { format.authors output.nonnull
751 { "author and editor" editor either.or.check }
757 format.btitle "title" output.check
759 { format.bvolume output
761 format.number.series output
763 publisher "publisher" output.check
767 format.book.crossref output.nonnull
770 format.edition output
771 format.date "year" output.check
782 format.authors output
783 author format.key output
785 format.title "title" output.check
786 howpublished address new.block.checkb
801 { format.editors "author and editor" output.check
802 editor format.key output
804 { format.authors output.nonnull
806 { "author and editor" editor either.or.check }
812 format.btitle "title" output.check
814 { format.bvolume output
815 format.chapter.pages "chapter and pages" output.check
817 format.number.series output
819 publisher "publisher" output.check
822 { format.chapter.pages "chapter and pages" output.check
824 format.book.crossref output.nonnull
827 format.edition output
828 format.date "year" output.check
837 FUNCTION {incollection}
839 format.authors "author" output.check
840 author format.key output
842 format.title "title" output.check
845 { format.in.ed.booktitle "booktitle" output.check
846 format.bvolume output
847 format.number.series output
848 format.chapter.pages output
850 publisher "publisher" output.check
852 format.edition output
853 format.date "year" output.check
855 { format.incoll.inproc.crossref output.nonnull
856 format.chapter.pages output
867 FUNCTION {inproceedings}
869 format.authors "author" output.check
870 author format.key output
872 format.title "title" output.check
875 { format.in.ed.booktitle "booktitle" output.check
876 format.bvolume output
877 format.number.series output
880 { organization publisher new.sentence.checkb
883 format.date "year" output.check
885 { address output.nonnull
886 format.date "year" output.check
893 { format.incoll.inproc.crossref output.nonnull
905 FUNCTION {conference} { inproceedings }
909 format.authors output
910 author format.key output
912 format.btitle "title" output.check
913 organization address new.block.checkb
916 format.edition output
924 FUNCTION {mastersthesis}
926 format.authors "author" output.check
927 author format.key output
929 format.title "title" output.check
931 "Master's thesis" format.thesis.type output.nonnull
932 school "school" output.check
934 format.date "year" output.check
943 format.authors output
944 author format.key output
945 title howpublished new.block.checkb
947 howpublished new.block.checka
960 format.authors "author" output.check
961 author format.key output
963 format.btitle "title" output.check
965 "PhD thesis" format.thesis.type output.nonnull
966 school "school" output.check
968 format.date "year" output.check
975 FUNCTION {proceedings}
977 format.editors output
978 editor format.key output
980 format.btitle "title" output.check
981 format.bvolume output
982 format.number.series output
984 format.date "year" output.check
996 FUNCTION {techreport}
998 format.authors "author" output.check
999 author format.key output
1001 format.title "title" output.check
1003 format.tr.number output.nonnull
1004 institution "institution" output.check
1006 format.date "year" output.check
1013 FUNCTION {unpublished}
1015 format.authors "author" output.check
1016 author format.key output
1018 format.title "title" output.check
1020 note "note" output.check
1026 FUNCTION {default.type} { misc }
1029 MACRO {jan} {"January"}
1031 MACRO {feb} {"February"}
1033 MACRO {mar} {"March"}
1035 MACRO {apr} {"April"}
1039 MACRO {jun} {"June"}
1041 MACRO {jul} {"July"}
1043 MACRO {aug} {"August"}
1045 MACRO {sep} {"September"}
1047 MACRO {oct} {"October"}
1049 MACRO {nov} {"November"}
1051 MACRO {dec} {"December"}
1055 MACRO {acmcs} {"ACM Computing Surveys"}
1057 MACRO {acta} {"Acta Informatica"}
1059 MACRO {cacm} {"Communications of the ACM"}
1061 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1063 MACRO {ibmsj} {"IBM Systems Journal"}
1065 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1067 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1070 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1072 MACRO {ipl} {"Information Processing Letters"}
1074 MACRO {jacm} {"Journal of the ACM"}
1076 MACRO {jcss} {"Journal of Computer and System Sciences"}
1078 MACRO {scp} {"Science of Computer Programming"}
1080 MACRO {sicomp} {"SIAM Journal on Computing"}
1082 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1084 MACRO {tods} {"ACM Transactions on Database Systems"}
1086 MACRO {tog} {"ACM Transactions on Graphics"}
1088 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1090 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1092 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1094 MACRO {tcs} {"Theoretical Computer Science"}
1106 FUNCTION {chop.word}
1109 s #1 len substring$ =
1110 { s len #1 + global.max$ substring$ }
1115 FUNCTION {format.lab.names}
1117 s #1 "{vv~}{ll}" format.name$
1118 s num.names$ duplicate$
1120 { pop$ " et~al." * }
1123 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1125 { " and " * s #2 "{vv~}{ll}" format.name$ * }
1133 FUNCTION {author.key.label}
1136 { cite$ #1 #3 substring$ }
1140 { author format.lab.names }
1144 FUNCTION {author.editor.key.label}
1148 { cite$ #1 #3 substring$ }
1152 { editor format.lab.names }
1155 { author format.lab.names }
1159 FUNCTION {author.key.organization.label}
1162 { organization empty$
1163 { cite$ #1 #3 substring$ }
1164 { "The " #4 organization chop.word #3 text.prefix$ }
1170 { author format.lab.names }
1174 FUNCTION {editor.key.organization.label}
1177 { organization empty$
1178 { cite$ #1 #3 substring$ }
1179 { "The " #4 organization chop.word #3 text.prefix$ }
1185 { editor format.lab.names }
1189 FUNCTION {calc.short.authors}
1193 'author.editor.key.label
1194 { type$ "proceedings" =
1195 'editor.key.organization.label
1197 'author.key.organization.label
1207 FUNCTION {calc.label}
1208 { calc.short.authors
1212 year duplicate$ empty$
1213 short.list key field.or.null = or
1221 FUNCTION {sort.format.names}
1225 s num.names$ 'numnames :=
1226 numnames 'namesleft :=
1229 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1233 namesleft #1 = t "others" = and
1235 { numnames #2 > nameptr #2 = and
1236 { "zz" * year field.or.null * " " * }
1245 nameptr #1 + 'nameptr :=
1246 namesleft #1 - 'namesleft :=
1251 FUNCTION {sort.format.title}
1255 "The " #4 t chop.word
1259 #1 global.max$ substring$
1262 FUNCTION {author.sort}
1265 { "to sort, need author or key in " cite$ * warning$
1271 { author sort.format.names }
1275 FUNCTION {author.editor.sort}
1279 { "to sort, need author, editor, or key in " cite$ * warning$
1285 { editor sort.format.names }
1288 { author sort.format.names }
1292 FUNCTION {author.organization.sort}
1294 { organization empty$
1296 { "to sort, need author, organization, or key in " cite$ * warning$
1302 { "The " #4 organization chop.word sortify }
1305 { author sort.format.names }
1309 FUNCTION {editor.organization.sort}
1311 { organization empty$
1313 { "to sort, need editor, organization, or key in " cite$ * warning$
1319 { "The " #4 organization chop.word sortify }
1322 { editor sort.format.names }
1336 { type$ "proceedings" =
1337 'editor.organization.sort
1339 'author.organization.sort
1348 year field.or.null sortify
1354 #1 entry.max$ substring$
1357 #1 entry.max$ substring$
1365 STRINGS { longest.label last.label next.extra }
1367 INTEGERS { longest.label.width last.extra.num number.label }
1369 FUNCTION {initialize.longest.label}
1370 { "" 'longest.label :=
1371 #0 int.to.chr$ 'last.label :=
1373 #0 'longest.label.width :=
1374 #0 'last.extra.num :=
1378 FUNCTION {forward.pass}
1379 { last.label label =
1380 { last.extra.num #1 + 'last.extra.num :=
1381 last.extra.num int.to.chr$ 'extra.label :=
1383 { "a" chr.to.int$ 'last.extra.num :=
1385 label 'last.label :=
1388 number.label #1 + 'number.label :=
1391 FUNCTION {reverse.pass}
1393 { "a" 'extra.label := }
1396 extra.label 'next.extra :=
1400 { "{\natexlab{" swap$ * "}}" * }
1403 label extra.label * 'label :=
1406 EXECUTE {initialize.longest.label}
1408 ITERATE {forward.pass}
1410 REVERSE {reverse.pass}
1412 FUNCTION {bib.sort.order}
1413 { sort.label 'sort.key$ :=
1416 ITERATE {bib.sort.order}
1420 FUNCTION {begin.bib}
1423 { preamble$ write$ newline$ }
1425 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1427 "\providecommand{\natexlab}[1]{#1}"
1429 "\providecommand{\url}[1]{\texttt{#1}}"
1431 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1433 " \providecommand{\doi}[1]{doi: #1}\else"
1435 " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1441 EXECUTE {init.state.consts}
1443 ITERATE {call.type$}
1447 "\end{thebibliography}" write$ newline$