The R package "stationery" offers themes and templates for 8 document types. It offers working examples of documents that use R markdown and LaTeX/Sweave and LaTeX/knitr to prepare guides, slides, and reports.
The 8 document types are
- HTML webpages prepared with Rmarkdown
- PDF guide documents prepared with Rmarkdown
- PDF report documents prepared with Rmarkdown
- PDF guide documents prepared with LaTeX/NoWeb using the knitr code chunk engine
- PDF guide documents prepared with LaTeX/NoWeb using the Sweave code chunk engine
- PDF report documents prepared with LaTeX/NoWeb using the knitr code chunk engine
- PDF report documents prepared with LaTeX/NoWeb using the Sweave code chunk engine
- PDF slides prepared with a KU customized Beamer slide template and the Sweave code chunk engine.
At the current time, the customization and integration of the Sweave code chunk engine with our document types is considerably further along. The knitr chunk engine documents are much more difficult to customize and we are currently in a default state with them.
Today we have uploaded the first version for general testing, numbered 0.71. To install in R, run the following.
CRAN <-"http://rweb.crmda.ku.edu/cran" KRAN <-"http://rweb.crmda.ku.edu/kran" options(repos =c(KRAN,CRAN)) install.packages("stationery", dep=TRUE, type="source")
After the signature, see the R session that proves this really will work.
Right now, all 8 of the document types can be initiated by the function we provide called "initWriteup". To create a new template folder, it is as simple as running
That will create a directory "writeup/rnw2pdf-slides-sweave". The first time you compile the document, it will create a folder named "theme" and copy some template files and logos into that folder. After that, if you want to replace the logos with your own pictures, or customize the templates, it will be quite obvious how to do so.
The vignettes directory right now has several instruction sheets that are nearing a presentable state. The vignettes "Rmarkdown", "code_chunks", and "HTML_special_features" are readable for humans, if not prize winning. The document-type-specific vignettes are going to undergo clarification this weekend.
Among those document specific guides listed here, the asterixed writeups are most complete:
instructions-rmd2pdf-guide.pdf instructions-rmd2pdf-report.pdf instructions-rnw2pdf-guide-knit.pdf (*) instructions-rnw2pdf-guide-sweave.pdf instructions-rnw2pdf-report-knit.pdf (*) instructions-rnw2pdf-report-sweave.pdf instructions-rnw2pdf-slides-sweave.pdf
> CRAN <-"http://rweb.crmda.ku.edu/cran" > KRAN <-"http://rweb.crmda.ku.edu/kran" > options(repos =c(KRAN,CRAN)) > install.packages("stationery", dep=TRUE, type="source") Installing package into ‘/home/pauljohn/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) trying URL 'http://rweb.crmda.ku.edu/kran/src/contrib/stationery_0.71.tar.gz' Content type 'application/x-gzip' length 6786069 bytes (6.5 MB) ================================================== downloaded 6.5 MB * installing *source* package ‘stationery’ ... ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ‘HTML_special_features.Rmd’ using ‘UTF-8’ ‘Rmarkdown.Rmd’ using ‘UTF-8’ ‘code_chunks.Rmd’ using ‘UTF-8’ ‘instructions-rmd2pdf-guide.Rmd’ using ‘UTF-8’ ‘instructions-rmd2pdf-report.Rmd’ using ‘UTF-8’ ‘instructions-rnw2pdf-guide-knit.Rnw’ using ‘UTF-8’ ‘instructions-rnw2pdf-report-knit.Rnw’ using ‘UTF-8’ ‘instructions-rnw2pdf-guide-sweave.Rnw’ using ‘UTF-8’ ‘instructions-rnw2pdf-report-sweave.Rnw’ using ‘UTF-8’ ‘instructions-rnw2pdf-slides-sweave.Rnw’ using ‘UTF-8’ ‘stationery.Rnw’ using ‘UTF-8’ ** testing if installed package can be loaded * DONE (stationery) The downloaded source packages are in ‘/tmp/Rtmpc2b9sK/downloaded_packages’