Wish: a way to define "presets" for chunk options for use in long documents / books #11751
gavinsimpson
started this conversation in
Feature Requests
Replies: 1 comment
-
There is indeed no cross engine way in Quarto yet to do that. Only thing close to this are
If you are working with R documents using knitr engine, then you could leverage the knitr's feature. I am thinking of This is a way to define options set, and named them. Then they can be used using ---
title: "TEST"
format: html
---
```{r}
#| label: setup
#| include: false
knitr::opts_template$set(
fullwidth = list(
fig.width = 10, fig.height = 6, fig.retina = 2, out.width = '100%'
)
)
```
```{r}
#| opts-label: fullwidth
plot(cars)
```
We could add What you describe is more generic and is a way to do generalize the knitr opts_template feature. Could be interesting but limited to common cell option across engine. 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When writing longer documents (i.e. presentations for lectures, papers, books, …) I often find myself writing the same few sets of chunk options over and over again. For example:
echo: false
andoutput: false
andmessage: false
etcfig-width
andfig-height
defined for document figures containing a single full-width plot or for a row of two plots, etcWhile one can set a single set of chunk defaults per output format, flexibility beyond that is (as far as I can tell) not possible. I would like to propose that it be possible that classes of chunks be defined in the YAML header or
_quarto.yml
, and subsequently applied to individual chunks via the chunk optionclass
. I.e. something likethen
or
It would be nice to be able to inherit options, for example:
Beta Was this translation helpful? Give feedback.
All reactions