##Example 1
#Read a sample LaTeX file
file<-'connect3-minimal.tex'
filepath<-paste(sub("examples/.*","\\1",
system.file("examples","connect3-minimal.tex",package="connect3")),
"examples", sep='')
obj<-read.latex(file, filepath)
obj
#Convert a LaTeX file to a Rich Text Format file
tex<-obj$tex
path<-obj$path
name<-'connect3-minimal'
outputlocation<-gsub('\\\\','/',tempdir())
write.rtf(tex,path,name,outputlocation)
##Example 2
## Step 1: Download an R Sweave file using 'knitr' from:
## 'https://github.com/yihui/knitr/blob/master/inst/examples/knitr-minimal.Rnw'
## Step 2: Save it as 'knitr-minimal.Rnw' in a folder such: 'C:/Users/Desktop/tmp'.
## Change r code chunck options
## "<<boring-plots, fig.width=4, fig.height=4, out.width='.4\\linewidth'>>="
## to
## "<<boring-plots, fig.width=3, fig.height=3, out.width='.4\\linewidth', dev='png'>>=".
## Step 3: Click Compile PDF in RStudio
## Step 4: Read 'knitr-minimal.tex' file in the folder using function read.latex
# file<-'knitr-minimal.tex'
# filepath<-'C:/Users/Desktop/tmp'
# obj<-read.latex(file, filepath)
# obj
## Step 5: Converts 'knitr-minimal.tex' file to 'knitr-minimal.rtf' file using function write.rtf
# tex<-obj$tex
# path<-obj$path
# name<-'knitr-minimal'
# write.rtf(tex,path,name,outputlocation)
Run the code above in your browser using DataLab