Hi,

it seems that `quarto` does not read `.Rprofile` file or at least does not activate `renv`.

For example, I had to create `_quarto.yml` with

```yml
project:
  execute-dir: project
```

And add `renv::activate()` in the first R chunk to have access to the project R library (_i.e._, to avoid having to specify the library path for `knitr::write_bib`).

````
---
title: "Methods"
author: "Mickaël Canouil, Ph.D."
date: "The 4th of May, 2022"
bibliography: references.bib
csl: https://raw.githubusercontent.com/citation-style-language/styles/master/apa-6th-edition.csl
format:
  html:
    self-contained: true
reference-location: margin
---

```{r}
renv::activate()
knitr::write_bib(
  x = c("base", "targets", "readxl"),
  file = "articles/references.bib"
)
```

## Methods

All analyses were performed using `r R.version.string` [@R-base] 
and the R package `targets` [@targets2021] for workflow management.
````

The directory looks like this:

```
.
├── .Rprofile
├── _quarto.yml
├── renv
│   ├── .gitignore
│   ├── activate.R
│   ├── library
│   ├── local
│   └── staging
└── articles
    └── methods.qmd
```

I used `quarto v0.9.298`.

Am I missing something ?

2022-05-04T09:20:02Z
mcanouil
closed
`Quarto` is not working well with `renv`
https://github.com/quarto-dev/quarto-cli/issues/794