2 %% File: `csplainnat.bst' for use with natbib package
3 %% This is a modification of `plainnat.bst' for Czech references style
4 %% (According to "CSN ISO 690: Bibliograficke citace. Obsah, forma a struktura").
5 %% Some modifications are commented, look for the keyword 'CHANGE'
6 %% For more detailed info use svn repository svn://kraken.pedf.cuni.cz/csplainnat/
8 %% Original plainnat.bst by Patrick W Daly
9 %% Modifications by David Mudr{\'{a}}k mudrd8mz@uxit.pedf.cuni.cz
11 %% MAJOR MODIFICATIONS
12 %% * Added "@ONLINE" item type with added "cited" field.
14 %% This program can be redistributed and/or modified under the terms
15 %% of the LaTeX Project Public License Distributed from CTAN
16 %% archives in directory macros/latex/base/lppl.txt; either
17 %% version 1 of the License, or any later version.
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.
78 { label extra.label sort.label short.list }
80 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
82 FUNCTION {init.state.consts}
89 STRINGS { s t t1 t2 } % CHANGE mudrd8mz 2005-10-12 adding t1, t2
91 FUNCTION {output.nonnull}
93 output.state mid.sentence =
95 { output.state after.block =
100 { output.state before.all =
102 { add.period$ " " * write$ }
106 mid.sentence 'output.state :=
119 FUNCTION {output.check}
122 { pop$ "empty " t * " in " * cite$ * warning$ }
134 { output.state before.all =
136 { after.block 'output.state := }
140 FUNCTION {new.sentence}
141 { output.state after.block =
143 { output.state before.all =
145 { after.sentence 'output.state := }
169 FUNCTION {new.block.checka}
176 FUNCTION {new.block.checkb}
185 FUNCTION {new.sentence.checka}
192 FUNCTION {new.sentence.checkb}
201 FUNCTION {field.or.null}
211 { "\emph{" swap$ * "}" * }
215 FUNCTION {capitalize} % CHANGE mudrd8mz 2005-10-12 adding new function
219 { "{\sc " swap$ * "}" * } %{ "u" change.case$ }
224 INTEGERS { nameptr namesleft numnames }
226 FUNCTION {format.names.full}
229 s num.names$ 'numnames :=
230 numnames 'namesleft :=
232 { s nameptr "{ll}" format.name$ 't1 := % CHANGE mudrd8mz 2005-10-12
233 t1 capitalize 't1 := % CHANGE mudrd8mz 2005-10-12
234 s nameptr "{, f.}{~j.}" format.name$ 't2 := % CHANGE mudrd8mz 2005-10-12
238 { " -- " * t * } % CHANGE mudrd8mz 2005-10-13 : adding "--"
240 { "" * } % CHANGE mudrd8mz 2005-10-12
243 t "OTHERS" = % CHANGE mudrd8mz 2005-10-12 because of capitalize
245 { " -- " * t * } % CHANGE mudrd8mz 2005-10-12 : between the last and the one before
252 nameptr #1 + 'nameptr :=
253 namesleft #1 - 'namesleft :=
258 FUNCTION {format.names.short} % CHANGE mudrd8mz 2005-10-14 adding more authors version
260 s #1 "{ll}" format.name$ 't1 :=
262 s #1 "{, f.}{~j.}" format.name$ 't2 :=
266 FUNCTION {format.names}
269 {format.names.short} % pokud ma citace vice nez 3 autory, uvadi se pouze PRVNI et al.
270 {format.names.full} % pokud ma citace max 3 autory, uvadi se vsichni
274 FUNCTION {format.key}
276 { key field.or.null }
281 FUNCTION {format.authors}
284 { author format.names }
288 FUNCTION {format.editors}
291 { editor format.names
292 editor num.names$ #1 >
293 { " (Ed.)" * } % CHANGE mudrd8mz 2005-10-12
300 FUNCTION {format.isbn}
303 { new.block "ISBN " isbn * }
307 FUNCTION {format.issn}
310 { new.block "ISSN " issn * }
314 FUNCTION {format.url}
317 { new.block "Dostupn{\'{e}}~z: $\texttt{<{" url * "}>}$" * }
323 FUNCTION {format.doi}
326 { new.block "\doi{" doi * "}" * }
330 FUNCTION {format.title}
338 FUNCTION {format.full.names}
341 s num.names$ 'numnames :=
342 numnames 'namesleft :=
345 "{vv~}{ll}" format.name$ 't :=
357 { ", " * t * } % CHANGE mudrd8mz 2005-10-12
364 nameptr #1 + 'nameptr :=
365 namesleft #1 - 'namesleft :=
370 FUNCTION {author.editor.full}
374 { editor format.full.names }
377 { author format.full.names }
381 FUNCTION {author.full}
384 { author format.full.names }
388 FUNCTION {editor.full}
391 { editor format.full.names }
395 FUNCTION {make.full.names}
400 { type$ "proceedings" =
408 FUNCTION {output.bibitem}
412 ")" make.full.names duplicate$ short.list =
421 before.all 'output.state :=
428 { t #1 #1 substring$ "-" =
429 { t #1 #2 substring$ "--" = not
431 t #2 global.max$ substring$ 't :=
433 { { t #1 #1 substring$ "-" = }
435 t #2 global.max$ substring$ 't :=
441 { t #1 #1 substring$ *
442 t #2 global.max$ substring$ 't :=
449 FUNCTION {format.date}
450 { year duplicate$ empty$
451 { "empty year in " cite$ * warning$
464 FUNCTION {format.btitle}
468 FUNCTION {tie.or.space.connect}
469 { duplicate$ text.length$ #3 <
476 FUNCTION {either.or.check}
479 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
483 FUNCTION {format.bvolume}
486 { "" volume tie.or.space.connect % CHANGE mudrd8mz 2005-10-12 removing "volume"
489 { " / " * series emphasize * } % CHANGE mudrd8mz 2005-10-12 "of" --> "/"
491 "volume and number" number either.or.check
496 FUNCTION {format.number.series}
499 { series field.or.null }
500 { output.state mid.sentence =
501 { "{\v{c}}." } % CHANGE mudrd8mz 2005-10-12 "{\v{c}}" instead of "number"
504 number tie.or.space.connect
506 { "there's a number but no series in " cite$ * warning$ }
507 { " v " * series * } % CHANGE mudrd8mz 2005-10-12 "in" --> "v"
516 FUNCTION {format.edition}
519 { output.state mid.sentence =
520 { edition "l" change.case$ " edition" * }
521 { edition "t" change.case$ " edition" * }
527 INTEGERS { multiresult }
529 FUNCTION {multi.page.check}
538 swap$ duplicate$ "," =
541 { #1 'multiresult := }
542 { t #2 global.max$ substring$ 't := }
549 FUNCTION {format.pages}
552 { pages multi.page.check
553 { "s." pages n.dashify tie.or.space.connect } % CHANGE mudrd8mz 2007-03-15: 'pages' -> 's.'
554 { "s." pages tie.or.space.connect } % CHANGE mudrd8mz 2007-03-15: 'pages' -> 's.'
560 FUNCTION {format.eid}
563 { "art." eid tie.or.space.connect }
567 FUNCTION {format.vol.num.pages}
568 { volume field.or.null
573 { "there's a number but no volume in " cite$ * warning$ }
581 { pop$ format.pages }
582 { ", s.~" * pages n.dashify * }
588 FUNCTION {format.vol.num.eid}
589 { volume field.or.null
592 { "\penalty0, " number * *
594 { "there's a number but no volume in " cite$ * warning$ }
603 { ":\penalty0 " * eid * }
609 FUNCTION {format.chapter.pages}
613 { "" } % CHANGE mudrd8mz 2008-04-08 removing the word "chapter"
614 { type "l" change.case$ }
616 chapter tie.or.space.connect
619 { ", " * format.pages * }
625 FUNCTION {format.in.ed.booktitle}
629 { "In " booktitle emphasize * }
630 { "In " format.editors * " " * booktitle emphasize * } % CHANGE mudrd8mz 2005-10-12
636 FUNCTION {empty.misc.check}
637 { author empty$ title empty$ howpublished empty$
638 month empty$ year empty$ note empty$
641 { "all relevant fields are empty in " cite$ * warning$ }
646 FUNCTION {format.thesis.type}
649 { pop$ type } % CHANGE mudrd8mz 2007-03-15: Do not lowercase the thesis type
653 FUNCTION {format.tr.number}
655 { "Technical Report" }
660 { number tie.or.space.connect }
664 FUNCTION {format.article.crossref}
667 { "need key or journal for " cite$ * " to crossref " * crossref *
671 { "In \emph{" journal * "}" * }
676 " \citep{" * crossref * "}" *
679 FUNCTION {format.book.crossref}
681 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
684 { "Volume" volume tie.or.space.connect
689 editor field.or.null author field.or.null =
693 { "need editor, key, or series for " cite$ * " to crossref " *
697 { "\emph{" * series * "}" * }
705 ", \citet{" * crossref * "}" *
708 FUNCTION {format.incoll.inproc.crossref}
710 editor field.or.null author field.or.null =
714 { "need editor, key, or booktitle for " cite$ * " to crossref " *
718 { "In \emph{" booktitle * "}" * }
726 " \citet{" * crossref * "}" *
731 format.authors "author" output.check
732 author format.key output
734 format.title "title" output.check
737 { journal emphasize "journal" output.check
739 format.date "year" output.check
741 { format.vol.num.pages output }
742 { format.vol.num.eid output }
745 { format.article.crossref output.nonnull
747 { format.pages output }
748 { format.eid output }
760 FUNCTION {online} % CHANGE mudrd8mz 2005-10-12 addign new item type
762 format.authors output
764 format.btitle " [online]" * output
772 { format.date "year" output.check }
777 { "[cit.~" cited * "]" * output }
790 { format.editors "author and editor" output.check
791 editor format.key output
793 { format.authors output.nonnull
795 { "author and editor" editor either.or.check }
801 format.btitle "title" output.check
804 format.bvolume output
805 format.number.series output
808 % address "~: " * publisher * % CHANGE mudrd8mz 2005-10-12
809 "publisher" output.check
812 format.book.crossref output.nonnull
815 format.edition output
816 format.date "year" output.check
827 format.authors output
828 author format.key output
830 format.title "title" output.check
831 howpublished address new.block.checkb
846 { format.editors "author and editor" output.check
847 editor format.key output
849 { format.authors output.nonnull
851 { "author and editor" editor either.or.check }
857 format.btitle "title" output.check
859 { format.bvolume output
860 format.chapter.pages "chapter and pages" output.check
862 format.number.series output
864 publisher "publisher" output.check
867 { format.chapter.pages "chapter and pages" output.check
869 format.book.crossref output.nonnull
872 format.edition output
873 format.date "year" output.check
882 FUNCTION {incollection}
884 format.authors "author" output.check
885 author format.key output
887 format.title "title" output.check
890 { format.in.ed.booktitle "booktitle" output.check
891 format.bvolume output
892 format.number.series output
894 address ": " * publisher * % CHANGE mudrd8mz 2005-10-12
895 "publisher" output.check
896 %publisher "publisher" output.check
898 format.edition output
899 format.date "year" output.check
901 format.chapter.pages output
903 { format.incoll.inproc.crossref output.nonnull
904 format.chapter.pages output
915 FUNCTION {inproceedings}
917 format.authors "author" output.check
918 author format.key output
920 format.title "title" output.check
923 { format.in.ed.booktitle "booktitle" output.check
924 format.bvolume output
925 format.number.series output
928 { organization publisher new.sentence.checkb
931 format.date "year" output.check
933 { address output.nonnull
934 format.date "year" output.check
941 { format.incoll.inproc.crossref output.nonnull
953 FUNCTION {conference} { inproceedings }
957 format.authors output
958 author format.key output
960 format.btitle "title" output.check
961 organization address new.block.checkb
964 format.edition output
972 FUNCTION {mastersthesis}
974 format.authors "author" output.check
975 author format.key output
977 format.title "title" output.check
979 "Master's thesis" format.thesis.type output.nonnull
980 school "school" output.check
982 format.date "year" output.check
991 format.authors output
992 author format.key output
993 title howpublished new.block.checkb
995 howpublished new.block.checka
1006 FUNCTION {phdthesis}
1008 format.authors "author" output.check
1009 author format.key output
1011 format.btitle "title" output.check
1013 "PhD thesis" format.thesis.type output.nonnull
1014 school "school" output.check
1016 format.date "year" output.check
1023 FUNCTION {proceedings}
1025 format.editors output
1026 editor format.key output
1028 format.btitle "title" output.check
1029 format.bvolume output
1030 format.number.series output
1032 format.date "year" output.check
1044 FUNCTION {techreport}
1046 format.authors "author" output.check
1047 author format.key output
1049 format.title "title" output.check
1051 format.tr.number output.nonnull
1052 institution "institution" output.check
1054 format.date "year" output.check
1061 FUNCTION {unpublished}
1063 format.authors "author" output.check
1064 author format.key output
1066 format.title "title" output.check
1069 note "note" output.check
1074 FUNCTION {default.type} { misc }
1077 MACRO {jan} {"January"}
1079 MACRO {feb} {"February"}
1081 MACRO {mar} {"March"}
1083 MACRO {apr} {"April"}
1087 MACRO {jun} {"June"}
1089 MACRO {jul} {"July"}
1091 MACRO {aug} {"August"}
1093 MACRO {sep} {"September"}
1095 MACRO {oct} {"October"}
1097 MACRO {nov} {"November"}
1099 MACRO {dec} {"December"}
1103 MACRO {acmcs} {"ACM Computing Surveys"}
1105 MACRO {acta} {"Acta Informatica"}
1107 MACRO {cacm} {"Communications of the ACM"}
1109 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1111 MACRO {ibmsj} {"IBM Systems Journal"}
1113 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1115 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1118 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1120 MACRO {ipl} {"Information Processing Letters"}
1122 MACRO {jacm} {"Journal of the ACM"}
1124 MACRO {jcss} {"Journal of Computer and System Sciences"}
1126 MACRO {scp} {"Science of Computer Programming"}
1128 MACRO {sicomp} {"SIAM Journal on Computing"}
1130 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1132 MACRO {tods} {"ACM Transactions on Database Systems"}
1134 MACRO {tog} {"ACM Transactions on Graphics"}
1136 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1138 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1140 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1142 MACRO {tcs} {"Theoretical Computer Science"}
1154 FUNCTION {chop.word}
1157 s #1 len substring$ =
1158 { s len #1 + global.max$ substring$ }
1163 FUNCTION {format.lab.names}
1165 s #1 "{vv~}{ll}" format.name$
1166 s num.names$ duplicate$
1168 { pop$ " et~al." * }
1171 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1173 { " -- " * s #2 "{vv~}{ll}" format.name$ * } % CHANGE mudrd8mz 2005-10-12: changed "and"
1181 FUNCTION {author.key.label}
1184 { cite$ #1 #3 substring$ }
1188 { author format.lab.names }
1192 FUNCTION {author.editor.key.label}
1196 { cite$ #1 #3 substring$ }
1200 { editor format.lab.names }
1203 { author format.lab.names }
1207 FUNCTION {author.key.organization.label}
1210 { organization empty$
1211 { cite$ #1 #3 substring$ }
1212 { "The " #4 organization chop.word #3 text.prefix$ }
1218 { author format.lab.names }
1222 FUNCTION {editor.key.organization.label}
1225 { organization empty$
1226 { cite$ #1 #3 substring$ }
1227 { "The " #4 organization chop.word #3 text.prefix$ }
1233 { editor format.lab.names }
1237 FUNCTION {calc.short.authors}
1241 'author.editor.key.label
1242 { type$ "proceedings" =
1243 'editor.key.organization.label
1245 'author.key.organization.label
1255 FUNCTION {calc.label}
1256 { calc.short.authors
1260 year duplicate$ empty$
1261 short.list key field.or.null = or
1269 FUNCTION {sort.format.names}
1273 s num.names$ 'numnames :=
1274 numnames 'namesleft :=
1277 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1281 namesleft #1 = t "others" = and
1283 { numnames #2 > nameptr #2 = and
1284 { "zz" * year field.or.null * " " * }
1293 nameptr #1 + 'nameptr :=
1294 namesleft #1 - 'namesleft :=
1299 FUNCTION {sort.format.title}
1303 "The " #4 t chop.word
1307 #1 global.max$ substring$
1310 FUNCTION {author.sort}
1313 { "to sort, need author or key in " cite$ * warning$
1319 { author sort.format.names }
1323 FUNCTION {author.editor.sort}
1327 { "to sort, need author, editor, or key in " cite$ * warning$
1333 { editor sort.format.names }
1336 { author sort.format.names }
1340 FUNCTION {author.organization.sort}
1342 { organization empty$
1344 { "to sort, need author, organization, or key in " cite$ * warning$
1350 { "The " #4 organization chop.word sortify }
1353 { author sort.format.names }
1357 FUNCTION {editor.organization.sort}
1359 { organization empty$
1361 { "to sort, need editor, organization, or key in " cite$ * warning$
1367 { "The " #4 organization chop.word sortify }
1370 { editor sort.format.names }
1384 { type$ "proceedings" =
1385 'editor.organization.sort
1387 'author.organization.sort
1398 #1 entry.max$ substring$
1401 #1 entry.max$ substring$
1409 STRINGS { longest.label last.label next.extra }
1411 INTEGERS { longest.label.width last.extra.num number.label }
1413 FUNCTION {initialize.longest.label}
1414 { "" 'longest.label :=
1415 #0 int.to.chr$ 'last.label :=
1417 #0 'longest.label.width :=
1418 #0 'last.extra.num :=
1422 FUNCTION {forward.pass}
1423 { last.label label =
1424 { last.extra.num #1 + 'last.extra.num :=
1425 last.extra.num int.to.chr$ 'extra.label :=
1427 { "a" chr.to.int$ 'last.extra.num :=
1429 label 'last.label :=
1432 number.label #1 + 'number.label :=
1435 FUNCTION {reverse.pass}
1437 { "a" 'extra.label := }
1440 extra.label 'next.extra :=
1444 { "{\natexlab{" swap$ * "}}" * }
1447 label extra.label * 'label :=
1450 EXECUTE {initialize.longest.label}
1452 ITERATE {forward.pass}
1454 REVERSE {reverse.pass}
1456 FUNCTION {bib.sort.order}
1457 { sort.label 'sort.key$ :=
1460 ITERATE {bib.sort.order}
1464 FUNCTION {begin.bib}
1467 { preamble$ write$ newline$ }
1469 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1471 "\providecommand{\natexlab}[1]{#1}"
1473 "\providecommand{\url}[1]{\texttt{#1}}"
1475 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1477 " \providecommand{\doi}[1]{doi: #1}\else"
1479 " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1485 EXECUTE {init.state.consts}
1487 ITERATE {call.type$}
1491 "\end{thebibliography}" write$ newline$