Home Comments Thread

[tinytex] The R package tinytex - Helper Functions to Manage TinyTeX, and Compile LaTeX Documents | /tinytex/r/

yihui yihui 3y ago

The R package tinytex - Helper Functions to Manage TinyTeX, and Compile LaTeX Documents

https://yihui.org/tinytex/r/

👍👍❤️👍

108 Replies

giscus-bot giscus-bot 3y ago
访客 *Nina* @ 2018-03-26 17:13:35 写道:

Dear Yihui,

Thanks for your time.

I am trying to knit the Rmd file to pdf, but the following shows. Could you help?

! Package inputenc Error: Unicode char 澶?(U+5927)  
(inputenc) not set up for use with LaTeX.

错误: Failed to compile 2_note_Introduction_to_data.tex. See 2_note_Introduction_to_data.log for more info.  
此外: Warning messages:  
1: 运行命令'"pdflatex" -halt-on-error -interaction=batchmode "2_note_Introduction_to_data.tex"'的状态是1  
2: In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :  
输入的字符串1不适用于此语言环境  
停止执行  

Thanks so much!
Nina

yihui yihui 3y ago

This may not be an easy question without seeing the actual source document, but you could try latex_engine: xelatex under pdf_document (i.e. use XeLaTeX to compile the document): https://bookdown.org/yihui/rmarkdown/pdf-document.html

Originally posted on 2018-03-26 20:29:01

jcssingson jcssingson 3y ago

Hi! I also encountered the same problem, in my case it was:

! LaTeX Error: Unicode character ^^[ (U+001B)
               not set up for use with LaTeX.

I realized that this came from the message when I load a package that has a lengthy message once loaded. I solved this by adding "include = FALSE" in the chunk so the lengthy message is not included when the rmd file is being knit to pdf.

Hope this helps.

VrishaliSingam VrishaliSingam 3y ago

Hi ! I have also encountered similar problem and I am trying to debug it but not able to find the solution.
following was the ERROR message in my case:

! LaTeX Error: Unicode character ○ (U+25CB)
not set up for use with LaTeX.

Error: LaTeX failed to compile Case_study-Bellabeat.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Case_study-Bellabeat.log for more info.
Execution halted

cderv cderv 3y ago

Are you using a LaTeX engine that supports Unicode ? pdflatex the defauilt does not
See our tips about that https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html

VrishaliSingam VrishaliSingam 3y ago

Thank you for your reply. I was running the code in R Markdown ( RStudio) and the Markdown file included symbols i.e. The White Circles.
I deleted those symbols from my Text and the Error resolved.

giscus-bot giscus-bot 3y ago
Guest *DHZ* @ 2019-04-12 00:01:54 originally posted:

Hello Yihui,

I am having issues with using R markdown and trying to knit into a pdf. This issue shows up:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7000)

log4cxx: setFile(/Users/hoferziccardi/Library/Application Support/MiKTeX/texmfs/data/miktex/log/pdflatex.log,true) call failed.

log4cxx: IO Exception : status code = 13

log4cxx: No output stream or file set for the appender named [RollingLogFile].

Sorry, but pdflatex did not succeed.

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

/Users/hoferziccardi/Library/Application Support/MiKTeX/texmfs/data/miktex/log/pdflatex.log

Error: Failed to compile working_List_de_Exercício_1_pdf.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips.

Execution halted

I'm not sure how to resolve this!

yihui yihui 3y ago

You may try to uninstall MiKTeX and install TinyTeX instead.

Originally posted on 2019-04-12 13:39:11

giscus-bot giscus-bot 3y ago
Guest *DHZ* @ 2019-04-16 07:48:46 originally posted:

Yihui, I appreciate you taking the time to answer.

I should have said this before, but I use a Mac.

I uninstalled MiKTeX and went into RStudio, pasting the following code to try to install it:

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

Is this correct?

The response was:

add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/hoferziccardi/Library/TinyTeX/bin/x86_64-darwin.

tlmgr: An error has occurred. See above messages. Exiting.

add of symlinks had 1 error(s), see messages above.

Error: Failed to install TinyTeX

In addition: Warning message:

Detected an existing tlmgr at /Users/hoferziccardi/Library/TinyTeX/bin/x86_64-darwin/tlmgr. It seems TeX Live has been installed (check tinytex::tinytex_root()). You are recommended to uninstall it, although TinyTeX should work well alongside another LaTeX distribution if a LaTeX document is compiled through tinytex::latexmk()

Is this because its a Mac? Should I install something else? I did try installing Mactex first (before even attempting Miktex) and it still gave an error message (can't remember which one, but it wouldn't let me knit to a pdf).

I'm new to R though, so I could just be making a stupid mistake and not be realizing it.

What should I do? Also, regarding it detecting an existing tlmgr I'm not sure what they mean by this. I definitely uninstalled the Miktex and Mactex I had installed earlier and emptied the bin.

yihui yihui 3y ago

It seems your TinyTeX installation was mostly successful. Please make sure all your R packages are up-to-date: https://yihui.name/en/2017/05/when-in-doubt-upgrade/

After that, quit and reopen RStudio, then retry to compile R Markdown to PDF.

If it still does not work, please file a Github issue to the tinytex repo.

Originally posted on 2019-04-17 13:24:29

giscus-bot giscus-bot 3y ago
Guest *Duleep Samuel* @ 2019-04-19 12:50:34 originally posted:

Sir will be thankful for a few more examples of usage. Thanks

giscus-bot giscus-bot 3y ago
Guest *Felix Kpogo* @ 2019-05-02 03:24:34 originally posted:

Hello Yihui,
I am a windows user, I have installed R, and I installed the MIKTex version on my PC but I am unable to knit to Pdf. This is the message I get:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7000 64-bit)
entering extended mode

Sorry, but C:UsersFELIXK~1AppDataLocalProgramsMIKTEX~1.9miktexbinx64pdflatex.exe did not succeed.

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

C:UsersFelix KpogoAppDataLocalMiKTeX2.9miktexlogpdflatex.log
Error: Failed to compile demo2.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips.
In addition: Warning message:
In readLines(logfile) : incomplete final line found on 'demo2.log'
Execution halted

Can you please help me resolve this?

yihui yihui 3y ago

Try to install TinyTeX instead: https://bookdown.org/yihui/rmarkdown/installation.html

Originally posted on 2019-05-02 13:42:43

giscus-bot giscus-bot 3y ago
Guest *Emilija* @ 2019-05-04 10:52:02 originally posted:

same problem, doesn't help

scottkosty scottkosty 2y ago

I know this is late, but in case anyone else comes across this: I wonder if the issue could be the tilde, ~, in the path. You could try changing to the directory (e.g., in R with setwd()) before trying to compile. In general, tinytex::latexmk() will not work with a ~ in the path to the file. You can either change directories manually, or you could try putting \string just before the tilde in the file name argument.

giscus-bot giscus-bot 3y ago
Guest *Lau* @ 2019-05-11 10:26:43 originally posted:

I am having issues with using R markdown and trying to knit into a pdf.
This the message I get:

! Package inputenc Error: Unicode character ≥ (U+2265)
(inputenc) not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
Errore: Failed to compile Guida_pericolosa.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See Guida_pericolosa.log for more info.
Esecuzione interrotta

Can you help me?

yihui yihui 3y ago

What is not clear in the error message?

Originally posted on 2019-05-11 14:37:32

giscus-bot giscus-bot 3y ago
Guest *Craig Van Pay* @ 2019-05-21 15:05:32 originally posted:

Hi Yihui,

I am new to LaTeX and tinytex and get this error when trying to knit a PDF:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode
! Package inputenc Error: Unicode character σ (U+03C3)
(inputenc) not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
Error: Failed to compile ChildLangManuscript.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See ChildLangManuscript.log for more info.
Execution halted

Can you please advise?

yihui yihui 3y ago

Yes, I have already advised in the error message. What did you do after reading the full error message?

Originally posted on 2019-05-21 16:03:04

giscus-bot giscus-bot 3y ago
Guest *Craig Van Pay* @ 2019-05-22 16:51:16 originally posted:

Yes, sorry doing exactly what you specified helped in the error message. I did not know how to change the LaTeX engine but learned through another of your FAQ. Sorry for the dumb question. :)

giscus-bot giscus-bot 3y ago
Guest *Ajinkya* @ 2019-09-09 20:25:09 originally posted:

! Undefined control sequence.
l.6 ifnum 0ifxetex 1fiifluatex
1fi=0 % if pdftex

Error: Failed to compile example.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See example.log for more info.
Execution halted

