rstudio / rticles

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

JOSS template error with bookdown #564

Closed mlysy closed 3 months ago

mlysy commented 3 months ago

As explained here, using the joss_article() template with bookdown is to be done by putting the following in the yaml header:

output:
  bookdown::pdf_book:
    base_format: rticles::joss_article

However, this produces an error message which can be reproduced as follows:

bookdown::pdf_book(base_format = rticles::joss_article)
Error in rmarkdown::pdf_document(..., template = template) : 
  formal argument "pandoc_args" matched by multiple actual arguments

It seems that adding a pandoc_args argument to rticles::joss_article() and prepending its value to the function's internal definition of pandoc_args solves the issue. (I've checked that this works, and this is also what rticles::jss_article() does).

Would you like me to submit a PR?

xfun::session_info("rticles")
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.3.1

Locale: en_CA.UTF-8 / en_CA.UTF-8 / en_CA.UTF-8 / C / en_CA.UTF-8 / en_CA.UTF-8

Package version:
  base64enc_0.1.3   bslib_0.6.1       cachem_1.0.8      cli_3.6.2        
  digest_0.6.34     ellipsis_0.3.2    evaluate_0.23     fastmap_1.1.1    
  fontawesome_0.5.2 fs_1.6.3          glue_1.7.0        graphics_4.3.1   
  grDevices_4.3.1   highr_0.10        htmltools_0.5.7   jquerylib_0.1.4  
  jsonlite_1.8.8    knitr_1.45        lifecycle_1.0.4   memoise_2.0.1    
  methods_4.3.1     mime_0.12         R6_2.5.1          rappdirs_0.3.3   
  rlang_1.1.3       rmarkdown_2.26    rticles_0.26.3    sass_0.4.8       
  stats_4.3.1       tinytex_0.49      tools_4.3.1       utils_4.3.1      
  xfun_0.42         yaml_2.3.8       

By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

cderv commented 3 months ago

Thanks you for the report !

You were absolutely right - it was quick enough to fix so I did the change. Thanks.

I'll do CRAN release shortly