auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Subfiles package and reftex


From: Colin Baxter
Subject: Re: [AUCTeX] Subfiles package and reftex
Date: Tue, 27 Dec 2016 07:54:31 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

On Mon, Dec 26 2016, Mosè Giordano wrote:

> Hi Edgar,
>
> 2016-12-26 5:14 GMT+01:00  <address@hidden>:
>> Hi there,
>>
>> I would like to know if there is a way to
>> (1) set a master file (Master.tex) which includes other files (\input,
>> \subfiles, \include or any other) with relative paths
>> (2) those other files (header.tex, File1.tex, File2.tex...) have labels (as
>> in \label{fig:NicePicture})
>> (3) set a cross-reference between those labels (File1.tex has
>> \label{fig:NicePicture} somewhere, and File2.tex has \cref{fig:NicePicture})
>> (4) set a bunch of styles (\usepackage, \newcommand, etc.) in one of the
>> external files (header.tex, for instance)
>> (5) use RefTeX to create those cross-references.
>>
>> Say, something like this:
>> |-Master.tex
>> |-preamble.tex
>> |-File1.tex
>> |-File2.tex
>>
>> But sometimes, I want to see how File2.tex looks like as a PDF before
>> compiling the whole thing. So, I set \usepackage{subfiles} in preamble.tex
>> and load it at the top of Master.tex with \input{preamble.tex}. This loads
>> all my \newcommand, styles and package options when I run pdflatex. However,
>> I am unable to use RefTeX between File1.tex and File2.tex. I have set the
>> %%% TeX-master: "Methods" at the bottom of File1.tex and File2.tex.
>
> "Methods"?  Did you "Master"?
>
> Anyway, a few hours ago was installed in AUCTeX a new patch that
> should improve your workflow with this package.  For example, this is
> my master file:
>
> \documentclass{article}
> \usepackage{subfiles,amsmath}
> \begin{document}
> hello world!
> \begin{equation}
>   \label{eq:1}
>   a + b = c
> \end{equation}
> \subfile{file1.tex}
> \end{document}
>
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% End:
>
>
> and this is my file1.tex file:
>
> \documentclass[master.tex]{subfiles}
>
> \begin{document}
> Equation~\eqref{eq:1}
> \end{document}
>
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% End:
>
> Inside file1.tex, now I can insert with RefTeX a reference defined in
> another file (like what I did to insert the reference to "eq:1"
> label).  Is this what you would like?
>
> Bye,
> Mosè
>


Hi,

How is this any advantage over simply using \include(file1}? I must be
missing something here.

Colin.



reply via email to

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