crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
654 stars 133 forks source link

Pandoc error knitting to #535

Closed maia-sh closed 1 year ago

maia-sh commented 2 years ago

I am trying to reproduce an an analysis knit to papaja::apa6_pdf. The repo is https://github.com/maia-sh/reg-pub-link and should be reproducible by cloning and restoring with renv. I finished the project around September 2021 at which point I was able to reproduce on other machines as well. I also was able to rerun this several months ago, so I'm wondering whether the bug appeared in the last few months.

Error/bug description

In short, when I knit manuscript.Rmd, it successfully creates the .md and fails with pandoc.

Here is the error message:

output file: manuscript.knit.md

Error running filter /Users/USER/Library/Application Support/renv/cache/v5/R-4.2/x86_64-apple-darwin17.0/rmdfiltr/0.1.3/d2e1277195d221e6118d8a77dda2e877/rmdfiltr/replace_ampersands.lua:
...95d221e6118d8a77dda2e877/rmdfiltr/replace_ampersands.lua:13: attempt to index a nil value (field 'c')
stack traceback:
Error: pandoc document conversion failed with error 83
Execution halted

To reproduce

Instructions in the README at https://github.com/maia-sh/reg-pub-link

What I've tried

I tried to do a fresh cloning of the repo and got the same error. I tried to update all packages, R, RStudio and got the same error.

I looked through documentation: https://cran.r-project.org/web/packages/rmdfiltr/vignettes/replace_ampersands.html

I looked at the following discussions/issues: https://github.com/crsh/papaja/issues/427 https://stackoverflow.com/questions/36826916/pandoc-citeproc-error-83-with-rmarkdown-file https://github.com/jgm/pandoc/issues/3411 https://community.rstudio.com/t/pandoc-document-conversion-failed-with-error-83/138962/4

...And unfortunately am still stuck!

Many thanks for your help!

crsh commented 2 years ago

Hey there, thanks for reaching out. I think this might be related to https://github.com/crsh/rmdfiltr/issues/11 and https://github.com/crsh/rmdfiltr/issues/9. Is it possible that you updated your RStudio/pandoc in the meantime? I'm afraid renv won't protect against errors caused by incompatibilities between pandoc and Lua-filters provided in R packages. This would require a container or virtual machine, I guess.

Anyway, there's a suggested fix in this PR: https://github.com/crsh/rmdfiltr/pull/12

You can try installing rmdfiltr from that branch (remotes::install_github("crsh/rmdfiltr@crsh/issue11")). Let me know if that resolves the issue for you.

github-actions[bot] commented 1 year ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.