1 ;;; jurabib.el --- AUCTeX style for the `jurabib' package
3 ;; Copyright (C) 2004, 2007 Free Software Foundation, Inc.
5 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
6 ;; Maintainer: auctex-devel@gnu.org
10 ;; This file is part of AUCTeX.
12 ;; AUCTeX is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
17 ;; AUCTeX is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
29 ;; This file adds support for the `jurabib' package.
31 ;; Currently only the citation-related commands are supported. Feel
32 ;; free to complete the support and send the result to the AUCTeX
33 ;; mailing list. But be aware that the code can only be included if
34 ;; you assign the copyright to the FSF.
41 ;; Taken from natbib.el and adapted.
43 '(("cite" . 2) ("cite*" . 2)
44 ("citetitle" . 2) ("fullcite" . 2)
45 ("citet" . 1) ("citealt" . 1)
46 ("citep" . 2) ("citealp" . 2)
47 ("citeauthor" . 2) ("citeyear" . 2)
48 ("footcite" . 2) ("footcite*" . 2)
49 ("footcitetitle" . 2) ("footfullcite" . 2)
50 ("footcitet" . 1) ("footcitealt" . 1)
51 ("footcitep" . 2) ("footcitealp" . 2)
52 ("footciteauthor" . 2) ("footciteyear" . 2))))
60 ;; No optional arguments
61 (list (car cmd) 'TeX-arg-cite))
63 ;; Just one optional argument, the post note
66 '(TeX-arg-conditional TeX-arg-cite-note-p (["Post-note"]) nil)
72 '(TeX-arg-conditional TeX-arg-cite-note-p (natbib-note-args) nil)
77 ;; FIXME: Completing read for field.
78 '("citefield" ; \citefield[]{}{}
79 (TeX-arg-conditional TeX-arg-cite-note-p (["Post-note"]) nil)
81 '("footcitefield" ; \footcitefield[]{}{}
82 (TeX-arg-conditional TeX-arg-cite-note-p (["Post-note"]) nil)
83 "Field" TeX-arg-cite))
85 ;; Make an entry in TeX-complete-list
90 (mapconcat (lambda (x) (regexp-quote (car x)))
92 '(("citefield") ("footcitefield"))) "\\|")
93 "\\)\\(\\[[^]\n\r\\%]*\\]\\)*{\\([^{}\n\r\\%,]*,\\)*"
94 "\\([^{}\n\r\\%,]*\\)")
95 4 'LaTeX-bibitem-list "}"))
97 ;; Add further symbols
99 '("citefullfirstfortype" 1)
100 '("citenotitlefortype" 1)
101 '("citeswithoutentry" 1)
102 '("citetitlefortype" 1)
103 '("citeworkwithtitle" 1)
105 '("nextcitenotitle" 1)
111 (when (and (featurep 'font-latex)
112 (eq TeX-install-font-lock 'font-latex-setup))
113 (font-latex-add-keywords '(("cite" "*[[{")
124 ("footcitetitle" "[[{")
125 ("footfullcite" "[[{")
129 ("footcitealp" "[[{")
130 ("footciteauthor" "[[{")
131 ("footciteyear" "[[{")
133 ("footcitefield" "[{{"))
135 (font-latex-add-keywords '(("citeswithoutentry" "{")
137 ("nextcitenotitle" "{")
138 ("nextcitereset" "{")
139 ("nextciteshort" "{"))
141 (font-latex-add-keywords '(("citenotitlefortype" "{")
142 ("citetitlefortype" "{")
143 ("jurabibsetup" "{"))
146 ;; Tell RefTeX (Thanks, Carsten)
147 (when (and (fboundp 'reftex-set-cite-format)
148 ;; Is it `reftex-cite-format' customized?
149 (not (get 'reftex-cite-format 'saved-value)))
150 ;; Check if RefTeX supports jurabib.
151 (if (assoc 'jurabib reftex-cite-format-builtin)
152 ;; Yes, use the provided default.
153 (reftex-set-cite-format 'jurabib)
154 ;; No, set it by hand.
155 (reftex-set-cite-format
156 '((?\C-m . "\\cite{%l}")
157 (?c . "\\cite[?][]{%l}")
160 (?e . "\\citep[e.g.][?]{%l}")
161 (?s . "\\citep[see][?]{%l}")
162 (?u . "\\fullcite{%l}")
163 (?i . "\\citetitle{%l}")
164 (?a . "\\citeauthor{%l}")
165 (?e . "\\citefield{?}{%l}")
166 (?y . "\\citeyear{%l}")
167 (?f . "\\footcite{%l}")
168 (?F . "\\footcite[?][]{%l}")
169 (?l . "\\footfullcite{%l}"))))))
171 ;; FIXME: The following list is the edited output of
172 ;; `TeX-auto-generate' which probably includes internal macros of
173 ;; jurabib. Unfortunately the macros which should be accessible to
174 ;; the user are not fully documented at the time of this writing.
175 ;; But instead of including only the limited part which is
176 ;; documented we rather give the user a bit too much. The list
177 ;; should be reduced when there is proper documentation, though.
181 '("artnumberformat" 1)
182 '("artvolnumformat" 2)
183 '("artvolumeformat" 1)
196 '("bibnumberformat" 1)
202 '("formatarticlepages" ["argument"] 2)
204 '("fullnameoxfordcrossref" 1)
205 '("incolledformat" 5)
208 '("jbannoteformat" 1)
210 '("jbarchnameformat" 1)
213 '("jbartcrossrefchecked" ["argument"] 1)
214 '("jbauthorindexfont" 1)
216 '("jbbibyearformat" 1)
217 '("jbcitationoyearformat" 1)
218 '("jbcitationyearformat" 1)
219 '("jbcrossrefchecked" ["argument"] 1)
221 '("jbedbyincollcrossreflong" 1)
222 '("jbedbyincollcrossrefshort" 1)
223 '("jbedbyincollcrossrefshortnoapy" 1)
224 '("jbedbyincollcrossrefshortwithapy" 1)
226 '("jbeditorindexfont" 1)
229 '("jbincollcrossref" 2)
233 '("jborganizationindexfont" 1)
236 '("jbrealcitation" 2)
237 '("jbshortarchformat" 1)
238 '("jbshortsubarchformat" 1)
242 '("nobibliography" 1)
243 '("nocitebuthowcited" 1)
244 '("numberandseries" 2)
246 '("pernumberformat" 1)
247 '("pervolnumformat" 2)
248 '("pervolumeformat" 1)
250 '("revnumberformat" 1)
251 '("revvolnumformat" 2)
252 '("revvolumeformat" 1)
298 "bibartperiodhowcited"
319 "bibcrossrefciteagain"
343 "bibincollcrossrefcite"
344 "bibincollcrossrefciteagain"
348 "bibleftcolumnadjust"
349 "bibleftcolumnstretch"
362 "bibrightcolumnadjust"
363 "bibrightcolumnstretch"
393 "diffpageibidemmidname"
461 "jbNotRevedNoVonNoJr"
469 "jbRevedFirstNoVonJr"
470 "jbRevedFirstNoVonNoJr"
471 "jbRevedFirstOnlyLast"
473 "jbRevedFirstVonNoJr"
474 "jbRevedNotFirstNoVonJr"
475 "jbRevedNotFirstNoVonNoJr"
476 "jbRevedNotFirstOnlyLast"
477 "jbRevedNotFirstVonJr"
478 "jbRevedNotFirstVonNoJr"
480 "jbactualauthorfnfont"
482 "jbaddtomakehowcited"
484 "jbafterstartpagesep"
494 "jbauthorfontifannotator"
496 "jbbeforestartpagesep"
506 "jbcitationyearformat"
508 "jbdisablecitationcrossref"
510 "jbdonotindexauthors"
511 "jbdonotindexeditors"
512 "jbdonotindexorganizations"
516 "jbedbyincollcrossrefcite"
517 "jbedbyincollcrossrefciteagain"
521 "jbfirstcitepageranges"
525 "jbhowcitedcomparepart"
526 "jbhowcitednormalpart"
527 "jbhowsepannotatorfirst"
528 "jbhowsepannotatorlast"
529 "jbhowsepbeforetitle"
530 "jbhowsepbeforetitleae"
531 "jbhowsepbeforetitleibidemname"
535 "jbindexonlyfirstauthors"
536 "jbindexonlyfirsteditors"
537 "jbindexonlyfirstorganizations"
546 "jbonlyforfirstcitefullbegin"
547 "jbonlyforfirstcitefullend"
558 "jbsamesubarchindent"
560 "jbshowbibextralabel"
563 "jbsuperscripteditionafterauthor"
576 "nofirstnameforcitation"
598 "samepageibidemmidname"
606 "technicalreportname"
634 ;;; jurabib.el ends here