]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/system_T/latex8.bst
Some more work...
[helm.git] / helm / papers / system_T / latex8.bst
1 \r
2 % ---------------------------------------------------------------\r
3 %\r
4 % $Id: latex8.bst,v 1.1 1995/09/15 15:13:49 ienne Exp $\r
5 %\r
6 % by Paolo.Ienne@di.epfl.ch\r
7 %\r
8 \r
9 % ---------------------------------------------------------------\r
10 %\r
11 % no guarantee is given that the format corresponds perfectly to \r
12 % IEEE 8.5" x 11" Proceedings, but most features should be ok.\r
13 %\r
14 % ---------------------------------------------------------------\r
15 %\r
16 % `latex8' from BibTeX standard bibliography style `abbrv'\r
17 % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.\r
18 % Copyright (C) 1985, all rights reserved.\r
19 % Copying of this file is authorized only if either\r
20 % (1) you make absolutely no changes to your copy, including name, or\r
21 % (2) if you do make changes, you name it something other than\r
22 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.\r
23 % This restriction helps ensure that all standard styles are identical.\r
24 % The file btxbst.doc has the documentation for this style.\r
25 \r
26 ENTRY\r
27   { address\r
28     author\r
29     booktitle\r
30     chapter\r
31     edition\r
32     editor\r
33     howpublished\r
34     institution\r
35     journal\r
36     key\r
37     month\r
38     note\r
39     number\r
40     organization\r
41     pages\r
42     publisher\r
43     school\r
44     series\r
45     title\r
46     type\r
47     volume\r
48     year\r
49   }\r
50   {}\r
51   { label }\r
52 \r
53 INTEGERS { output.state before.all mid.sentence after.sentence after.block }\r
54 \r
55 FUNCTION {init.state.consts}\r
56 { #0 'before.all :=\r
57   #1 'mid.sentence :=\r
58   #2 'after.sentence :=\r
59   #3 'after.block :=\r
60 }\r
61 \r
62 STRINGS { s t }\r
63 \r
64 FUNCTION {output.nonnull}\r
65 { 's :=\r
66   output.state mid.sentence =\r
67     { ", " * write$ }\r
68     { output.state after.block =\r
69  { add.period$ write$\r
70    newline$\r
71    "\newblock " write$\r
72  }\r
73  { output.state before.all =\r
74      'write$\r
75      { add.period$ " " * write$ }\r
76    if$\r
77  }\r
78       if$\r
79       mid.sentence 'output.state :=\r
80     }\r
81   if$\r
82   s\r
83 }\r
84 \r
85 FUNCTION {output}\r
86 { duplicate$ empty$\r
87     'pop$\r
88     'output.nonnull\r
89   if$\r
90 }\r
91 \r
92 FUNCTION {output.check}\r
93 { 't :=\r
94   duplicate$ empty$\r
95     { pop$ "empty " t * " in " * cite$ * warning$ }\r
96     'output.nonnull\r
97   if$\r
98 }\r
99 \r
100 FUNCTION {output.bibitem}\r
101 { newline$\r
102   "\bibitem{" write$\r
103   cite$ write$\r
104   "}" write$\r
105   newline$\r
106   ""\r
107   before.all 'output.state :=\r
108 }\r
109 \r
110 FUNCTION {fin.entry}\r
111 { add.period$\r
112   write$\r
113   newline$\r
114 }\r
115 \r
116 FUNCTION {new.block}\r
117 { output.state before.all =\r
118     'skip$\r
119     { after.block 'output.state := }\r
120   if$\r
121 }\r
122 \r
123 FUNCTION {new.sentence}\r
124 { output.state after.block =\r
125     'skip$\r
126     { output.state before.all =\r
127  'skip$\r
128  { after.sentence 'output.state := }\r
129       if$\r
130     }\r
131   if$\r
132 }\r
133 \r
134 FUNCTION {not}\r
135 {   { #0 }\r
136     { #1 }\r
137   if$\r
138 }\r
139 \r
140 FUNCTION {and}\r
141 {   'skip$\r
142     { pop$ #0 }\r
143   if$\r
144 }\r
145 \r
146 FUNCTION {or}\r
147 {   { pop$ #1 }\r
148     'skip$\r
149   if$\r
150 }\r
151 \r
152 FUNCTION {new.block.checka}\r
153 { empty$\r
154     'skip$\r
155     'new.block\r
156   if$\r
157 }\r
158 \r
159 FUNCTION {new.block.checkb}\r
160 { empty$\r
161   swap$ empty$\r
162   and\r
163     'skip$\r
164     'new.block\r
165   if$\r
166 }\r
167 \r
168 FUNCTION {new.sentence.checka}\r
169 { empty$\r
170     'skip$\r
171     'new.sentence\r
172   if$\r
173 }\r
174 \r
175 FUNCTION {new.sentence.checkb}\r
176 { empty$\r
177   swap$ empty$\r
178   and\r
179     'skip$\r
180     'new.sentence\r
181   if$\r
182 }\r
183 \r
184 FUNCTION {field.or.null}\r
185 { duplicate$ empty$\r
186     { pop$ "" }\r
187     'skip$\r
188   if$\r
189 }\r
190 \r
191 FUNCTION {emphasize}\r
192 { duplicate$ empty$\r
193     { pop$ "" }\r
194     { "{\em " swap$ * "}" * }\r
195   if$\r
196 }\r
197 \r
198 INTEGERS { nameptr namesleft numnames }\r
199 \r
200 FUNCTION {format.names}\r
201 { 's :=\r
202   #1 'nameptr :=\r
203   s num.names$ 'numnames :=\r
204   numnames 'namesleft :=\r
205     { namesleft #0 > }\r
206     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=\r
207       nameptr #1 >\r
208  { namesleft #1 >\r
209      { ", " * t * }\r
210      { numnames #2 >\r
211   { "," * }\r
212   'skip$\r
213        if$\r
214        t "others" =\r
215   { " et~al." * }\r
216   { " and " * t * }\r
217        if$\r
218      }\r
219    if$\r
220  }\r
221  't\r
222       if$\r
223       nameptr #1 + 'nameptr :=\r
224 \r
225       namesleft #1 - 'namesleft :=\r
226     }\r
227   while$\r
228 }\r
229 \r
230 FUNCTION {format.authors}\r
231 { author empty$\r
232     { "" }\r
233     { author format.names }\r
234   if$\r
235 }\r
236 \r
237 FUNCTION {format.editors}\r
238 { editor empty$\r
239     { "" }\r
240     { editor format.names\r
241       editor num.names$ #1 >\r
242  { ", editors" * }\r
243  { ", editor" * }\r
244       if$\r
245     }\r
246   if$\r
247 }\r
248 \r
249 FUNCTION {format.title}\r
250 { title empty$\r
251     { "" }\r
252     { title "t" change.case$ }\r
253   if$\r
254 }\r
255 \r
256 FUNCTION {n.dashify}\r
257 { 't :=\r
258   ""\r
259     { t empty$ not }\r
260     { t #1 #1 substring$ "-" =\r
261  { t #1 #2 substring$ "--" = not\r
262      { "--" *\r
263        t #2 global.max$ substring$ 't :=\r
264      }\r
265      {   { t #1 #1 substring$ "-" = }\r
266   { "-" *\r
267     t #2 global.max$ substring$ 't :=\r
268   }\r
269        while$\r
270      }\r
271    if$\r
272  }\r
273  { t #1 #1 substring$ *\r
274    t #2 global.max$ substring$ 't :=\r
275  }\r
276       if$\r
277     }\r
278   while$\r
279 }\r
280 \r
281 FUNCTION {format.date}\r
282 { year empty$\r
283     { month empty$\r
284  { "" }\r
285  { "there's a month but no year in " cite$ * warning$\r
286    month\r
287  }\r
288       if$\r
289     }\r
290     { month empty$\r
291  'year\r
292  { month " " * year * }\r
293       if$\r
294     }\r
295   if$\r
296 }\r
297 \r
298 FUNCTION {format.btitle}\r
299 { title emphasize\r
300 }\r
301 \r
302 FUNCTION {tie.or.space.connect}\r
303 { duplicate$ text.length$ #3 <\r
304     { "~" }\r
305     { " " }\r
306   if$\r
307   swap$ * *\r
308 }\r
309 \r
310 FUNCTION {either.or.check}\r
311 { empty$\r
312     'pop$\r
313     { "can't use both " swap$ * " fields in " * cite$ * warning$ }\r
314   if$\r
315 }\r
316 \r
317 FUNCTION {format.bvolume}\r
318 { volume empty$\r
319     { "" }\r
320     { "volume" volume tie.or.space.connect\r
321       series empty$\r
322  'skip$\r
323  { " of " * series emphasize * }\r
324       if$\r
325       "volume and number" number either.or.check\r
326     }\r
327   if$\r
328 }\r
329 \r
330 FUNCTION {format.number.series}\r
331 { volume empty$\r
332     { number empty$\r
333  { series field.or.null }\r
334  { output.state mid.sentence =\r
335      { "number" }\r
336      { "Number" }\r
337    if$\r
338    number tie.or.space.connect\r
339    series empty$\r
340      { "there's a number but no series in " cite$ * warning$ }\r
341      { " in " * series * }\r
342    if$\r
343  }\r
344       if$\r
345     }\r
346     { "" }\r
347   if$\r
348 }\r
349 \r
350 FUNCTION {format.edition}\r
351 { edition empty$\r
352     { "" }\r
353     { output.state mid.sentence =\r
354  { edition "l" change.case$ " edition" * }\r
355  { edition "t" change.case$ " edition" * }\r
356       if$\r
357     }\r
358   if$\r
359 }\r
360 \r
361 INTEGERS { multiresult }\r
362 \r
363 FUNCTION {multi.page.check}\r
364 { 't :=\r
365   #0 'multiresult :=\r
366     { multiresult not\r
367       t empty$ not\r
368       and\r
369     }\r
370     { t #1 #1 substring$\r
371       duplicate$ "-" =\r
372       swap$ duplicate$ "," =\r
373       swap$ "+" =\r
374       or or\r
375  { #1 'multiresult := }\r
376  { t #2 global.max$ substring$ 't := }\r
377       if$\r
378     }\r
379   while$\r
380   multiresult\r
381 }\r
382 \r
383 FUNCTION {format.pages}\r
384 { pages empty$\r
385     { "" }\r
386     { pages multi.page.check\r
387  { "pages" pages n.dashify tie.or.space.connect }\r
388  { "page" pages tie.or.space.connect }\r
389       if$\r
390     }\r
391   if$\r
392 }\r
393 \r
394 FUNCTION {format.vol.num.pages}\r
395 { volume field.or.null\r
396   number empty$\r
397     'skip$\r
398     { "(" number * ")" * *\r
399       volume empty$\r
400  { "there's a number but no volume in " cite$ * warning$ }\r
401  'skip$\r
402       if$\r
403     }\r
404   if$\r
405   pages empty$\r
406     'skip$\r
407     { duplicate$ empty$\r
408  { pop$ format.pages }\r
409  { ":" * pages n.dashify * }\r
410       if$\r
411     }\r
412   if$\r
413 }\r
414 \r
415 FUNCTION {format.chapter.pages}\r
416 { chapter empty$\r
417     'format.pages\r
418     { type empty$\r
419  { "chapter" }\r
420  { type "l" change.case$ }\r
421       if$\r
422       chapter tie.or.space.connect\r
423       pages empty$\r
424  'skip$\r
425  { ", " * format.pages * }\r
426       if$\r
427     }\r
428   if$\r
429 }\r
430 \r
431 FUNCTION {format.in.ed.booktitle}\r
432 { booktitle empty$\r
433     { "" }\r
434     { editor empty$\r
435  { "In " booktitle emphasize * }\r
436  { "In " format.editors * ", " * booktitle emphasize * }\r
437       if$\r
438     }\r
439   if$\r
440 }\r
441 \r
442 FUNCTION {empty.misc.check}\r
443 \r
444 { author empty$ title empty$ howpublished empty$\r
445   month empty$ year empty$ note empty$\r
446   and and and and and\r
447   key empty$ not and\r
448     { "all relevant fields are empty in " cite$ * warning$ }\r
449     'skip$\r
450   if$\r
451 }\r
452 \r
453 FUNCTION {format.thesis.type}\r
454 { type empty$\r
455     'skip$\r
456     { pop$\r
457       type "t" change.case$\r
458     }\r
459   if$\r
460 }\r
461 \r
462 FUNCTION {format.tr.number}\r
463 { type empty$\r
464     { "Technical Report" }\r
465     'type\r
466   if$\r
467   number empty$\r
468     { "t" change.case$ }\r
469     { number tie.or.space.connect }\r
470   if$\r
471 }\r
472 \r
473 FUNCTION {format.article.crossref}\r
474 { key empty$\r
475     { journal empty$\r
476  { "need key or journal for " cite$ * " to crossref " * crossref *\r
477    warning$\r
478    ""\r
479  }\r
480  { "In {\em " journal * "\/}" * }\r
481       if$\r
482     }\r
483     { "In " key * }\r
484   if$\r
485   " \cite{" * crossref * "}" *\r
486 }\r
487 \r
488 FUNCTION {format.crossref.editor}\r
489 { editor #1 "{vv~}{ll}" format.name$\r
490   editor num.names$ duplicate$\r
491   #2 >\r
492     { pop$ " et~al." * }\r
493     { #2 <\r
494  'skip$\r
495  { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =\r
496      { " et~al." * }\r
497      { " and " * editor #2 "{vv~}{ll}" format.name$ * }\r
498    if$\r
499  }\r
500       if$\r
501     }\r
502   if$\r
503 }\r
504 \r
505 FUNCTION {format.book.crossref}\r
506 { volume empty$\r
507     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$\r
508       "In "\r
509     }\r
510     { "Volume" volume tie.or.space.connect\r
511       " of " *\r
512     }\r
513   if$\r
514   editor empty$\r
515   editor field.or.null author field.or.null =\r
516   or\r
517     { key empty$\r
518  { series empty$\r
519      { "need editor, key, or series for " cite$ * " to crossref " *\r
520        crossref * warning$\r
521        "" *\r
522      }\r
523      { "{\em " * series * "\/}" * }\r
524    if$\r
525  }\r
526  { key * }\r
527       if$\r
528     }\r
529     { format.crossref.editor * }\r
530   if$\r
531   " \cite{" * crossref * "}" *\r
532 }\r
533 \r
534 FUNCTION {format.incoll.inproc.crossref}\r
535 { editor empty$\r
536   editor field.or.null author field.or.null =\r
537   or\r
538     { key empty$\r
539  { booktitle empty$\r
540      { "need editor, key, or booktitle for " cite$ * " to crossref " *\r
541        crossref * warning$\r
542        ""\r
543      }\r
544      { "In {\em " booktitle * "\/}" * }\r
545    if$\r
546  }\r
547  { "In " key * }\r
548       if$\r
549     }\r
550     { "In " format.crossref.editor * }\r
551   if$\r
552   " \cite{" * crossref * "}" *\r
553 }\r
554 \r
555 FUNCTION {article}\r
556 { output.bibitem\r
557   format.authors "author" output.check\r
558   new.block\r
559   format.title "title" output.check\r
560   new.block\r
561   crossref missing$\r
562     { journal emphasize "journal" output.check\r
563       format.vol.num.pages output\r
564       format.date "year" output.check\r
565     }\r
566     { format.article.crossref output.nonnull\r
567       format.pages output\r
568     }\r
569   if$\r
570   new.block\r
571   note output\r
572   fin.entry\r
573 }\r
574 \r
575 FUNCTION {book}\r
576 { output.bibitem\r
577   author empty$\r
578     { format.editors "author and editor" output.check }\r
579     { format.authors output.nonnull\r
580       crossref missing$\r
581  { "author and editor" editor either.or.check }\r
582  'skip$\r
583       if$\r
584     }\r
585   if$\r
586   new.block\r
587   format.btitle "title" output.check\r
588   crossref missing$\r
589     { format.bvolume output\r
590       new.block\r
591       format.number.series output\r
592       new.sentence\r
593       publisher "publisher" output.check\r
594       address output\r
595     }\r
596     { new.block\r
597       format.book.crossref output.nonnull\r
598     }\r
599   if$\r
600   format.edition output\r
601   format.date "year" output.check\r
602   new.block\r
603   note output\r
604   fin.entry\r
605 }\r
606 \r
607 FUNCTION {booklet}\r
608 { output.bibitem\r
609   format.authors output\r
610   new.block\r
611   format.title "title" output.check\r
612   howpublished address new.block.checkb\r
613   howpublished output\r
614   address output\r
615   format.date output\r
616   new.block\r
617   note output\r
618   fin.entry\r
619 }\r
620 \r
621 FUNCTION {inbook}\r
622 { output.bibitem\r
623   author empty$\r
624     { format.editors "author and editor" output.check }\r
625     { format.authors output.nonnull\r
626 \r
627       crossref missing$\r
628  { "author and editor" editor either.or.check }\r
629  'skip$\r
630       if$\r
631     }\r
632   if$\r
633   new.block\r
634   format.btitle "title" output.check\r
635   crossref missing$\r
636     { format.bvolume output\r
637       format.chapter.pages "chapter and pages" output.check\r
638       new.block\r
639       format.number.series output\r
640       new.sentence\r
641       publisher "publisher" output.check\r
642       address output\r
643     }\r
644     { format.chapter.pages "chapter and pages" output.check\r
645       new.block\r
646       format.book.crossref output.nonnull\r
647     }\r
648   if$\r
649   format.edition output\r
650   format.date "year" output.check\r
651   new.block\r
652   note output\r
653   fin.entry\r
654 }\r
655 \r
656 FUNCTION {incollection}\r
657 { output.bibitem\r
658   format.authors "author" output.check\r
659   new.block\r
660   format.title "title" output.check\r
661   new.block\r
662   crossref missing$\r
663     { format.in.ed.booktitle "booktitle" output.check\r
664       format.bvolume output\r
665       format.number.series output\r
666       format.chapter.pages output\r
667       new.sentence\r
668       publisher "publisher" output.check\r
669       address output\r
670       format.edition output\r
671       format.date "year" output.check\r
672     }\r
673     { format.incoll.inproc.crossref output.nonnull\r
674       format.chapter.pages output\r
675     }\r
676   if$\r
677   new.block\r
678   note output\r
679   fin.entry\r
680 }\r
681 \r
682 FUNCTION {inproceedings}\r
683 { output.bibitem\r
684   format.authors "author" output.check\r
685   new.block\r
686   format.title "title" output.check\r
687   new.block\r
688   crossref missing$\r
689     { format.in.ed.booktitle "booktitle" output.check\r
690       format.bvolume output\r
691       format.number.series output\r
692       format.pages output\r
693       address empty$\r
694  { organization publisher new.sentence.checkb\r
695    organization output\r
696    publisher output\r
697    format.date "year" output.check\r
698  }\r
699  { address output.nonnull\r
700    format.date "year" output.check\r
701    new.sentence\r
702    organization output\r
703    publisher output\r
704  }\r
705       if$\r
706     }\r
707     { format.incoll.inproc.crossref output.nonnull\r
708       format.pages output\r
709     }\r
710   if$\r
711   new.block\r
712   note output\r
713   fin.entry\r
714 }\r
715 \r
716 FUNCTION {conference} { inproceedings }\r
717 \r
718 FUNCTION {manual}\r
719 { output.bibitem\r
720   author empty$\r
721     { organization empty$\r
722  'skip$\r
723  { organization output.nonnull\r
724    address output\r
725  }\r
726       if$\r
727     }\r
728     { format.authors output.nonnull }\r
729   if$\r
730   new.block\r
731   format.btitle "title" output.check\r
732   author empty$\r
733     { organization empty$\r
734  { address new.block.checka\r
735    address output\r
736  }\r
737  'skip$\r
738       if$\r
739     }\r
740     { organization address new.block.checkb\r
741       organization output\r
742       address output\r
743     }\r
744   if$\r
745   format.edition output\r
746   format.date output\r
747   new.block\r
748   note output\r
749   fin.entry\r
750 }\r
751 \r
752 FUNCTION {mastersthesis}\r
753 { output.bibitem\r
754   format.authors "author" output.check\r
755   new.block\r
756   format.title "title" output.check\r
757   new.block\r
758   "Master's thesis" format.thesis.type output.nonnull\r
759   school "school" output.check\r
760   address output\r
761   format.date "year" output.check\r
762   new.block\r
763   note output\r
764   fin.entry\r
765 }\r
766 \r
767 FUNCTION {misc}\r
768 { output.bibitem\r
769   format.authors output\r
770   title howpublished new.block.checkb\r
771   format.title output\r
772   howpublished new.block.checka\r
773   howpublished output\r
774   format.date output\r
775   new.block\r
776   note output\r
777   fin.entry\r
778   empty.misc.check\r
779 }\r
780 \r
781 FUNCTION {phdthesis}\r
782 { output.bibitem\r
783   format.authors "author" output.check\r
784   new.block\r
785   format.btitle "title" output.check\r
786   new.block\r
787   "PhD thesis" format.thesis.type output.nonnull\r
788   school "school" output.check\r
789   address output\r
790   format.date "year" output.check\r
791   new.block\r
792   note output\r
793   fin.entry\r
794 }\r
795 \r
796 FUNCTION {proceedings}\r
797 { output.bibitem\r
798   editor empty$\r
799     { organization output }\r
800     { format.editors output.nonnull }\r
801 \r
802   if$\r
803   new.block\r
804   format.btitle "title" output.check\r
805   format.bvolume output\r
806   format.number.series output\r
807   address empty$\r
808     { editor empty$\r
809  { publisher new.sentence.checka }\r
810  { organization publisher new.sentence.checkb\r
811    organization output\r
812  }\r
813       if$\r
814       publisher output\r
815       format.date "year" output.check\r
816     }\r
817     { address output.nonnull\r
818       format.date "year" output.check\r
819       new.sentence\r
820       editor empty$\r
821  'skip$\r
822  { organization output }\r
823       if$\r
824       publisher output\r
825     }\r
826   if$\r
827   new.block\r
828   note output\r
829   fin.entry\r
830 }\r
831 \r
832 FUNCTION {techreport}\r
833 { output.bibitem\r
834   format.authors "author" output.check\r
835   new.block\r
836   format.title "title" output.check\r
837   new.block\r
838   format.tr.number output.nonnull\r
839   institution "institution" output.check\r
840   address output\r
841   format.date "year" output.check\r
842   new.block\r
843   note output\r
844   fin.entry\r
845 }\r
846 \r
847 FUNCTION {unpublished}\r
848 { output.bibitem\r
849   format.authors "author" output.check\r
850   new.block\r
851   format.title "title" output.check\r
852   new.block\r
853   note "note" output.check\r
854   format.date output\r
855   fin.entry\r
856 }\r
857 \r
858 FUNCTION {default.type} { misc }\r
859 \r
860 MACRO {jan} {"Jan."}\r
861 \r
862 MACRO {feb} {"Feb."}\r
863 \r
864 MACRO {mar} {"Mar."}\r
865 \r
866 MACRO {apr} {"Apr."}\r
867 \r
868 MACRO {may} {"May"}\r
869 \r
870 MACRO {jun} {"June"}\r
871 \r
872 MACRO {jul} {"July"}\r
873 \r
874 MACRO {aug} {"Aug."}\r
875 \r
876 MACRO {sep} {"Sept."}\r
877 \r
878 MACRO {oct} {"Oct."}\r
879 \r
880 MACRO {nov} {"Nov."}\r
881 \r
882 MACRO {dec} {"Dec."}\r
883 \r
884 MACRO {acmcs} {"ACM Comput. Surv."}\r
885 \r
886 MACRO {acta} {"Acta Inf."}\r
887 \r
888 MACRO {cacm} {"Commun. ACM"}\r
889 \r
890 MACRO {ibmjrd} {"IBM J. Res. Dev."}\r
891 \r
892 MACRO {ibmsj} {"IBM Syst.~J."}\r
893 \r
894 MACRO {ieeese} {"IEEE Trans. Softw. Eng."}\r
895 \r
896 MACRO {ieeetc} {"IEEE Trans. Comput."}\r
897 \r
898 MACRO {ieeetcad}\r
899  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}\r
900 \r
901 MACRO {ipl} {"Inf. Process. Lett."}\r
902 \r
903 MACRO {jacm} {"J.~ACM"}\r
904 \r
905 MACRO {jcss} {"J.~Comput. Syst. Sci."}\r
906 \r
907 MACRO {scp} {"Sci. Comput. Programming"}\r
908 \r
909 MACRO {sicomp} {"SIAM J. Comput."}\r
910 \r
911 MACRO {tocs} {"ACM Trans. Comput. Syst."}\r
912 \r
913 MACRO {tods} {"ACM Trans. Database Syst."}\r
914 \r
915 MACRO {tog} {"ACM Trans. Gr."}\r
916 \r
917 MACRO {toms} {"ACM Trans. Math. Softw."}\r
918 \r
919 MACRO {toois} {"ACM Trans. Office Inf. Syst."}\r
920 \r
921 MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}\r
922 \r
923 MACRO {tcs} {"Theoretical Comput. Sci."}\r
924 \r
925 READ\r
926 \r
927 FUNCTION {sortify}\r
928 { purify$\r
929   "l" change.case$\r
930 }\r
931 \r
932 INTEGERS { len }\r
933 \r
934 FUNCTION {chop.word}\r
935 { 's :=\r
936   'len :=\r
937   s #1 len substring$ =\r
938     { s len #1 + global.max$ substring$ }\r
939     's\r
940   if$\r
941 }\r
942 \r
943 FUNCTION {sort.format.names}\r
944 { 's :=\r
945   #1 'nameptr :=\r
946   ""\r
947   s num.names$ 'numnames :=\r
948   numnames 'namesleft :=\r
949     { namesleft #0 > }\r
950     { nameptr #1 >\r
951  { "   " * }\r
952  'skip$\r
953       if$\r
954       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=\r
955       nameptr numnames = t "others" = and\r
956  { "et al" * }\r
957  { t sortify * }\r
958       if$\r
959       nameptr #1 + 'nameptr :=\r
960       namesleft #1 - 'namesleft :=\r
961     }\r
962   while$\r
963 }\r
964 \r
965 FUNCTION {sort.format.title}\r
966 { 't :=\r
967   "A " #2\r
968     "An " #3\r
969       "The " #4 t chop.word\r
970     chop.word\r
971   chop.word\r
972   sortify\r
973   #1 global.max$ substring$\r
974 }\r
975 \r
976 FUNCTION {author.sort}\r
977 { author empty$\r
978     { key empty$\r
979  { "to sort, need author or key in " cite$ * warning$\r
980    ""\r
981  }\r
982  { key sortify }\r
983       if$\r
984     }\r
985     { author sort.format.names }\r
986   if$\r
987 }\r
988 \r
989 FUNCTION {author.editor.sort}\r
990 { author empty$\r
991     { editor empty$\r
992  { key empty$\r
993      { "to sort, need author, editor, or key in " cite$ * warning$\r
994        ""\r
995      }\r
996      { key sortify }\r
997    if$\r
998  }\r
999  { editor sort.format.names }\r
1000       if$\r
1001     }\r
1002     { author sort.format.names }\r
1003   if$\r
1004 }\r
1005 \r
1006 FUNCTION {author.organization.sort}\r
1007 { author empty$\r
1008 \r
1009     { organization empty$\r
1010  { key empty$\r
1011      { "to sort, need author, organization, or key in " cite$ * warning$\r
1012        ""\r
1013      }\r
1014      { key sortify }\r
1015    if$\r
1016  }\r
1017  { "The " #4 organization chop.word sortify }\r
1018       if$\r
1019     }\r
1020     { author sort.format.names }\r
1021   if$\r
1022 }\r
1023 \r
1024 FUNCTION {editor.organization.sort}\r
1025 { editor empty$\r
1026     { organization empty$\r
1027  { key empty$\r
1028      { "to sort, need editor, organization, or key in " cite$ * warning$\r
1029        ""\r
1030      }\r
1031      { key sortify }\r
1032    if$\r
1033  }\r
1034  { "The " #4 organization chop.word sortify }\r
1035       if$\r
1036     }\r
1037     { editor sort.format.names }\r
1038   if$\r
1039 }\r
1040 \r
1041 FUNCTION {presort}\r
1042 { type$ "book" =\r
1043   type$ "inbook" =\r
1044   or\r
1045     'author.editor.sort\r
1046     { type$ "proceedings" =\r
1047  'editor.organization.sort\r
1048  { type$ "manual" =\r
1049      'author.organization.sort\r
1050      'author.sort\r
1051    if$\r
1052  }\r
1053       if$\r
1054     }\r
1055   if$\r
1056   "    "\r
1057   *\r
1058   year field.or.null sortify\r
1059   *\r
1060   "    "\r
1061   *\r
1062   title field.or.null\r
1063   sort.format.title\r
1064   *\r
1065   #1 entry.max$ substring$\r
1066   'sort.key$ :=\r
1067 }\r
1068 \r
1069 ITERATE {presort}\r
1070 \r
1071 SORT\r
1072 \r
1073 STRINGS { longest.label }\r
1074 \r
1075 INTEGERS { number.label longest.label.width }\r
1076 \r
1077 FUNCTION {initialize.longest.label}\r
1078 { "" 'longest.label :=\r
1079   #1 'number.label :=\r
1080   #0 'longest.label.width :=\r
1081 }\r
1082 \r
1083 FUNCTION {longest.label.pass}\r
1084 { number.label int.to.str$ 'label :=\r
1085   number.label #1 + 'number.label :=\r
1086   label width$ longest.label.width >\r
1087     { label 'longest.label :=\r
1088       label width$ 'longest.label.width :=\r
1089     }\r
1090     'skip$\r
1091   if$\r
1092 }\r
1093 \r
1094 EXECUTE {initialize.longest.label}\r
1095 \r
1096 ITERATE {longest.label.pass}\r
1097 \r
1098 FUNCTION {begin.bib}\r
1099 { preamble$ empty$\r
1100     'skip$\r
1101     { preamble$ write$ newline$ }\r
1102   if$\r
1103   "\begin{thebibliography}{"  longest.label  * \r
1104   "}\setlength{\itemsep}{-1ex}\small" * write$ newline$\r
1105 }\r
1106 \r
1107 EXECUTE {begin.bib}\r
1108 \r
1109 EXECUTE {init.state.consts}\r
1110 \r
1111 ITERATE {call.type$}\r
1112 \r
1113 FUNCTION {end.bib}\r
1114 { newline$\r
1115   "\end{thebibliography}" write$ newline$\r
1116 }\r
1117 \r
1118 EXECUTE {end.bib}\r
1119 \r
1120 % end of file latex8.bst\r
1121 % ---------------------------------------------------------------\r
1122 \r
1123 \r
1124 \r