[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] RefTeX + knitr: Multi-document with master *.Rnw file
From: |
David O'Shaughnessy |
Subject: |
Re: [AUCTeX] RefTeX + knitr: Multi-document with master *.Rnw file |
Date: |
Mon, 19 Oct 2015 12:24:46 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Hi Tassilo,
On 14/10/15 18:36, Tassilo Horn wrote:
> David O'Shaughnessy <address@hidden> writes:
>
> Hi David,
>
>>>> 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.
>>
>> 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)?
>
> Maybe, but I only tested very briefly. I have never used knitr and just
> made up some test files. Do you have some minimal sample files I could
> use for testing?
Attached is an archive with a working example. The structure is:
master.Rnw
-> ./chapter1.tex
-> ./chapter2.Rnw
-> ./chapter3.tex
refs.bib
I've run it through knitr and compiled it with xelatex (see master.pdf),
so you can just open master.Rnw with emacs and test out reftex-toc and
reftex-citation.
Hopefully this is useful,
Dave.
rnw_example.tar.gz
Description: GNU Zip compressed data