[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Defining new citation formats with natbib

From: Sven Bretfeld
Subject: [AUCTeX] Defining new citation formats with natbib
Date: Mon, 15 Jan 2007 14:24:00 +0100

Hello to all

I use the natbib package with multibib for a book project and I mostly
need the commands \citealtse{} \citetse{} \citealtpr{} \citetpr{}
(where se and pr stand for secondary resp. primary literature).

I've tried to make RefTeX providing these citation formats as options
when I hit C-c [. After experimenting in vain for a while, I put
the following code, which I found via Google, in my .emacs file:

(defun my-LaTeX-mode-setup ()
  ;; Set up my own cite format for natbib.  (when (and (fboundp
             (member "natbib" (TeX-style-list)))
     '((?\C-m . "\\cite{%l}")
       (?s . "\\citealtse{%l}") (?S . "\\citetse{%l}") (?p
       . "\\citealtpr{%l}") (?P . "\\citetpr{%l}") (?e
       . "\\citep[e.g.][]{%l}") (?s . "\\citep[see][]{%l}") (?a
       . "\\citeauthor{%l}") (?A . "\\citeauthor*{%l}") (?y
       . "\\citeyear{%l}") (?Y . "\\citeyearpar{%l}") (?n
       . "\\nocite{%l}")))))

(add-hook 'LaTeX-mode-hook 'my-LaTeX-mode-setup)

But still RefTeX presents only the default list of citation formats
when I hit C-c [. Can anybody see the mistake?

Thanks for help

reply via email to

[Prev in Thread] Current Thread [Next in Thread]