Learn R Programming

r2lh (version 0.6.1)

rtlMainFile: ~ Generation of LaTeX main document ~

Description

This function generates a LaTeX main document designed to include some files built by rtlu or rtlb.

Usage

rtlMainFile(fileOut = "main.tex",text="",sweave=FALSE)

Arguments

fileOut
characters; name of the main document.
text
text to be included in the LaTeX document, between the '\begin{document}' and '\end{document}' macros.
sweave
logical; if TRUE, the main document is designed to be compiled with Sweave.

Value

  • A LaTeX or a Sweave file ("main.tex" by default).

Author

Christophe Genolini christophe.genolini@free.fr PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health INSERM U669 / Maison de Solenn / Paris Bernard Desgraupes bernard.desgraupes@u-paris10.fr University of Paris Ouest - Nanterre

English correction

Jean-Marc Chamot jchamot@u-paris10.fr Laboratoire "Sport & Culture" / "Sports & Culture" Laboratory University of Paris 10 / Nanterre

Details

rtlMainFile generates a LaTeX master file or a Sweave file ready to include some files built by rtlu or rtlb.

References

LaTeX web site http://www.latex-project.org/ Data are available on line: http://christophe.genolini.free.fr/EPO/EPO2007-Fraude.php

See Also

rtlu, rtlb, r2lh-package, examCheating, Sweave, latex

Examples

Run this code
# # # # # # # # # # # # # # # # # # #
#   R to LaTeX, Main file generation  #
 #             Examples              #
  #           rtlMainFile           #
   # # # # # # # # # # # # # # # # #

### Creates a Sweave file
text <- "\\maketitle
\\tableofcontents

<<>>=
data(examCheating)
@

\\section{Univariate analysis}

<<>>=
rtlu(examCheating$CheatScore,fileOut='ExamCheat-univ1.tex')
@
\\input{ExamCheat-univ1.tex}


\\section{Bivariate analysis}

<<>>=
#rtlb(examCheating$CheatScore~examCheating$Sexe,fileOut='ExamCheat-biv1.tex')
@
\\input{ExamCheat-biv1.tex}
"

if(!file.exists("example/sweave",recursive=TRUE)){dir.create("example/sweave",recursive=TRUE)}else{}
setwd("example/sweave")

rtlMainFile(fileOut="main.Rnw",text=text,sweave=TRUE)
Sweave("main.Rnw")
setwd("../..")

Run the code above in your browser using DataLab