(no commit message)
[csplainnat.git] / csplainnat.bst
blob65e8bfd7be03253f861b9b086c392be7a8d3d728
1 %% $Id$
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 'ZMENA' -- it means 'CHANGE' in Czech.
6 %% For more detailed info use svn repository svn://kraken.pedf.cuni.cz/csplainnat/
7 %%
8 %% Original plainnat.bst by Patrick W Daly
9 %% Modifications by David Mudr{\'{a}}k mudrd8mz@uxit.pedf.cuni.cz
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  % BibTeX `plainnat' family
17  %   version 0.99b for BibTeX versions 0.99a or later,
18  %   for LaTeX versions 2.09 and 2e.
19  %
20  % For use with the `natbib.sty' package; emulates the corresponding
21  %   member of the `plain' family, but with author-year citations.
22  %
23  % With version 6.0 of `natbib.sty', it may also be used for numerical
24  %   citations, while retaining the commands \citeauthor, \citefullauthor,
25  %   and \citeyear to print the corresponding information.
26  %
27  % For version 7.0 of `natbib.sty', the KEY field replaces missing
28  %   authors/editors, and the date is left blank in \bibitem.
29  %
30  % Includes field EID for the sequence/citation number of electronic journals
31  %  which is used instead of page numbers.
32  %
33  % Includes fields ISBN and ISSN.
34  %
35  % Includes field URL for Internet addresses.
36  %
37  % Includes field DOI for Digital Object Idenfifiers.
38  %
39  % Works best with the url.sty package of Donald Arseneau.
40  %
41  % Works with identical authors and year are further sorted by
42  %   citation key, to preserve any natural sequence.
43  %
44  % CHANGES
45  % * Added "@ONLINE" item type with added "cited" field.
46 ENTRY
47   { address
48     author
49     booktitle
50     chapter
51     doi
52     eid
53     edition
54     editor
55     howpublished
56     institution
57     isbn
58     issn
59     journal
60     key
61     month
62     note
63     number
64     organization
65     pages
66     publisher
67     school
68     series
69     title
70     type
71     url
72     volume
73     year
74     cited
75   }
76   {}
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}
82 { #0 'before.all :=
83   #1 'mid.sentence :=
84   #2 'after.sentence :=
85   #3 'after.block :=
88 STRINGS { s t t1 t2 } %  ZMENA mudrd8mz 2005-10-12 pridavam t1, t2
90 FUNCTION {output.nonnull}
91 { 's :=
92   output.state mid.sentence =
93     { ", " * write$ }
94     { output.state after.block =
95         { add.period$ write$
96           newline$
97           "\newblock " write$
98         }
99         { output.state before.all =
100             'write$
101             { add.period$ " " * write$ }
102           if$
103         }
104       if$
105       mid.sentence 'output.state :=
106     }
107   if$
108   s
111 FUNCTION {output}
112 { duplicate$ empty$
113     'pop$
114     'output.nonnull
115   if$
118 FUNCTION {output.check}
119 { 't :=
120   duplicate$ empty$
121     { pop$ "empty " t * " in " * cite$ * warning$ }
122     'output.nonnull
123   if$
126 FUNCTION {fin.entry}
127 { add.period$
128   write$
129   newline$
132 FUNCTION {new.block}
133 { output.state before.all =
134     'skip$
135     { after.block 'output.state := }
136   if$
139 FUNCTION {new.sentence}
140 { output.state after.block =
141     'skip$
142     { output.state before.all =
143         'skip$
144         { after.sentence 'output.state := }
145       if$
146     }
147   if$
150 FUNCTION {not}
151 {   { #0 }
152     { #1 }
153   if$
156 FUNCTION {and}
157 {   'skip$
158     { pop$ #0 }
159   if$
162 FUNCTION {or}
163 {   { pop$ #1 }
164     'skip$
165   if$
168 FUNCTION {new.block.checka}
169 { empty$
170     'skip$
171     'new.block
172   if$
175 FUNCTION {new.block.checkb}
176 { empty$
177   swap$ empty$
178   and
179     'skip$
180     'new.block
181   if$
184 FUNCTION {new.sentence.checka}
185 { empty$
186     'skip$
187     'new.sentence
188   if$
191 FUNCTION {new.sentence.checkb}
192 { empty$
193   swap$ empty$
194   and
195     'skip$
196     'new.sentence
197   if$
200 FUNCTION {field.or.null}
201 { duplicate$ empty$
202     { pop$ "" }
203     'skip$
204   if$
207 FUNCTION {emphasize}
208 { duplicate$ empty$
209     { pop$ "" }
210     { "\emph{" swap$ * "}" * }
211   if$
214 FUNCTION {capitalize}  %  ZMENA mudrd8mz 2005-10-12 pridavam novou funkci
216   duplicate$ empty$
217     { pop$ "" }
218     { "u" change.case$ }
219   if$
223 INTEGERS { nameptr namesleft numnames }
225 FUNCTION {format.names.full}
226 { 's :=
227   #1 'nameptr :=
228   s num.names$ 'numnames :=
229   numnames 'namesleft :=
230     { namesleft #0 > }
231     { s nameptr "{ll}" format.name$ 't1 :=          % ZMENA mudrd8mz 2005-10-12 
232       t1 capitalize 't1 :=                          % ZMENA mudrd8mz 2005-10-12 
233       s nameptr "{, f.}{~j.}" format.name$ 't2 :=   % ZMENA mudrd8mz 2005-10-12
234       t1 t2 * 't :=
235       nameptr #1 >
236         { namesleft #1 >
237             { " -- " * t * } % ZMENA mudrd8mz 2005-10-13 : pomlcka mezi autory
238             { numnames #2 >
239                 { "" * } % ZMENA mudrd8mz 2005-10-12 
240                 'skip$
241               if$
242               t "OTHERS" = % ZMENA mudrd8mz 2005-10-12 kvuli capitalize 
243                 { " et~al." * }
244                 { " -- " * t * } % ZMENA mudrd8mz 2005-10-12 : pomlcka mezi poslednim a predposl. autorem
245               if$
246             }
247           if$
248         }
249         't
250       if$
251       nameptr #1 + 'nameptr :=
252       namesleft #1 - 'namesleft :=
253     }
254   while$
257 FUNCTION {format.names.short} %  ZMENA mudrd8mz 2005-10-14 pridavam verzi pro vic autoru
258 { 's :=
259   s #1 "{ll}" format.name$ 't1 :=          
260   t1 capitalize 't1 :=                    
261   s #1 "{, f.}{~j.}" format.name$ 't2 := 
262   t1 t2 * " et~al." *
265 FUNCTION {format.names}
266 {   duplicate$
267     num.names$ #3 >             
268         {format.names.short} % pokud ma citace vice nez 3 autory, uvadi se pouze PRVNI et al.
269         {format.names.full}  % pokud ma citace max 3 autory, uvadi se vsichni
270     if$
273 FUNCTION {format.key}
274 { empty$
275     { key field.or.null }
276     { "" }
277   if$
280 FUNCTION {format.authors}
281 { author empty$
282     { "" }
283     { author format.names }
284   if$
287 FUNCTION {format.editors}
288 { editor empty$
289     { "" }
290     { editor format.names
291       editor num.names$ #1 >
292         { " (Ed.)" * } % ZMENA mudrd8mz 2005-10-12 menim zobrazovani
293         { " (Ed.)" * }
294       if$
295     }
296   if$
299 FUNCTION {format.isbn}
300 { isbn empty$
301     { "" }
302     { new.block "ISBN " isbn * }
303   if$
306 FUNCTION {format.issn}
307 { issn empty$
308     { "" }
309     { new.block "ISSN " issn * }
310   if$
313 FUNCTION {format.url}
314 { url empty$
315     { "" }
316     { new.block "Dostupn{\'{e}} z: \url{" url * "}" * }
317   if$
320 FUNCTION {format.doi}
321 { doi empty$
322     { "" }
323     { new.block "\doi{" doi * "}" * }
324   if$
327 FUNCTION {format.title}
328 { title empty$
329     { "" }
330     { title }
331   if$
335 FUNCTION {format.full.names}
336 {'s :=
337   #1 'nameptr :=
338   s num.names$ 'numnames :=
339   numnames 'namesleft :=
340     { namesleft #0 > }
341     { s nameptr
342       "{vv~}{ll}" format.name$ 't :=
343       nameptr #1 >
344         {
345           namesleft #1 >
346             { ", " * t * }
347             {
348               numnames #2 >
349                 { "," * }
350                 'skip$
351               if$
352               t "others" =
353                 { " et~al." * }
354                 { ", " * t * } %  ZMENA mudrd8mz 2005-10-12 
355               if$
356             }
357           if$
358         }
359         't
360       if$
361       nameptr #1 + 'nameptr :=
362       namesleft #1 - 'namesleft :=
363     }
364   while$
367 FUNCTION {author.editor.full}
368 { author empty$
369     { editor empty$
370         { "" }
371         { editor format.full.names }
372       if$
373     }
374     { author format.full.names }
375   if$
378 FUNCTION {author.full}
379 { author empty$
380     { "" }
381     { author format.full.names }
382   if$
385 FUNCTION {editor.full}
386 { editor empty$
387     { "" }
388     { editor format.full.names }
389   if$
392 FUNCTION {make.full.names}
393 { type$ "book" =
394   type$ "inbook" =
395   or
396     'author.editor.full
397     { type$ "proceedings" =
398         'editor.full
399         'author.full
400       if$
401     }
402   if$
405 FUNCTION {output.bibitem}
406 { newline$
407   "\bibitem[" write$
408   label write$
409   ")" make.full.names duplicate$ short.list =
410      { pop$ }
411      { * }
412    if$
413   "]{" * write$
414   cite$ write$
415   "}" write$
416   newline$
417   ""
418   before.all 'output.state :=
421 FUNCTION {n.dashify}
422 { 't :=
423   ""
424     { t empty$ not }
425     { t #1 #1 substring$ "-" =
426         { t #1 #2 substring$ "--" = not
427             { "--" *
428               t #2 global.max$ substring$ 't :=
429             }
430             {   { t #1 #1 substring$ "-" = }
431                 { "-" *
432                   t #2 global.max$ substring$ 't :=
433                 }
434               while$
435             }
436           if$
437         }
438         { t #1 #1 substring$ *
439           t #2 global.max$ substring$ 't :=
440         }
441       if$
442     }
443   while$
446 FUNCTION {format.date}
447 { year duplicate$ empty$
448     { "empty year in " cite$ * warning$
449        pop$ "" }
450     'skip$
451   if$
452   month empty$
453     'skip$
454     { month
455       " " * swap$ *
456     }
457   if$
458   extra.label *
461 FUNCTION {format.btitle}
462 { title emphasize
465 FUNCTION {tie.or.space.connect}
466 { duplicate$ text.length$ #3 <
467     { "~" }
468     { " " }
469   if$
470   swap$ * *
473 FUNCTION {either.or.check}
474 { empty$
475     'pop$
476     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
477   if$
480 FUNCTION {format.bvolume}
481 { volume empty$
482     { "" }
483     { "" volume tie.or.space.connect %  ZMENA mudrd8mz 2005-10-12 vypoustim "volume"
484       series empty$
485         'skip$
486         { " / " * series emphasize * } % ZMENA mudrd8mz 2005-10-12 menim "of" na "/"
487       if$
488       "volume and number" number either.or.check
489     }
490   if$
493 FUNCTION {format.number.series}
494 { volume empty$
495     { number empty$
496         { series field.or.null }
497         { output.state mid.sentence =
498             { "è." } % ZMENA mudrd8mz 2005-10-12 menim "number"
499             { "È." }
500           if$
501           number tie.or.space.connect
502           series empty$
503             { "there's a number but no series in " cite$ * warning$ }
504             { " v " * series * } % ZMENA mudrd8mz 2005-10-12 menim  "in"
505           if$
506         }
507       if$
508     }
509     { "" }
510   if$
513 FUNCTION {format.edition}
514 { edition empty$
515     { "" }
516     { output.state mid.sentence =
517         { edition "l" change.case$ " edition" * }
518         { edition "t" change.case$ " edition" * }
519       if$
520     }
521   if$
524 INTEGERS { multiresult }
526 FUNCTION {multi.page.check}
527 { 't :=
528   #0 'multiresult :=
529     { multiresult not
530       t empty$ not
531       and
532     }
533     { t #1 #1 substring$
534       duplicate$ "-" =
535       swap$ duplicate$ "," =
536       swap$ "+" =
537       or or
538         { #1 'multiresult := }
539         { t #2 global.max$ substring$ 't := }
540       if$
541     }
542   while$
543   multiresult
546 FUNCTION {format.pages}
547 { pages empty$
548     { "" }
549     { pages multi.page.check
550         { "pages" pages n.dashify tie.or.space.connect }
551         { "page" pages tie.or.space.connect }
552       if$
553     }
554   if$
557 FUNCTION {format.eid}
558 { eid empty$
559     { "" }
560     { "art." eid tie.or.space.connect }
561   if$
564 FUNCTION {format.vol.num.pages}
565 { volume field.or.null
566   number empty$
567     'skip$
568     { "\penalty0 " number * *
569       volume empty$
570         { "there's a number but no volume in " cite$ * warning$ }
571         'skip$
572       if$
573     }
574   if$
575   pages empty$
576     'skip$
577     { duplicate$ empty$
578         { pop$ format.pages }
579         { ", s.~" * pages n.dashify * }
580       if$
581     }
582   if$
585 FUNCTION {format.vol.num.eid}
586 { volume field.or.null
587   number empty$
588     'skip$
589     { "\penalty0 (" number * ")" * *
590       volume empty$
591         { "there's a number but no volume in " cite$ * warning$ }
592         'skip$
593       if$
594     }
595   if$
596   eid empty$
597     'skip$
598     { duplicate$ empty$
599         { pop$ format.eid }
600         { ":\penalty0 " * eid * }
601       if$
602     }
603   if$
606 FUNCTION {format.chapter.pages}
607 { chapter empty$
608     'format.pages
609     { type empty$
610         { "chapter" }
611         { type "l" change.case$ }
612       if$
613       chapter tie.or.space.connect
614       pages empty$
615         'skip$
616         { ", " * format.pages * }
617       if$
618     }
619   if$
622 FUNCTION {format.in.ed.booktitle}
623 { booktitle empty$
624     { "" }
625     { editor empty$
626         { "In " booktitle emphasize * }
627         { "In " format.editors * " " * booktitle emphasize * } %  ZMENA mudrd8mz 2005-10-12 
628       if$
629     }
630   if$
633 FUNCTION {empty.misc.check}
634 { author empty$ title empty$ howpublished empty$
635   month empty$ year empty$ note empty$
636   and and and and and
637   key empty$ not and
638     { "all relevant fields are empty in " cite$ * warning$ }
639     'skip$
640   if$
643 FUNCTION {format.thesis.type}
644 { type empty$
645     'skip$
646     { pop$
647       type "t" change.case$
648     }
649   if$
652 FUNCTION {format.tr.number}
653 { type empty$
654     { "Technical Report" }
655     'type
656   if$
657   number empty$
658     { "t" change.case$ }
659     { number tie.or.space.connect }
660   if$
663 FUNCTION {format.article.crossref}
664 { key empty$
665     { journal empty$
666         { "need key or journal for " cite$ * " to crossref " * crossref *
667           warning$
668           ""
669         }
670         { "In \emph{" journal * "}" * }
671       if$
672     }
673     { "In " key * }
674   if$
675   " \citep{" * crossref * "}" *
678 FUNCTION {format.book.crossref}
679 { volume empty$
680     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
681       "In "
682     }
683     { "Volume" volume tie.or.space.connect
684       " of " *
685     }
686   if$
687   editor empty$
688   editor field.or.null author field.or.null =
689   or
690     { key empty$
691         { series empty$
692             { "need editor, key, or series for " cite$ * " to crossref " *
693               crossref * warning$
694               "" *
695             }
696             { "\emph{" * series * "}" * }
697           if$
698         }
699         { key * }
700       if$
701     }
702     'skip$
703   if$
704   ", \citet{" * crossref * "}" *
707 FUNCTION {format.incoll.inproc.crossref}
708 { editor empty$
709   editor field.or.null author field.or.null =
710   or
711     { key empty$
712         { booktitle empty$
713             { "need editor, key, or booktitle for " cite$ * " to crossref " *
714               crossref * warning$
715               ""
716             }
717             { "In \emph{" booktitle * "}" * }
718           if$
719         }
720         { "In " key * }
721       if$
722     }
723     { "In " }
724   if$
725   " \citet{" * crossref * "}" *
728 FUNCTION {article}
729 { output.bibitem
730   format.authors "author" output.check
731   author format.key output
732   new.block
733   format.title "title" output.check
734   new.block
735   crossref missing$
736     { journal emphasize "journal" output.check
737       format.date "year" output.check
738       eid empty$
739         { format.vol.num.pages output }
740         { format.vol.num.eid output }
741       if$
742     }
743     { format.article.crossref output.nonnull
744       eid empty$
745         { format.pages output }
746         { format.eid output }
747       if$
748     }
749   if$
750   format.issn output
751   format.doi output
752   format.url output
753   new.block
754   note output
755   fin.entry
758 FUNCTION {online} %  ZMENA mudrd8mz 2005-10-12 zcela pridavam
759 { output.bibitem
760   format.authors output
761   new.block
762   format.btitle " [online]" * output
763   new.sentence
764   publisher missing$
765     'skip$
766     { publisher output }
767   if$
768   year missing$
769     'skip$
770     { format.date "year" output.check }
771   if$
772   new.sentence
773   cited missing$
774     'skip$
775     { "[cit.~" cited * "]" * output }
776   if$
777   new.sentence
778   note output
779   new.sentence
780   format.url output
781   fin.entry
785 FUNCTION {book}
786 { output.bibitem
787   author empty$
788     { format.editors "author and editor" output.check
789       editor format.key output
790     }
791     { format.authors output.nonnull
792       crossref missing$
793         { "author and editor" editor either.or.check }
794         'skip$
795       if$
796     }
797   if$
798   new.block
799   format.btitle "title" output.check
800   crossref missing$
801     { new.block
802       format.bvolume output
803       format.number.series output
804       new.sentence
805       address "~: " * publisher *   % ZMENA mudrd8mz 2005-10-12 menim styl adresy a vydavatele
806       "publisher" output.check      
807     }
808     { new.block
809       format.book.crossref output.nonnull
810     }
811   if$
812   format.edition output
813   format.date "year" output.check
814   format.doi output
815   format.url output
816   new.block
817   note output
818   format.isbn output
819   fin.entry
822 FUNCTION {booklet}
823 { output.bibitem
824   format.authors output
825   author format.key output
826   new.block
827   format.title "title" output.check
828   howpublished address new.block.checkb
829   howpublished output
830   address output
831   format.date output
832   format.doi output
833   format.url output
834   new.block
835   note output
836   format.isbn output
837   fin.entry
840 FUNCTION {inbook}
841 { output.bibitem
842   author empty$
843     { format.editors "author and editor" output.check
844       editor format.key output
845     }
846     { format.authors output.nonnull
847       crossref missing$
848         { "author and editor" editor either.or.check }
849         'skip$
850       if$
851     }
852   if$
853   new.block
854   format.btitle "title" output.check
855   crossref missing$
856     { format.bvolume output
857       format.chapter.pages "chapter and pages" output.check
858       new.block
859       format.number.series output
860       new.sentence
861       publisher "publisher" output.check
862       address output
863     }
864     { format.chapter.pages "chapter and pages" output.check
865       new.block
866       format.book.crossref output.nonnull
867     }
868   if$
869   format.edition output
870   format.date "year" output.check
871   format.doi output
872   format.url output
873   new.block
874   note output
875   format.isbn output
876   fin.entry
879 FUNCTION {incollection}
880 { output.bibitem
881   format.authors "author" output.check
882   author format.key output
883   new.block
884   format.title "title" output.check
885   new.block
886   crossref missing$
887     { format.in.ed.booktitle "booktitle" output.check
888       format.bvolume output
889       format.number.series output
890       format.chapter.pages output
891       new.sentence
892       address ": " * publisher *   % ZMENA mudrd8mz 2005-10-12 menim styl adresy a vydavatele
893       "publisher" output.check      
894       %publisher "publisher" output.check
895       %address output
896       format.edition output
897       format.date "year" output.check
898     }
899     { format.incoll.inproc.crossref output.nonnull
900       format.chapter.pages output
901     }
902   if$
903   format.doi output
904   format.url output
905   new.block
906   format.isbn output
907   note output
908   fin.entry
911 FUNCTION {inproceedings}
912 { output.bibitem
913   format.authors "author" output.check
914   author format.key output
915   new.block
916   format.title "title" output.check
917   new.block
918   crossref missing$
919     { format.in.ed.booktitle "booktitle" output.check
920       format.bvolume output
921       format.number.series output
922       format.pages output
923       address empty$
924         { organization publisher new.sentence.checkb
925           organization output
926           publisher output
927           format.date "year" output.check
928         }
929         { address output.nonnull
930           format.date "year" output.check
931           new.sentence
932           organization output
933           publisher output
934         }
935       if$
936     }
937     { format.incoll.inproc.crossref output.nonnull
938       format.pages output
939     }
940   if$
941   format.doi output
942   format.url output
943   new.block
944   format.isbn output
945   note output
946   fin.entry
949 FUNCTION {conference} { inproceedings }
951 FUNCTION {manual}
952 { output.bibitem
953   format.authors output
954   author format.key output
955   new.block
956   format.btitle "title" output.check
957   organization address new.block.checkb
958   organization output
959   address output
960   format.edition output
961   format.date output
962   format.url output
963   new.block
964   note output
965   fin.entry
968 FUNCTION {mastersthesis}
969 { output.bibitem
970   format.authors "author" output.check
971   author format.key output
972   new.block
973   format.title "title" output.check
974   new.block
975   "Master's thesis" format.thesis.type output.nonnull
976   school "school" output.check
977   address output
978   format.date "year" output.check
979   format.url output
980   new.block
981   note output
982   fin.entry
985 FUNCTION {misc}
986 { output.bibitem
987   format.authors output
988   author format.key output
989   title howpublished new.block.checkb
990   format.title output
991   howpublished new.block.checka
992   howpublished output
993   format.date output
994   format.issn output
995   format.url output
996   new.block
997   note output
998   fin.entry
999   empty.misc.check
1002 FUNCTION {phdthesis}
1003 { output.bibitem
1004   format.authors "author" output.check
1005   author format.key output
1006   new.block
1007   format.btitle "title" output.check
1008   new.block
1009   "PhD thesis" format.thesis.type output.nonnull
1010   school "school" output.check
1011   address output
1012   format.date "year" output.check
1013   format.url output
1014   new.block
1015   note output
1016   fin.entry
1019 FUNCTION {proceedings}
1020 { output.bibitem
1021   format.editors output
1022   editor format.key output
1023   new.block
1024   format.btitle "title" output.check
1025   format.bvolume output
1026   format.number.series output
1027   address output
1028   format.date "year" output.check
1029   new.sentence
1030   organization output
1031   publisher output
1032   format.doi output
1033   format.url output
1034   new.block
1035   format.isbn output
1036   note output
1037   fin.entry
1040 FUNCTION {techreport}
1041 { output.bibitem
1042   format.authors "author" output.check
1043   author format.key output
1044   new.block
1045   format.title "title" output.check
1046   new.block
1047   format.tr.number output.nonnull
1048   institution "institution" output.check
1049   address output
1050   format.date "year" output.check
1051   format.url output
1052   new.block
1053   note output
1054   fin.entry
1057 FUNCTION {unpublished}
1058 { output.bibitem
1059   format.authors "author" output.check
1060   author format.key output
1061   new.block
1062   format.title "title" output.check
1063   format.url output
1064   new.block
1065   note "note" output.check
1066   format.date output
1067   fin.entry
1070 FUNCTION {default.type} { misc }
1073 MACRO {jan} {"January"}
1075 MACRO {feb} {"February"}
1077 MACRO {mar} {"March"}
1079 MACRO {apr} {"April"}
1081 MACRO {may} {"May"}
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"}
1113 MACRO {ieeetcad}
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"}
1141 READ
1143 FUNCTION {sortify}
1144 { purify$
1145   "l" change.case$
1148 INTEGERS { len }
1150 FUNCTION {chop.word}
1151 { 's :=
1152   'len :=
1153   s #1 len substring$ =
1154     { s len #1 + global.max$ substring$ }
1155     's
1156   if$
1159 FUNCTION {format.lab.names}
1160 { 's :=
1161   s #1 "{vv~}{ll}" format.name$
1162   s num.names$ duplicate$
1163   #2 >
1164     { pop$ " et~al." * }
1165     { #2 <
1166         'skip$
1167         { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1168             { " et~al." * }
1169             { " -- " * s #2 "{vv~}{ll}" format.name$ * } % ZMENA mudrd8mz 2005-10-12 menim "and"
1170           if$
1171         }
1172       if$
1173     }
1174   if$
1177 FUNCTION {author.key.label}
1178 { author empty$
1179     { key empty$
1180         { cite$ #1 #3 substring$ }
1181         'key
1182       if$
1183     }
1184     { author format.lab.names }
1185   if$
1188 FUNCTION {author.editor.key.label}
1189 { author empty$
1190     { editor empty$
1191         { key empty$
1192             { cite$ #1 #3 substring$ }
1193             'key
1194           if$
1195         }
1196         { editor format.lab.names }
1197       if$
1198     }
1199     { author format.lab.names }
1200   if$
1203 FUNCTION {author.key.organization.label}
1204 { author empty$
1205     { key empty$
1206         { organization empty$
1207             { cite$ #1 #3 substring$ }
1208             { "The " #4 organization chop.word #3 text.prefix$ }
1209           if$
1210         }
1211         'key
1212       if$
1213     }
1214     { author format.lab.names }
1215   if$
1218 FUNCTION {editor.key.organization.label}
1219 { editor empty$
1220     { key empty$
1221         { organization empty$
1222             { cite$ #1 #3 substring$ }
1223             { "The " #4 organization chop.word #3 text.prefix$ }
1224           if$
1225         }
1226         'key
1227       if$
1228     }
1229     { editor format.lab.names }
1230   if$
1233 FUNCTION {calc.short.authors}
1234 { type$ "book" =
1235   type$ "inbook" =
1236   or
1237     'author.editor.key.label
1238     { type$ "proceedings" =
1239         'editor.key.organization.label
1240         { type$ "manual" =
1241             'author.key.organization.label
1242             'author.key.label
1243           if$
1244         }
1245       if$
1246     }
1247   if$
1248   'short.list :=
1251 FUNCTION {calc.label}
1252 { calc.short.authors
1253   short.list
1254   "("
1255   *
1256   year duplicate$ empty$
1257   short.list key field.or.null = or
1258      { pop$ "" }
1259      'skip$
1260   if$
1261   *
1262   'label :=
1265 FUNCTION {sort.format.names}
1266 { 's :=
1267   #1 'nameptr :=
1268   ""
1269   s num.names$ 'numnames :=
1270   numnames 'namesleft :=
1271     { namesleft #0 > }
1272     {
1273       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
1274       nameptr #1 >
1275         {
1276           "   "  *
1277           namesleft #1 = t "others" = and
1278             { "zzzzz" * }
1279             { numnames #2 > nameptr #2 = and
1280                 { "zz" * year field.or.null * "   " * }
1281                 'skip$
1282               if$
1283               t sortify *
1284             }
1285           if$
1286         }
1287         { t sortify * }
1288       if$
1289       nameptr #1 + 'nameptr :=
1290       namesleft #1 - 'namesleft :=
1291     }
1292   while$
1295 FUNCTION {sort.format.title}
1296 { 't :=
1297   "A " #2
1298     "An " #3
1299       "The " #4 t chop.word
1300     chop.word
1301   chop.word
1302   sortify
1303   #1 global.max$ substring$
1306 FUNCTION {author.sort}
1307 { author empty$
1308     { key empty$
1309         { "to sort, need author or key in " cite$ * warning$
1310           ""
1311         }
1312         { key sortify }
1313       if$
1314     }
1315     { author sort.format.names }
1316   if$
1319 FUNCTION {author.editor.sort}
1320 { author empty$
1321     { editor empty$
1322         { key empty$
1323             { "to sort, need author, editor, or key in " cite$ * warning$
1324               ""
1325             }
1326             { key sortify }
1327           if$
1328         }
1329         { editor sort.format.names }
1330       if$
1331     }
1332     { author sort.format.names }
1333   if$
1336 FUNCTION {author.organization.sort}
1337 { author empty$
1338     { organization empty$
1339         { key empty$
1340             { "to sort, need author, organization, or key in " cite$ * warning$
1341               ""
1342             }
1343             { key sortify }
1344           if$
1345         }
1346         { "The " #4 organization chop.word sortify }
1347       if$
1348     }
1349     { author sort.format.names }
1350   if$
1353 FUNCTION {editor.organization.sort}
1354 { editor empty$
1355     { organization empty$
1356         { key empty$
1357             { "to sort, need editor, organization, or key in " cite$ * warning$
1358               ""
1359             }
1360             { key sortify }
1361           if$
1362         }
1363         { "The " #4 organization chop.word sortify }
1364       if$
1365     }
1366     { editor sort.format.names }
1367   if$
1371 FUNCTION {presort}
1372 { calc.label
1373   label sortify
1374   "    "
1375   *
1376   type$ "book" =
1377   type$ "inbook" =
1378   or
1379     'author.editor.sort
1380     { type$ "proceedings" =
1381         'editor.organization.sort
1382         { type$ "manual" =
1383             'author.organization.sort
1384             'author.sort
1385           if$
1386         }
1387       if$
1388     }
1389   if$
1390   "    "
1391   *
1392   cite$
1393   *
1394   #1 entry.max$ substring$
1395   'sort.label :=
1396   sort.label *
1397   #1 entry.max$ substring$
1398   'sort.key$ :=
1401 ITERATE {presort}
1403 SORT
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 :=
1412   "" 'next.extra :=
1413   #0 'longest.label.width :=
1414   #0 'last.extra.num :=
1415   #0 'number.label :=
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 :=
1422     }
1423     { "a" chr.to.int$ 'last.extra.num :=
1424       "" 'extra.label :=
1425       label 'last.label :=
1426     }
1427   if$
1428   number.label #1 + 'number.label :=
1431 FUNCTION {reverse.pass}
1432 { next.extra "b" =
1433     { "a" 'extra.label := }
1434     'skip$
1435   if$
1436   extra.label 'next.extra :=
1437   extra.label
1438   duplicate$ empty$
1439     'skip$
1440     { "{\natexlab{" swap$ * "}}" * }
1441   if$
1442   'extra.label :=
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}
1458 SORT
1460 FUNCTION {begin.bib}
1461 {   preamble$ empty$
1462     'skip$
1463     { preamble$ write$ newline$ }
1464   if$
1465   "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1466   write$ newline$
1467   "\providecommand{\natexlab}[1]{#1}"
1468   write$ newline$
1469   "\providecommand{\url}[1]{\texttt{#1}}"
1470   write$ newline$
1471   "\expandafter\ifx\csname urlstyle\endcsname\relax"
1472   write$ newline$
1473   "  \providecommand{\doi}[1]{doi: #1}\else"
1474   write$ newline$
1475   "  \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi"
1476   write$ newline$
1479 EXECUTE {begin.bib}
1481 EXECUTE {init.state.consts}
1483 ITERATE {call.type$}
1485 FUNCTION {end.bib}
1486 { newline$
1487   "\end{thebibliography}" write$ newline$
1490 EXECUTE {end.bib}