tintHtml: Tint Is Not Tufte - A Tufte-Inspired HTML Format

View source: R/html.R

tintHtmlR Documentation

Tint Is Not Tufte – A Tufte-Inspired HTML Format


A template for creating html reports according to the style of Edward R. Tufte and Richard Feynman, but with an updated font choice. The three key functions tintHtml, tintPdf and tintBook offer, respectively, support for html and pdf-based shorter (“article-length” writeups as well as support for longer pdf-based content.




tintPdf(fig_width = 4, fig_height = 2.5, fig_crop = TRUE,
  dev = "pdf", highlight = "tango", citation_package = "natbib",
  latex_engine = "pdflatex", ...)

tintBook(fig_width = 4, fig_height = 2.5, fig_crop = TRUE,
  dev = "pdf", highlight = "tango", citation_package = "natbib",
  latex_engine = "pdflatex", ...)


margin_note(text, icon = "⊕")





Other arguments to be passed to pdf_document or html_document

Note: For tintPdf and tintBook, you can specify a custom template argument to replace the default. You cannot use the theme argument in tintHHtml() because this argument has been set internally.


Default width (in inches) for figures


Default height (in inches) for figures


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


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


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


The LaTeX package to process citations, natbib or biblatex. Use none if neither package is to be used.


LaTeX engine for producing PDF output. Options are "pdflatex", "lualatex", and "xelatex".


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


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)


tintHtml provides the HTML format based on the Tufte CSS https://edwardtufte.github.io/tufte-css/ with fonts set according to https://github.com/nogginfuel/envisioned-css. tintPdf provides a similar PDF format using the same font family and styling applied to the Tufte-LaTeX https://tufte-latex.github.io/tufte-latex/ class. tintBook is a (still somewhat experimental) pdf book variant.

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.


See https://rstudio.github.io/tufte/ for the tufte package this was initially derived from. See https://eddelbuettel.github.io/tint/ for usage examples from this package.

See Also

Custom-templates, YAML-metadata.

tint documentation built on Nov. 2, 2022, 1:06 a.m.