help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Customize reftex according to auctex mode


From: Kevin Rodgers
Subject: Re: Customize reftex according to auctex mode
Date: Sun, 30 Nov 2008 08:12:07 -0700
User-agent: Thunderbird 2.0.0.18 (Macintosh/20081105)

Jean Magnan de Bornier wrote:
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?

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





reply via email to

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