Pleas I use PC (Windows 10), R version 3.6.2, Rstudio 1.2.1335.
First, I've read all the issues listed here, some of issues are really similar to mine, but none of them can solve my problem. So I started investigating by trying different possible solution.
First of all, in order to clear out all the Tex issue, I uninstall all the tex software (e.g, CTEX, MIKTEX, TEXSTUDIO, TEXTWORK, etc.) then open RStudio to install TinyTex.
- install r-package "tinytex" done
-
install the LaTex distribution via R
tinytex::install_tinytex(TRUE) This step gave me some issues but I don't know why. after running this, R console remind me to close my rstudio, reopen, and try " tinytex:::is_tinytex() " (See blog below).
TinyTeX installed to C:\Users\abc\AppData\Roaming/TinyTeX
Please quit and reopen your R session and IDE (if you are using one, such as RStudio or Emacs) and check if tinytex:::is_tinytex() is TRUE.
Warning messages:
1: Detected an existing tlmgr at C:\Users\abc\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat. 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().
2: In file.remove("TinyTeX/install-tl.log") :
cannot remove file 'TinyTeX/install-tl.log', reason 'No such file or directory'
Somehow the system always said "FALSE", but it is fixed by using "tinytex:::install_prebuilt()".
Then, I've tried 2 commands:
tinytex::tinytex_root()
The system gave:
[1] "C:\Users\abc\AppData\Roaming\TinyTeX"
Then update LaTeX packages
tinytex::tlmgr_update()
The system gave:
Setting up xz with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/xz/xz.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\xz\xz.exe didn't work
xz (XZ Utils) 5.2.4
liblzma 5.2.4
tlmgr.pl: package repository http://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable)
Cool, you see xz (XZ Utils) 5.2.4 and liblzma 5.2.4 first showed up.
Then I did what yihui suggested on the tinytex webpage to install all necessary packages:
tinytex:::install_yihui_pkgs().
Everything went well and then the xz.exe didn't work showed again.
Setting up xz with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/xz/xz.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\xz\xz.exe didn't work
xz (XZ Utils) 5.2.4
liblzma 5.2.4
TLPDB::_install_package: unsupported container format xz
TLPDB::_install_package: unsupported container format xz
TLPDB::_install_package: unsupported container format xz
xz (XZ Utils) 5.2.4
liblzma 5.2.4
Then, I knit my Rmarkdown file. The system gave a lot of 'Can't spawn "cmd.exe" message' and eventually halt my file compiling process.
here is the part of what I get.
Setting up tar with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/tar.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\tar.exe didn't work
GNU tar 1.11.8 + 2.2(WIN32)
Setting up wget with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/wget/wget.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\wget\wget.exe didn't work
GNU Wget 1.20.1 built on mingw32.
Setting up xz with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/xz/xz.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\xz\xz.exe didn't work
xz (XZ Utils) 5.2.4
liblzma 5.2.4
tlmgr.pl: package repository http://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable)
[1/2, ??:??/??:??] install: lm-math [369k]
[2/2, 00:00/00:00] install: unicode-math [42k]
TLPDB::_install_package: unsupported container format xz
TLPDB::_install_package: unsupported container format xz
tlmgr.pl: package log updated: C:/Users/abc/AppData/Roaming/TinyTeX/texmf-var/web2c/tlmgr.log
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
tlmgr search --file --global "/unicode-math.sty"
Setting up xz with C:/Users/abc/AppData/Roaming/TinyTeX/tlpkg/installer/xz/xz.exe as C:\Users\abc\AppData\Roaming\TinyTeX\tlpkg\installer\xz\xz.exe didn't work
! LaTeX Error: File `unicode-math.sty' not found.
! Emergency stop.
<read *>
Error: LaTeX failed to compile gtap_summary_report_final.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See gtap_summary_report_final.log for more info.
Execution halted
OK. I guess I may not have 'unicode-math.sty' and I went to website, download it, then I don't know where I should put to the Tinytex subfolder, since I've already removed all the CTEX, MIKTEX, TEXTWORK software from my pc.
2nd thought: I reinstall CTEX in which MIKTEX basic and textwork are both included.
Need your help to solve the problem.