[Top][All Lists]

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

Re: [AUCTeX-devel] reftex-select-toggle-follow for master and slave file

From: Arash Esbati
Subject: Re: [AUCTeX-devel] reftex-select-toggle-follow for master and slave files
Date: Thu, 24 Nov 2016 19:15:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1

Uwe Brauer <address@hidden> writes:

>    > If you restart Emacs and open main.tex *only*, you have access to all
>    > labels defined in the subfiles?  I don't get anything when I open
>    > main.tex and hit `C-c )' (RefTeX enabled).
>  If  reftex-revisit-to-follow is set to t, then I do see these labels,
>  if it is nil, then only if these files have been already opened.

Thanks for checking.  I'm not sure why `reftex-revisit-to-follow' makes
a difference for you.  For me, I always see no labels (blank RefTeX
labels buffer) when I only load main.tex as the entry point.  I'm
attaching the logic I've implemented to ltxtable.el applied to
subfiles.el from git.

   ;; Ensure that \subfile stays in one line
   (LaTeX-paragraph-commands-add-locally "subfile")

   ;; Tell AUCTeX that \subfile loads a file.  regexp is the same as
   ;; for \input or \include.  This will run `TeX-run-style-hooks' on
   ;; subfile(s) when master file is loaded.
      1 TeX-auto-file))

   ;; Tell RefTeX the same thing.
   (when (and (boundp 'reftex-include-file-commands)
              (not (member "subfile" reftex-include-file-commands)))
     (add-to-list 'reftex-include-file-commands "subfile" t)

This makes \subfile act like \input and both AUCTeX and RefTeX seem to
be happy with it.  Maybe you can give it a roll.  The complete style is

Best, Arash

Attachment: subfiles.el
Description: application/emacs-lisp

reply via email to

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