knitr::opts_chunk$set(echo = TRUE,  dev = "cairo_pdf")

Purpose

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()

Tisa Sans Pro

ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  labs(title="Tisa Sans Pro", subtitle="This is a subtitle") +
  theme_premium()

Roboto Condensed

ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  labs(title="Roboto Condensed", subtitle="This is a subtitle") +
  theme_premium_rc()


dungates/DGThemes documentation built on Dec. 20, 2021, 2:14 a.m.