# [R] Sweave, R and complex latex projects

From: Mark Wardle <mark_at_wardle.org>
Date: Sat 14 Oct 2006 - 22:00:27 GMT

I've been able to use R very successfully to run simple statistics and generate the plots I require.

I've been evaluating Sweave, and have hit upon a small problem that I don't seem to be able to workaround. Sweave runs very well for single file latex documents, but I have a complex thesis made up of several parts and chapters. These are arranged with a master latex file and subdirectories with "\include"-ed latex fragments representing those parts/chapters, and I don't seem to be able to get Sweave to work properly.

I've tried a number of approaches, including converting the master document into a Snw file itself, or even generating chapters manually chapter by chapter using Sweave and then "\include"ing the result into the master tex file. Unfortunately for the latter attempt, the the latex generated doesn't prepend the required path to the filename, and so latex looks for the pdfs and tex files in the wrong place - it looks in the "root" directory (where the master tex file is located) rather than the chapter subdirectory where all the files have been generated.

I hope I'm not missing something obviously documented, but I can't see it in the Sweave docs. Is there an option to prepend a pathname to the filename of Sweave generated TeX and PDF documents?

Many thanks,

Mark

```--
Dr. Mark Wardle
Clinical research fellow and Specialist Registrar in Neurology,
C2-B2 link, Cardiff University, Heath Park, CARDIFF, CF14 4XN. UK
email: wardle@cardiff.ac.uk  mark@wardle.org   OpenPGP key: 66896A39

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help