Lillian Welsh
Lillian Welsh

Reputation: 39

knit pdf in rmarkdown: LaTeX installation

I have an rmd file in RStudio that I've successfully knitted as html, but pdf is required. When I changed the output to pdf, I got a 'No LaTeX installation detected' error so I ran

install.packages('tinytex')
tinytex::install_tinytex(force=TRUE)

as instructed in the error text (below)

When I click Knit, the rendering always stalls at the same percent (ran the chunk- it's fine) and when I ultimately stop the rendering, it gives me the same error.

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/

  If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()

  Otherwise consider MiKTeX on Windows - http://miktex.org

Tinytex is checked off in the Packages window as installed.

If I run install again, I get:

Warning in install.packages :
  package ‘tinytex’ is in use and will not be installed

Is there something else I'm supposed to do to knit to pdf?

This is what I've got in the YAML header:

date: "`r Sys.Date()`"
output: 
  pdf_document:
    toc: true
    fig_caption: true
    df_print: kable

Upvotes: 0

Views: 2475

Answers (1)

Lillian Welsh
Lillian Welsh

Reputation: 39

Not a solution, but an answer nonetheless. I watched a youtube video by Shainu who suggests knitting to word and then just saving it as a pdf. That way, there's no need to mess with LaTeX. That workaround serves my purposes. It's also easier to save styles that way.

Upvotes: 0

Related Questions