nhsengland / nhs-r-reporting

A repository to share code, good practice, resources, and knowledge about using R across NHS England.
https://nhsengland.github.io/nhs-r-reporting/
MIT License
27 stars 6 forks source link

Rendering/Knitting to PDF #24

Open samjee410 opened 1 year ago

samjee410 commented 1 year ago

I've moved to using Rmarkdown and trying Quarto as well. I quickly ran into the issue of not being able to render/knit to PDF or Word. If you have issues you could try installing this in R:

tinytex::install_tinytex(version = "latest") (further info relating to this here - https://github.com/rstudio/tinytex/issues/326

I had error messages such as:

In Quarto

No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/

In Rmarkdown

Error: LaTeX failed to compile test-knit.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  '"pdflatex"' not found
Execution halted
No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/

I have of course viewed online searches for help, and tried the install of TinyText and running it before rendering to PDF/Word, but without luck. It's as though the latex package is not available for rendering to PDF/Word. Anyone face or overcome these issues ?

craig-shenton commented 1 year ago

You might have to install using quarto, rather than as an R package:

quarto install tinytex