if (FALSE) {
txt <- "\\section{example}"
tbl <- "\\begin{tabular}{|l|c|r|} 1 & 2 & 3 \\\\ 4 & 5 & 6 \\\\ \\end{tabular}"
add <- "\\\\ Including some additional text"
ltx_doc(c(txt,tbl,add),out=paste0(tempfile(),".tex"),show=FALSE)
# You can use xtable (and any other packages that output tex)
library(xtable)
data(Theoph)
xtbl <- print(xtable(Theoph),tabular.environment="longtable",floating=FALSE,print.results=FALSE)
ltx_doc(xtbl,out=tempfile(fileext = ".tex"))
}
Run the code above in your browser using DataLab