Christopher W. Ryan
2009-Jan-27 17:48 UTC
[R] using Sweave with a master file that has several iputted .tex files
Suppose I have a Master.Rnw file that looks something like this: \documentclass[12pt]{mypaper} \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{url} \usepackage{indentfirst} \usepackage{fancyhdr} \usepackage{Sweave} \pagestyle{fancy} \lhead{sonographic rectal diameter and ADHD} \rhead{ } \usepackage{abbrevs} %\usepackage{natbib} %\usepackage{apacite} \bibliographystyle{StandardMedicalJournal} %\bibpunct{}{}{,}{}{}{} \usepackage{multirow} \usepackage{outlines} \begin{document} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/SpecificAims} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/BackgroundAndSignificance} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/PreliminaryStudies} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/ResearchDesignAndMethods} ...abbrevieated... \end{document} Some of the inputted files contain R code, enclosed in <<chunkname>>and @. Several of them don't contain any R code. Can I compile the whole document with Sweave("Master.Rnw") ? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ "If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea." [Antoine de St. Exupery]
JLucke at ria.buffalo.edu
2009-Jan-27 17:53 UTC
[R] using Sweave with a master file that has several iputted .tex files
Use the "include" function in LaTeX. "Christopher W. Ryan" <cryan@binghamton.edu> Sent by: r-help-bounces@r-project.org 01/27/2009 12:48 PM To r-help@stat.math.ethz.ch cc Subject [R] using Sweave with a master file that has several iputted .tex files Suppose I have a Master.Rnw file that looks something like this: \documentclass[12pt]{mypaper} \usepackage[margin=1in]{geometry} \usepackage{setspace} \usepackage{url} \usepackage{indentfirst} \usepackage{fancyhdr} \usepackage{Sweave} \pagestyle{fancy} \lhead{sonographic rectal diameter and ADHD} \rhead{ } \usepackage{abbrevs} %\usepackage{natbib} %\usepackage{apacite} \bibliographystyle{StandardMedicalJournal} %\bibpunct{}{}{,}{}{}{} \usepackage{multirow} \usepackage{outlines} \begin{document} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/SpecificAims} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/BackgroundAndSignificance} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/PreliminaryStudies} \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/ResearchDesignAndMethods} ...abbrevieated... \end{document} Some of the inputted files contain R code, enclosed in <<chunkname>>and @. Several of them don't contain any R code. Can I compile the whole document with Sweave("Master.Rnw") ? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ "If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea." [Antoine de St. Exupery] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
Duncan Murdoch
2009-Jan-27 18:04 UTC
[R] using Sweave with a master file that has several iputted .tex files
On 1/27/2009 12:48 PM, Christopher W. Ryan wrote:> Suppose I have a Master.Rnw file that looks something like this: > > > \documentclass[12pt]{mypaper} > \usepackage[margin=1in]{geometry} > \usepackage{setspace} > \usepackage{url} > \usepackage{indentfirst} > \usepackage{fancyhdr} > \usepackage{Sweave} > \pagestyle{fancy} > \lhead{sonographic rectal diameter and ADHD} > \rhead{ } > \usepackage{abbrevs} > %\usepackage{natbib} > %\usepackage{apacite} > \bibliographystyle{StandardMedicalJournal} > %\bibpunct{}{}{,}{}{}{} > > \usepackage{multirow} > \usepackage{outlines} > > \begin{document} > > \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/SpecificAims} > > \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/BackgroundAndSignificance} > > \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/PreliminaryStudies} > > \input{C:/DATA/SCHOLAR/ADHDConstipation/SonographicStudy/PAR06180/ResearchDesignAndMethods} > > ...abbrevieated... > > \end{document} > > Some of the inputted files contain R code, enclosed in <<chunkname>>> and @. Several of them don't contain any R code. > > Can I compile the whole document with Sweave("Master.Rnw") ?No, it will only process the file you give it. There are various "makefiles" around that handle dependencies, running Sweave on each changed Rnw file before running latex on the master file. For example, see http://tolstoy.newcastle.edu.au/R/e2/help/06/11/4891.html (which I haven't tried, I just googled for Sweave makefile). Duncan Murdoch