ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/xDissertation/nddiss2e.bst
Revision: 3336
Committed: Wed Jan 30 16:01:02 2008 UTC (16 years, 5 months ago) by xsun
File size: 26632 byte(s)
Log Message:
Imported Dissertation

File Contents

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