Reputation: 475
I have the following question: I am creating an HTML document using RMD and html_document. I use tabset
and tabset-pills
to structure the content. My question now is:
Can I render the same RMD document but do not interprete the tabset
settings?
To provide an example: Can I render this RMD file resulting in the two different outputs below?
---
output: html_document
---
# Headline 1
## Headline 2 {.tabset}
### Headline 3 in a tab
### Headline 4 in a tab
### Headline 5 in a tab
Thanks Stephan
Upvotes: 0
Views: 402
Reputation: 160397
You can use a parameterized document and inline code:
---
title: Hello
output: html_document
params:
intab: TRUE
---
# Headline 1
## Headline 2 `r if (isTRUE(params$intab)) "{.tabset}"`
### Headline 3 in a tab
### Headline 4 in a tab
### Headline 5 in a tab
Rscript.exe -e "rmarkdown::render('62095186.Rmd')" # default
# Rscript.exe -e "rmarkdown::render('62095186.Rmd', params=list(intab=TRUE))" # same
Rscript.exe -e "rmarkdown::render('62095186.Rmd', params=list(intab=FALSE))" # by exception
Upvotes: 3