ESS[SAS]: somebody forgot about the SUM statement (probably me)
[ess.git] / doc / techrep / abbrvnat.bst
blob41c2719f9641cf841a80ca62401bd28bb1c9222a
1 %% File: `abbrvnat.bst'\r
2 %% A modification of `abbrv.bst' for use with natbib package \r
3 %%\r
4 %% Copyright 1993-1999 Patrick W Daly\r
5 %% Max-Planck-Institut f\"ur Aeronomie\r
6 %% Max-Planck-Str. 2\r
7 %% D-37191 Katlenburg-Lindau\r
8 %% Germany\r
9 %% E-mail: daly@linmpi.mpg.de\r
10 %%\r
11 %% This program can be redistributed and/or modified under the terms\r
12 %% of the LaTeX Project Public License Distributed from CTAN\r
13 %% archives in directory macros/latex/base/lppl.txt; either\r
14 %% version 1 of the License, or any later version.\r
15 %%\r
16  % Version and source file information:\r
17  % \ProvidesFile{natbst.mbs}[1999/05/11 1.6 (PWD)]\r
18  %\r
19  % BibTeX `plainnat' family\r
20  %   version 0.99b for BibTeX versions 0.99a or later,\r
21  %   for LaTeX versions 2.09 and 2e.\r
22  %\r
23  % For use with the `natbib.sty' package; emulates the corresponding\r
24  %   member of the `plain' family, but with author-year citations.\r
25  %\r
26  % With version 6.0 of `natbib.sty', it may also be used for numerical\r
27  %   citations, while retaining the commands \citeauthor, \citefullauthor,\r
28  %   and \citeyear to print the corresponding information.\r
29  %\r
30  % For version 7.0 of `natbib.sty', the KEY field replaces missing\r
31  %   authors/editors, and the date is left blank in \bibitem.\r
32  %\r
33  % Includes fields ISBN and ISSN.\r
34  %\r
35  % Includes field URL for Internet addresses (best used with\r
36  % with the url.sty package of Donald Arseneau\r
37  %\r
38 ENTRY\r
39   { address\r
40     author\r
41     booktitle\r
42     chapter\r
43     edition\r
44     editor\r
45     howpublished\r
46     institution\r
47     isbn\r
48     issn\r
49     journal\r
50     key\r
51     month\r
52     note\r
53     number\r
54     organization\r
55     pages\r
56     publisher\r
57     school\r
58     series\r
59     title\r
60     type\r
61     url\r
62     volume\r
63     year\r
64   }\r
65   {}\r
66   { label extra.label sort.label short.list }\r
68 INTEGERS { output.state before.all mid.sentence after.sentence after.block }\r
70 FUNCTION {init.state.consts}\r
71 { #0 'before.all :=\r
72   #1 'mid.sentence :=\r
73   #2 'after.sentence :=\r
74   #3 'after.block :=\r
75 }\r
77 STRINGS { s t }\r
79 FUNCTION {output.nonnull}\r
80 { 's :=\r
81   output.state mid.sentence =\r
82     { ", " * write$ }\r
83     { output.state after.block =\r
84         { add.period$ write$\r
85           newline$\r
86           "\newblock " write$\r
87         }\r
88         { output.state before.all =\r
89             'write$\r
90             { add.period$ " " * write$ }\r
91           if$\r
92         }\r
93       if$\r
94       mid.sentence 'output.state :=\r
95     }\r
96   if$\r
97   s\r
98 }\r
100 FUNCTION {output}\r
101 { duplicate$ empty$\r
102     'pop$\r
103     'output.nonnull\r
104   if$\r
107 FUNCTION {output.check}\r
108 { 't :=\r
109   duplicate$ empty$\r
110     { pop$ "empty " t * " in " * cite$ * warning$ }\r
111     'output.nonnull\r
112   if$\r
115 FUNCTION {fin.entry}\r
116 { add.period$\r
117   write$\r
118   newline$\r
121 FUNCTION {new.block}\r
122 { output.state before.all =\r
123     'skip$\r
124     { after.block 'output.state := }\r
125   if$\r
128 FUNCTION {new.sentence}\r
129 { output.state after.block =\r
130     'skip$\r
131     { output.state before.all =\r
132         'skip$\r
133         { after.sentence 'output.state := }\r
134       if$\r
135     }\r
136   if$\r
139 FUNCTION {not}\r
140 {   { #0 }\r
141     { #1 }\r
142   if$\r
145 FUNCTION {and}\r
146 {   'skip$\r
147     { pop$ #0 }\r
148   if$\r
151 FUNCTION {or}\r
152 {   { pop$ #1 }\r
153     'skip$\r
154   if$\r
157 FUNCTION {new.block.checka}\r
158 { empty$\r
159     'skip$\r
160     'new.block\r
161   if$\r
164 FUNCTION {new.block.checkb}\r
165 { empty$\r
166   swap$ empty$\r
167   and\r
168     'skip$\r
169     'new.block\r
170   if$\r
173 FUNCTION {new.sentence.checka}\r
174 { empty$\r
175     'skip$\r
176     'new.sentence\r
177   if$\r
180 FUNCTION {new.sentence.checkb}\r
181 { empty$\r
182   swap$ empty$\r
183   and\r
184     'skip$\r
185     'new.sentence\r
186   if$\r
189 FUNCTION {field.or.null}\r
190 { duplicate$ empty$\r
191     { pop$ "" }\r
192     'skip$\r
193   if$\r
196 FUNCTION {emphasize}\r
197 { duplicate$ empty$\r
198     { pop$ "" }\r
199     { "{\em " swap$ * "}" * }\r
200   if$\r
203 INTEGERS { nameptr namesleft numnames }\r
205 FUNCTION {format.names}\r
206 { 's :=\r
207   #1 'nameptr :=\r
208   s num.names$ 'numnames :=\r
209   numnames 'namesleft :=\r
210     { namesleft #0 > }\r
211     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=\r
212       nameptr #1 >\r
213         { namesleft #1 >\r
214             { ", " * t * }\r
215             { numnames #2 >\r
216                 { "," * }\r
217                 'skip$\r
218               if$\r
219               t "others" =\r
220                 { " et~al." * }\r
221                 { " and " * t * }\r
222               if$\r
223             }\r
224           if$\r
225         }\r
226         't\r
227       if$\r
228       nameptr #1 + 'nameptr :=\r
229       namesleft #1 - 'namesleft :=\r
230     }\r
231   while$\r
234 FUNCTION {format.key}\r
235 { empty$\r
236     { key field.or.null }\r
237     { "" }\r
238   if$\r
241 FUNCTION {format.authors}\r
242 { author empty$\r
243     { "" }\r
244     { author format.names }\r
245   if$\r
248 FUNCTION {format.editors}\r
249 { editor empty$\r
250     { "" }\r
251     { editor format.names\r
252       editor num.names$ #1 >\r
253         { ", editors" * }\r
254         { ", editor" * }\r
255       if$\r
256     }\r
257   if$\r
260 FUNCTION {format.isbn}\r
261 { isbn empty$\r
262     { "" }\r
263     { new.block "ISBN " isbn * }\r
264   if$\r
267 FUNCTION {format.issn}\r
268 { issn empty$\r
269     { "" }\r
270     { new.block "ISSN " issn * }\r
271   if$\r
274 FUNCTION {format.url}\r
275 { url empty$\r
276     { "" }\r
277     { new.block "URL \url{" url * "}" * }\r
278   if$\r
281 FUNCTION {format.title}\r
282 { title empty$\r
283     { "" }\r
284     { title "t" change.case$ }\r
285   if$\r
288 FUNCTION {format.full.names}\r
289 {'s :=\r
290   #1 'nameptr :=\r
291   s num.names$ 'numnames :=\r
292   numnames 'namesleft :=\r
293     { namesleft #0 > }\r
294     { s nameptr\r
295       "{vv~}{ll}" format.name$ 't :=\r
296       nameptr #1 >\r
297         {\r
298           namesleft #1 >\r
299             { ", " * t * }\r
300             {\r
301               numnames #2 >\r
302                 { "," * }\r
303                 'skip$\r
304               if$\r
305               t "others" =\r
306                 { " et~al." * }\r
307                 { " and " * t * }\r
308               if$\r
309             }\r
310           if$\r
311         }\r
312         't\r
313       if$\r
314       nameptr #1 + 'nameptr :=\r
315       namesleft #1 - 'namesleft :=\r
316     }\r
317   while$\r
320 FUNCTION {author.editor.full}\r
321 { author empty$\r
322     { editor empty$\r
323         { "" }\r
324         { editor format.full.names }\r
325       if$\r
326     }\r
327     { author format.full.names }\r
328   if$\r
331 FUNCTION {author.full}\r
332 { author empty$\r
333     { "" }\r
334     { author format.full.names }\r
335   if$\r
338 FUNCTION {editor.full}\r
339 { editor empty$\r
340     { "" }\r
341     { editor format.full.names }\r
342   if$\r
345 FUNCTION {make.full.names}\r
346 { type$ "book" =\r
347   type$ "inbook" =\r
348   or\r
349     'author.editor.full\r
350     { type$ "proceedings" =\r
351         'editor.full\r
352         'author.full\r
353       if$\r
354     }\r
355   if$\r
358 FUNCTION {output.bibitem}\r
359 { newline$\r
360   "\bibitem[" write$\r
361   label write$\r
362   ")" make.full.names duplicate$ short.list =\r
363      { pop$ }\r
364      { * }\r
365    if$\r
366   "]{" * write$\r
367   cite$ write$\r
368   "}" write$\r
369   newline$\r
370   ""\r
371   before.all 'output.state :=\r
374 FUNCTION {n.dashify}\r
375 { 't :=\r
376   ""\r
377     { t empty$ not }\r
378     { t #1 #1 substring$ "-" =\r
379         { t #1 #2 substring$ "--" = not\r
380             { "--" *\r
381               t #2 global.max$ substring$ 't :=\r
382             }\r
383             {   { t #1 #1 substring$ "-" = }\r
384                 { "-" *\r
385                   t #2 global.max$ substring$ 't :=\r
386                 }\r
387               while$\r
388             }\r
389           if$\r
390         }\r
391         { t #1 #1 substring$ *\r
392           t #2 global.max$ substring$ 't :=\r
393         }\r
394       if$\r
395     }\r
396   while$\r
399 FUNCTION {format.date}\r
400 { year duplicate$ empty$\r
401     { "empty year in " cite$ * warning$\r
402        pop$ "" }\r
403     'skip$\r
404   if$\r
405   month empty$\r
406     'skip$\r
407     { month\r
408       " " * swap$ *\r
409     }\r
410   if$\r
411   extra.label *\r
414 FUNCTION {format.btitle}\r
415 { title emphasize\r
418 FUNCTION {tie.or.space.connect}\r
419 { duplicate$ text.length$ #3 <\r
420     { "~" }\r
421     { " " }\r
422   if$\r
423   swap$ * *\r
426 FUNCTION {either.or.check}\r
427 { empty$\r
428     'pop$\r
429     { "can't use both " swap$ * " fields in " * cite$ * warning$ }\r
430   if$\r
433 FUNCTION {format.bvolume}\r
434 { volume empty$\r
435     { "" }\r
436     { "volume" volume tie.or.space.connect\r
437       series empty$\r
438         'skip$\r
439         { " of " * series emphasize * }\r
440       if$\r
441       "volume and number" number either.or.check\r
442     }\r
443   if$\r
446 FUNCTION {format.number.series}\r
447 { volume empty$\r
448     { number empty$\r
449         { series field.or.null }\r
450         { output.state mid.sentence =\r
451             { "number" }\r
452             { "Number" }\r
453           if$\r
454           number tie.or.space.connect\r
455           series empty$\r
456             { "there's a number but no series in " cite$ * warning$ }\r
457             { " in " * series * }\r
458           if$\r
459         }\r
460       if$\r
461     }\r
462     { "" }\r
463   if$\r
466 FUNCTION {format.edition}\r
467 { edition empty$\r
468     { "" }\r
469     { output.state mid.sentence =\r
470         { edition "l" change.case$ " edition" * }\r
471         { edition "t" change.case$ " edition" * }\r
472       if$\r
473     }\r
474   if$\r
477 INTEGERS { multiresult }\r
479 FUNCTION {multi.page.check}\r
480 { 't :=\r
481   #0 'multiresult :=\r
482     { multiresult not\r
483       t empty$ not\r
484       and\r
485     }\r
486     { t #1 #1 substring$\r
487       duplicate$ "-" =\r
488       swap$ duplicate$ "," =\r
489       swap$ "+" =\r
490       or or\r
491         { #1 'multiresult := }\r
492         { t #2 global.max$ substring$ 't := }\r
493       if$\r
494     }\r
495   while$\r
496   multiresult\r
499 FUNCTION {format.pages}\r
500 { pages empty$\r
501     { "" }\r
502     { pages multi.page.check\r
503         { "pages" pages n.dashify tie.or.space.connect }\r
504         { "page" pages tie.or.space.connect }\r
505       if$\r
506     }\r
507   if$\r
510 FUNCTION {format.vol.num.pages}\r
511 { volume field.or.null\r
512   number empty$\r
513     'skip$\r
514     { "\penalty0 (" number * ")" * *\r
515       volume empty$\r
516         { "there's a number but no volume in " cite$ * warning$ }\r
517         'skip$\r
518       if$\r
519     }\r
520   if$\r
521   pages empty$\r
522     'skip$\r
523     { duplicate$ empty$\r
524         { pop$ format.pages }\r
525         { ":\penalty0 " * pages n.dashify * }\r
526       if$\r
527     }\r
528   if$\r
531 FUNCTION {format.chapter.pages}\r
532 { chapter empty$\r
533     'format.pages\r
534     { type empty$\r
535         { "chapter" }\r
536         { type "l" change.case$ }\r
537       if$\r
538       chapter tie.or.space.connect\r
539       pages empty$\r
540         'skip$\r
541         { ", " * format.pages * }\r
542       if$\r
543     }\r
544   if$\r
547 FUNCTION {format.in.ed.booktitle}\r
548 { booktitle empty$\r
549     { "" }\r
550     { editor empty$\r
551         { "In " booktitle emphasize * }\r
552         { "In " format.editors * ", " * booktitle emphasize * }\r
553       if$\r
554     }\r
555   if$\r
558 FUNCTION {empty.misc.check}\r
559 { author empty$ title empty$ howpublished empty$\r
560   month empty$ year empty$ note empty$\r
561   and and and and and\r
562   key empty$ not and\r
563     { "all relevant fields are empty in " cite$ * warning$ }\r
564     'skip$\r
565   if$\r
568 FUNCTION {format.thesis.type}\r
569 { type empty$\r
570     'skip$\r
571     { pop$\r
572       type "t" change.case$\r
573     }\r
574   if$\r
577 FUNCTION {format.tr.number}\r
578 { type empty$\r
579     { "Technical Report" }\r
580     'type\r
581   if$\r
582   number empty$\r
583     { "t" change.case$ }\r
584     { number tie.or.space.connect }\r
585   if$\r
588 FUNCTION {format.article.crossref}\r
589 { key empty$\r
590     { journal empty$\r
591         { "need key or journal for " cite$ * " to crossref " * crossref *\r
592           warning$\r
593           ""\r
594         }\r
595         { "In {\em " journal * "\/}" * }\r
596       if$\r
597     }\r
598     { "In " key * }\r
599   if$\r
600   " \citep{" * crossref * "}" *\r
603 FUNCTION {format.book.crossref}\r
604 { volume empty$\r
605     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$\r
606       "In "\r
607     }\r
608     { "Volume" volume tie.or.space.connect\r
609       " of " *\r
610     }\r
611   if$\r
612   editor empty$\r
613   editor field.or.null author field.or.null =\r
614   or\r
615     { key empty$\r
616         { series empty$\r
617             { "need editor, key, or series for " cite$ * " to crossref " *\r
618               crossref * warning$\r
619               "" *\r
620             }\r
621             { "{\em " * series * "\/}" * }\r
622           if$\r
623         }\r
624         { key * }\r
625       if$\r
626     }\r
627     'skip$\r
628   if$\r
629   ", \citet{" * crossref * "}" *\r
632 FUNCTION {format.incoll.inproc.crossref}\r
633 { editor empty$\r
634   editor field.or.null author field.or.null =\r
635   or\r
636     { key empty$\r
637         { booktitle empty$\r
638             { "need editor, key, or booktitle for " cite$ * " to crossref " *\r
639               crossref * warning$\r
640               ""\r
641             }\r
642             { "In {\em " booktitle * "\/}" * }\r
643           if$\r
644         }\r
645         { "In " key * }\r
646       if$\r
647     }\r
648     { "In " }\r
649   if$\r
650   " \citet{" * crossref * "}" *\r
653 FUNCTION {article}\r
654 { output.bibitem\r
655   format.authors "author" output.check\r
656   author format.key output\r
657   new.block\r
658   format.title "title" output.check\r
659   new.block\r
660   crossref missing$\r
661     { journal emphasize "journal" output.check\r
662       format.vol.num.pages output\r
663       format.date "year" output.check\r
664     }\r
665     { format.article.crossref output.nonnull\r
666       format.pages output\r
667     }\r
668   if$\r
669   format.issn output\r
670   format.url output\r
671   new.block\r
672   note output\r
673   fin.entry\r
676 FUNCTION {book}\r
677 { output.bibitem\r
678   author empty$\r
679     { format.editors "author and editor" output.check\r
680       editor format.key output\r
681     }\r
682     { format.authors output.nonnull\r
683       crossref missing$\r
684         { "author and editor" editor either.or.check }\r
685         'skip$\r
686       if$\r
687     }\r
688   if$\r
689   new.block\r
690   format.btitle "title" output.check\r
691   crossref missing$\r
692     { format.bvolume output\r
693       new.block\r
694       format.number.series output\r
695       new.sentence\r
696       publisher "publisher" output.check\r
697       address output\r
698     }\r
699     { new.block\r
700       format.book.crossref output.nonnull\r
701     }\r
702   if$\r
703   format.edition output\r
704   format.date "year" output.check\r
705   format.isbn output\r
706   format.url output\r
707   new.block\r
708   note output\r
709   fin.entry\r
712 FUNCTION {booklet}\r
713 { output.bibitem\r
714   format.authors output\r
715   author format.key output\r
716   new.block\r
717   format.title "title" output.check\r
718   howpublished address new.block.checkb\r
719   howpublished output\r
720   address output\r
721   format.date output\r
722   format.isbn output\r
723   format.url output\r
724   new.block\r
725   note output\r
726   fin.entry\r
729 FUNCTION {inbook}\r
730 { output.bibitem\r
731   author empty$\r
732     { format.editors "author and editor" output.check\r
733       editor format.key output\r
734     }\r
735     { format.authors output.nonnull\r
736       crossref missing$\r
737         { "author and editor" editor either.or.check }\r
738         'skip$\r
739       if$\r
740     }\r
741   if$\r
742   new.block\r
743   format.btitle "title" output.check\r
744   crossref missing$\r
745     { format.bvolume output\r
746       format.chapter.pages "chapter and pages" output.check\r
747       new.block\r
748       format.number.series output\r
749       new.sentence\r
750       publisher "publisher" output.check\r
751       address output\r
752     }\r
753     { format.chapter.pages "chapter and pages" output.check\r
754       new.block\r
755       format.book.crossref output.nonnull\r
756     }\r
757   if$\r
758   format.edition output\r
759   format.date "year" output.check\r
760   format.isbn output\r
761   format.url output\r
762   new.block\r
763   note output\r
764   fin.entry\r
767 FUNCTION {incollection}\r
768 { output.bibitem\r
769   format.authors "author" output.check\r
770   author format.key output\r
771   new.block\r
772   format.title "title" output.check\r
773   new.block\r
774   crossref missing$\r
775     { format.in.ed.booktitle "booktitle" output.check\r
776       format.bvolume output\r
777       format.number.series output\r
778       format.chapter.pages output\r
779       new.sentence\r
780       publisher "publisher" output.check\r
781       address output\r
782       format.edition output\r
783       format.date "year" output.check\r
784     }\r
785     { format.incoll.inproc.crossref output.nonnull\r
786       format.chapter.pages output\r
787     }\r
788   if$\r
789   format.isbn output\r
790   format.url output\r
791   new.block\r
792   note output\r
793   fin.entry\r
796 FUNCTION {inproceedings}\r
797 { output.bibitem\r
798   format.authors "author" output.check\r
799   author format.key output\r
800   new.block\r
801   format.title "title" output.check\r
802   new.block\r
803   crossref missing$\r
804     { format.in.ed.booktitle "booktitle" output.check\r
805       format.bvolume output\r
806       format.number.series output\r
807       format.pages output\r
808       address empty$\r
809         { organization publisher new.sentence.checkb\r
810           organization output\r
811           publisher output\r
812           format.date "year" output.check\r
813         }\r
814         { address output.nonnull\r
815           format.date "year" output.check\r
816           new.sentence\r
817           organization output\r
818           publisher output\r
819         }\r
820       if$\r
821     }\r
822     { format.incoll.inproc.crossref output.nonnull\r
823       format.pages output\r
824     }\r
825   if$\r
826   format.isbn output\r
827   format.url output\r
828   new.block\r
829   note output\r
830   fin.entry\r
833 FUNCTION {conference} { inproceedings }\r
835 FUNCTION {manual}\r
836 { output.bibitem\r
837   format.authors output\r
838   author format.key output\r
839   new.block\r
840   format.btitle "title" output.check\r
841   organization address new.block.checkb\r
842   organization output\r
843   address output\r
844   format.edition output\r
845   format.date output\r
846   format.url output\r
847   new.block\r
848   note output\r
849   fin.entry\r
852 FUNCTION {mastersthesis}\r
853 { output.bibitem\r
854   format.authors "author" output.check\r
855   author format.key output\r
856   new.block\r
857   format.title "title" output.check\r
858   new.block\r
859   "Master's thesis" format.thesis.type output.nonnull\r
860   school "school" output.check\r
861   address output\r
862   format.date "year" output.check\r
863   format.url output\r
864   new.block\r
865   note output\r
866   fin.entry\r
869 FUNCTION {misc}\r
870 { output.bibitem\r
871   format.authors output\r
872   author format.key output\r
873   title howpublished new.block.checkb\r
874   format.title output\r
875   howpublished new.block.checka\r
876   howpublished output\r
877   format.date output\r
878   format.issn output\r
879   format.url output\r
880   new.block\r
881   note output\r
882   fin.entry\r
883   empty.misc.check\r
886 FUNCTION {phdthesis}\r
887 { output.bibitem\r
888   format.authors "author" output.check\r
889   author format.key output\r
890   new.block\r
891   format.btitle "title" output.check\r
892   new.block\r
893   "PhD thesis" format.thesis.type output.nonnull\r
894   school "school" output.check\r
895   address output\r
896   format.date "year" output.check\r
897   format.url output\r
898   new.block\r
899   note output\r
900   fin.entry\r
903 FUNCTION {proceedings}\r
904 { output.bibitem\r
905   format.editors output\r
906   editor format.key output\r
907   new.block\r
908   format.btitle "title" output.check\r
909   format.bvolume output\r
910   format.number.series output\r
911   address output\r
912   format.date "year" output.check\r
913   new.sentence\r
914   organization output\r
915   publisher output\r
916   format.isbn output\r
917   format.url output\r
918   new.block\r
919   note output\r
920   fin.entry\r
923 FUNCTION {techreport}\r
924 { output.bibitem\r
925   format.authors "author" output.check\r
926   author format.key output\r
927   new.block\r
928   format.title "title" output.check\r
929   new.block\r
930   format.tr.number output.nonnull\r
931   institution "institution" output.check\r
932   address output\r
933   format.date "year" output.check\r
934   format.url output\r
935   new.block\r
936   note output\r
937   fin.entry\r
940 FUNCTION {unpublished}\r
941 { output.bibitem\r
942   format.authors "author" output.check\r
943   author format.key output\r
944   new.block\r
945   format.title "title" output.check\r
946   format.url output\r
947   new.block\r
948   note "note" output.check\r
949   format.date output\r
950   fin.entry\r
953 FUNCTION {default.type} { misc }\r
956 MACRO {jan} {"Jan."}\r
958 MACRO {feb} {"Feb."}\r
960 MACRO {mar} {"Mar."}\r
962 MACRO {apr} {"Apr."}\r
964 MACRO {may} {"May"}\r
966 MACRO {jun} {"June"}\r
968 MACRO {jul} {"July"}\r
970 MACRO {aug} {"Aug."}\r
972 MACRO {sep} {"Sept."}\r
974 MACRO {oct} {"Oct."}\r
976 MACRO {nov} {"Nov."}\r
978 MACRO {dec} {"Dec."}\r
982 MACRO {acmcs} {"ACM Comput. Surv."}\r
984 MACRO {acta} {"Acta Inf."}\r
986 MACRO {cacm} {"Commun. ACM"}\r
988 MACRO {ibmjrd} {"IBM J. Res. Dev."}\r
990 MACRO {ibmsj} {"IBM Syst.~J."}\r
992 MACRO {ieeese} {"IEEE Trans. Softw. Eng."}\r
994 MACRO {ieeetc} {"IEEE Trans. Comput."}\r
996 MACRO {ieeetcad}\r
997  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}\r
999 MACRO {ipl} {"Inf. Process. Lett."}\r
1001 MACRO {jacm} {"J.~ACM"}\r
1003 MACRO {jcss} {"J.~Comput. Syst. Sci."}\r
1005 MACRO {scp} {"Sci. Comput. Programming"}\r
1007 MACRO {sicomp} {"SIAM J. Comput."}\r
1009 MACRO {tocs} {"ACM Trans. Comput. Syst."}\r
1011 MACRO {tods} {"ACM Trans. Database Syst."}\r
1013 MACRO {tog} {"ACM Trans. Gr."}\r
1015 MACRO {toms} {"ACM Trans. Math. Softw."}\r
1017 MACRO {toois} {"ACM Trans. Office Inf. Syst."}\r
1019 MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}\r
1021 MACRO {tcs} {"Theoretical Comput. Sci."}\r
1024 READ\r
1026 FUNCTION {sortify}\r
1027 { purify$\r
1028   "l" change.case$\r
1031 INTEGERS { len }\r
1033 FUNCTION {chop.word}\r
1034 { 's :=\r
1035   'len :=\r
1036   s #1 len substring$ =\r
1037     { s len #1 + global.max$ substring$ }\r
1038     's\r
1039   if$\r
1042 FUNCTION {format.lab.names}\r
1043 { 's :=\r
1044   s #1 "{vv~}{ll}" format.name$\r
1045   s num.names$ duplicate$\r
1046   #2 >\r
1047     { pop$ " et~al." * }\r
1048     { #2 <\r
1049         'skip$\r
1050         { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =\r
1051             { " et~al." * }\r
1052             { " and " * s #2 "{vv~}{ll}" format.name$ * }\r
1053           if$\r
1054         }\r
1055       if$\r
1056     }\r
1057   if$\r
1060 FUNCTION {author.key.label}\r
1061 { author empty$\r
1062     { key empty$\r
1063         { cite$ #1 #3 substring$ }\r
1064         'key\r
1065       if$\r
1066     }\r
1067     { author format.lab.names }\r
1068   if$\r
1071 FUNCTION {author.editor.key.label}\r
1072 { author empty$\r
1073     { editor empty$\r
1074         { key empty$\r
1075             { cite$ #1 #3 substring$ }\r
1076             'key\r
1077           if$\r
1078         }\r
1079         { editor format.lab.names }\r
1080       if$\r
1081     }\r
1082     { author format.lab.names }\r
1083   if$\r
1086 FUNCTION {author.key.organization.label}\r
1087 { author empty$\r
1088     { key empty$\r
1089         { organization empty$\r
1090             { cite$ #1 #3 substring$ }\r
1091             { "The " #4 organization chop.word #3 text.prefix$ }\r
1092           if$\r
1093         }\r
1094         'key\r
1095       if$\r
1096     }\r
1097     { author format.lab.names }\r
1098   if$\r
1101 FUNCTION {editor.key.organization.label}\r
1102 { editor empty$\r
1103     { key empty$\r
1104         { organization empty$\r
1105             { cite$ #1 #3 substring$ }\r
1106             { "The " #4 organization chop.word #3 text.prefix$ }\r
1107           if$\r
1108         }\r
1109         'key\r
1110       if$\r
1111     }\r
1112     { editor format.lab.names }\r
1113   if$\r
1116 FUNCTION {calc.short.authors}\r
1117 { type$ "book" =\r
1118   type$ "inbook" =\r
1119   or\r
1120     'author.editor.key.label\r
1121     { type$ "proceedings" =\r
1122         'editor.key.organization.label\r
1123         { type$ "manual" =\r
1124             'author.key.organization.label\r
1125             'author.key.label\r
1126           if$\r
1127         }\r
1128       if$\r
1129     }\r
1130   if$\r
1131   'short.list :=\r
1134 FUNCTION {calc.label}\r
1135 { calc.short.authors\r
1136   short.list\r
1137   "("\r
1138   *\r
1139   year duplicate$ empty$\r
1140   short.list key field.or.null = or\r
1141      { pop$ "" }\r
1142      'skip$\r
1143   if$\r
1144   *\r
1145   'label :=\r
1148 FUNCTION {sort.format.names}\r
1149 { 's :=\r
1150   #1 'nameptr :=\r
1151   ""\r
1152   s num.names$ 'numnames :=\r
1153   numnames 'namesleft :=\r
1154     { namesleft #0 > }\r
1155     { nameptr #1 >\r
1156         { "   " * }\r
1157         'skip$\r
1158       if$\r
1159       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=\r
1160       nameptr numnames = t "others" = and\r
1161         { "et al" * }\r
1162         { t sortify * }\r
1163       if$\r
1164       nameptr #1 + 'nameptr :=\r
1165       namesleft #1 - 'namesleft :=\r
1166     }\r
1167   while$\r
1170 FUNCTION {sort.format.title}\r
1171 { 't :=\r
1172   "A " #2\r
1173     "An " #3\r
1174       "The " #4 t chop.word\r
1175     chop.word\r
1176   chop.word\r
1177   sortify\r
1178   #1 global.max$ substring$\r
1181 FUNCTION {author.sort}\r
1182 { author empty$\r
1183     { key empty$\r
1184         { "to sort, need author or key in " cite$ * warning$\r
1185           ""\r
1186         }\r
1187         { key sortify }\r
1188       if$\r
1189     }\r
1190     { author sort.format.names }\r
1191   if$\r
1194 FUNCTION {author.editor.sort}\r
1195 { author empty$\r
1196     { editor empty$\r
1197         { key empty$\r
1198             { "to sort, need author, editor, or key in " cite$ * warning$\r
1199               ""\r
1200             }\r
1201             { key sortify }\r
1202           if$\r
1203         }\r
1204         { editor sort.format.names }\r
1205       if$\r
1206     }\r
1207     { author sort.format.names }\r
1208   if$\r
1211 FUNCTION {author.organization.sort}\r
1212 { author empty$\r
1213     { organization empty$\r
1214         { key empty$\r
1215             { "to sort, need author, organization, or key in " cite$ * warning$\r
1216               ""\r
1217             }\r
1218             { key sortify }\r
1219           if$\r
1220         }\r
1221         { "The " #4 organization chop.word sortify }\r
1222       if$\r
1223     }\r
1224     { author sort.format.names }\r
1225   if$\r
1228 FUNCTION {editor.organization.sort}\r
1229 { editor empty$\r
1230     { organization empty$\r
1231         { key empty$\r
1232             { "to sort, need editor, organization, or key in " cite$ * warning$\r
1233               ""\r
1234             }\r
1235             { key sortify }\r
1236           if$\r
1237         }\r
1238         { "The " #4 organization chop.word sortify }\r
1239       if$\r
1240     }\r
1241     { editor sort.format.names }\r
1242   if$\r
1245 FUNCTION {presort}\r
1246 { calc.label\r
1247   label sortify\r
1248   "    "\r
1249   *\r
1250   type$ "book" =\r
1251   type$ "inbook" =\r
1252   or\r
1253     'author.editor.sort\r
1254     { type$ "proceedings" =\r
1255         'editor.organization.sort\r
1256         { type$ "manual" =\r
1257             'author.organization.sort\r
1258             'author.sort\r
1259           if$\r
1260         }\r
1261       if$\r
1262     }\r
1263   if$\r
1264   "    "\r
1265   *\r
1266   year field.or.null sortify\r
1267   *\r
1268   "    "\r
1269   *\r
1270   title field.or.null\r
1271   sort.format.title\r
1272   *\r
1273   #1 entry.max$ substring$\r
1274   'sort.label :=\r
1275   sort.label *\r
1276   #1 entry.max$ substring$\r
1277   'sort.key$ :=\r
1280 ITERATE {presort}\r
1282 SORT\r
1284 STRINGS { longest.label last.label next.extra }\r
1286 INTEGERS { longest.label.width last.extra.num number.label }\r
1288 FUNCTION {initialize.longest.label}\r
1289 { "" 'longest.label :=\r
1290   #0 int.to.chr$ 'last.label :=\r
1291   "" 'next.extra :=\r
1292   #0 'longest.label.width :=\r
1293   #0 'last.extra.num :=\r
1294   #0 'number.label :=\r
1297 FUNCTION {forward.pass}\r
1298 { last.label label =\r
1299     { last.extra.num #1 + 'last.extra.num :=\r
1300       last.extra.num int.to.chr$ 'extra.label :=\r
1301     }\r
1302     { "a" chr.to.int$ 'last.extra.num :=\r
1303       "" 'extra.label :=\r
1304       label 'last.label :=\r
1305     }\r
1306   if$\r
1307   number.label #1 + 'number.label :=\r
1310 FUNCTION {reverse.pass}\r
1311 { next.extra "b" =\r
1312     { "a" 'extra.label := }\r
1313     'skip$\r
1314   if$\r
1315   extra.label 'next.extra :=\r
1316   extra.label\r
1317   duplicate$ empty$\r
1318     'skip$\r
1319     { "{\natexlab{" swap$ * "}}" * }\r
1320   if$\r
1321   'extra.label :=\r
1322   label extra.label * 'label :=\r
1325 EXECUTE {initialize.longest.label}\r
1327 ITERATE {forward.pass}\r
1329 REVERSE {reverse.pass}\r
1331 FUNCTION {bib.sort.order}\r
1332 { sort.label  'sort.key$ :=\r
1335 ITERATE {bib.sort.order}\r
1337 SORT\r
1339 FUNCTION {begin.bib}\r
1340 {   preamble$ empty$\r
1341     'skip$\r
1342     { preamble$ write$ newline$ }\r
1343   if$\r
1344   "\begin{thebibliography}{" number.label int.to.str$ * "}" *\r
1345   write$ newline$\r
1346   "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"\r
1347   write$ newline$\r
1348   "\expandafter\ifx\csname url\endcsname\relax" write$ newline$\r
1349   "  \def\url#1{{\tt #1}}\fi" write$ newline$\r
1352 EXECUTE {begin.bib}\r
1354 EXECUTE {init.state.consts}\r
1356 ITERATE {call.type$}\r
1358 FUNCTION {end.bib}\r
1359 { newline$\r
1360   "\end{thebibliography}" write$ newline$\r
1363 EXECUTE {end.bib}\r