rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.79k stars 1.27k forks source link

Unable to compile a book in pdf #531

Closed deanfantazzini closed 6 years ago

deanfantazzini commented 6 years ago

In the last 2 days I am completely unable to build a textbook with bookdown in pdf (while the gitbook version works normally): I tried to reinstall RStudio, Miktex (updating all packages), but to no avail. The funny thing is that in the error log it says that opening xelatex.exe did not succeed, but in the Rstudio global and project options pdfLaTex is used to compile Latex into pdf.

Find below the error that I get when trying to build the pdf of the classical bookdown-demo example:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS bookdown-demo.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bookdown-demo.tex --table-of-contents --toc-depth 2 --template "d:\PROGRA~2\R\R-34~1.3\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --number-sections --highlight-style tango --latex-engine xelatex --natbib --include-in-header preamble.tex --variable graphics=yes --variable "geometry:margin=1in" --variable tables=yes --standalone 
output file: bookdown-demo.knit.md

This is XeTeX, Version 3.14159265-2.6-0.99999 (MiKTeX 2.9.6600 64-bit)
entering extended mode

Sorry, but d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe did not succeed.

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

  C:/Users/Dean/AppData/Local/MiKTeX/2.9/miktex/log/xelatex.log

You may want to visit the MiKTeX project page, if you need help.
This is XeTeX, Version 3.14159265-2.6-0.99999 (MiKTeX 2.9.6600 64-bit)
entering extended mode

Sorry, but d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe did not succeed.

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

  C:/Users/Dean/AppData/Local/MiKTeX/2.9/miktex/log/xelatex.log

You may want to visit the MiKTeX project page, if you need help.
This is XeTeX, Version 3.14159265-2.6-0.99999 (MiKTeX 2.9.6600 64-bit)
entering extended mode

Sorry, but d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe did not succeed.

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

  C:/Users/Dean/AppData/Local/MiKTeX/2.9/miktex/log/xelatex.log

You may want to visit the MiKTeX project page, if you need help.

Output created: _book/bookdown-demo.pdf
������ � tools::file_path_as_absolute(output_file) :
  file '_book/bookdown-demo.pdf' does not exist
������: <Anonymous> ... render_book -> render_cur_session -> <Anonymous> -> <Anonymous>
��������: ��������������:
1: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
2: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
3: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
4: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
5: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
6: ���������� ������� '"xelatex" -halt-on-error -interaction=batchmode "bookdown-demo.tex"' ����� ������ 1 
���������� �����������
Exited with status 1.

The contents of the xelatex.log file are reported below:

2018-02-05 20:37:29,575+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:29,587+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:29,589+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:29,662+0300 INFO  xelatex - going to create file: xelatex.fmt
2018-02-05 20:37:32,821+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:32,821+0300 FATAL xelatex - Info: 
2018-02-05 20:37:32,821+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:32,821+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:32,821+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:37:33,012+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:33,012+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:33,027+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:33,273+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:33,273+0300 FATAL xelatex - Info: 
2018-02-05 20:37:33,273+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:33,273+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:33,273+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:37:33,470+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:33,486+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:33,486+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:33,735+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:33,735+0300 FATAL xelatex - Info: 
2018-02-05 20:37:33,735+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:33,735+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:33,735+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:37:33,935+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:33,950+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:33,950+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:34,201+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:34,201+0300 FATAL xelatex - Info: 
2018-02-05 20:37:34,201+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:34,201+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:34,201+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:37:34,404+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:34,419+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:34,419+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:34,670+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:34,670+0300 FATAL xelatex - Info: 
2018-02-05 20:37:34,670+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:34,670+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:34,670+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:37:34,862+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:37:34,877+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:37:34,877+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:37:35,137+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:37:35,137+0300 FATAL xelatex - Info: 
2018-02-05 20:37:35,137+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:37:35,137+0300 FATAL xelatex - Line: 45
2018-02-05 20:37:35,137+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:26,621+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:26,621+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:26,621+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:26,831+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:26,831+0300 FATAL xelatex - Info: 
2018-02-05 20:44:26,831+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:26,831+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:26,831+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:26,963+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:26,978+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:26,978+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:27,178+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:27,178+0300 FATAL xelatex - Info: 
2018-02-05 20:44:27,178+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:27,178+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:27,178+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:27,425+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:27,425+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:27,425+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:27,622+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:27,622+0300 FATAL xelatex - Info: 
2018-02-05 20:44:27,622+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:27,622+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:27,622+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:27,766+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:27,773+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:27,774+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:27,959+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:27,959+0300 FATAL xelatex - Info: 
2018-02-05 20:44:27,959+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:27,959+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:27,959+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:28,121+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:28,121+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:28,121+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:28,332+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:28,332+0300 FATAL xelatex - Info: 
2018-02-05 20:44:28,332+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:28,332+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:28,332+0300 INFO  xelatex - finishing with exit code 1
2018-02-05 20:44:28,457+0300 INFO  xelatex - starting with command line: d:\PROGRA~2\MIKTEX~1.9\miktex\bin\x64\xelatex.exe -halt-on-error -interaction=batchmode bookdown-demo.tex
2018-02-05 20:44:28,472+0300 INFO  xelatex - allowing known shell commands
2018-02-05 20:44:28,472+0300 INFO  xelatex - enabling input (output) from (to) processes
2018-02-05 20:44:28,673+0300 FATAL xelatex - GUI framework cannot be initialized.
2018-02-05 20:44:28,673+0300 FATAL xelatex - Info: 
2018-02-05 20:44:28,673+0300 FATAL xelatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2018-02-05 20:44:28,673+0300 FATAL xelatex - Line: 45
2018-02-05 20:44:28,673+0300 INFO  xelatex - finishing with exit code 1
deanfantazzini commented 6 years ago

here is the devtools::session_info('bookdown')

Session info -------------------------------------------------------------------------------------- setting value
version R version 3.4.3 (2017-11-30) system x86_64, mingw32
ui RStudio (1.1.419)
language (EN)
collate Russian_Russia.1251
tz Europe/Moscow
date 2018-02-05

Packages ------------------------------------------------------------------------------------------- package version date source
backports 1.1.2 2017-12-13 CRAN (R 3.4.3) base64enc 0.1-3 2015-07-28 CRAN (R 3.4.1) bookdown 0.6 2018-01-25 CRAN (R 3.4.3) digest 0.6.15 2018-01-28 CRAN (R 3.4.3) evaluate 0.10.1 2017-06-24 CRAN (R 3.4.3) graphics
3.4.3 2017-12-06 local
grDevices 3.4.3 2017-12-06 local
highr 0.6 2016-05-09 CRAN (R 3.4.3) htmltools 0.3.6 2017-04-28 CRAN (R 3.4.3) jsonlite 1.5 2017-06-01 CRAN (R 3.4.3) knitr 1.19 2018-01-29 CRAN (R 3.4.3) magrittr 1.5 2014-11-22 CRAN (R 3.4.3) markdown 0.8 2017-04-20 CRAN (R 3.4.3) methods
3.4.3 2017-12-06 local
mime 0.5 2016-07-07 CRAN (R 3.4.1) Rcpp 0.12.15 2018-01-20 CRAN (R 3.4.3) rmarkdown 1.8 2017-11-17 CRAN (R 3.4.3) rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3) stats 3.4.3 2017-12-06 local
stringi 1.1.6 2017-11-17 CRAN (R 3.4.2) stringr 1.2.0 2017-02-18 CRAN (R 3.4.3) tools 3.4.3 2017-12-06 local
utils
3.4.3 2017-12-06 local
xfun 0.1 2018-01-22 CRAN (R 3.4.3) yaml 2.1.16 2017-12-12 CRAN (R 3.4.3)

yihui commented 6 years ago

You may try to uninstall MiKTeX, and install TinyTeX instead (and restart RStudio):

devtools::install_github('yihui/tinytex')
tinytex::install_tinytex()
devtools::install_github('rstudio/rmarkdown')

More info: https://yihui.name/tinytex/

deanfantazzini commented 6 years ago

Thank you! You saved my day and really a lot of nerves. Thanks again.

yihui commented 6 years ago

Glad to know tinytex saved a person (once again)!

jiachenghe666 commented 5 years ago

Thanks! It saves my life, too!

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.