I am getting this error. How should I resolve it?

giscus-bot giscus-bot 3y ago
访客 *黄傲* @ 2019-11-11 01:59:45 写道:

Hi, Yihui,
I'm a beginner of r markdown, and I encountered a problem when I try to get the pdf document.
tlmgr search --file --global "/grffile.sty"
! LaTeX Error: File `grffile.sty' not found.
I tried to tlmgr_install(), but it seems no change. could you please give me some recommendation?

Thanks a lot !

giscus-bot giscus-bot 3y ago
Guest *Guilherme Ottoni* @ 2019-11-11 13:13:15 originally posted:

I've tried the following and I couldn't manage to solve the problem:
tlmgr_search('/grffile.sty')
tlmgr search --file --global "/grffile.sty"
tlmgr.pl: package repository http://linorg.usp.br/CTAN/systems/texlive/tlnet (verified)
It returns no package, so I can't install any.

yihui yihui 3y ago

I just fixed the issue in rmarkdown. Please see rstudio/tinytex#152 (comment)

Originally posted on 2019-11-11 15:56:04

giscus-bot giscus-bot 3y ago
Guest *Guilherme Ottoni* @ 2019-11-11 16:19:17 originally posted:

Working perfectly!
Many thanks, Yihui

giscus-bot giscus-bot 3y ago
Guest *César Lemos* @ 2019-11-11 15:01:31 originally posted:

Hi, Yihui!

I try to get the pfd document and the following message appears:

tlmgr search --file --global "/grffile.sty"
! LaTeX Error: File `grffile.sty' not found.

Do you have any recommendations for the file to be generated?

Many thanks!!

yihui yihui 3y ago

Please see rstudio/tinytex#152 (comment)

Originally posted on 2019-11-11 15:55:31

giscus-bot giscus-bot 3y ago
Guest *César Lemos* @ 2019-11-11 16:38:11 originally posted:

Thank you very much!! :D

giscus-bot giscus-bot 3y ago
Guest *Ana-Maria-Magdalena Zambori* @ 2019-12-09 10:42:26 originally posted:

Hi, Yihui!

I have this Error....output file: Klausur.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Klausur.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output Klausur.tex --self-contained --include-in-header "C:UsersANAZADocumentsRwin-library3.5rmarkdownrmdlatexsubtitle.tex" --highlight-style tango --latex-engine pdflatex --variable graphics --include-in-header "C:UsersANAZAAppDataLocalTempRtmpkhl970rmarkdown-str3bb012e16b5c.html" --include-in-header "C:UsersANAZADocumentsRwin-library3.5rmarkdownrmdlatexcompact-title.tex"
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7000 64-bit)
entering extended mode
! Extra alignment tab has been changed to cr.
endtemplate

Fehler: Failed to compile Klausur.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See Klausur.log for more info.
Ausführung angehalten

Can you help me?

yihui yihui 3y ago

I'm not sure if it is the same issue as rstudio/rmarkdown#1716, but please try remotes::install_github('rstudio/rmarkdown').

Originally posted on 2019-12-09 14:57:20

giscus-bot giscus-bot 3y ago
Guest *Liz Hurtado* @ 2020-01-02 17:40:24 originally posted:

Hi, Yihui!
I have this error. I appreciate yout help.

output file: cv.knit.md

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
fmtutil: fmtutil is using the following fmtutil.cnf files (in precedence order):
fmtutil: c:/users/lizbh/appdata/roaming/tinytex/texmf-dist/web2c/fmtutil.cnf
fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes:
fmtutil: c:/users/lizbh/documents/.tinytex/texmf-config/web2c/fmtutil.cnf
fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
fmtutil [INFO]: total formats: 0
fmtutil [INFO]: exiting with status 0
I can't find the format file `pdflatex.fmt'!
Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UserslizbhAppDataRoamingTinyTeXbinwin32mktexfmt
! fmtutil: fmtutil is using the following fmtutil.cnf files (in precedence order):
! fmtutil: c:/users/lizbh/appdata/roaming/tinytex/texmf-dist/web2c/fmtutil.cnf
! fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes:
! fmtutil: c:/users/lizbh/documents/.tinytex/texmf-config/web2c/fmtutil.cnf
! fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil: c:/users/lizbh/appdata/roaming/tinytex/texmf-dist/web2c/fmtutil.cnf
! fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes:
! fmtutil: c:/users/lizbh/documents/.tinytex/texmf-config/web2c/fmtutil.cnf
! fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes:
! fmtutil: c:/users/lizbh/documents/.tinytex/texmf-config/web2c/fmtutil.cnf
! fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil: c:/users/lizbh/documents/.tinytex/texmf-config/web2c/fmtutil.cnf
! fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil [INFO]: writing formats under c:/users/lizbh/documents/.tinytex/texmf-var/web2c
! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil [INFO]: did not find entry for byfmt=pdflatex, skipped
! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil [INFO]: total formats: 0
! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! fmtutil [INFO]: exiting with status 0
! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! Running the command C:UserslizbhAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UserslizbhAppDataRoamingTinyTeXbinwin32mktexfmt

Error: Failed to compile cv.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See cv.log for more info.
Execution halted

yihui yihui 3y ago

Could you try tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))? Thanks!

Originally posted on 2020-01-27 22:24:50

giscus-bot giscus-bot 3y ago
Guest *Iara Passos* @ 2020-01-09 13:55:36 originally posted:

Hi! I'm trying to run the bookdown-demo in Rstudio Cloud and it returns me this error:

output file: bookdown-demo.knit.md

