1 % cj.bst v1.1 2003-08-18
2 % Antonio Vallecillo (av@lcc.uma.es)
4 % v1.1 - First version (2003-08-18)
6 %======================================================================
7 % EXAMPLES OF USE and NOTES ON "cj.bst"
9 % The following examples of BibTeX entries can be used for producing
10 % references of journal articles, books, chapters, conferences,
11 % and technical documents:
15 % author = {Carlos Canal and Lidia Fuentes and Ernesto Pimentel
16 % and Jos\'e M. Troya and Antonio Vallecillo},
17 % title = {Extending {CORBA} Interfaces with Protocols},
27 % author = {John F. Sowa},
28 % title = {Knowledge Representation},
29 % publisher = {Brooks/Cole},
31 % address = {Pacific Grove, CA},
35 % @Incollection{SZY00,
36 % author = {Clemens Szyperski},
37 % booktitle = {Foundations of Component-Based Systems},
38 % title = {Components and the Way Ahead},
39 % editor = {Gary T. Leavens and Murali Sitaraman},
40 % publisher = {Cambridge University Press},
42 % address = {Cambrigde, UK},
46 % @Inproceedings{cda-wordgraphs:97,
47 % author = {M. Crochemore and R. Verin},
49 % title = {Direct construction of compact directed acyclic word graphs},
50 % booktitle = {Proc. of CPM 97},
51 % month = {12-14 August},
52 % address = {Cambridge, MA},
54 % publisher = {Springer-Verlag, Berlin},
57 % -- technical document/standard
60 % organization = {International Telecommunications Union},
61 % title = {Framework on formal methods in conformance testing},
63 % address = {Geneva, Switzerland},
64 % note = {ITU-T Recommendation X.500},
65 % number = {ITU-T X.500},
68 % Using the "cj.bst" style they produce, respectively:
71 % Canal, C., Fuentes, L., Pimentel, E., Troya, J.~M., and
72 % Vallecillo, A. (2001)
73 % Extending {CORBA} interfaces with protocols.
74 % \newblock {\em The Computer Journal}, {\bf 44}, 448--462.
77 % Sowa, J.~F. (2000) {\em Knowledge Representation}.
78 % Brooks/Cole, Pacific Grove, CA.
81 % Szyperski, C. (2000) Components and the way ahead.
82 % \newblock In Leavens, G.~T. and Sitaraman, M. (eds.),
83 % {\em Foundations of Component-Based Systems}.
84 % Cambridge University Press, Cambrigde, UK.
86 % \bibitem{cda-wordgraphs:97}
87 % Crochemore, M. and Verin, R. (1997) Direct construction of
88 % compact directed acyclic word graphs.
89 % \newblock {\em Proc. of CPM 97}, Cambridge, MA, 12-14 August,
90 % pp. 192--211. Springer-Verlag, Berlin.
93 % ITU-T X.500 (1997) {\em Framework on formal methods in conformance testing}.
94 % \newblock International Telecommunications Union.
95 % \newblock Geneva, Switzerland.
98 % - In the "book", "Incollection", and "Technical Report" items,
99 % the "address" field contains the publisher location.
100 % - In the "Inproceedings" and "conference" BibTeX items, the "address"
101 % field contains the conference location, so the publisher location
102 % should be included in the "publisher" field.
103 % - In "Inproceedings" and "conference" BibTeX items, the "month" field
104 % should also contain the days of the conference, as indicated in the
106 % - In the "Manual" BibTeX item, the "number" field should contain the
107 % number of the technical document being referenced. This field will
108 % be used as main index for the entry in the bibliography produced.
109 % - A warning is generated if any of the fields shown for these examples
111 % - Some literals are avaliable for the most common journals and
112 % editorials, as indicated by the following list of BibTeX macros
113 %======================================================================
115 % Literals for MONTHS
117 MACRO {jan} {"January"}
119 MACRO {feb} {"February"}
121 MACRO {mar} {"March"}
123 MACRO {apr} {"April"}
131 MACRO {aug} {"August"}
133 MACRO {sep} {"September"}
135 MACRO {oct} {"October"}
137 MACRO {nov} {"November"}
139 MACRO {dec} {"December"}
141 % Literals for JOURNALS
143 MACRO {acmcs} {"ACM Computing Surveys"}
145 MACRO {acta} {"Acta Informatica"}
147 MACRO {cacm} {"Communications of the ACM"}
149 MACRO {cj} {"The Computer Journal"}
151 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
153 MACRO {ibmsj} {"IBM Systems Journal"}
155 MACRO {ist} {"Information and Software Technology"}
157 MACRO {ieeec} {"IEEE Computer"}
159 MACRO {ieees} {"IEEE Software"}
161 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
163 MACRO {ieeetc} {"IEEE Transactions on Computers"}
166 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
168 MACRO {ipl} {"Information Processing Letters"}
170 MACRO {jacm} {"Journal of the ACM"}
172 MACRO {jcss} {"Journal of Computer and System Sciences"}
174 MACRO {jss} {"Journal of Systems and Software"}
176 MACRO {scp} {"Science of Computer Programming"}
178 MACRO {sicomp} {"SIAM Journal on Computing"}
180 MACRO {spe} {"Software--Practice and Experience"}
182 MACRO {tocs} {"ACM Transactions on Computer Systems"}
184 MACRO {tods} {"ACM Transactions on Database Systems"}
186 MACRO {tog} {"ACM Transactions on Graphics"}
188 MACRO {toms} {"ACM Transactions on Mathematical Software"}
190 MACRO {toois} {"ACM Transactions on Office Information Systems"}
192 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
194 MACRO {tcs} {"Theoretical Computer Science"}
196 % Literals for EDITORIALS
198 MACRO {ACMP} {"ACM Press"}
200 MACRO {ADDISON} {"Addison-Wesley"}
202 MACRO {ADDISON-BOSTON} {"Addison-Wesley, Boston"}
204 MACRO {CUP} {"Cambridge University Press"}
206 MACRO {CUP-UK} {"Cambridge University Press, Cambridge, England"}
208 MACRO {IEEE-CSP} {"IEEE Computer Society Press"}
210 MACRO {ICP} {"Imperial College Press"}
212 MACRO {ICP-UK} {"Imperial College Press, UK"}
214 MACRO {KAP} {"Kluwer Academic Publishers"}
216 MACRO {MIT} {"MIT Press"}
218 MACRO {NH} {"North-Holland"}
220 MACRO {OUP} {"Oxford University Press"}
222 MACRO {OUP-UK} {"Oxford University Press, UK"}
224 MACRO {PRENTICE} {"Prentice Hall"}
226 MACRO {SPRINGER} {"Springer-Verlag"}
228 MACRO {SPRINGER-BERLIN} {"Springer-Verlag, Berlin"}
230 MACRO {SPRINGER-HEIDELBERG} {"Springer-Verlag, Heidelberg"}
232 MACRO {SPRINGER-NY} {"Springer-Verlag, NY"}
234 % Literals for SERIES
236 MACRO {LNCS} {"Lecture Notes in Computer Science"}
238 MACRO {LNAI} {"LNAI"}
240 MACRO {ENTCS} {"Electronic Notes in Theoretical Computer Science"}
242 %=================================================================
243 %% Start of the cj.bst code
272 INTEGERS { output.state before.all mid.sentence after.sentence after.block
275 FUNCTION {init.state.consts}
278 #2 'after.sentence :=
281 #0 'doblank := % put a blank in output.nonnul if not zero
287 { % what to do between output items
294 % from plain.bst (add periods after title, but also adds
295 % commas in other places)
296 FUNCTION {output.nonnull}
298 output.state mid.sentence =
301 { output.state after.block =
306 { output.state before.all =
308 { add.period$ " " * write$ }
312 mid.sentence 'output.state :=
325 FUNCTION {output.check}
328 { pop$ "empty " t * " in " * cite$ * warning$ }
333 FUNCTION {output.bibitem}
340 before.all 'output.state :=
350 { output.state before.all =
352 { after.block 'output.state := }
356 FUNCTION {new.sentence}
357 { output.state after.block =
359 { output.state before.all =
361 { after.sentence 'output.state := }
385 FUNCTION {new.block.checka}
392 FUNCTION {new.block.checkb}
401 FUNCTION {new.sentence.checka}
408 FUNCTION {new.sentence.checkb}
417 FUNCTION {field.or.null}
427 { "{\em " swap$ * "}" * }
431 INTEGERS { nameptr namesleft numnames }
433 FUNCTION {format.names} % needs a total rewrite using 'and' function
436 s num.names$ 'numnames :=
437 numnames 'namesleft :=
440 s nameptr "{vv }{ll}{, f.}{, jj}" format.name$ 't := % de Geuzaine, C., jr
441 % s nameptr "{vv }{ll}{ f.}{, jj}" format.name$ 't := % de Geuzaine C., jr
442 % s nameptr "{ff }{vv }{ll}{, jj}" format.name$ 't := % Christophe de Geuzaine, jr
443 % s nameptr "{f. }{vv }{ll}{, jj}" format.name$ 't := % C. de Geuzaine, jr
444 % s nameptr "{vv }{ll}{, ff}{, jj}" format.name$ 't := % de Geuzaine, Christophe, jr
445 % s nameptr "{vv }{ll}{, ff}{, jj}" format.name$ 't := % de Geuzaine, Christophe, jr
462 nameptr #1 + 'nameptr :=
463 namesleft #1 - 'namesleft :=
468 FUNCTION {format.authors}
471 { author format.names }
475 FUNCTION {format.editors}
479 { editor format.names
480 editor num.names$ #1 >
488 FUNCTION {format.title}
491 { title "t" change.case$ }
495 FUNCTION {format.address}
502 FUNCTION {format.note}
514 { t #1 #1 substring$ "-" =
515 { t #1 #2 substring$ "--" = not
517 t #2 global.max$ substring$ 't :=
519 { { t #1 #1 substring$ "-" = }
521 t #2 global.max$ substring$ 't :=
527 { t #1 #1 substring$ *
528 t #2 global.max$ substring$ 't :=
535 FUNCTION {format.date}
539 { "there's a month but no year in " cite$ * warning$
546 % { month " " * year * }
553 FUNCTION {format.month}
561 FUNCTION {format.btitle}
565 FUNCTION {tie.or.space.connect}
566 { duplicate$ text.length$ #3 <
573 FUNCTION {either.or.check}
576 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
580 FUNCTION {format.bvolume}
585 % { ", Vol. " * "{\bf " * volume "} of " * series * } %% No "vol."
586 { ", " * series ", " * "{\bf" * volume "}" * * }
588 "volume and number" number either.or.check
593 FUNCTION {format.chapter}
596 { ", chapter" * chapter %tie.or.space.connect
602 FUNCTION {format.number.series}
605 { series field.or.null }
607 { "there's a number but no series in " cite$ * warning$ }
608 { ", " * series ", " * "{\bf" * number "}" * * }
618 FUNCTION {format.edition}
621 { output.state mid.sentence =
622 { ", " * edition "l" change.case$ " edition" * }
623 { ", " * edition "t" change.case$ " edition" * }
629 INTEGERS { multiresult }
631 FUNCTION {multi.page.check}
640 swap$ duplicate$ "," =
643 { #1 'multiresult := }
644 { t #2 global.max$ substring$ 't := }
651 FUNCTION {format.pages}
654 { pages multi.page.check
655 { ", " * "pp." pages n.dashify tie.or.space.connect }
656 { "" pages tie.or.space.connect }
662 FUNCTION {format.vol.num.pages}
664 { "empty volume in " cite$ * warning$
667 { ", {\bf " * volume "}" * field.or.null
677 { pop$ format.pages }
678 { ", " * pages n.dashify * }
684 FUNCTION {format.chapter.pages}
689 { type "l" change.case$ }
691 chapter tie.or.space.connect
694 { ", " * format.pages * }
700 FUNCTION {format.in.ed.booktitle}
704 % { "In " booktitle emphasize *}
705 { booktitle emphasize }
706 { "In " format.editors * ", " * booktitle emphasize * }
712 FUNCTION {empty.misc.check}
713 { author empty$ title empty$ howpublished empty$
714 month empty$ year empty$ note empty$
716 { "all relevant fields are empty in " cite$ * warning$ }
721 FUNCTION {format.thesis.type}
725 type "t" change.case$
730 FUNCTION {format.tr.type}
732 { "Technical Report" }
737 FUNCTION {format.tr.number} %% old way
739 { "Technical Report" }
744 { number tie.or.space.connect }
748 FUNCTION {format.article.crossref}
751 { "need key or journal for " cite$ * " to crossref " * crossref *
755 { "In {\em " journal * "\/}" * }
760 " \cite{" * crossref * "}" *
763 FUNCTION {format.crossref.editor}
764 { editor #1 "{vv~}{ll}" format.name$
765 editor num.names$ duplicate$
770 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
772 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
780 FUNCTION {format.book.crossref}
782 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
785 { "Volume" volume tie.or.space.connect
790 editor field.or.null author field.or.null =
794 { "need editor, key, or series for " cite$ * " to crossref " *
798 { "{\em " * series * "\/}" * }
804 { format.crossref.editor * }
806 " \cite{" * crossref * "}" *
809 FUNCTION {format.incoll.inproc.crossref}
811 editor field.or.null author field.or.null =
815 { "need editor, key, or booktitle for " cite$ * " to crossref " *
819 { "In " booktitle * }
825 { "In " format.crossref.editor * }
827 " \cite{" * crossref * "}" *
832 format.authors "author" output.check
833 format.date "year" output.check
834 format.title "title" output.check
837 { journal emphasize "journal" output.check
838 format.vol.num.pages output
840 { format.article.crossref output.nonnull
851 { format.editors "author and editor" output.check }
852 { format.authors output.nonnull
854 { "author and editor" editor either.or.check }
859 format.date "year" output.check
860 #1 'doblank := % remove blanks
861 format.btitle emphasize "title" output.check
862 format.edition output
864 { format.bvolume output
865 format.number.series output
867 publisher "publisher" output.check
868 format.address "address" output.check
871 format.book.crossref output.nonnull
876 #0 'doblank := % blanks again TDS
881 format.authors output
882 format.date "year" output.check
883 format.title "title" output.check
884 howpublished address new.block.checkb
886 format.address output
894 { format.editors "author and editor" output.check }
895 { format.authors output.nonnull
898 format.date "year" output.check
899 format.btitle "title" output.check
901 format.in.ed.booktitle output
905 format.address "address" output.check
907 { format.chapter.pages "chapter and pages" output.check
909 format.book.crossref output.nonnull
912 % format.edition output
918 FUNCTION {inproceedings}
920 format.authors "author" output.check
921 format.date "year" output.check
922 format.title "title" output.check
925 { format.in.ed.booktitle "booktitle" output.check
926 format.address "address" output.check
927 format.month "month" output.check
928 format.bvolume output
929 format.number.series output
930 format.pages "pages" output.check
932 organization publisher new.sentence.checkb
934 publisher "publisher" output.check
936 { format.incoll.inproc.crossref output.nonnull
937 format.chapter output
945 FUNCTION {incollection}
946 %% same as "inproceedings, but without pages
947 %% and the address means the publisher location, and therefore goes at the end.
948 %% Useful for book chapters.
951 format.authors "author" output.check
952 format.date "year" output.check
953 format.title "title" output.check
956 { format.in.ed.booktitle "booktitle" output.check
957 format.chapter output
959 format.bvolume output
960 format.number.series output
961 %% format.chapter.pages "pages" output.check
964 organization publisher new.sentence.checkb
966 publisher "publisher" output.check
967 format.address "address" output.check
969 { format.incoll.inproc.crossref output.nonnull
970 format.chapter output
978 FUNCTION {conference} { incollection }
984 "empty number in " cite$ * warning$
986 { organization empty$
988 { organization output.nonnull
989 address "address" output.check
993 { format.authors output.nonnull }
995 format.date "year" output.check
996 format.btitle emphasize "title" output.check
997 format.edition output
999 { organization empty$
1000 { address new.block.checka
1006 { organization address new.block.checkb
1009 address "address" output.check
1014 { % if number is not empty
1016 format.date "year" output.check
1017 format.btitle emphasize "title" output.check
1018 format.edition output
1020 { organization empty$
1021 { address new.block.checka
1027 { organization address new.block.checkb
1030 address "address" output.check
1039 FUNCTION {mastersthesis}
1041 format.authors "author" output.check
1042 format.date "year" output.check
1043 format.title "title" output.check
1045 "Master's thesis." format.thesis.type output.nonnull
1046 school "school" output.check
1052 FUNCTION {masterthesis} { mastersthesis }
1056 format.authors output
1058 title howpublished new.block.checkb
1060 howpublished new.block.checka
1067 FUNCTION {phdthesis}
1069 format.authors "author" output.check
1070 format.date "year" output.check
1071 format.btitle "title" output.check
1073 "PhD thesis" format.thesis.type output.nonnull
1074 school "school" output.check
1080 FUNCTION {proceedings}
1083 { format.editors "editor" output.check
1086 { format.editors output.nonnull }
1088 format.date "year" output.check
1089 format.btitle emphasize "title" output.check
1090 format.address "address" output.check
1091 format.month "month" output.check
1092 format.bvolume output
1093 format.number.series output
1095 organization publisher new.sentence.checkb
1097 publisher "publisher" output.check
1102 FUNCTION {techreport}
1105 { number "number" output.check
1106 format.date "year" output.check
1107 format.title "title" output.check
1109 format.tr.type output
1111 { format.authors "author" output.check
1112 format.date "year" output.check
1113 format.title "title" output.check
1115 format.tr.number "number" output.check %output.nonnull
1116 % format.tr.type output
1120 institution "institution" output.check
1121 format.address "address" output.check
1126 FUNCTION {unpublished}
1128 format.authors "author" output.check
1129 format.date "year" output.check
1130 format.title "title" output.check
1132 format.note "note" output.check
1136 FUNCTION {default.type} { misc }
1142 FUNCTION {begin.bib}
1145 { preamble$ write$ newline$ }
1147 "\begin{thebibliography}{99}"
1153 EXECUTE {init.state.consts}
1155 ITERATE {call.type$}
1159 "\end{thebibliography}" write$ newline$