knitr (version 1.3)

opts_template: Template for creating reusable chunk options

Description

Creates a template binding a label to a set of chunk options. Every chunk that references the template label will have the specificed set of options applied to it.

Usage

opts_template

Arguments

format

List of 4 $ get :function (name, default = FALSE) $ set :function (...) $ merge :function (values) $ restore:function (target = value)

Examples

Run this code
opts_template$set(myfigures = list(fig.height = 4, fig.width = 4))
# later you can reuse these chunk options by 'opts.label', e.g.

# <<foo, opts.label='myfigures'>>=

# the above is equivalent to <<foo, fig.height=4, fig.width=4>>=

Run the code above in your browser using DataCamp Workspace