Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The template Rmd file doesn't run #128

Open
kangy10 opened this issue Nov 23, 2024 · 1 comment
Open

The template Rmd file doesn't run #128

kangy10 opened this issue Nov 23, 2024 · 1 comment

Comments

@kangy10
Copy link

kangy10 commented Nov 23, 2024

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)
  10. | base::.handleSimpleError(function (e) …
  11. global h(simpleError(msg, call))
    Execution halted
@dicook
Copy link
Collaborator

dicook commented Nov 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants