devtools::install_github('nstrayer/tuftesque2')
Replace the output
value in your .Rmd
header with tuftesque2::tuftesque
...
Before:
...
author: "Nick Strayer"
date: "4/25/2019"
output: html_document
---
After:
...
author: "Nick Strayer"
date: "4/25/2019"
output: tuftesque2::tuftesque
---
Text notes:
To do a plain text sidenote just wrap whatever you want in square brackets [...]
followed by curly brackets with .side-note
inside...
Normal text [an insightful sidenote]{.side-note} and some more text...
Arbitrary notes:
If you want to put a plot or other more complicated values in your side-note you simply wrap everything in colon buffers:
::::: {.side-note}
You can even do plots in the side notes!
```{r, echo=FALSE}
library(magrittr)
library(ggplot2)
tibble::tibble( x = rnorm(200) ) %>%
ggplot(aes(x = x)) +
geom_histogram(bins = 100)
```
:::::
Thanks to Félix M., if you want to allow the reader to view a plot without any distraction you can make it lightbox-able. To do this simply add the class
of 'lightbox'
to the chunk generating the plot.
```{r, class = 'lightbox'}
ggplot(data, aes(x = x)) +
geom_histogram(bins = 100)
```
You can even stack these with sidenote plots for even more convenience.
```{r, class = 'side-note lightbox'}
ggplot(data, aes(x = x)) +
geom_histogram(bins = 100)
```
This is under active development, use at your own peril.