Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Rmd compilation failed due to LaTeX

I am trying to knit my .Rmd document to pdf. I have tried both to install tinytex and separate miktex distribution, but neither helped. When I compile a .Rmd file I still get:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS file-R-20200512.utf8.md --to beamer --from markdown+autolink_bare_uris+tex_math_single_backslash --output file-R-20200512.tex --highlight-style tango --pdf-engine pdflatex --self-contained 
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7400 64-bit)
entering extended mode

Sorry, but C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed.

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

  C:\Users\my_username\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log
I was unable to find any missing LaTeX packages from the error log file-R-20200512.log.
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7400 64-bit)
entering extended mode

Sorry, but C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed.

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

  C:\Users\my_username\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log
I was unable to find any missing LaTeX packages from the error log file-R-20200512.log.
Error: LaTeX failed to compile file-R-20200512.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
  In addition: Warning messages:
  1: In readLines(log) :
  incomplete final line found on 'file-R-20200512.log'
2: In readLines(log) :
  incomplete final line found on 'file-R-20200512.log'
3: In readLines(log) :
  incomplete final line found on 'file-R-20200512.log'
Execution halted

The .log file contains following output. I have tried to update packages from miktex, but the check doesn't find any updates since installation.

2020-05-06 16:01:18,180+0200 INFO  pdflatex - this process (38856) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:01:18,191+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:01:18,192+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:01:18,325+0200 INFO  pdflatex - going to create file: pdflatex.fmt
2020-05-06 16:01:18,367+0200 INFO  pdflatex.core - start process: initexmf --dump-by-name=pdflatex --engine=pdftex
2020-05-06 16:01:30,553+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:01:30,553+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:01:30,558+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:01:30,558+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:01:30,558+0200 FATAL pdflatex - Info: 
  2020-05-06 16:01:30,559+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:01:30,559+0200 FATAL pdflatex - Line: 77
2020-05-06 16:01:30,559+0200 INFO  pdflatex - this process (38856) finishes with exit code 1
2020-05-06 16:01:30,559+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:01:30,559+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:01:34,677+0200 INFO  pdflatex - this process (78772) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:01:34,690+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:01:34,690+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:01:34,911+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:01:34,911+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:01:34,911+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:01:34,911+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:01:34,911+0200 FATAL pdflatex - Info: 
  2020-05-06 16:01:34,911+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:01:34,911+0200 FATAL pdflatex - Line: 77
2020-05-06 16:01:34,911+0200 INFO  pdflatex - this process (78772) finishes with exit code 1
2020-05-06 16:01:34,913+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:01:34,913+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:01:43,760+0200 INFO  pdflatex - this process (39904) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:01:43,773+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:01:43,773+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:01:43,997+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:01:43,997+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:01:43,997+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:01:43,998+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:01:43,998+0200 FATAL pdflatex - Info: 
  2020-05-06 16:01:43,998+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:01:43,998+0200 FATAL pdflatex - Line: 77
2020-05-06 16:01:43,998+0200 INFO  pdflatex - this process (39904) finishes with exit code 1
2020-05-06 16:01:44,000+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:01:44,000+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:01:47,971+0200 INFO  pdflatex - this process (74460) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:01:47,992+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:01:47,992+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:01:48,163+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:01:48,164+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:01:48,164+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:01:48,164+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:01:48,164+0200 FATAL pdflatex - Info: 
  2020-05-06 16:01:48,165+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:01:48,165+0200 FATAL pdflatex - Line: 77
2020-05-06 16:01:48,165+0200 INFO  pdflatex - this process (74460) finishes with exit code 1
2020-05-06 16:01:48,166+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:01:48,166+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:09:36,414+0200 INFO  pdflatex - this process (36484) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:09:36,423+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:09:36,423+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:09:36,735+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:09:36,735+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:09:36,735+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:09:36,735+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:09:36,735+0200 FATAL pdflatex - Info: 
  2020-05-06 16:09:36,735+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:09:36,735+0200 FATAL pdflatex - Line: 77
2020-05-06 16:09:36,737+0200 INFO  pdflatex - this process (36484) finishes with exit code 1
2020-05-06 16:09:36,739+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:09:36,739+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:09:40,541+0200 INFO  pdflatex - this process (45876) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:09:40,553+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:09:40,553+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:09:40,774+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:09:40,774+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:09:40,774+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:09:40,774+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:09:40,774+0200 FATAL pdflatex - Info: 
  2020-05-06 16:09:40,774+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:09:40,774+0200 FATAL pdflatex - Line: 77
2020-05-06 16:09:40,774+0200 INFO  pdflatex - this process (45876) finishes with exit code 1
2020-05-06 16:09:40,774+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:09:40,774+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:09:49,202+0200 INFO  pdflatex - this process (72048) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:09:49,215+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:09:49,215+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:09:49,425+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:09:49,425+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:09:49,425+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:09:49,427+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:09:49,427+0200 FATAL pdflatex - Info: 
  2020-05-06 16:09:49,427+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:09:49,427+0200 FATAL pdflatex - Line: 77
2020-05-06 16:09:49,427+0200 INFO  pdflatex - this process (72048) finishes with exit code 1
2020-05-06 16:09:49,429+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:09:49,429+0200 ERROR miktex.core - still open: file-R-20200512.log
2020-05-06 16:09:53,141+0200 INFO  pdflatex - this process (64132) started by 'Rterm' with command line: C:\Users\my_username~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe -halt-on-error -interaction=batchmode file-R-20200512.tex
2020-05-06 16:09:53,151+0200 INFO  pdflatex - allowing known shell commands
2020-05-06 16:09:53,151+0200 INFO  pdflatex - enabling input (output) from (to) processes
2020-05-06 16:09:53,304+0200 FATAL pdflatex.core - GUI framework cannot be initialized.
2020-05-06 16:09:53,304+0200 FATAL pdflatex.core - Data: 
  2020-05-06 16:09:53,304+0200 FATAL pdflatex.core - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp:77
2020-05-06 16:09:53,304+0200 FATAL pdflatex - GUI framework cannot be initialized.
2020-05-06 16:09:53,304+0200 FATAL pdflatex - Info: 
  2020-05-06 16:09:53,304+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-05-06 16:09:53,304+0200 FATAL pdflatex - Line: 77
2020-05-06 16:09:53,304+0200 INFO  pdflatex - this process (64132) finishes with exit code 1
2020-05-06 16:09:53,304+0200 ERROR miktex.core - still open: file-R-20200512.tex
2020-05-06 16:09:53,304+0200 ERROR miktex.core - still open: file-R-20200512.log

What may be the issue and how can I fix it?

like image 710
Xaume Avatar asked May 06 '20 14:05

Xaume


1 Answers

So first, I uninstalled tinytex (I think by tinytex::uninstall_tinytex()).

Then, in miktex console, go to settings > allow install missing packages on the fly.

See if that works!

like image 77
J. W. Rozelle Avatar answered Oct 05 '22 22:10

J. W. Rozelle