auctex-devel
[Top][All Lists]
Advanced

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

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


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] subfiles, private macros, scan the master file
Date: Mon, 7 Nov 2016 00:34:01 +0100

Hi Uwe,

2016-11-02 9:34 GMT+01:00 Uwe Brauer <address@hidden>:
> 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}???

Sorry, I don't know the subfiles class, so I don't completely
understand what you're asking.  You would like to run the Emacs style
file associated to "main.tex" but not make "main.tex" the
`TeX-master'?  This is possible with a subfiles style files which
takes care of running "main.tex"'s hook (the name of the file is
available in `LaTeX-provided-class-options' variable).

Bye,
Mosè



reply via email to

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