0

I have been trying to render a pdf document from an R markdown file. I've installed/uninstalled the miktex installation multiple times all to no avail. I get the following error message:

C:\Users\myusername\AppData\Local\MiKTeX\miktex\log\pdflatex.log

Error: LaTeX failed to compile testing_pdf_render.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See testing_pdf_render.log for more info.

Are there other alternatives for getting the PDF report from an R markdown document? No matter what I've tried LaTeX fails to compile for me.

Diego
  • 392
  • 3
  • 16
  • If you can use a chromium based browser, you can try `pagedown`. – RLesur Mar 15 '21 at 20:08
  • The error message seems to indicate that latex is installed properly, there's just a problem with your input file. Have you tried the minimal example markdown file? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Mar 15 '21 at 20:18
  • I am literally just trying this out with the RMarkdown sample file that you create in the begining. It's the one that you get when all you do is open the Rmarkdown file and give it a title. – Diego Mar 15 '21 at 20:26
  • one issue that I had in the past is I didn't install the complete miktex file so make sure you downloaded the full miktex and not just the base version – Mike Mar 15 '21 at 20:29
  • @Mike where did you download from? I got this one basic-miktex-21.2-x64.exe. – Diego Mar 15 '21 at 20:50
  • here is the link that will take you to that full install https://miktex.org/howto/download-miktex-2-9, the complete install is called MiKTeX Net Installer, I would uninstall the basic and then install the full version. – Mike Mar 16 '21 at 13:04

1 Answers1

0

One alternative for getting PDFs reports from an R markdown documents is the tinytex package. From the R Markdown Definitive Guide:

TinyTeX is a lightweight, portable, cross-platform, and easy-to-maintain LaTeX distribution. The R companion package tinytex (Xie 2020e) can help you automatically install missing LaTeX packages when compiling LaTeX or R Markdown documents to PDF, and also ensures a LaTeX document is compiled for the correct number of times to resolve all cross-references.

You can give it a try by typing:

install.packages("tinytex")
tinytex::install_tinytex() 

More details here and here

canovasjm
  • 501
  • 1
  • 3
  • 11