tlmgr search --file --global '/unicode-math.sty'
Unknown directive ...containerchecksum 57a177b65450718631f36bfd8db0f2d1bff788f3bf147137b6412714cc945c7e08832f14f9e7e659adf7e072a91f13a2ea27fe3161cd9b60313bc956f1f543c6... , please fix it! at /usr/share/texlive/tlpkg/TeXLive/TLPOBJ.pm line 210, <$retfh> line 5910.
! LaTeX Error: File `unicode-math.sty' not found.

! Emergency stop.
<read *="">

Error: Failed to compile bookdown-demo.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See bookdown-demo.log for more info.
In addition: Warning messages:
1: In system2("tlmgr", args, ...) :
running command ''tlmgr' search --file --global '/unicode-math.sty'' had status 25
2: In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
Failed to find a package that contains unicode-math.sty
Execution halted

Exited with status 1.

I updated the packages and when I try to run (tinytex::tlmgr_update()) it returns this error:
tlmgr update --all --self
(running on Debian, switching to user mode!)
Unknown directive ...containerchecksum 57a177b65450718631f36bfd8db0f2d1bff788f3bf147137b6412714cc945c7e08832f14f9e7e659adf7e072a91f13a2ea27fe3161cd9b60313bc956f1f543c6... , please fix it! at /usr/share/texlive/tlpkg/TeXLive/TLPOBJ.pm line 210, <$retfh> line 5910.
fmtutil [ERROR]: format directory not writable: /var/lib/texmf/web2c

I already used bookdown in RStudio Cloud and until december, 2019 it was working very well.

Can you help me? Thank you!

yihui yihui 3y ago

Try tinytex::install_tinytex()

Originally posted on 2020-01-09 16:34:09

giscus-bot giscus-bot 3y ago
Guest *Salem* @ 2021-09-26 16:02:35 originally posted:

I was unable to find any missing LaTeX packages from the error log Handout_test.log.
! Paragraph ended before optparams@@ was complete.

giscus-bot giscus-bot 3y ago
Guest *Guneykan Ozkaya* @ 2020-01-25 19:19:06 originally posted:

Hi please help:

kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: No such file or directory
! kpathsea: Running mktexfmt pdflatex.fmt

! mktexfmt: No such file or directory

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

yihui yihui 3y ago

Could you try tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))? Thanks!

Originally posted on 2020-01-27 22:07:12

giscus-bot giscus-bot 3y ago
Guest *Guneykan Ozkaya* @ 2020-01-27 22:09:52 originally posted:

I got this:

TeX Live does not seem to be installed. See https://yihui.org/tinytex/.tlmgr install texlive-scripts
sh: tlmgr: command not found
error in running commandTeX Live does not seem to be installed. See https://yihui.org/tinytex/.tlmgr update --self
sh: tlmgr: command not found
error in running commandsh: fmtutil-sys: command not found
error in running commandTeX Live does not seem to be installed. See https://yihui.org/tinytex/.tlmgr install texlive-scripts
sh: tlmgr: command not found
error in running commandsh: tlmgr: command not found
error in running command

yihui yihui 3y ago

That means you need to tinytex::install_tinytex() first.

Originally posted on 2020-01-28 15:55:26

giscus-bot giscus-bot 3y ago
Guest *Guneykan Ozkaya* @ 2020-01-28 15:58:41 originally posted:

Thanks a lot but I cannot:

rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/adjustbox/tc-pdftex.def: Permission denied  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/adjustbox/trimclip.sty: Permission denied  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/adjustbox/adjcalc.sty: Permission denied  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/adjustbox/adjustbox.sty: Permission denied  
....  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/ucs/data: Permission denied  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex/ucs: Directory not empty  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex/latex: Directory not empty  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist/tex: Directory not empty  
rm: /Users/guneykan/Library/TinyTeX/texmf-dist: Directory not empty  
rm: /Users/guneykan/Library/TinyTeX: Directory not empty  
mv: rename texlive/texmf-dist to /Users/guneykan/Library/TinyTeX/texmf-dist: Directory not empty  
[install-unx.sh](http://install-unx.sh): line 20: /Users/guneykan/Library/TinyTeX/bin/x86_64-darwin/tlmgr: No such file or directory  
[install-unx.sh](http://install-unx.sh): line 27: /Users/guneykan/Library/TinyTeX/bin/x86_64-darwin/tlmgr: No such file or directory  
sh: /Users/guneykan/Library/TinyTeX/bin/x86_64-darwin/tlmgr: No such file or directory  
error in running commandsh: /Users/guneykan/Library/TinyTeX/bin/x86_64-darwin/tlmgr: No such file or directory  
error in running commandTinyTeX installed to /Users/guneykan/Library/TinyTeX  
TinyTeX was not successfully installed or configured.Your PATH variable is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin. See https://yihui.org/tinytex/faq/ for more information.
giscus-bot giscus-bot 3y ago
Guest *Marly Tatiana Celis* @ 2020-02-02 16:01:34 originally posted:

Hi there ! I'm getting this error after trying everything to solve it. What is it about? How can I solve it

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode

yihui yihui 3y ago

Sorry, but I have no idea. It seems there isn't even an error message.

Have you tried tinytex:::install_prebuilt()?

Originally posted on 2020-02-03 16:59:31

giscus-bot giscus-bot 3y ago
Guest *Marly Tatiana Celis* @ 2020-02-03 20:01:16 originally posted:

First, thank you for replying. Second, I posted the question because I was really frustrated after following all the steps you suggest for debugging. Also, I was not sure what the error/warning was about, since I have already updated and reinstalled back everything. At the end, the issue was a misplaced character in a latex syntax. So it was more a series of unfortunate events. I guess that identifying what an error is about is more of an art than a science. I really appreciate you taking the time to answer though. Thanks

yihui yihui 3y ago

Sorry to hear that! In this case, a minimal reproducible example can help a lot when you ask this type of questions. You might be able to figure it out sooner by yourself as you minimize your example. When you have time, I recommend watching Jenny's talk at this year's rstudio::conf. The video is not available yet, but the slides are helpful enough (especially page 37): https://speakerdeck.com/jennybc/object-of-type-closure-is-not-subsettable?slide=37

Originally posted on 2020-02-03 20:11:47

giscus-bot giscus-bot 3y ago
Guest *TT* @ 2020-03-12 16:42:38 originally posted:

I am also getting this error - can you please detail how you solved?

yihui yihui 3y ago

What did you try? Did you follow the debugging tips above? https://yihui.org/tinytex/r/#debugging

Originally posted on 2020-03-12 17:23:12

giscus-bot giscus-bot 3y ago
Guest *Marly Tatiana Celis* @ 2020-03-12 21:17:11 originally posted:

The way I solved it was: 1) I carefully followed the steps recommended here. 2) I was creating a reprex, and that's how I realized my own mistake; after all, I was able to solve it without asking any further. I'd suggest you check the slides Yihui Xie linked in the previous reply. (As they say "To find a needle, try looking in a smaller stack") Try creating a reprex, it may sound time-consuming, but I bet it will help you.

giscus-bot giscus-bot 3y ago
Guest *Cris* @ 2020-02-05 22:16:47 originally posted:

Hello! I am aware there was a problem with fig.align and knitting a pdf a while back. (rstudio/rmarkdown#325) But I am having this problem now.

When I remove the fig.align the document knits to PDF without problems, but when I include it, only the .tex file is produced and the console shows the following message at the end:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode
I was unable to find any missing LaTeX packages from the error log Reporte.log.
! Undefined control sequence.
C:Users
Documents Informes...
l.103 ...ero_files/figure-latex/unnamed-chunk-2-1}
end{center}

Error: LaTeX failed to compile

My session info:
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Mexico.1252 LC_CTYPE=Spanish_Mexico.1252 LC_MONETARY=Spanish_Mexico.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Mexico.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] mxmaps_0.6.0 lubridate_1.7.4 readxl_1.3.1 forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3 purrr_0.3.3 readr_1.3.1 tidyr_1.0.2
[10] tibble_2.1.3 ggplot2_3.2.1 tidyverse_1.3.0

giscus-bot giscus-bot 3y ago
Guest *Michel* @ 2020-02-17 18:36:56 originally posted:

I have this error and I don't know what to do! Could anyone help? I use miktex.
Erro: LaTeX failed to compile respostas.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Além disso: Warning messages:
1: In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
'"pdflatex"' not found
2: In system2(...) : '"pdflatex"' not found
Execução interrompida

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

MacTeX on macOS - https://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)

Linux: Use system package manager

yihui yihui 3y ago

The message said:

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

Have you done that?

Originally posted on 2020-02-17 19:21:19

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-20 14:14:28 originally posted:

Dear Yiuhi - Thanks so much first of all for this amazing TeX solution! All of a sudden today I am unable to render any PDF in RStudio, with files that ran just fine minutes before. I get the following log output. Can you help me identify the reason please?

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex 2019.5.12) 20 FEB 2020 14:34
entering extended mode
restricted write18 enabled.
%&-line parsing enabled.
**MODE_proposal_APA.tex
(./MODE_proposal_APA.tex
LaTeX2e <2018-12-01>
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/apa7/apa7.cls
Document Class: apa7 2019/12/30 v1.04 APA formatting (7th edition)
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
c@part=count80
c@section=count81
c@subsection=count82
c@subsubsection=count83
c@paragraph=count84
c@subparagraph=count85
c@figure=count86
c@table=count87
abovecaptionskip=skip41
belowcaptionskip=skip42
bibindent=dimen102
) (/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2019/09/21 v2.5h e-TeX tools for LaTeX (JAW)
etb@tempcnta=count88
)
Class apa7 Info: No bibliography package was specified; defaulting to (but not
loading) Biblatex on input line 218.
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/lm/lmodern.sty
Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info: Overwriting math alphabet `mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info: Overwriting math alphabet `mathsf' in version `normal'
(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info: Overwriting math alphabet `mathit' in version `normal'
(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info: Overwriting math alphabet `mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info: Overwriting math alphabet `mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info: Overwriting math alphabet `mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info: Overwriting math alphabet `mathit' in version `bold'
(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info: Overwriting math alphabet `mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
) (/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2020/02/11 v2.0o Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 48.
)
LaTeX Font Info: Try loading font information for T1+lmr on input line 112.
(/Users/jrennstich/Library/TinyTeX/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
! Undefined control sequence.
l.115 xdef@fontenc@load@list{@fontenc@load@list

Here is how much of TeX's memory you used:
865 strings out of 494553
9926 string characters out of 6176313
67543 words of memory out of 5000000
4604 multiletter control sequences out of 15000+600000
6937 words of font info for 16 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
30i,0n,24p,804b,76s stack positions out of 5000i,500n,10000p,200000b,80000s

! ==> Fatal error occurred, no output PDF file produced!

yihui yihui 3y ago

Have you followed the debugging tips on this page? It asked you to update packages first. Did you do that?

Originally posted on 2020-02-20 14:51:27

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-20 16:14:44 originally posted:

Yes. Followed all the instructions there.

yihui yihui 3y ago

That's weird. A quick google search for the error message led me to https://tex.stackexchange.com/a/529280/9128, and if you run tinytex::tlmgr_update(), it should run fmtutil-sys --all, which should fix the issue, according to David Carlisle's answer.

Anyway, if that doesn't work, you can probably try to reinstall TinyTeX.

Originally posted on 2020-02-20 16:22:42

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-20 18:08:01 originally posted:

Did as instructed (and kept getting errors when running "
fmtutil-sys --all"). So I uninstalled and re-installed (but with command install_tinytex). I got the following error messages when I ran the command:

tlmgr install: package ifluatex not present in repository.

tlmgr install: package ifxetex not present in repository.

and later

[72/74, 00:21/00:21] install: xkeyval [13k]
[73/74, 00:21/00:21] install: xunicode [26k]
[74/74, 00:21/00:21] install: zapfding [46k]
running mktexlsr ...
tlmgr: action install returned an error; continuing.
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
regenerating language.dat
regenerating language.def
regenerating language.dat.lua
regenerating fmtutil.cnf in /Users/jrennstich/Library/TinyTeX/texmf-dist
running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --no-error-if-no-format --byengine tex ...
done running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --no-error-if-no-format --byengine tex.
running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byfmt mf ...
done running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byfmt mf.
running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byhyphen "/Users/jrennstich/Library/TinyTeX/texmf-var/tex/generic/config/language.dat" ...
done running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byhyphen "/Users/jrennstich/Library/TinyTeX/texmf-var/tex/generic/config/language.dat".
running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byhyphen "/Users/jrennstich/Library/TinyTeX/texmf-var/tex/generic/config/language.def" ...
done running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byhyphen "/Users/jrennstich/Library/TinyTeX/texmf-var/tex/generic/config/language.def".
running fmtutil-sys --no-error-if-no-engine=luahbtex,luajittex,mfluajit --byhyphen "/Users/jrennstich/Library/TinyTeX/texmf-var/tex/generic/config/language.dat.lua" ...
tlmgr: An error has occurred. See above messages. Exiting.

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-20 18:15:14 originally posted:

I suspect there's some leftover from previous TeX or tinytex installations. Is there anyway to check that or delete them manually? I ran uninstall_tinytex(force = TRUE) before, but perhaps there is another way to check and be sure there is no old/other installation? I checked in the folder structure but couldn't find anything really, am not sure where I need to look however.

yihui yihui 3y ago

uninstall_tinytex() should uninstall TinyTeX cleanly. There shouldn't be any leftover. My guess for the failure of installation is that tlmgr chose a random CTAN mirror that was somehow corrupted or not fully synced to the main repository. You can take a look at the first few lines of the installation log, which looks like this
Automated TeX Live installation using profile: ../tinytex.profile
Loading http://ctan.mirrors.hoobly.com/systems/texlive/tlnet/tlpkg/texlive.tlpdb
Installing TeX Live 2019 from: http://ctan.mirrors.hoobly.com/systems/texlive/tlnet (not verified)

I succeeded with this mirror, so you can probably try

tinytex::install_tinytex(repos = 'http://ctan.mirrors.hoobly.com/systems/texlive/tlnet')

Originally posted on 2020-02-20 23:54:52

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-21 09:15:05 originally posted:

Thanks again. No change. I keep getting that l.115 xdef@fontenc@load@list{@fontenc@load@list error.

yihui yihui 3y ago

Then I'm out of ideas. This is really weird. I can't reproduce it on my computer. Can you try tinytex:::fmtutil()?

Originally posted on 2020-02-21 14:55:26

giscus-bot giscus-bot 3y ago
Guest *joachimr* @ 2020-02-21 15:20:51 originally posted:

I solved it with the help of some folks over at stackexchange. I had to delete the .tinytex folder in my user folder.

giscus-bot giscus-bot 3y ago
Guest *Wilson Lee* @ 2020-02-24 23:53:35 originally posted:

Hi Yihui,
Thanks for your great and cool stuff. I follow the steps on debugging but still get this message when trying to render Rmarkdown to a PDF file

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode

I was unable to find any missing LaTeX packages from the error log EEA2020.log.

! Package pdftex.def Error: File `~/Dropbox/Research Paper/In Progress/Project

#1/Rplot/Rplot01.png' not found: using draft setting.

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

giscus-bot giscus-bot 3y ago
Guest *Aldo Alexis Benitez Lopez* @ 2020-03-01 04:36:56 originally posted:

Hi, Yihui!
I keep getting this error and I don't know what to do.

! Package pdftex.def Error: File `alfa.png' not found: using draft setting.

Error: LaTeX failed to compile teoria.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.

giscus-bot giscus-bot 3y ago
Guest *pras patel* @ 2020-04-02 01:24:29 originally posted:

Hi Yihui ,
I stuck with below error when I am trying to Create output in PDF from using RMARKDOWN-(knit to APA6_pdf).
I really appreciate your help in advance.
Thanks.
------------------------------------ Rmarkdown ERROR----------------------------------------------
! Sorry, but C:PROGRA~1MIKTEX~1.9miktexbinx64pdflatex.exe did not succeed.

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

! C:UsersprasuAppDataLocalMiKTeX2.9miktexlogpdflatex.log

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

giscus-bot giscus-bot 3y ago
访客 *Xinyi Liu* @ 2020-04-02 04:53:25 写道:

Hi Yihui!
I was going to knit my rmarkdown to a pdf file but it throw an error like this:

I was unable to find any missing LaTeX packages from the error log hw2.log.  
! Package inputenc Error: Unicode character ν (U+03BD)  
(inputenc) not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see <https://bookdown.org/yihui/rmarkdown/pdf-document.html>  
错误: LaTeX failed to compile hw2.tex. See <https://yihui.org/tinytex/r/#debugging> for debugging tips. See hw2.log for more info.  
停止执行  

Could you help me with it?
Thanks a lot!

giscus-bot giscus-bot 3y ago
Guest *Xiaochi* @ 2020-04-15 09:34:20 originally posted:

I encountered the same error.

yihui yihui 3y ago

Did you read the error messages above? If you did, what did you try?

Originally posted on 2020-04-15 21:46:26

giscus-bot giscus-bot 3y ago
Guest *Pan Sharling* @ 2020-04-06 01:41:29 originally posted:

Hi! I tried to use R markdown but it shows this error. Thank you for your help!

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode
tlmgr search --file --global '/STA255-Final-A_files/figure-latex/3 a'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "en_CN.UTF-8",
LANG = "en_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
TeX Live 2019 is frozen forever and will no
longer be updated. This happens in preparation for a new release.

If you're interested in helping to pretest the new release (when
pretests are available), please read https://tug.org/texlive/pretest.html.
Otherwise, just wait, and the new release will be ready in due time.
! LaTeX Error: File `STA255-Final-A_files/figure-latex/3 a' not found.

Error: LaTeX failed to compile STA255-Final-A.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See STA255-Final-A.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = !verbose) :
Failed to find a package that contains STA255-Final-A_files/figure-latex/3 a
Execution halted

yihui yihui 3y ago

Try not to use spaces in chunk labels, e.g. use "3-a" instead of "3 a".

Originally posted on 2020-04-15 21:47:26

giscus-bot giscus-bot 3y ago
Guest *Pan Sharling* @ 2020-04-16 00:02:53 originally posted:

It works! Thank you very much!

giscus-bot giscus-bot 3y ago
Guest *pras patel* @ 2020-04-07 22:30:42 originally posted:

Hi Yihui,

I am trying to install papaja in R studio but I am getting error below so please help me to out of this problem. Thanks in advance.

Error: LaTeX failed to compile trial3.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

yihui yihui 3y ago

Sounds like you need to install LaTeX. See https://bookdown.org/yihui/rmarkdown/installation.html

Originally posted on 2020-04-08 02:07:12

giscus-bot giscus-bot 3y ago
Guest *pras patel* @ 2020-04-09 00:00:32 originally posted:

Hi Yihui,
I applied your suggestion but have new error so could you please help me to getting out of this situation. I am trying to install papaja in R and following below mentioned steps.

1.Update to the most current version of R by downloading from CRAN.
2.Update to the most current version of RStudio
3.From RStudio, go to the Tools|Install Packages… and install:
a.RMarkdown
b.knitR
c.tinyTex (do not use any other version of LaTeX! This one is known to be useful, downloads in seconds instead of hours, and is designed to work directly with R.)
4.Watch for errors and FIX THEM before continuing. Google any errors you get and apply the fixes. This WILL NOT WORK if you have unresolved errors!
5.Install papaja with the following commands

install.packages(c('devtools', 'curl'))
devtools::install_github("crsh/papaja")


Got error when trying to run this code "devtools::install_github("crsh/papaja")
".

Error: .onLoad failed in loadNamespace() for 'pkgload', details:
call: NULL
error: package ‘backports’ does not have a namespace

I really appreciate your help. Thanks in advance.

yihui yihui 3y ago

Sounds like certain R packages are broken in your system. You may need to reinstall these problematic packages (e.g. 'backports' in this case).

Originally posted on 2020-04-09 18:57:45

giscus-bot giscus-bot 3y ago
Guest *Rubén* @ 2020-04-13 15:33:42 originally posted:

Hi Yihui! I keep getting this message when I try to compile a .Rmd file:


! fmtutil [ERROR]: -user mode but path setup is -sys type, bailing out.
! ...v NietoAppDataRoamingTinyTeXbinwin32runscript.tlu:915: command failed with exit code 1:
! perl.exe "c:UsersRubn Jov NietoAppDataRoamingTinyTeXtexmf-distscriptstexlivefmtutil.pl" --user --byfmt pdflatex
! Running the command C:UsersRubn Jov NietoAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! ...v NietoAppDataRoamingTinyTeXbinwin32runscript.tlu:915: command failed with exit code 1:
! perl.exe "c:UsersRubn Jov NietoAppDataRoamingTinyTeXtexmf-distscriptstexlivefmtutil.pl" --user --byfmt pdflatex
! Running the command C:UsersRubn Jov NietoAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! perl.exe "c:UsersRubn Jov NietoAppDataRoamingTinyTeXtexmf-distscriptstexlivefmtutil.pl" --user --byfmt pdflatex
! Running the command C:UsersRubn Jov NietoAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! Running the command C:UsersRubn Jov NietoAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UsersRubn Jov NietoAppDataRoamingTinyTeXbinwin32mktexfmt

! warning: kpathsea: mktexfmt output `c:/Users/Rubn Jov Nieto/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.

Error: LaTeX failed to compile dsdd.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See dsdd.log for more info.
Además: Warning message:
In xfun::read_utf8(f2) :
The file C:UsersRUBNJO~1AppDataLocalTempRtmpYFv1hKstderr2f905c5e2519 is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 2, 3, 4, 8, 9


I've tried everything I've read in the debugging part, since tinytex:::install_prebuilt(), tinytex::reinstall_tinytex(), update R and the package.

When I tinytex:::is_tinytex() it appears TRUE. But i don't know why it doesn't works for me...

Thanks in advance for all your work and attention

yihui yihui 3y ago

If you try tinytex::reinstall_tinytex(), please make sure you do that after you update your R packages (to have the latest version of tinytex), and restart your R session.

Originally posted on 2020-04-15 21:49:09

giscus-bot giscus-bot 3y ago
Guest *ujjwal singh* @ 2020-04-14 19:43:39 originally posted:

Hi Yihui ,

I found error

output file: ss.knit.md

! Sorry, but C:PROGRA~1MIKTEX~1.9miktexbinx64pdflatex.exe did not succeed.

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

! C:UsersUjjwal SinghAppDataLocalMiKTeX2.9miktexlogpdflatex.log

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

Please suggest me to overcome this problem

yihui yihui 3y ago

Since you are using MiKTeX, I have no idea. Perhaps you can try to install TinyTeX and see if it works.

Originally posted on 2020-04-15 21:43:40

giscus-bot giscus-bot 3y ago
Guest *Sergio Mansilla* @ 2020-05-29 20:25:27 originally posted:

Hey @disqus_5lVCHCcxOW:disqus I found a solution. I had the exact same problem as you. All I did was uninstall MiKTeX and run the commands for installing tinytex.

giscus-bot giscus-bot 3y ago
Guest *dili chili wili mili* @ 2021-12-31 05:40:16 originally posted:

Worked for me too!

giscus-bot giscus-bot 3y ago
Guest *Nhi Nguyen* @ 2022-01-27 23:27:56 originally posted:

OMGGG THANK YOU. This worked!!

giscus-bot giscus-bot 3y ago
访客 *Wushaohao Chen* @ 2020-04-16 00:48:39 写道:

Hi, Yihui!
I have this error when knit the pdf from R markdown. Could you help me with it? Thank you so much!

output file: Homework2.knit.md

! LaTeX Error: File `geometry.sty' not found.

*! Emergency stop.
<read ="">

! Unfortunately, the package upquote could not be installed.

! Please check the log file:

! C:UsersTEMP.DESKTOP-QIO3G7I.000AppDataLocalMiKTeX2.9miktexlogpdflatex.log

错误: LaTeX failed to compile Homework2.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Homework2.log for more info.
此外: There were 19 warnings (use warnings() to see them)
停止执行

yihui yihui 3y ago

The simplest solution is probably this: https://bookdown.org/yihui/rmarkdown-cookbook/install-latex.html You can uninstall MiKTeX, but don't have to.

If you must use MiKTeX and cannot use TinyTeX, see the last paragraph here: https://bookdown.org/yihui/rmarkdown-cookbook/install-latex-pkgs.html

Originally posted on 2020-04-16 15:50:54

giscus-bot giscus-bot 3y ago
Guest *Kalpit Pandey* @ 2020-04-19 11:28:49 originally posted:

Hi, Yihui!
I have this error.

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

|................ | 22%  
label: setup (with options)

processing file: testPdf.Rmd  
List of 1  
$ include: logi FALSE

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

|............................... | 44%  
label: unnamed-chunk-1 (with options)  
List of 1  
$ include: logi FALSE

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

|............................................... | 67%  
label: cars  
|...................................................... | 78%  
ordinary text without R code

|.............................................................. | 89%  
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 [testPdf.utf8.md](http://testPdf.utf8.md) --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output testPdf.tex --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --lua-filter "C:/Users/kalpi/OneDrive/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "C:/Users/kalpi/OneDrive/Documents/R/win-library/3.6/rmarkdown/rmd/lua/latex-div.lua" --variable "geometry:margin=1in"  
output file: [testPdf.knit.md](http://testPdf.knit.md)

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)  
restricted write18 enabled.  
I can't find the format file `pdflatex.fmt'!  
fmtutil [ERROR]: -user mode but path setup is -sys type, bailing out.  
...rskalpiAppDataRoamingTinyTeXbinwin32runscript.tlu:915: command failed with exit code 1:  
perl.exe c:UserskalpiAppDataRoamingTinyTeXtexmf-distscriptstexlive[fmtutil.pl](http://fmtutil.pl) --user --byfmt pdflatex  
Running the command C:UserskalpiAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UserskalpiAppDataRoamingTinyTeXbinwin32mktexfmt  
I was unable to find any missing LaTeX packages from the error log testPdf.log.  
! fmtutil [ERROR]: -user mode but path setup is -sys type, bailing out.  
! ...rskalpiAppDataRoamingTinyTeXbinwin32runscript.tlu:915: command failed with exit code 1:  
! perl.exe c:UserskalpiAppDataRoamingTinyTeXtexmf-distscriptstexlive[fmtutil.pl](http://fmtutil.pl) --user --byfmt pdflatex  
! Running the command C:UserskalpiAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! ...rskalpiAppDataRoamingTinyTeXbinwin32runscript.tlu:915: command failed with exit code 1:  
! perl.exe c:UserskalpiAppDataRoamingTinyTeXtexmf-distscriptstexlive[fmtutil.pl](http://fmtutil.pl) --user --byfmt pdflatex  
! Running the command C:UserskalpiAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! perl.exe c:UserskalpiAppDataRoamingTinyTeXtexmf-distscriptstexlive[fmtutil.pl](http://fmtutil.pl) --user --byfmt pdflatex  
! Running the command C:UserskalpiAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! Running the command C:UserskalpiAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UserskalpiAppDataRoamingTinyTeXbinwin32mktexfmt

Error: LaTeX failed to compile testPdf.tex. See <https://yihui.org/tinytex/r/#debugging> for debugging tips. See testPdf.log for more info.  
Execution halted

File: testPdf.rmd

---  
title: "R Markdwon"  
author: "Kalpit"  
date: "19/04/2020"  
output: pdf_document  
---

```{r setup, include=FALSE}  
knitr::opts_chunk$set(echo = TRUE)  
```

```{r, include=FALSE}  
options(tinytex.verbose = 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](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.
yihui yihui 3y ago

See below: https://yihui.org/tinytex/r/#comment-4872674616

Originally posted on 2020-04-19 13:50:35

giscus-bot giscus-bot 3y ago
Guest *Chul-Kyoo Joseph Jung* @ 2020-04-26 00:40:05 originally posted:

Hi Yihui,
I always got this error message. Could you help me?

output file: dp02_slide.knit.md

tlmgr search --file --global '/tikzlibrarytopaths.code.tex'
tlmgr search --file --global '/tikzlibraryarrows.code.tex'
tlmgr search --file --global '/tikzlibraryplotmarks.code.tex'
Trying to automatically install missing LaTeX packages...
tlmgr install pgf
tlmgr: package repository http://ctan.mirror.colo-serv.net/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr install: package already present: pgf
tlmgr path add
tlmgr search --file --global '/tikzlibrarytopaths.code.tex'
tlmgr search --file --global '/tikzlibraryarrows.code.tex'
tlmgr search --file --global '/tikzlibraryplotmarks.code.tex'
! File ended while scanning use of beamer@collect@@Body.

par
<*> dp02_slide.tex

Error: Failed to compile dp02_slide.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See dp02_slide.log for more info.
Execution halted

yihui yihui 3y ago

Please do what the error message told you to do first (at least you didn't update your R packages). Thanks!

Originally posted on 2020-04-26 01:45:24

giscus-bot giscus-bot 3y ago
Guest *Chul-Kyoo Joseph Jung* @ 2020-04-26 03:12:25 originally posted:

Thanks for your response. As you suggest I updated R last week 3.6.3 version and followed your debugging guideline in your webpage such as install.packages('tinytex') and tinytex::reinstall_tinytex(). And I still get

! File ended while scanning use of beamer@collect@@Body.

par
<*> dp02_slide.tex

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

Do I miss something here? Any tip would be a great help!

yihui yihui 3y ago

Thanks for following the guideline! Now we need a minimal reproducible example. I suggest you post a question to RStudio Community or Stack Overflow with that example.

Originally posted on 2020-04-26 18:12:04

giscus-bot giscus-bot 3y ago
Guest *Caren* @ 2020-04-28 06:19:08 originally posted:

Hi, Yihui.

Could you please help me with the error I got?
The error message is the following:

! Package inputenc Error: Unicode character − (U+2212)
(inputenc) not set up for use with LaTeX.
Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
Error: LaTeX failed to compile Homework-4.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Homework-4.log for more info.
Execution halted

I have downloaded XeLaTeX from http://www.texts.io/support/0001/ but I don't know why I couldn't use this compiler.
Thanks a lot.

yihui yihui 3y ago

No need to download XeLaTeX separately. You can install TinyTeX (which includes xelatex): https://bookdown.org/yihui/rmarkdown-cookbook/install-latex.html And change the LaTeX engine to xelatex: https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html

Originally posted on 2020-04-28 18:42:35

giscus-bot giscus-bot 3y ago
Guest *sungyang* @ 2020-05-11 23:10:57 originally posted:

I had the same error message when I tried to convert table to PDF. It works when I convert table to html.
! Package inputenc Error: Unicode character ??(U+2264)
(inputenc) not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
LaTeX failed to compile d.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See d.log for more info.

In grepl("==> Fatal error occurred", x[i], fixed = TRUE) :

giscus-bot giscus-bot 3y ago
Guest *Rubayat Jinnah* @ 2020-06-10 17:07:05 originally posted:

How did you solve this error?

giscus-bot giscus-bot 3y ago
Guest *Dorin Stanciu* @ 2020-04-30 09:43:58 originally posted:

Hi Yihui, I just wanted to thank you for all the great gifts you've given us and for all the dedication and sacrifice you put in helping us to use them. You're not just a genius but also a wonderful person. Your advice saved my work countless times. Best of luck, mate!

yihui yihui 3y ago

Thanks for the kind words, Dorin!

Originally posted on 2020-04-30 13:26:10

giscus-bot giscus-bot 3y ago
Guest *Dorin Stanciu* @ 2020-04-30 13:45:29 originally posted:

Don't mention it!
We forget too often to say it and take people like you for granted.
And, when I look at the pace and level at which you do things, I find myself between depression and highest motivation :) Fortunately, the latter wins always. But the feeling that you have a magical device and compress more hours into the day, and somehow you never sleep, is still there... :)
So, thanks again, and I look forward for many, many decades of Yihui Xie wisdom around.

giscus-bot giscus-bot 3y ago
Guest *Sam Kristen* @ 2020-04-30 15:59:41 originally posted:

Dear Yihui!
I encounter this error after trying all tips above. I'm currently having options(tinytex.verbose = TRUE) in my RMarkdown. I'm working on my thesis and would really appreciate your prompt help!! Thank you!!

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
restricted write18 enabled.
entering extended mode
tlmgr search --file --global '/tikzlibrarytopaths.code.tex'
tlmgr search --file --global '/tikzlibraryplotmarks.code.tex'
tlmgr search --file --global '/tikzlibraryarrows.code.tex'
tlmgr search --file --global '/tikzlibrarypositioning.code.tex'
Trying to automatically install missing LaTeX packages...
tlmgr install pgf
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2017/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr update --self
tlmgr: package repository http://ctan.mirror.colo-serv.net/systems/texlive/tlnet (not verified: gnupg not available)
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2017/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
fmtutil [ERROR]: format directory not writable: /usr/local/texlive/2017/texmf-var/web2c
tlmgr install pgf
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2017/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr path add
add of symlinks had 2 error(s), see messages above.
add_link_dir_dir: destination /usr/local/bin not writable, no links from /usr/local/texlive/2017/bin/x86_64-darwin.
add_link_dir_dir: /usr/local/share/info/dir exists; not making symlink.
man symlink destination (/usr/local/share/man) not writable,cannot add symlinks.
tlmgr: An error has occurred. See above messages. Exiting.
! Package inputenc Error: Unicode char € (U+80)
(inputenc) not set up for use with LaTeX.

Error: Failed to compile Simplifying-RSA_3rd-Draft.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See Simplifying-RSA_3rd-Draft.log for more info.
Execution halted

yihui yihui 3y ago

Please read https://yihui.org/tinytex/r/#debugging again and follow the instructions first. From the error message, at least you didn't update your R packages successfully.

Originally posted on 2020-04-30 20:29:25

giscus-bot giscus-bot 3y ago
Guest *Lordda* @ 2020-05-02 20:21:57 originally posted:

Hi Yihui,

I have some trouble using latex environment in Rmarkdown. I was trying to use theorem or proof environment you mentioned in the guidebook, but when I actually use them they were the uncompiled Latex code under those environment, and if I quote some R code inside there would be extra "```" at the bottom. Here are the codes:

---  
title: "HW"  
author: "Author"  
#date:"`r Sys.Date()"  
output:  
pdf_document: default  
bookdown::pdf_document2:  
base_format: pagedown::pdf_paged  
df_print: paged  
---

```{r global_options, include=FALSE}  
knitr::opts_chunk$set(fig.width=6, fig.height=6, fig.path='Figs/',  
echo=TRUE, warning=FALSE, message=FALSE)  
```

```{theorem}  
Here is my theorem.  
begin{equation}  
E=mc^2  
(#eq:emc)  
end{equation}  
```

```{proof, name="#1"}  
Here is my proof.

begin{equation}  
e^{ipi}+1=0  
end{proof}

```{r echo=TRUE}  
set.seed(777)  
m <- 10000  
pi0 <- 0.9  
a <- 10  
z <- 1*( runif(m) <= 1-pi0 )  
x <- runif(m)  
x[z==1] <- rbeta( sum(z), shape1=1, shape2=a )  
hist(x)  
```
giscus-bot giscus-bot 3y ago
Guest *Jesus Walter Salinas Flores* @ 2020-05-04 19:51:16 originally posted:

I have this error. I appreciate your help.

I was unable to find any missing LaTeX packages from the error log Ejemplo-1-RMarkdown.log.
! Package pdftex.def Error: File `https://www.storybench.org/wp-content/uploads
/2017/05/tidyverse-730x294.png' not found: using draft setting.

Error: LaTeX failed to compile Ejemplo-1-RMarkdown.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Ejemplo-1-RMarkdown.log for more info.
Ejecución interrumpida

yihui yihui 3y ago

You cannot use images from URLs. You can only use local images.

Originally posted on 2020-05-04 23:40:44

giscus-bot giscus-bot 3y ago
Guest *Javiera* @ 2020-05-12 15:13:16 originally posted:

Hi!
I have this error, can you help me?

Running the command C:UsersjavAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UsersjavAppDataRoamingTinyTeXbinwin32mktexfmt
I was unable to find any missing LaTeX packages from the error log Reporte_CES_V6.log.
! Running the command C:UsersjavAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UsersjavAppDataRoamingTinyTeXbinwin32mktexfmt

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

Ejecución interrumpida

yihui yihui 3y ago

I'm investigating this issue right now. Please keep an eye on rstudio/tinytex#210 Thanks, and I'm sorry for the trouble!

Originally posted on 2020-05-14 03:03:59

giscus-bot giscus-bot 3y ago
Guest *Javiera* @ 2020-05-14 16:20:27 originally posted:

Thanks! I will keep an eye.

giscus-bot giscus-bot 3y ago
Guest *Carl Morgenstern* @ 2020-05-13 01:46:11 originally posted:

Hi Yihui

I am trying to produce a pdf file from an R notebook. When I knitr it I end up with this. All my packages are up to date. I have both the R Markdown console output as well as the end of the log file.

I hope that you help. Thanks!

Carl Morgenstern

label: unnamed-chunk-16 (with options)  
List of 2  
$ echo : logi FALSE  
$ warning: logi FALSE

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

/Applications/<http://RStudio.app/Contents/MacOS/pandoc/pandoc> +RTS -K512m -RTS [TraceReduction.utf8.md](http://TraceReduction.utf8.md) --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output TraceReduction.tex --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/latex-div.lua --variable 'geometry:margin=1in' --include-in-header /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/latex/subtitle.tex --include-in-header /var/folders/7q/k7zsmnlj5t3c0r9cqw_jpp0h0000gp/T//Rtmp9iD2RK/rmarkdown-str17cb54fcafae7.html  
output file: [TraceReduction.knit.md](http://TraceReduction.knit.md)

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)  
restricted write18 enabled.  
entering extended mode  
I was unable to find any missing LaTeX packages from the error log TraceReduction.log.  
! LaTeX Error: There's no line here to end.

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

The log says at the very end:

LaTeX Font Info: Font shape `T1/lmtt/bx/n' in size <10> not available  
(Font) Font shape `T1/lmtt/b/n' tried instead on input line 183.

Overfull hbox (128.74324pt too wide) in paragraph at lines 189--189  
[]T1/lmtt/m/n/10 ## -- Attaching packages ------------------------------------  
---------------------------------- tidyverse 1.3.0 --[]  
[]

Overfull hbox (128.74324pt too wide) in paragraph at lines 202--202  
[]T1/lmtt/m/n/10 ## -- Conflicts ---------------------------------------------  
---------------------------- tidyverse_conflicts() --[]  
[]

[1

{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/[pdftex.map](http://pdftex.map)}]  
LaTeX Font Info: Try loading font information for TS1+lmtt on input line 207  
.  
(/usr/local/texlive/2019/texmf-dist/tex/latex/lm/ts1lmtt.fd  
File: ts1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern  
) [2] [3]

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.  
Type H <return> for immediate help.  
...

l.363 }  
  
Here is how much of TeX's memory you used:  
14029 strings out of 492616  
209557 string characters out of 6129482  
322864 words of memory out of 5000000  
17722 multiletter control sequences out of 15000+600000  
33795 words of font info for 53 fonts, out of 8000000 for 9000  
1141 hyphenation exceptions out of 8191  
42i,9n,50p,822b,508s stack positions out of 5000i,500n,10000p,200000b,80000s

! ==> Fatal error occurred, no output PDF file produced!
giscus-bot giscus-bot 3y ago
Guest *Andrey Sivyakov* @ 2020-05-13 02:56:05 originally posted:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
I can't find the format file `pdflatex.fmt'!
Running the command C:UserssolgaAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UserssolgaAppDataRoamingTinyTeXbinwin32mktexfmt
I was unable to find any missing LaTeX packages from the error log test1.log.
! Running the command C:UserssolgaAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UserssolgaAppDataRoamingTinyTeXbinwin32mktexfmt

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

yihui yihui 3y ago

I'm investigating this issue right now. Please keep an eye on rstudio/tinytex#210 Thanks, and sorry for the trouble!

Originally posted on 2020-05-14 03:03:18

giscus-bot giscus-bot 3y ago
Guest *Andrey Sivyakov* @ 2020-05-14 03:10:24 originally posted:

Thank you! I ended up using MiKTeX eventually. There seem to be issues with installation of MiKTeX/TexLive packages when you install them not as admin. What I ended up doing after installation of MiKTeX was knitting .rmd file from cmd as Admin. This way MiKTeX will let you know what packages are missing and install them all. After that I can knit rmd to PDF using the button in RStudio. Note sure it will help you troubleshoot the issue with TinyTex though :)

Thanks again!

Andrey

giscus-bot giscus-bot 3y ago
Guest *Joanne Imanuel* @ 2020-05-14 01:59:01 originally posted:

Hi Yihui,
I get the following Message Box when I try to knit an Rmarkdown file to PDF.

"The code execution cannot proceed because luatex.dll was not found. Reinstalling the program may fix this problem."

with the following output in R
output file: TestFile.knit.md

! Running the command C:UsersJoanne RuthAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UsersJoanne RuthAppDataRoamingTinyTeXbinwin32mktexfmt

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

I have tried uninstalling and then reinstalling tinytex even reinstalling R but nothing seems to work.
During the installation, I get the message box saying that there would be two error messages pertaining to luatex.dll and that they can just be ignored. Somehow, they end up being a problem when I try to knit.

Would appreciate any help.
Many thanks!

yihui yihui 3y ago

I'm investigating this issue right now. Please keep an eye on rstudio/tinytex#210 Thanks, and sorry for the trouble!

Originally posted on 2020-05-14 03:02:39

giscus-bot giscus-bot 3y ago
Guest *Joanne Imanuel* @ 2020-05-14 03:09:34 originally posted:

Thanks for the quick reply.
Will keep an eye on the GitHub thread.
Appreciate the help!

giscus-bot giscus-bot 3y ago
Guest *Vidhi Patel* @ 2020-05-15 11:39:58 originally posted:

even i am getting this error. I have tried everything reinstalling, uninstalling, updating R everything. Please help

yihui yihui 3y ago

As I said below, the thread rstudio/tinytex#210 contains the latest updates about this problem, which has affected many people, and you are certainly not alone. Thanks!

Originally posted on 2020-05-15 19:19:35

giscus-bot giscus-bot 3y ago
Guest *Melvin Lopez* @ 2020-05-14 03:43:19 originally posted:

I have spent a number of hours trying different solution to resolve my PDF compilation problem. From my search I have tried a number of suggestions to no avail from this thread. rstudio/tinytex#103. Unfortunately, it doesn't say if Keabla's issue was resolved, but any assistance would be greatly appreciated.

Regards,
Mel

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

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
I can't find the format file `pdflatex.fmt'!
Running the command C:UsersmelviAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UsersmelviAppDataRoamingTinyTeXbinwin32mktexfmt
I was unable to find any missing LaTeX packages from the error log test.log.
! Running the command C:UsersmelviAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UsersmelviAppDataRoamingTinyTeXbinwin32mktexfmt

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

TinyTex Install
tinytex:::is_tinytex() = TRUE

PDFLATEX Info

file.info(tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'pdflatex.exe'))
size isdir mode
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/pdflatex.exe 1536 FALSE 777
mtime
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/pdflatex.exe 2020-05-13 22:59:52
ctime
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/pdflatex.exe 2020-05-13 22:59:52
atime
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/pdflatex.exe 2020-05-13 23:12:32
exe
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/pdflatex.exe win32

Tinytex root

tinytex::tinytex_root()
[1] "C:UsersmelviAppDataRoamingTinyTeX"

PATH INFO

Sys.getenv('PATH')
[1] "C:rtools40usrbin;C:Program FilesRR-4.0.0binx64;H:OculusSupportoculus-runtime;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)Calibre2;C:Program FilesNVIDIA CorporationNVIDIA NvDLISR;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;h:Program FilesGitcmd;C:UsersmelviAppDataRoamingTinyTeX;C:UsersmelviAppDataLocalMicrosoftWindowsApps;C:UsersmelviAppDataRoamingTinyTeXtexmf-disttexlatexlatexconfig;C:UsersmelviAppDataRoamingTinyTeXbinwin32"
(tinytex::tlmgr_path())
Use of uninitialized value in bitwise or (|) at C:UsersmelviAppDataRoamingTinyTeXtexmf-distscriptstexlivetlmgr.pl line 1497.
[1] 0

(function() { tinytex:::tweak_path(); Sys.getenv('PATH') })()
[1] "C:rtools40usrbin;C:Program FilesRR-4.0.0binx64;H:OculusSupportoculus-runtime;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)Calibre2;C:Program FilesNVIDIA CorporationNVIDIA NvDLISR;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;h:Program FilesGitcmd;C:UsersmelviAppDataRoamingTinyTeX;C:UsersmelviAppDataLocalMicrosoftWindowsApps;C:UsersmelviAppDataRoamingTinyTeXtexmf-disttexlatexlatexconfig;C:UsersmelviAppDataRoamingTinyTeXbinwin32"

p = tinytex:::win_app_dir('TinyTeX', 'bin', 'win32', 'tlmgr.bat')
p
[1] "C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/tlmgr.bat"
file_test('-x', p)
C:UsersmelviAppDataRoaming/TinyTeX/bin/win32/tlmgr.bat
TRUE
(function() {

  • tinytex:::tweak_path()
  • print(Sys.which('pdflatex'))
  • system2('pdflatex', '--version')
  • })()
    pdflatex
    "C:UsersmelviAppDataRoamingTinyTeXbinwin32pdflatex.exe"
    pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX)
    kpathsea version 6.3.2
    Copyright 2020 Han The Thanh (pdfTeX) et al.
    There is NO warranty. Redistribution of this software is
    covered by the terms of both the pdfTeX copyright and
    the Lesser GNU General Public License.
    For more information about these matters, see the file
    named COPYING and the pdfTeX source.
    Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
    Compiled with libpng 1.6.37; using libpng 1.6.37
    Compiled with zlib 1.2.11; using zlib 1.2.11
    Compiled with xpdf version 4.02

pdflatex
Error: object 'pdflatex' not found
""
[1] ""

yihui yihui 3y ago

You can ignore rstudio/tinytex#103 but keep an eye on rstudio/tinytex#210 instead. Thanks, and I'm sorry for the trouble!

Originally posted on 2020-05-14 03:50:04

giscus-bot giscus-bot 3y ago
Guest *Melvin Lopez* @ 2020-05-14 04:17:23 originally posted:

Thank you, I thought I was losing my mind or my troubleshooting skills were @#$@#

I guess I will have to wait until its fixed. Would going to a different distribution help?

giscus-bot giscus-bot 3y ago
Guest *ladylori33* @ 2020-05-14 04:31:18 originally posted:

I am trying to knit a pdf document and am receiving the following message. I have gone through the debugging instructions as well as some of the additional suggestions in the comments for similar issues, and haven't been able to resolve the issue. Anything that you can do to help would be greatly appreciated.

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted write18 enabled.
I can't find the format file `pdflatex.fmt'!
Running the command C:UserslstevAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:UserslstevAppDataRoamingTinyTeXbinwin32mktexfmt
I was unable to find any missing LaTeX packages from the error log report.log.
! Running the command C:UserslstevAppDataRoamingTinyTeXbinwin32fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:UserslstevAppDataRoamingTinyTeXbinwin32mktexfmt

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

yihui yihui 3y ago

Please keep an eye on rstudio/tinytex#210 Thanks, and sorry for the trouble!

Originally posted on 2020-05-14 13:09:06

giscus-bot giscus-bot 3y ago
Guest *Qian Wang* @ 2020-06-04 14:29:03 originally posted:

Hi Yihui,

I am stuck with this error message when I am trying to create output in PDF while using R Markdown after knitting.

Error: LaTeX failed to compile my-R-Markdown.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.

I have tried all debugging tips but this error message still exist.

Could you pls so kind and help me?

Thanks

Qian

giscus-bot giscus-bot 3y ago
Guest *Rubayat Jinnah* @ 2020-06-10 03:34:04 originally posted:

Hi, I am using Rmarkdown and xelatex as a pdf engine. I am getting the following error.
! LaTeX Error: Option clash for package fontspec.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.65 ...Package[eu@zf@math]{fontspec}[2008/08/09]

giscus-bot giscus-bot 3y ago
Guest *Sócrates Brasileiro* @ 2020-06-23 19:38:06 originally posted:

Hi, thank you for your dedication. Just sharing a recent experience that brought me to this site. While compiling a RMarkdown file to a pdf, I received an error message that lead me here. The error message was:

"
! Missing $ inserted.

$
l.457 $ y_{j, k} = mu + a_{k} + b_{j,k} $
Try to find the following text in Multilevel-Specification.Rmd:
$ y_{j, k}
You may need to add $ $ around a certain inline R expression r in Multilevel-Specification.Rmd (see the above hint). See rstudio/rmarkdown#385 for more info.
Error: LaTeX failed to compile Multilevel-Specification.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Multilevel-Specification.log for more info.
Execution halted"

I had no inline r expression, and I was able to compile to MSWord (although the inline equation was not properly formatted). So I thought there was a separated issue regarding compiling to pdf, and I came to this site and I started following all the suggested steps to debug it, but always unsuccessfuly. When I tried tinytex:::install_prebuilt(), then I got worried, because, it started installing something and did not stoped, the pop-up window was saying that it was installed up to 64315136565% or something like that when I forcefully shut RStudio down. After all trials, I tried to uninstall MikTek and install TexLive. I left it overnight, and in the morning it was saying it would still take 10 hours to finish. I just aborted it.

Then I came back to the first part of the error message. And I realized that I had an inline equation $ y_{j, k} = mu + a_{k} + b_{j,k} $ with blank spaces between dollar signs and math symbols. I just trimmed off blank spaces ($y_{j, k} = mu + a_{k} + b_{j,k}$) and done, it compiled.

yihui yihui 3y ago

Thanks for posting back! Here is the official documentation about math expressions in Pandoc's Markdown: https://pandoc.org/MANUAL.html#math

Originally posted on 2020-06-23 20:18:22

giscus-bot giscus-bot 3y ago
Guest *Jammi N Rao* @ 2020-07-07 18:32:56 originally posted:

Hi Yihui,
I am using R v 4 and RStudio both recently re-installed. Knit woirked fine until this morning and then for no discernible reason I get this error on the same .RMD file

!fmtutil [ERROR]: -user mode but path setup is -sys type, bailing out

Is it obvious what the probllem is

yihui yihui 3y ago

I don't have an idea about this error. A blind shot in the dark that I usually recommend is tinytex:::install_prebuilt().

Originally posted on 2020-07-07 23:53:49

giscus-bot giscus-bot 3y ago
Guest *Oscar MK* @ 2020-08-22 07:07:48 originally posted:

Hi, Yihui!
I am working in Rstudio Cloud and I have this error. I appreciate yout help.

! Undefined control sequence.
l.8 tikz
node [scale=1, inner sep=0] {

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

giscus-bot giscus-bot 3y ago
Guest *RHT* @ 2020-08-25 01:54:58 originally posted:

bookdown::render_book('index.Rmd', "bookdown::pdf_book", config_file='_bookdown.yml', clean=TRUE)

! ! Unable to read an entire line---bufsize=200000.

! Please increase buf_size in texmf.cnf.

giscus-bot giscus-bot 3y ago
Guest *RHT* @ 2020-08-25 02:35:35 originally posted:

bookdown::render_book('index.Rmd', "bookdown::pdf_book", config_file='_bookdown.yml', clean=TRUE)

! ! Unable to read an entire line---bufsize=200000.

! Please increase buf_size in texmf.cnf.

Solution:

Sys.setenv(buf_size=999999)
bookdown::render_book('index.Rmd', "bookdown::pdf_book", config_file='_bookdown.yml', clean=TRUE)
Sys.unsetenv("buf_size")

giscus-bot giscus-bot 3y ago
Guest *Pamela* @ 2020-09-29 02:01:26 originally posted:

Hi Yihui: I updated the Latex package following your instructions but I got the following error message:
tlmgr update --all --self
Error in system2("tlmgr", args, ...) : '"tlmgr"' not found

install.packages(tlmgr)
Error in install.packages : 'match' requires vector arguments

what I should do?
Thank you
Best
Pamela

yihui yihui 3y ago

I don't think you have installed TinyTeX. Please try tinytex::install_tinytex().

Originally posted on 2020-09-29 15:00:17

giscus-bot giscus-bot 3y ago
Guest *Muhammet F Isik* @ 2020-11-07 19:55:05 originally posted:

I keep getting error below, Can anyone help me about this ?

output file: asdada.knit.md

! kpathsea: Running mktexfmt pdflatex.fmt

! mktexfmt [ERROR]: -user mode but path setup is -sys type, bailing out.

Error: LaTeX failed to compile asdada.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See asdada.log for more info.
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/

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

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

MacTeX on macOS - https://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)

Linux: Use system package manager

giscus-bot giscus-bot 3y ago
Guest *Sahil* @ 2020-11-19 03:43:39 originally posted:

I am trying to knit a .RMD file as .PDF file. I am getting the following error on console. I tried updating packages via Tools but it didn't work.

How do I change the xfun version?
namespace 'xfun' 0.17 is already loaded, but >= 0.19 is required

giscus-bot giscus-bot 3y ago
yihui yihui 3y ago

install.packages('xfun')

Originally posted on 2020-11-19 14:24:09

Sign in to join the discussion

Sign in with GitHub