Test ref.label and opts.label

Chunk a

1 + 1
2 + 2

Chunk b

1:10

Setting opts_template

knitr::opts_template$set(
  skip = list(eval = FALSE),
  b = list(results = 'markup', prompt = TRUE)
)

ref.label = 'a'

Ignore chunk options on chunk a:


ref.label = I('a')

Inherit chunk options from chunk a:


ref.label = 'a' and opts.label = TRUE

Inherit chunk options from chunk a:


ref.label = 'a' and opts.label = 'b'

Inherit chunk options from template b and then chunk b:


ref.label = c('b', 'a') and opts.label = TRUE

Inherit chunk options from chunk b (no output) and a (no source), so you see nothing below:


ref.label = I(c('b', 'a'))

Same as the previous section---you see nothing below:


ref.label = I(c('b', 'a')) and echo = TRUE

Inherit chunk options from chunk b (no output) and a (no source), and then override with echo = TRUE:


ref.label = c('b', 'a') and opts.label = 'a'

Inherit code from chunk b and a, and chunk options from chunk a (no source):


ref.label = c('b', 'a') and opts.label = 'skip'

Inherit code from chunk b and a, and chunk options from template skip (no evaluation):


ref.label = I(c('b', 'a')) and opts.label = 'skip'

Inherit code from chunk b and a, and chunk options from template skip (ignore I() in ref.label since opts.label is not empty):




Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on Aug. 21, 2025, 5:27 p.m.