Debian Codegraph @

texmf-dist/bibtex/bst/opcit/opcit.bst

raw
1 %%
2 %% This is file `opcit.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% opcit.dtx (with options: `bst')
8 %% Part of the `opcit' project: bibliographical references as footnotes.
9 %%
10 %% Copyright 2006 Federico Garcia
11 %%
12 ENTRY
13 { address
14 author
15 booktitle
16 chapter
17 edition
18 editor
19 hereafter
20 howpublished
21 institution
22 journal
23 key
24 month
25 note
26 number
27 organization
28 pages
29 publisher
30 school
31 series
32 title
33 type
34 url
35 urldate
36 volume
37 year
38 }
39 {}
40 { label }
41
42 INTEGERS { output.state before.all mid.sentence after.sentence
43 after.block quoted.state period.state }
44
45 STRINGS { s t last.authors quotes }
46
47 FUNCTION {init.state.consts}
48 { #0 'period.state :=
49 #0 'before.all :=
50 "" 'last.authors :=
51 "" 'quotes :=
52 }
53
54 FUNCTION {new.block}
55 { output.state before.all =
56 'skip$
57 { after.block 'output.state := }
58 if$
59 }
60 FUNCTION {not}
61 { { #0 }
62 { #1 }
63 if$
64 }
65
66 FUNCTION {and}
67 { 'skip$
68 { pop$ #0 }
69 if$
70 }
71
72 FUNCTION {or}
73 { { pop$ #1 }
74 'skip$
75 if$
76 }
77
78 FUNCTION {field.or.null}
79 { duplicate$ empty$
80 { pop$ "" }
81 'skip$
82 if$
83 }
84
85 FUNCTION {emphasize}
86 { duplicate$ empty$
87 { pop$ "" }
88 { "{\em " swap$ * "}" * }
89 if$
90 }
91
92 INTEGERS { nameptr namesleft numnames }
93
94 FUNCTION{format.names}
95 { 's :=
96 #1 'nameptr :=
97 s num.names$ 'numnames :=
98 numnames 'namesleft :=
99 { namesleft #0 > }
100 { s nameptr "{ff }{vv~}{ll}{,~jj}" format.name$ 't :=
101 nameptr #1 >
102 { namesleft #1 >
103 { ", " * t * }
104 { numnames #2 >
105 { "," * }
106 'skip$
107 if$
108 t "others" =
109 { " et~al." * }
110 { " and " * t * }
111 if$
112 }
113 if$
114 }
115 't
116 if$
117 nameptr #1 + 'nameptr :=
118 namesleft #1 - 'namesleft :=
119 }
120 while$
121 }
122
123 FUNCTION {format.swap.names}
124 { 's :=
125 s num.names$ 'numnames :=
126 "\SwapNames{" s #1 "{ff}" format.name$
127 duplicate$ #-1 #1 substring$
128 "." =
129 { #1 'period.state := }
130 'skip$
131 if$
132 * "}{" *
133 s #1 "{vv~}{ll}" format.name$ * "}" *
134 s #1 "{, jj}" format.name$ *
135 numnames #3 >
136 { " et~al." * #1 'period.state := }
137 { numnames #1 >
138 { #2 'nameptr :=
139 numnames #1 - 'namesleft :=
140 { namesleft #0 > }
141 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
142 namesleft #1 >
143 { ", " * t * }
144 { " and " * t * }
145 if$
146 nameptr #1 + 'nameptr :=
147 namesleft #1 - 'namesleft :=
148 }
149 while$
150 }
151 'skip$
152 if$
153 }
154 if$
155 }
156
157 FUNCTION {format.authors}
158 { author empty$
159 { ""
160 "" 'last.authors :=
161 }
162 { author format.names
163 last.authors =
164 { "\sameauthors" }
165 { before.all output.state =
166 { author format.swap.names }
167 { author format.names }
168 if$ }
169 if$
170 author format.names 'last.authors :=
171 }
172 if$
173 }
174
175 FUNCTION {format.editors}
176 { editor empty$
177 { "" }
178 { before.all output.state =
179 { editor format.swap.names }
180 { editor format.names }
181 if$
182 }
183 if$
184 }
185
186 FUNCTION {format.editors.ed}
187 { editor empty$
188 { "" }
189 { before.all output.state =
190 { editor format.swap.names }
191 { editor format.names }
192 if$
193 editor num.names$ #1 >
194 { " (eds.)" * }
195 { " (ed.)" * }
196 if$
197 #0 'period.state :=
198 }
199 if$
200 }
201
202 FUNCTION {n.dashify}
203 { 't :=
204 ""
205 { t empty$ not }
206 { t #1 #1 substring$ "-" =
207 { t #1 #2 substring$ "--" = not
208 { "--" *
209 t #2 global.max$ substring$ 't :=
210 }
211 { { t #1 #1 substring$ "-" = }
212 { "-" *
213 t #2 global.max$ substring$ 't :=
214 }
215 while$
216 }
217 if$
218 }
219 { t #1 #1 substring$ *
220 t #2 global.max$ substring$ 't :=
221 }
222 if$
223 }
224 while$
225 }
226
227 FUNCTION {format.date}
228 { year empty$
229 { month empty$
230 { "" }
231 { "there's a month but no year in " cite$ * warning$
232 "\toomit[month]{" month * " }" *
233 }
234 if$
235 }
236 { month empty$
237 'year
238 { "\toomit[month]{" month * " }" * year * }
239 if$
240 }
241 if$
242 }
243
244 FUNCTION {tie.or.space.connect}
245 { duplicate$ text.length$ #3 <
246 { "~" }
247 { " " }
248 if$
249 swap$ * *
250 }
251
252 FUNCTION{either.warning}
253 { empty$
254 'pop$
255 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
256 if$
257 }
258 FUNCTION {format.bvolume}
259 { volume empty$
260 { "" }
261 { "\bibcase volume" volume tie.or.space.connect
262 series empty$
263 'skip$
264 { " of " * series emphasize * }
265 if$
266 "volume and number" number either.warning
267 }
268 if$
269 }
270
271 FUNCTION {format.number.series}
272 { volume empty$
273 { number empty$
274 { series empty$
275 { "" }
276 { ", series " * series * "" }
277 if$
278 }
279 { "\bibcase number"
280 number tie.or.space.connect
281 series empty$
282 { "there's a number but no series in " cite$ * warning$ }
283 { " in " * series * }
284 if$
285 }
286 if$
287 }
288 { "" }
289 if$
290 }
291
292 INTEGERS { multiresult}
293
294 FUNCTION {multi.page.check}
295 { 't :=
296 #0 'multiresult :=
297 { multiresult not
298 t empty$ not
299 and
300 }
301 { t #1 #1 substring$
302 duplicate$ "-" =
303 swap$ duplicate$ "," =
304 swap$ "+" =
305 or or
306 { #1 'multiresult := }
307 { t #2 global.max$ substring$ 't := }
308 if$
309 }
310 while$
311 multiresult
312 }
313
314 FUNCTION {format.pages}
315 { pages empty$
316 { "" }
317 { pages multi.page.check
318 { "\toomit[pages]{\bibcase " swap$ * pages n.dashify tie.or.space.connect "}" * }
319 { "\toomit[pages]{\bibcase " swap$ * pages tie.or.space.connect "}" * }
320 if$
321 }
322 if$
323 }
324
325 FUNCTION {format.vol.num.date.pages}
326 { volume empty$
327 'skip$
328 { volume }
329 if$
330 number empty$
331 'skip$
332 { "/" number *
333 volume empty$
334 { "there's a number but no volume in " cite$ * warning$ }
335 { * }
336 if$
337 }
338 if$
339 " (" * format.date * ")" *
340 pages empty$
341 'skip$
342 { duplicate$ empty$
343 { pop$ "" format.pages * }
344 { ": " format.pages * }
345 if$
346 }
347 if$
348 }
349
350 FUNCTION {format.chapter.pages}
351 { chapter empty$
352 { pages empty$
353 { "" }
354 { ": " format.pages }
355 if$
356 }
357 { "\newblock\bibpunctuation "
358 type empty$
359 { "\bibcase chapter" * }
360 { type "l" change.case$ * }
361 if$
362 chapter tie.or.space.connect
363 pages empty$
364 'skip$
365 { ", pages " * format.pages * }
366 if$
367 }
368 if$
369 }
370
371 FUNCTION{get.lastnames}
372 { 's :=
373 s num.names$ 'numnames :=
374 s #1 "{vv~}{ll}" format.name$
375 numnames #3 >
376 { " et~al." * }
377 { numnames #1 >
378 { #2 'nameptr :=
379 numnames #1 - 'namesleft :=
380 { namesleft #0 > }
381 { s nameptr "{vv~}{ll}" format.name$ 't :=
382 namesleft #1 >
383 { ", " * t * }
384 { " and " * t * }
385 if$
386 nameptr #1 + 'nameptr :=
387 namesleft #1 - 'namesleft :=
388 }
389 while$
390 }
391 'skip$
392 if$
393 }
394 if$
395 }
396
397 FUNCTION {make.address.publisher.year}
398 { ""
399 address empty$
400 'skip$
401 { address * }
402 if$
403 publisher empty$
404 'skip$
405 { address empty$
406 { publisher * }
407 { ": " * publisher * }
408 if$
409 }
410 if$
411 format.date duplicate$ "" =
412 'pop$
413 { swap$ duplicate$ "" =
414 { * }
415 { swap$ ", " swap$ * * }
416 if$}
417 if$
418 duplicate$ "" =
419 'skip$
420 { "\bibparenthesis{" swap$ * "}" * }
421 if$
422 }
423
424 FUNCTION {make.url}
425 { "\url{" url * "}" *
426 urldate empty$
427 { "there is url but no urldate in " cite$ * warning$ }
428 { " (accessed " * urldate * ")" * }
429 if$
430 }
431
432 FUNCTION {output.bibitem}
433 { newline$
434 "\bibitem{" write$
435 cite$ "}" * write$
436 ""
437 newline$
438 "\biblastnames{" write$
439 author empty$
440 { editor empty$
441 { organization empty$
442 { "no last names in " cite$ * warning$ }
443 { organization }
444 if$
445 }
446 { editor get.lastnames
447 editor num.names$ #1 >
448 { " (eds.)" * }
449 { " (ed.)" * }
450 if$
451 }
452 if$
453 }
454 { author get.lastnames }
455 if$
456 "}" * write$
457 before.all 'output.state :=
458 }
459
460 FUNCTION{output.start}
461 { hereafter empty$
462 'skip$
463 { "\bibhereafter{{\noexpand\em " write$ hereafter "}}" * write$ }
464 if$
465 newline$
466 "\opcitstart " write$
467 }
468
469 FUNCTION{output.as.block}
470 { duplicate$ "" =
471 'pop$
472 { period.state #1 =
473 { "\GobbleOrNot" #0 'period.state := }
474 { "" }
475 if$
476 "\bibpunctuation" * quotes * write$ newline$ "\newblock " swap$ * write$
477 #1 'output.state :=
478 }
479 if$
480 "" 'quotes :=
481 }
482
483 FUNCTION{output.omitted}
484 { 't :=
485 duplicate$ "" =
486 { pop$ }
487 { "\toomit[" t * "]{\bibpunctuation\bibcase " * swap$ * "}" * write$ }
488 if$
489 }
490
491 FUNCTION {fin.entry}
492 { write$
493 note empty$ {""} {note} if$ "note" output.omitted
494 "\opcitend" write$
495 newline$
496 }
497
498 FUNCTION{empty.warning}
499 { 't :=
500 duplicate$ empty$
501 { pop$ "empty " t * " in " * cite$ * warning$ ""}
502 'skip$
503 if$
504 }
505
506 FUNCTION{empty.chapter.and.pages.warning}
507 { 't :=
508 chapter empty$
509 { pages empty$
510 { pop$ "empty " t * " in " * cite$ * warning$ "" }
511 'skip$
512 if$
513 }
514 'skip$
515 if$
516
517 }
518
519 FUNCTION{book}
520 { output.bibitem
521 output.start
522 author empty$
523 { format.editors.ed "author and editor" empty.warning write$ }
524 { format.authors "author and editor" editor either.warning write$ }
525 if$
526 title emphasize "title" empty.warning output.as.block
527 edition empty$
528 'skip$
529 { "\bibcase " edition * " edition" * output.as.block }
530 if$
531 howpublished missing$
532 'skip$
533 { "\bibcase " howpublished * output.as.block }
534 if$
535 format.bvolume "volume" output.omitted
536 format.number.series "number" output.omitted
537 make.address.publisher.year write$
538 url empty$
539 'skip$
540 { make.url output.as.block }
541 if$
542 fin.entry
543 }
544
545 FUNCTION{article}
546 { output.bibitem
547 output.start
548 format.authors "author" empty.warning write$
549 "``" title * "title" empty.warning output.as.block "''" 'quotes :=
550 howpublished empty$
551 'skip$
552 { "\bibpunctuation'' \newblock\toomit[howpublished]{\bibcase
553 " howpublished * write$
554 "}" 'quotes :=
555 }
556 if$
557 journal emphasize "journal" empty.warning
558 " " * format.vol.num.date.pages "year" empty.warning * output.as.block
559 url empty$
560 'skip$
561 { make.url output.as.block }
562 if$
563 fin.entry
564 }
565
566 FUNCTION {incollection}
567 { output.bibitem
568 output.start
569 format.authors "author" empty.warning write$
570 "``" title * "title" empty.warning output.as.block "''" 'quotes :=
571 "\bibcase in " output.as.block
572 crossref empty$
573 'skip$
574 { "\bibincite{" crossref * "}" * write$ }
575 if$
576 "{" write$
577 editor empty$
578 'skip$
579 { format.editors.ed ", " * write$ }
580 if$
581 booktitle emphasize "booktitle" empty.warning write$
582 edition empty$
583 'skip$
584 { "\bibcase " edition * " edition" * output.as.block }
585 if$
586 make.address.publisher.year write$
587 url empty$
588 'skip$
589 { make.url output.as.block }
590 if$
591 "}" write$
592 format.chapter.pages write$
593 fin.entry
594 }
595
596 FUNCTION {inbook}
597 { output.bibitem
598 output.start
599 author empty$
600 { format.editors.ed "author and editor" empty.warning write$ }
601 { format.authors "author and editor" editor either.warning write$ }
602 if$
603 "``" title * "title" empty.warning output.as.block "''" 'quotes :=
604 chapter empty$
605 'skip$
606 { type empty$
607 { "\bibcase chapter " chapter * }
608 { "\bibcase " type * " " * chapter * }
609 if$
610 }
611 if$
612 pages empty$
613 'skip$
614 { chapter empty$
615 { "\bibcase pages" pages n.dashify tie.or.space.connect }
616 { "\toomit[pages]{ (pages" * pages n.dashify tie.or.space.connect ")}" * }
617 if$
618 }
619 if$
620 "chapter and pages" empty.warning
621 " of " *
622 crossref empty$
623 { booktitle emphasize * "booktitle" empty.warning
624 edition empty$
625 'skip$
626 { ", " * edition "l" change.case$ * " edition" * }
627 if$
628 howpublished missing$
629 'skip$
630 { ", " * howpublished * }
631 if$
632 output.as.block
633 make.address.publisher.year write$
634 }
635 { "\bibincitestar{" * crossref * "}{" * booktitle emphasize * "}" * output.as.block }
636 if$
637 fin.entry
638 }
639
640 FUNCTION{phdthesis}
641 { output.bibitem
642 output.start
643 format.authors "author" empty.warning write$
644 title emphasize "title" empty.warning
645 "\bibparenthesis{Ph.\,D.\ diss\GobbleOrNot.}" * output.as.block
646 address empty$
647 { "" }
648 { address ": " * }
649 if$
650 school "school" empty.warning * output.as.block
651 month empty$
652 { "" }
653 { month " " * }
654 if$
655 year "year" empty.warning * output.as.block
656 fin.entry
657 }
658
659 FUNCTION{mastersthesis}
660 { output.bibitem
661 output.start
662 format.authors "author" empty.warning write$
663 title emphasize "title" empty.warning
664 "\bibparenthesis{M.\,A.\ thesis}" * output.as.block
665 address empty$
666 { "" }
667 { address ": " * }
668 if$
669 school "school" empty.warning * output.as.block
670 month empty$
671 { "" }
672 { month " " * }
673 if$
674 year "year" empty.warning * output.as.block
675 fin.entry
676 }
677
678 FUNCTION{proceedings}
679 { output.bibitem
680 output.start
681 editor empty$
682 { organization "editor and organization" empty.warning write$ }
683 { format.editors.ed "editor" empty.warning write$ }
684 if$
685 title emphasize "title" empty.warning output.as.block
686 format.bvolume "volume" output.omitted
687 format.number.series "number" output.omitted
688 make.address.publisher.year write$
689 fin.entry
690 }
691
692 FUNCTION {booklet}
693 { book }
694
695 FUNCTION {inproceedings}
696 { output.bibitem
697 output.start
698 format.authors "author" empty.warning write$
699 "``" title * "title" empty.warning output.as.block "''" 'quotes :=
700 "\bibcase in " output.as.block
701 crossref empty$
702 'skip$
703 { "\bibincite{" crossref * "}" * write$ }
704 if$
705 "{" booktitle emphasize * "booktitle" empty.warning write$
706 editor empty$
707 { organization "editor and organization" empty.warning output.as.block }
708 { ", edited by " format.editors * write$ }
709 if$
710 make.address.publisher.year write$
711 "}" write$
712 format.chapter.pages write$
713 fin.entry
714 }
715
716 FUNCTION {misc}
717 { output.bibitem
718 output.start
719 format.authors "author" empty.warning write$
720 title output.as.block
721 howpublished missing$
722 'skip$
723 { howpublished output.as.block }
724 if$
725 format.date output.as.block
726 fin.entry
727 }
728
729 FUNCTION {default.type} { misc }
730
731 MACRO {jan} {"January"}
732
733 MACRO {feb} {"February"}
734
735 MACRO {mar} {"March"}
736
737 MACRO {apr} {"April"}
738
739 MACRO {may} {"May"}
740
741 MACRO {jun} {"June"}
742
743 MACRO {jul} {"July"}
744
745 MACRO {aug} {"August"}
746
747 MACRO {sep} {"September"}
748
749 MACRO {oct} {"October"}
750
751 MACRO {nov} {"November"}
752
753 MACRO {dec} {"December"}
754
755 MACRO {acmcs} {"ACM Computing Surveys"}
756
757 MACRO {acta} {"Acta Informatica"}
758
759 MACRO {cacm} {"Communications of the ACM"}
760
761 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
762
763 MACRO {ibmsj} {"IBM Systems Journal"}
764
765 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
766
767 MACRO {ieeetc} {"IEEE Transactions on Computers"}
768
769 MACRO {ieeetcad}
770 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
771
772 MACRO {ipl} {"Information Processing Letters"}
773
774 MACRO {jacm} {"Journal of the ACM"}
775
776 MACRO {jcss} {"Journal of Computer and System Sciences"}
777
778 MACRO {scp} {"Science of Computer Programming"}
779
780 MACRO {sicomp} {"SIAM Journal on Computing"}
781
782 MACRO {tocs} {"ACM Transactions on Computer Systems"}
783
784 MACRO {tods} {"ACM Transactions on Database Systems"}
785
786 MACRO {tog} {"ACM Transactions on Graphics"}
787
788 MACRO {toms} {"ACM Transactions on Mathematical Software"}
789
790 MACRO {toois} {"ACM Transactions on Office Information Systems"}
791
792 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
793
794 MACRO {tcs} {"Theoretical Computer Science"}
795
796 READ
797
798 FUNCTION {sortify}
799 { purify$
800 "l" change.case$
801 }
802
803 INTEGERS { len }
804
805 FUNCTION {chop.word}
806 { 's :=
807 'len :=
808 s #1 len substring$ =
809 { s len #1 + global.max$ substring$ }
810 's
811 if$
812 }
813
814 FUNCTION {sort.format.names}
815 { 's :=
816 #1 'nameptr :=
817 ""
818 s num.names$ 'numnames :=
819 numnames 'namesleft :=
820 { namesleft #0 > }
821 { nameptr #1 >
822 { " " * }
823 'skip$
824 if$
825 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
826 nameptr numnames = t "others" = and
827 { "et al" * }
828 { t sortify * }
829 if$
830 nameptr #1 + 'nameptr :=
831 namesleft #1 - 'namesleft :=
832 }
833 while$
834 }
835
836 FUNCTION {sort.format.title}
837 { 't :=
838 "A " #2
839 "An " #3
840 "The " #4 t chop.word
841 chop.word
842 chop.word
843 sortify
844 #1 global.max$ substring$
845 }
846
847 FUNCTION {author.sort}
848 { author empty$
849 { key empty$
850 { "to sort, need author or key in " cite$ * warning$
851 ""
852 }
853 { key sortify }
854 if$
855 }
856 { author sort.format.names }
857 if$
858 }
859
860 FUNCTION {author.editor.sort}
861 { author empty$
862 { editor empty$
863 { key empty$
864 { "to sort, need author, editor, or key in " cite$ * warning$
865 ""
866 }
867 { key sortify }
868 if$
869 }
870 { editor sort.format.names }
871 if$
872 }
873 { author sort.format.names }
874 if$
875 }
876
877 FUNCTION {author.organization.sort}
878 { author empty$
879 { organization empty$
880 { key empty$
881 { "to sort, need author, organization, or key in " cite$ * warning$
882 ""
883 }
884 { key sortify }
885 if$
886 }
887 { "The " #4 organization chop.word sortify }
888 if$
889 }
890 { author sort.format.names }
891 if$
892 }
893
894 FUNCTION {editor.organization.sort}
895 { editor empty$
896 { organization empty$
897 { key empty$
898 { "to sort, need editor, organization, or key in " cite$ * warning$
899 ""
900 }
901 { key sortify }
902 if$
903 }
904 { "The " #4 organization chop.word sortify }
905 if$
906 }
907 { editor sort.format.names }
908 if$
909 }
910
911 FUNCTION {presort}
912 { type$ "book" =
913 type$ "inbook" =
914 or
915 'author.editor.sort
916 { type$ "proceedings" =
917 'editor.organization.sort
918 { type$ "manual" =
919 'author.organization.sort
920 'author.sort
921 if$
922 }
923 if$
924 }
925 if$
926 " "
927 *
928 year field.or.null sortify
929 *
930 " "
931 *
932 title field.or.null
933 sort.format.title
934 *
935 #1 entry.max$ substring$
936 'sort.key$ :=
937 }
938 FUNCTION {begin.bib}
939 { preamble$ empty$
940 'skip$
941 { preamble$ write$ newline$ }
942 if$
943 "\newBibCommand{\bibparenthesis[1]}{ (#1)}{. \newblock #1}" write$ newline$
944 "\newBibCommand{\bibincite[2]}{\recover@last\@nameuse{@#1}}{#2}" write$ newline$
945 "\newBibCommand{\bibincitestar[2]}{\recover@last " write$ newline$
946 " \@nameuse{#1@star}}{#2}" write$ newline$
947 "\newBibCommand{\SwapNames[2]}{#1 #2}{#2, #1}" write$ newline$
948 "\newBibCommand{\GobbleOrNot}{\relax}{\newblock\@gobble}" write$ newline$
949 "\begin{thebibliography}{}" write$ newline$
950 }
951 ITERATE {presort}
952
953 SORT
954
955 EXECUTE {begin.bib}
956
957 EXECUTE {init.state.consts}
958
959 ITERATE {call.type$}
960
961 FUNCTION {end.bib}
962 { newline$
963 "\end{thebibliography}" write$ newline$
964 }
965
966 EXECUTE {end.bib}