On 12/10/15 22:31, Tassilo Horn wrote: > David O'Shaughnessy <david.oshaughne...@my.jcu.edu.au> 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
For some reason that doesn't work for me. reftex-toc is only aware of the entire multi-document structure if I use; %%% Local Variables: %%% mode: latex %%% TeX-master: "master.tex" %%% TeX-default-extension: "tex" %%% End: whereas; %%% Local Variables: %%% mode: latex %%% TeX-master: "master.Rnw" %%% TeX-default-extension: "Rnw" %%% End: leaves reftex-toc only showing the structure for whatever child document is in the buffer. Maybe my Emacs is too old (24.3.1)? Although I have fixed my referencing problem by setting reftex-default-bibliography in ~/.emacs (not ideal but it works for now). The other thing regarding reftex-toc is the inclusion of Rnw parts via knitr; <<chunk-name, child='child.Rnw'>>= @ It seems to me that reftex-toc is unaware of these inserts. Is there a way to bring these inserts into the reftex ToC list? Thanks, Dave. _______________________________________________ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex