Skip to content
Discussion options

You must be logged in to vote

I can't see how to set up the global variables fig.path and out.width like I would with Rmd

First thing is that you can still use the same setup chunk as you have in R Markdown. It should just work without any transformation. Knitr option can be set this way.

Example
---
format: gfm
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "docs/source/_static/README-",
  out.width = "100%"
)
```

# Readme

```{r}
1 + 1
```

A figure

```{r}
plot(cars)
```

Regarding a more Quarto way for this, you can set global knitr option in YAML now - see https://quarto.org/docs/computations/execution-options.html#knitr-options

Example
---
format: 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danielvartan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants