knitr::opts_chunk$set(echo = TRUE, dev = "cairo_pdf")
The purpose of this template is to show what you need to do in order to use Tisa Sans Pro or Roboto Condensed in PDF output documents.
The main consideration is the use of Cairo
and --- specifically -- the cairo_pdf
output device. It is best to set that in the knit
chunk defaults (as seen in
the setup
block) but you can also do that in the individual chunks as has also been
demonstrated in the "Roboto Condensed" chunk.
Make sure to include the library calls as they are here.
library(DGThemes) library(ggplot2) library(Cairo) library(extrafont) extrafont::loadfonts()
ggplot(mtcars, aes(wt, mpg)) + geom_point() + labs(title="Tisa Sans Pro", subtitle="This is a subtitle") + theme_premium()
ggplot(mtcars, aes(wt, mpg)) + geom_point() + labs(title="Roboto Condensed", subtitle="This is a subtitle") + theme_premium_rc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.