Debian Codegraph @

texmf-dist/bibtex/bst/confproc/newapave.bst

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