Pakillo / grateful

Facilitate citation of R packages
https://pakillo.github.io/grateful/
Other
229 stars 18 forks source link

Some citations not rendering properly. #53

Closed jkylearmstrong closed 4 weeks ago

jkylearmstrong commented 1 month ago

Hi there, might be related to a previously reported issue https://github.com/Pakillo/grateful/issues/44 but some citations are again not rendering correctly, in particular, I notice that future is having issues again, but I don't think it's the exact same situation we were in last time. I am using grateful Version: 0.2.10 from CRAN.

image

Pakillo commented 1 month ago

Hi @jkylearmstrong,

Many thanks for reporting. I can't reproduce this problem (see example below). Can you check if those references (e.g. partykit2006) are saved in the BibTeX file (grateful-refs.bib by default)? It looks as if it can't find those references in the BibTeX file when rendering (but can find others).

---
title: "example"
bibliography:
  - grateful-refs.bib
format: pdf
---

```{r}
library('survival')
library('future')
grateful::cite_packages(output = "paragraph",
                        out.dir = here::here(),
                        passive.voice = TRUE)
sessionInfo()


[test.pdf](https://github.com/user-attachments/files/17544966/test.pdf)
jkylearmstrong commented 4 weeks ago

Scratch, that, the mistake was mine. I had

grateful::cite_packages(output = "paragraph",
                        out.dir = here::here(),
                        omit = NULL,
                        include.RStudio = F,
                        passive.voice = T)

and unless the document is in the main directory of the RProject, the former will not work whereas, this will always print out relative to the document's rendering path:

grateful::cite_packages(output = "paragraph",
                        out.dir = getwd(),
                        omit = NULL,
                        include.RStudio = F,
                        passive.voice = T)

I just moved some files around and this didn't occur to me until I actually looked at the code.

Thanks!

Pakillo commented 4 weeks ago

Ah yes, getwd() is recommended for out.dir. It was the default, but had to remove it to comply with CRAN policies. Thanks for the follow up, and glad it works!

Cheers