tufte_handout: Tufte handout formats (PDF and HTML)

Description Usage Arguments Details References Examples

View source: R/handout.R

Description

Templates for creating handouts according to the style of Edward R. Tufte and Richard Feynman.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
tufte_handout(fig_width = 4, fig_height = 2.5, fig_crop = TRUE, dev = "pdf", 
    highlight = "default", ...)

tufte_book(fig_width = 4, fig_height = 2.5, fig_crop = TRUE, dev = "pdf", 
    highlight = "default", ...)

tufte_html(..., tufte_features = c("fonts", "background", "italics"), 
    tufte_variant = c("default", "envisioned"), margin_references = TRUE)

newthought(text)

margin_note(text, icon = "⊕")

quote_footer(text)

sans_serif(text)

Arguments

fig_width

Default width (in inches) for figures

fig_height

Default width (in inches) for figures

fig_crop

TRUE to automatically apply the pdfcrop utility (if available) to pdf figures

dev

Graphics device to use for figure output (defaults to pdf)

highlight

Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", and "haddock". Pass NULL to prevent syntax highlighting.

...

Other arguments to be passed to pdf_document or html_document (note you cannot use the template argument in tufte_handout or the theme argument in tufte_html(); these arguments have been set internally)

tufte_features

A character vector of style features to enable: fonts stands for the et-book fonts in the tufte-css project, background means the lightyellow background color of the page, and italics means whether to use italics for the headers. You can enable a subset of these features, or just disable all of them by NULL. When this argument is not used and the tufte_variant argument is not default, no features are enabled.

tufte_variant

A variant of the Tufte style. Currently supported styles are default (from the tufte-css project), and envisioned (inspired by the project Envisioned CSS http://nogginfuel.com/envisioned-css/ but essentially just sets the font family to Roboto Condensed, and changed the background/foregroudn colors).

margin_references

Whether to place citations in margin notes.

text

A character string to be presented as a “new thought” (using small caps), or a margin note, or a footer of a quote

icon

A character string to indicate there is a hidden margin note when the page width is too narrow (by default it is a circled plus sign)

Details

tufte_handout() provides the PDF format based on the Tufte-LaTeX class: https://tufte-latex.github.io/tufte-latex/.

tufte_html() provides the HTML format based on the Tufte CSS: https://edwardtufte.github.io/tufte-css/.

newthought() can be used in inline R expressions in R Markdown (e.g. `r newthought(Some text)`), and it works for both HTML (<span class="newthought">text</span>) and PDF (\newthought{text}) output.

margin_note() can be used in inline R expressions to write a margin note (like a sidenote but not numbered).

quote_footer() formats text as the footer of a quote. It puts text in <footer></footer> for HTML output, and after \hfill for LaTeX output (to right-align text).

sans_serif() applies sans-serif fonts to text.

References

See http://rstudio.github.io/tufte for an example.

Examples

1
2
library(tufte)
newthought("In this section")

rstudio/tufte documentation built on July 30, 2018, 10:15 p.m.