Uwe Brauer <o...@mat.ucm.es> 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. (TeX-auto-add-regexp `(,(concat "\\\\subfile" "{\\(\\.*[^#}%\\\\\\.\n\r]+\\)\\(\\.[^#}%\\\\\\.\n\r]+\\)?}") 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) (reftex-compile-variables)) 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 attached. Best, Arash
subfiles.el
Description: application/emacs-lisp
_______________________________________________ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel