Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R cmd check Latex error: FATAL pdflatex - GUI framework cannot be initialized

I am checking my package and this is actually the last remaining problem. The pdf file cannot be compiled and the logfile tells me

2015-10-15 14:17:47,430+0200 INFO  pdflatex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-10-15 14:17:50,276+0200 FATAL pdflatex - GUI framework cannot be initialized.
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Info: 
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2015-10-15 14:17:50,276+0200 FATAL pdflatex - Line: 50

Any idea where the problem could be?

like image 650
Christine Blume Avatar asked Oct 15 '15 12:10

Christine Blume


3 Answers

I had this same issue, but for the newest versions of Miktex, mo.exe does not exist, and is replaced by the Miktex console. If you open it, go into settings and change the package on-the-fly setting from "Ask Me" to "Always", then the packages will install. If you do "Never" instead, then you'll have to do the individual package installation described by @topchef.

October 2021 Screenshot of the MiKTeX Console Settings tab with "Always" selected

like image 177
user11837196 Avatar answered Nov 04 '22 02:11

user11837196


This is known problem wit MikTex 2.9 when pdflatex encounters error

GUI framework cannot be initialized.

(found on my Windows 7 system in the file ~\AppData\Local\MiKTeX\2.9\miktex\log)

So far, I can offer following sequence of actions to remedy this:

  1. In Windows Command prompt go to MiKTeX bin folder (e.g. C:\Program Files (x86)\MiKTeX 2.9\miktex\bin) and run utility mo.exe;

  2. In General tab change 'Install missing packages on-the-fly:' option to No (this will disable GUI and error above won't be happening again);

  3. Run R CMD that calls latex converter again (in my case

    R CMD Rd2pdf man/
    

again to see new errors;

  1. This time miktex won't complaint about GUI - instead it will be missing packages with error like this

    ! LaTeX Error: File `inconsolata.sty' not found.
    
  2. Start MiKTeX package manager (again from mo.exe Packages tab) and install missing package one at the time by repeating steps 3.-5.

This might be not most effective way of fixing this so I appreciate corrections or alternative solutions.

like image 32
topchef Avatar answered Nov 04 '22 03:11

topchef


I ran into this problem just... A very easy solution for me that allowed me not to renege on the install on the fly option is to install TexStudio, open your .tex file in there, and compile it: you will be able to install all your MikTex packages on the fly as desired and retain control over what gets installed.

like image 3
tchevrier Avatar answered Nov 04 '22 01:11

tchevrier