rjournal / rjtools

Tools for AUTHORS to use for checking and submitting articles to the R Journal
https://rjournal.github.io/rjtools/
Other
31 stars 14 forks source link

The template Rmd file doesn't run #128

Open kangy10 opened 5 days ago

kangy10 commented 5 days ago

Following the journal instruction, I did the following

library(rjtools) create_article(name = "quokka-bilby")

Then I knit the quokka-bilby.Rmd in RStudio. This is what I get.

Standard error: processing file: quokka-bilby.Rmd output file: quokka-bilby.knit.md

! Undefined control sequence. l.72 \pandocbounded {\includegraphics[keepaspectratio]{quokka-bilby_files/fig...

Backtrace:

  1. rmarkdown::render("/home/yicheng/Dropbox/Research/dripRpkg/rj/tmp2/quokka-…
  2. output_format$on_exit()
  3. local overlay()
  4. callr::r(function(input) { …
  5. callr:::get_result(output = out, options)
  6. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))

    Subprocess backtrace:

    1. rmarkdown::render(input, output_format = "rjtools::rjournal_pdf_article")
    2. output_format$post_processor(front_matter, input, output_file, …
    3. tinytex::latexmk("RJwrapper.tex", fmt$pandoc$latex_engine, pdf_file = xfun…
    4. tinytex:::latexmk_emu(file, engine, bib_engine, engine_args, min_times, …
    5. local run_engine()
    6. tinytex:::system2_quiet(engine, c("-halt-on-error", "-interaction=batchmode", …
    7. local on_error()
    8. tinytex:::show_latex_error(file, logfile)
    9. base::stop(e, " See ", logfile, " for more info.", call. = FALSE)
  7. | base::.handleSimpleError(function (e) …
  8. global h(simpleError(msg, call)) Execution halted
dicook commented 5 days ago

Hi @kangy10, There is a proble with the current version of pandoc. The workaround is to use these lines in the yaml:

output: 
  rjtools::rjournal_pdf_article:
    toc: no
  rjtools::rjournal_web_article:
    self_contained: yes
    toc: no

The sample article has been updated with this. Then to render teh article, you need to work from the R console, and run:

pandoc::pandoc_activate(version = '3.1.6')
rmarkdown::render("quokka-bilby.Rmd", output_format = "all")

Then both the html and the pdf will be rendered correctly.