R markdown doen't work. Problems whit latex route.

Hi! I don't know why, but even the markdown example of r studio doesn't work on my windows.
But latex by itself, works well (outside of R).
Does anyone have an idea? :confused: help please!

processing file: exp.Rmd
  |..........                                                            |  14%
  ordinary text without R code

  |....................                                                  |  29%
label: setup (with options) 
List of 1
 $ include: logi FALSE

  |..............................                                        |  43%
  ordinary text without R code

  |........................................                              |  57%
label: cars
  |..................................................                    |  71%
  ordinary text without R code

  |............................................................          |  86%
label: pressure (with options) 
List of 1
 $ echo: logi FALSE

  |......................................................................| 100%
  ordinary text without R code


"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS exp.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output exp.tex --lua-filter "C:\Users\crudd\OneDrive\Documentos\R\win-library\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\crudd\OneDrive\Documentos\R\win-library\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in" 
output file: exp.knit.md

! Sorry, but C:\Users\crudd\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed.

! The log file hopefully contains the information to get MiKTeX going again:

!   C:\Users\crudd\AppData\Local\MiKTeX\miktex\log\pdflatex.log

Error: LaTeX failed to compile exp.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See exp.log for more info.
Además: Warning message:
In has_crop_tools() : 
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.
Ejecución interrumpida

As your are using MikTeX, it is possible that you are missing a LaTeX package for your document to compile.
tinytex won't be able to automatically install missing package with MikTeX.

It will with TeX Live though which you can get by installing TinyTeX:

This is a portable distribution that works well with R and R Markdown.

If you want to still use MikTeX, you can try to check in MikTeX log if any what package could be missing. Maybe tools like this package can help :man_shrugging:

I would advice to install and use TinyTeX if you could: TinyTeX - A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live - Yihui Xie | 谢益辉

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.