David O'Shaughnessy <[email protected]> writes:

Hi David,

> I have a multi-document structure that is a mixture of .tex and .Rnw
> files. The main file (master.Rnw) calls the child .tex files with;
> \include{file.tex}
>
> and the child .Rnw files (which are knitted) with;
> <<chunk, child='file.Rnw'>>=
> @
>
> I include my biblatex references in master.Rnw with;
> \addbibresource{references.bib}
>
> I compile it all with a Makefile, and it works very smoothly. However,
> I am having trouble getting RefTeX to play nice with this setup.
> There are two problems:
>
> 1) In Emacs, reftex-citation does not recognize my bibliography when
> inside child documents. I can fix this by setting TeX-master to
> "master.tex", but not "master.Rnw", which leads to problem 2
>
> 2) While setting the master document as "master.tex" enables inserting
> citations via reftex-citation in child documents, it breaks reftex-toc
> by sending me into "master.tex" instead of "master.Rnw" (if I select a
> ToC entry from the master file). Then I run the risk of making edits in
> master.tex only to have them overwritten by master.Rnw when I do a
> compile (which knits the contents of master.Rnw to master.tex).
>
> Is there a way to make RefTeX understand that the master file is an
> .Rnw file?

I've just tried doing that by putting the following local variables
section into the included tex files:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "test.Rnw"
%%% TeX-default-extension: "Rnw"
%%% End:

That seems to work although I only tested very briefly.

Bye,
Tassilo


_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to