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
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: \url{" url * "}" * }
321 FUNCTION {format.doi}
324 { new.block "\doi{" doi * "}" * }
328 FUNCTION {format.title}
336 FUNCTION {format.full.names}
339 s num.names$ 'numnames :=
340 numnames 'namesleft :=
343 "{vv~}{ll}" format.name$ 't :=
355 { ", " * t * } % CHANGE mudrd8mz 2005-10-12
362 nameptr #1 + 'nameptr :=
363 namesleft #1 - 'namesleft :=
368 FUNCTION {author.editor.full}
372 { editor format.full.names }
375 { author format.full.names }
379 FUNCTION {author.full}
382 { author format.full.names }
386 FUNCTION {editor.full}
389 { editor format.full.names }
393 FUNCTION {make.full.names}
398 { type$ "proceedings" =
406 FUNCTION {output.bibitem}
410 ")" make.full.names duplicate$ short.list =
419 before.all 'output.state :=
426 { t #1 #1 substring$ "-" =
427 { t #1 #2 substring$ "--" = not
429 t #2 global.max$ substring$ 't :=
431 { { t #1 #1 substring$ "-" = }
433 t #2 global.max$ substring$ 't :=
439 { t #1 #1 substring$ *
440 t #2 global.max$ substring$ 't :=
447 FUNCTION {format.date}
448 { year duplicate$ empty$
449 { "empty year in " cite$ * warning$
462 FUNCTION {format.btitle}
466 FUNCTION {tie.or.space.connect}
467 { duplicate$ text.length$ #3 <
474 FUNCTION {either.or.check}
477 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
481 FUNCTION {format.bvolume}
484 { "" volume tie.or.space.connect % CHANGE mudrd8mz 2005-10-12 removing "volume"
487 { " / " * series emphasize * } % CHANGE mudrd8mz 2005-10-12 "of" --> "/"
489 "volume and number" number either.or.check
494 FUNCTION {format.number.series}
497 { series field.or.null }
498 { output.state mid.sentence =
499 { "{\v{c}}." } % CHANGE mudrd8mz 2005-10-12 "{\v{c}}" instead of "number"
502 number tie.or.space.connect
504 { "there's a number but no series in " cite$ * warning$ }
505 { " v " * series * } % CHANGE mudrd8mz 2005-10-12 "in" --> "v"
514 FUNCTION {format.edition}
517 { output.state mid.sentence =
518 { edition "l" change.case$ " edition" * }
519 { edition "t" change.case$ " edition" * }
525 INTEGERS { multiresult }
527 FUNCTION {multi.page.check}
536 swap$ duplicate$ "," =
539 { #1 'multiresult := }
540 { t #2 global.max$ substring$ 't := }
547 FUNCTION {format.pages}
550 { pages multi.page.check
551 { "s." pages n.dashify tie.or.space.connect } % CHANGE mudrd8mz 2007-03-15: 'pages' -> 's.'
552 { "s." pages tie.or.space.connect } % CHANGE mudrd8mz 2007-03-15: 'pages' -> 's.'
558 FUNCTION {format.eid}
561 { "art." eid tie.or.space.connect }
565 FUNCTION {format.vol.num.pages}
566 { volume field.or.null
571 { "there's a number but no volume in " cite$ * warning$ }
579 { pop$ format.pages }
580 { ", s.~" * pages n.dashify * }
586 FUNCTION {format.vol.num.eid}
587 { volume field.or.null
590 { "\penalty0, " number * *
592 { "there's a number but no volume in " cite$ * warning$ }
601 { ":\penalty0 " * eid * }
607 FUNCTION {format.chapter.pages}
612 { type "l" change.case$ }
614 chapter tie.or.space.connect
617 { ", " * format.pages * }
623 FUNCTION {format.in.ed.booktitle}
627 { "In " booktitle emphasize * }
628 { "In " format.editors * " " * booktitle emphasize * } % CHANGE mudrd8mz 2005-10-12
634 FUNCTION {empty.misc.check}
635 { author empty$ title empty$ howpublished empty$
636 month empty$ year empty$ note empty$
639 { "all relevant fields are empty in " cite$ * warning$ }
644 FUNCTION {format.thesis.type}
647 { pop$ type } % CHANGE mudrd8mz 2007-03-15: Do not lowercase the thesis type
651 FUNCTION {format.tr.number}
653 { "Technical Report" }
658 { number tie.or.space.connect }
662 FUNCTION {format.article.crossref}
665 { "need key or journal for " cite$ * " to crossref " * crossref *
669 { "In \emph{" journal * "}" * }
674 " \citep{" * crossref * "}" *
677 FUNCTION {format.book.crossref}
679 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
682 { "Volume" volume tie.or.space.connect
687 editor field.or.null author field.or.null =
691 { "need editor, key, or series for " cite$ * " to crossref " *
695 { "\emph{" * series * "}" * }
703 ", \citet{" * crossref * "}" *
706 FUNCTION {format.incoll.inproc.crossref}
708 editor field.or.null author field.or.null =
712 { "need editor, key, or booktitle for " cite$ * " to crossref " *
716 { "In \emph{" booktitle * "}" * }
724 " \citet{" * crossref * "}" *
729 format.authors "author" output.check
730 author format.key output
732 format.title "title" output.check
735 { journal emphasize "journal" output.check
737 format.date "year" output.check
739 { format.vol.num.pages output }
740 { format.vol.num.eid output }
743 { format.article.crossref output.nonnull
745 { format.pages output }
746 { format.eid output }
758 FUNCTION {online} % CHANGE mudrd8mz 2005-10-12 addign new item type
760 format.authors output
762 format.btitle " [online]" * output
770 { format.date "year" output.check }
775 { "[cit.~" cited * "]" * output }
788 { format.editors "author and editor" output.check
789 editor format.key output
791 { format.authors output.nonnull
793 { "author and editor" editor either.or.check }
799 format.btitle "title" output.check
802 format.bvolume output
803 format.number.series output
805 address "~: " * publisher * % CHANGE mudrd8mz 2005-10-12
806 "publisher" output.check
809 format.book.crossref output.nonnull
812 format.edition output
813 format.date "year" output.check
824 format.authors output
825 author format.key output
827 format.title "title" output.check
828 howpublished address new.block.checkb
843 { format.editors "author and editor" output.check
844 editor format.key output
846 { format.authors output.nonnull
848 { "author and editor" editor either.or.check }
854 format.btitle "title" output.check
856 { format.bvolume output
857 format.chapter.pages "chapter and pages" output.check
859 format.number.series output
861 publisher "publisher" output.check
864 { format.chapter.pages "chapter and pages" output.check
866 format.book.crossref output.nonnull
869 format.edition output
870 format.date "year" output.check
879 FUNCTION {incollection}
881 format.authors "author" output.check
882 author format.key output
884 format.title "title" output.check
887 { format.in.ed.booktitle "booktitle" output.check
888 format.bvolume output
889 format.number.series output
890 format.chapter.pages output
892 address ": " * publisher * % CHANGE mudrd8mz 2005-10-12
893 "publisher" output.check
894 %publisher "publisher" output.check
896 format.edition output
897 format.date "year" output.check
899 { format.incoll.inproc.crossref output.nonnull
900 format.chapter.pages output
911 FUNCTION {inproceedings}
913 format.authors "author" output.check
914 author format.key output
916 format.title "title" output.check
919 { format.in.ed.booktitle "booktitle" output.check
920 format.bvolume output
921 format.number.series output
924 { organization publisher new.sentence.checkb
927 format.date "year" output.check
929 { address output.nonnull
930 format.date "year" output.check
937 { format.incoll.inproc.crossref output.nonnull
949 FUNCTION {conference} { inproceedings }
953 format.authors output
954 author format.key output
956 format.btitle "title" output.check
957 organization address new.block.checkb
960 format.edition output
968 FUNCTION {mastersthesis}
970 format.authors "author" output.check
971 author format.key output
973 format.title "title" output.check
975 "Master's thesis" format.thesis.type output.nonnull
976 school "school" output.check
978 format.date "year" output.check
987 format.authors output
988 author format.key output
989 title howpublished new.block.checkb
991 howpublished new.block.checka
1002 FUNCTION {phdthesis}
1004 format.authors "author" output.check
1005 author format.key output
1007 format.btitle "title" output.check
1009 "PhD thesis" format.thesis.type output.nonnull
1010 school "school" output.check
1012 format.date "year" output.check
1019 FUNCTION {proceedings}
1021 format.editors output
1022 editor format.key output
1024 format.btitle "title" output.check
1025 format.bvolume output
1026 format.number.series output
1028 format.date "year" output.check
1040 FUNCTION {techreport}
1042 format.authors "author" output.check
1043 author format.key output
1045 format.title "title" output.check
1047 format.tr.number output.nonnull
1048 institution "institution" output.check
1050 format.date "year" output.check
1057 FUNCTION {unpublished}
1059 format.authors "author" output.check
1060 author format.key output
1062 format.title "title" output.check
1065 note "note" output.check
1070 FUNCTION {default.type} { misc }
1073 MACRO {jan} {"January"}
1075 MACRO {feb} {"February"}
1077 MACRO {mar} {"March"}
1079 MACRO {apr} {"April"}
1083 MACRO {jun} {"June"}
1085 MACRO {jul} {"July"}
1087 MACRO {aug} {"August"}
1089 MACRO {sep} {"September"}
1091 MACRO {oct} {"October"}
1093 MACRO {nov} {"November"}
1095 MACRO {dec} {"December"}
1099 MACRO {acmcs} {"ACM Computing Surveys"}
1101 MACRO {acta} {"Acta Informatica"}
1103 MACRO {cacm} {"Communications of the ACM"}
1105 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1107 MACRO {ibmsj} {"IBM Systems Journal"}
1109 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1111 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1114 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1116 MACRO {ipl} {"Information Processing Letters"}
1118 MACRO {jacm} {"Journal of the ACM"}
1120 MACRO {jcss} {"Journal of Computer and System Sciences"}
1122 MACRO {scp} {"Science of Computer Programming"}
1124 MACRO {sicomp} {"SIAM Journal on Computing"}
1126 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1128 MACRO {tods} {"ACM Transactions on Database Systems"}
1130 MACRO {tog} {"ACM Transactions on Graphics"}
1132 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1134 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1136 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1138 MACRO {tcs} {"Theoretical Computer Science"}
1150 FUNCTION {chop.word}
1153 s #1 len substring$ =
1154 { s len #1 + global.max$ substring$ }
1159 FUNCTION {format.lab.names}
1161 s #1 "{vv~}{ll}" format.name$
1162 s num.names$ duplicate$
1164 { pop$ " et~al." * }
1167 { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1169 { " -- " * s #2 "{vv~}{ll}" format.name$ * } % CHANGE mudrd8mz 2005-10-12: changed "and"
1177 FUNCTION {author.key.label}
1180 { cite$ #1 #3 substring$ }
1184 { author format.lab.names }
1188 FUNCTION {author.editor.key.label}
1192 { cite$ #1 #3 substring$ }
1196 { editor format.lab.names }
1199 { author format.lab.names }
1203 FUNCTION {author.key.organization.label}
1206 { organization empty$
1207 { cite$ #1 #3 substring$ }
1208 { "The " #4 organization chop.word #3 text.prefix$ }
1214 { author format.lab.names }
1218 FUNCTION {editor.key.organization.label}
1221 { organization empty$
1222 { cite$ #1 #3 substring$ }
1223 { "The " #4 organization chop.word #3 text.prefix$ }
1229 { editor format.lab.names }
1233 FUNCTION {calc.short.authors}
1237 'author.editor.key.label
1238 { type$ "proceedings" =
1239 'editor.key.organization.label
1241 'author.key.organization.label
1251 FUNCTION {calc.label}
1252 { calc.short.authors
1256 year duplicate$ empty$
1257 short.list key field.or.null = or
1265 FUNCTION {sort.format.names}
1269 s num.names$ 'numnames :=
1270 numnames 'namesleft :=
1273 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1277 namesleft #1 = t "others" = and
1279 { numnames #2 > nameptr #2 = and
1280 { "zz" * year field.or.null * " " * }
1289 nameptr #1 + 'nameptr :=
1290 namesleft #1 - 'namesleft :=
1295 FUNCTION {sort.format.title}
1299 "The " #4 t chop.word
1303 #1 global.max$ substring$
1306 FUNCTION {author.sort}
1309 { "to sort, need author or key in " cite$ * warning$
1315 { author sort.format.names }
1319 FUNCTION {author.editor.sort}
1323 { "to sort, need author, editor, or key in " cite$ * warning$
1329 { editor sort.format.names }
1332 { author sort.format.names }
1336 FUNCTION {author.organization.sort}
1338 { organization empty$
1340 { "to sort, need author, organization, or key in " cite$ * warning$
1346 { "The " #4 organization chop.word sortify }
1349 { author sort.format.names }
1353 FUNCTION {editor.organization.sort}
1355 { organization empty$
1357 { "to sort, need editor, organization, or key in " cite$ * warning$
1363 { "The " #4 organization chop.word sortify }
1366 { editor sort.format.names }
1380 { type$ "proceedings" =
1381 'editor.organization.sort
1383 'author.organization.sort
1394 #1 entry.max$ substring$
1397 #1 entry.max$ substring$
1405 STRINGS { longest.label last.label next.extra }
1407 INTEGERS { longest.label.width last.extra.num number.label }
1409 FUNCTION {initialize.longest.label}
1410 { "" 'longest.label :=
1411 #0 int.to.chr$ 'last.label :=
1413 #0 'longest.label.width :=
1414 #0 'last.extra.num :=
1418 FUNCTION {forward.pass}
1419 { last.label label =
1420 { last.extra.num #1 + 'last.extra.num :=
1421 last.extra.num int.to.chr$ 'extra.label :=
1423 { "a" chr.to.int$ 'last.extra.num :=
1425 label 'last.label :=
1428 number.label #1 + 'number.label :=
1431 FUNCTION {reverse.pass}
1433 { "a" 'extra.label := }
1436 extra.label 'next.extra :=
1440 { "{\natexlab{" swap$ * "}}" * }
1443 label extra.label * 'label :=
1446 EXECUTE {initialize.longest.label}
1448 ITERATE {forward.pass}
1450 REVERSE {reverse.pass}
1452 FUNCTION {bib.sort.order}
1453 { sort.label 'sort.key$ :=
1456 ITERATE {bib.sort.order}
1460 FUNCTION {begin.bib}
1463 { preamble$ write$ newline$ }
1465 "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1467 "\providecommand{\natexlab}[1]{#1}"
1469 "\providecommand{\url}[1]{\texttt{#1}}"
1471 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1473 " \providecommand{\doi}[1]{doi: #1}\else"
1475 " \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1481 EXECUTE {init.state.consts}
1483 ITERATE {call.type$}
1487 "\end{thebibliography}" write$ newline$