rtlMainFile: ~ Generation of LaTeX main document ~

Description Usage Arguments Details Value Author English correction References See Also Examples

Description

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

Usage

1
r2lMainFile(fileOut = "main.tex",text="\\input{univ.tex}",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.

Details

r2lMainFile generates a LaTeX master file or a Sweave file ready to include some files built by r2lu or r2lb.

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

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

r2lu, r2lb, r2lh-package, examCheating, Sweave, latex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 # # # # # # # # # # # # # # # # # # #
#   R to LaTeX, Main file generation  #
 #             Examples              #
  #           r2lMainFile           #
   # # # # # # # # # # # # # # # # #

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

<<>>=
data(examCheating)
@

\\section{Univariate analysis}

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


\\section{Bivariate analysis}

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

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

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

r2lh documentation built on May 29, 2017, 12:11 p.m.