quarto-dev / quarto-dev/quarto-cli

Document unsupported knitr chunk options

Aperta
#3,371 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@cwickham ci sta già lavorando.

Dal 22/3/2023.

documentation lint
Lingua principale
JavaScript
Stelle
6k
Fork
458
Merge medio
1g 9h
PR unite (30g)
41

Descrizione

Where should we set knitr chunk options in YAML? The original proposal from Max was:

format:
  html:
    fig-width: 6
    fig-height: 4.25
    fig-align: center

or

knitr:
  opts_chunk:
    fig-width: 6
    fig-height: 4.25
    fig-align: center

More comments from him:

Any recommendation? Are there certain options that should go in one place or another?

Also, I have the equivalent of _common.R. I’d like to specific device settings there using knitr::opts_chunk$set(blah blah blah)
Does that work too? I’d use this to alter options based on the target format (i.e. HTML versus LaTeX).

It looks like dev shouldn't be set in _quarto.yml (and is silently ignored). I set dev: svg for HTML format and it tried to use png.

My understanding is that some of them can be set under execute in the YAML: https://quarto.org/docs/reference/formats/html.html#execution.

And some under knitr: https://quarto.org/docs/reference/cells/cells-knitr.html

And I think instead of dev it's fig-format?
I'm also curious about the "right" answer to this.
And I'm fairly certain you can use knitr::opts_chunk$set(blah blah blah).

I (@allenmanning) answered:

you can use the R code version. also yes its fig-format. The format: html is for universally supported quarto options (i.e. stuff that works in jupyter and knitr). we've attempted to support as much as possible in both but knitr still has a lot of things that jupyter doesn't (thus the opts_chunk failsafe). So I'd say that the correct/recommended approach is to use the universal options (fig-format, execute: echo, etc.) and then only use the opts_chunk for things that are unsupported with the normal syntax

Is there a list of the unsupported options?

we don't currently

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.