This is my first time trying to use r and RStudio to generate a report. When I use RStudio and the knitr button to create the document in html format the process finishes fine, with no errors. But when I try the same to make the document .pdf the errors occur.
To create a .pdf document from a rmarkdown file I have installed rmarkdown, knitr, tinytex, I have also installed TinyTeX (from R with tinytex) and PANDOC, the error when executing tinytex :: pdflatex ('test.tex')
is the following:
> tinytex::pdflatex('test.tex')
Sorry, no translations available for es_ES (nor es); falling back to English.
Make sure that you have the package "texlive-msg-translations" installed.
(If you'd like to help translate the installer's messages, please see
https://tug.org/texlive/doc.html#install-tl-xlate for information.)
tlmgr update --all --self
warning: kpathsea: configuration file texmf.cnf not found in these directories: ...
Sorry, no translations available for es_ES (nor es); falling back to English.
Make sure that you have the package "texlive-msg-translations" installed.
(If you'd like to help translate the installer's messages, please see
https://tug.org/texlive/doc.html#install-tl-xlate for information.)
tlmgr.pl: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr.pl install: package already present: kpathsea
Sorry, no translations available for es_ES (nor es); falling back to English.
Make sure that you have the package "texlive-msg-translations" installed.
(If you'd like to help translate the installer's messages, please see
https://tug.org/texlive/doc.html#install-tl-xlate for information.)
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ...
! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ...
! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
Error: LaTeX failed to compile test.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See test.log for more info.
Además: Warning messages:
1: In xfun::read_utf8(f2) :
The file C:\Users\JOSCAR~1\AppData\Local\Temp\RtmpKW4Z5j\stderr1f3c1e9738a0 is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 1, 3, 7, 8
2: In xfun::read_utf8(f2) :
The file C:\Users\JOSCAR~1\AppData\Local\Temp\RtmpKW4Z5j\stderr1f3c1d92194c is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 1, 3, 7, 8
> tinytex::xelatex('test.tex')
UPGRADE 1
Running from RStudio knitr / knitr to PDF, a .log file is generated
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ...
! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ... ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
UPGRADE 2
Running with rmarkdown::render("esfuerzo local social EELL.rmd", "pdf_document"), identical result with the same content of the .log file.
additionally, I show the traceback result
Error: LaTeX failed to compile esfuerzo-local-social-EELL.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See esfuerzo-local-social-EELL.log for more info.
12. stop(e, " See ", logfile, " for more info.", call. = FALSE)
11. show_latex_error(file, logfile)
10. on_error()
9. system2_quiet(engine, c("-halt-on-error", "-interaction=batchmode", engine_args, shQuote(file)), error = { if (install_packages) tlmgr_update(run_fmtutil = FALSE, .quiet = TRUE) ...
8. run_engine()
7. on_error()
6. system2_quiet(engine, c("-halt-on-error", "-interaction=batchmode", engine_args, shQuote(file)), error = { if (install_packages) tlmgr_update(run_fmtutil = FALSE, .quiet = TRUE) ...
5. run_engine()
4. latexmk_emu(file, engine, bib_engine, engine_args, min_times, max_times, install_packages, clean)
3. tinytex::latexmk(file, engine, if (biblatex) "biber" else "bibtex")
2. latexmk(texfile, output_format$pandoc$latex_engine, "--biblatex" %in% output_format$pandoc$args)
1. rmarkdown::render("esfuerzo local social EELL.rmd", "pdf_document")
R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
UPGRADE 3
Generating a basic document with RStudio file/new file/R Markdown and knitr/knitr to PDF button the error is the same, here the .log file
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ...! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
! warning: kpathsea: configuration file texmf.cnf not found in these directories: ...! ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...éCarlos\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe
! kpathsea: Running mktexfmt pdflatex.fmt
! The command name is C:\Users\Jos<e9>Carlos\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/Jos<e9>Carlos/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.
test.Rmd
```
---
title: "test"
author: "José Carlos"
date: "21/5/2021"
output:
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
```