Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Customize reftex according to auctex mode

0 views
Skip to first unread message

Jean Magnan de Bornier

unread,
Nov 30, 2008, 5:15:36 AM11/30/08
to
Hi all,
I have been trying to customize reftex-cite-format to be "\cite{%l}" when
using LaTeX, and "\cite[%l]" when using ConTeXt.

My first attempt was simply the last line here:

(add-hook 'ConTeXt-mode-hook
(function
(lambda ()
(reftex-mode t)
(auto-fill-mode 1)
(LaTeX-math-mode 1)
))
(setq reftex-cite-format "\\cite[%l]"))

But this command once given is also applied to latex files; I then tried
writing the corresponding instruction in (add-hook 'LaTeX-mode-hook...
but then auctex has reverted to the latex behavior even for context files.

So apparently I cannot customize reftex within aa auctex mode? Or am I
just clumsy?

AUCTeX 11.85

TIA,
--
Jean

Kevin Rodgers

unread,
Nov 30, 2008, 10:12:07 AM11/30/08
to help-gn...@gnu.org

A little clumsy, yes :-) First, you need to move the setq form inside
the hook function. As it is, the setq form is being evaluated when
add-hook runs, providing its APPEND argument.

Second, you probably want to make reftex-cite-format's value local to
the Context mode buffers. So:

(add-hook 'ConTeXt-mode-hook
(function
(lambda ()
(reftex-mode t)
(auto-fill-mode 1)
(LaTeX-math-mode 1)

(set (make-local-variable 'reftex-cite-format) "\\cite[%l]"))))

--
Kevin Rodgers
Denver, Colorado, USA

Jean Magnan de Bornier

unread,
Nov 30, 2008, 10:48:11 AM11/30/08
to
Kevin Rodgers <kevin.d...@gmail.com> wrote :

Thank you so much Kevin, this works like a charm!
--
Jean

0 new messages