auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] subfiles, private macros, scan the master file


From: Uwe Brauer
Subject: [AUCTeX-devel] subfiles, private macros, scan the master file
Date: Wed, 02 Nov 2016 08:34:01 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi

A year ago I asked such a question concerning reftex and the feature I
proposed was implemented (thanks). I scanned the archives but I am not
sure whether the following issue also has been treated (the feature is
not implemented). I vaguely remember that Tassilo said it is not
possible.

Anyhow:

Given the following minimal example for subfiles.

First the master file.


,----
| 
| \documentclass[12pt]{article}
| 
| \newcommand{\ubcomment}[2][]{%
| \refstepcounter{ubcomment}%
| {%
| \todo[linecolor=black,backgroundcolor={green!40!},size=\footnotesize]{%
| \textbf{Fixme: UB [\uppercase{#1}\theubcomment]:}~#2}%
| }}
| 
| 
| \usepackage{subfiles}
| 
| \begin{document}
| 
| This is the main file.
| 
| \subfile{sec-01-introduction.tex}
| \end{document}
`----

As usual if I use TeX-insert-macro in that file auctex will complete the
name of the macro.

Now to a slave file

,----
| 
| \documentclass[main.tex]{subfiles}
| \begin{document}
| 
| \section{Introduction}
| \label{sec:introduction}
| 
| \end{document}
| 
`----

In that file file  TeX-insert-macro in that file will not work. I could
either insert the definition of that macro, write a private small style
which I insert, or use

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:

In the slave file. But the latter solution which is the most elegant
causes sometimes problems if I run the main.tex file. The problem is if
the master file contains more slave files, then running slave 1 (which
contains the reference to TeX-master will then run master and so defy
the whole idea of the subfiles package.

Therefore: Is it possible without too much hassle that auctex could provide more
support for subfiles and would scan the master file main.tex, just based on
the line
\documentclass[main.tex]{subfiles}???

Uwe Brauer 



reply via email to

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