rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.48k stars 521 forks source link

rticles::joss_article does not work with r chunks and image chunks. #576

Open benyamindsmith opened 3 weeks ago

benyamindsmith commented 3 weeks ago

I am working with rticles to write a JOSS article and it would be nice to preview how the article would look when I am running it.

I have noticed that when specifying output: rticles::joss_article realized that I am unable to knit my .Rmd file to a pdf.

Minimal Example (example.Rmd)

---
title: "Example"
author: "Benjamin Smith"
date: "`r Sys.Date()`"
output:
  rticles::joss_article
---

# Introduction 

`This is some text`

# Some R code

\```{r}
print("This is some R output!")
\```

# An Image

![This is an image!!](https://pkgs.rstudio.com/rticles/logo.png)

Error Code

  |...................................                 |  67% (unnamed-chunk-1)

processing file: example.Rmd

"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS example.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output example.tex --lua-filter "C:\Users\bensmith\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\bensmith\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua" --embed-resources --standalone --template "C:\Users\bensmith\AppData\Local\R\win-library\4.2\rticles\rmarkdown\templates\joss\resources\template.tex" --highlight-style tango --pdf-engine xelatex --variable "logo_path=C:/Users/bensmith/AppData/Local/R/win-library/4.2/rticles/rmarkdown/templates/joss/resources/JOSS-logo.png" --variable "journal_name=Journal of Open Source Software" --variable graphics --variable pandoc3 --variable pandoc317 --variable pandoc318 
output file: example.knit.md

tlmgr.pl: package repository https://muug.ca/mirror/ctan/systems/texlive/tlnet (not verified: pubkey missing)
tlmgr.pl install: package already present: l3backend
tlmgr.pl install: package already present: l3backend-dev
! Undefined control sequence.
l.284 \pandocbounded
                    {\includegraphics[keepaspectratio]{https://pkgs.rstudio.... 

Error: LaTeX failed to compile example.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See example.log for more info.
Execution halted

I did my fair share of looking at issues but none of them seem to point to the root of the problem.

Similar issues:

I do already have tinytex installed so that could not be the issue.

cderv commented 2 weeks ago

This is related to

Templates needs update for a newer Pandoc version, while not breaking older version of Pandoc 😞

I'll come back to this very soon.

benyamindsmith commented 2 weeks ago

@cderv thanks for letting me know. I'm sure other rticles users will encounter the same problem.

The fix that I'm doing now is just using an older version of pandoc (I used 3.1.13 without any issues when using rticles)