Reputation: 1166
How can I set the Ubuntu family font for this .html Markdown document, including graphics, in RStudio?
---
title: "Untitled"
author: "Me"
date: "23/10/2014"
output: html_document
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Upvotes: 0
Views: 381
Reputation: 8822
For the document as a whole, the easiest approach is to use the built-in united
theme, which is based on Ubuntu fonts. Replace output: html_document
with this:
output:
html_document:
theme: united
R Markdown doesn't control the fonts used inside graphics objects, so you'll need to check the docs for your plotting library of choice to do that (here's a guide for base R).
Upvotes: 1