library(tint)
library(dtkbook)
# invalidate cache when the package version changes
knitr::opts_chunk$set(tidy = FALSE, cache.extra = packageVersion('tint'))
options(htmltools.dir.version = FALSE)

Book markup

I particularly like to create Tufte-style books. The tufte and tint R packages are vergy helpful here, but they don't do everything that's needed.

How is this line formatted?

Another example involves a table like that shown in the margin: r margin_content("Let's say @r knitr::kable(mtcars[1:5, 1:2], format = 'latex', row.names = FALSE)@")

Try out the margin_table() function

Add in something to margin_content and margin_table that will check if there really is a margin_table(). If not, don't use it.

r margin_content("@r exists('margin_table')@")

Can we put this in the margin? Yes in PDF, no in HTML.

r margin_table(mtcars[, 1:2], caption = "Caption for table!", header = 'mtcars', move = 0)



dtkaplan/dtkbook documentation built on May 15, 2019, 4:59 p.m.