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

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

Re: display reftex-toc automatically


From: carsten_dominik
Subject: Re: display reftex-toc automatically
Date: 13 Jun 2005 13:55:05 -0700
User-agent: G2/0.2


Fabian Braennstroem schrieb:
> Hi,
>
> I would like to display the reftex-toc automatically when I open an
> existing tex-file. It would be nice if the automatic start just works
> for an 'article' (and similark class and not for any letter-class.
> Do you have any idea?
>

Untested:


(add-hook 'reftex-mode-hook
          (lambda ()
            (let ((class (save-excursion
                           (goto-char (point-min))
                           (if (re-search-forward
                                "\\documentclass.*?{\\([^}]+\\)}" nil t)
                               (match-string 1)))))
              (if (member class '("article" "book" "report"))
                  (reftex-toc)))))

- Carsten



reply via email to

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