• R语言已解决
  • 电脑名称中文,R Markdown 制作 beamer 幻灯片出错。

各位大佬,大家好。我按照谢老大https://yihui.org/tinytex/cn/这里的说明已经安装好TinyTeX,运行出现下列错误:
我猜想是路径中包含了中文“微软”,不换电脑情况下如何解决?

Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/??/Documents": 文件名、目录名或卷标语法不正确。
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/??/Documents": 文件名、目录名或卷标语法不正确。

processing file: 123.Rmd
|.......... | 14%
ordinary text without R code

|.................... | 29%
label: setup (with options)
List of 1
$ include: logi FALSE

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

|........................................ | 57%
label: cars
|.................................................. | 71%
ordinary text without R code

|............................................................ | 86%
label: pressure (with options)
List of 1
$ echo: logi FALSE

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

"D:/RStudio/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS 123.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output 123.tex --lua-filter "E:\rpackages4.1.3\library\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "E:\rpackages4.1.3\library\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in"
output file: 123.knit.md

tlmgr update --all --self
warning: kpathsea: configuration file texmf.cnf not found in these directories: C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf/web2c;C:/Users/΢��/AppData/Roaming/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf/web2c.
tlmgr.pl: package repository https://mirrors.nwafu.edu.cn/ctan/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr.pl install: package already present: kpathsea
! warning: kpathsea: configuration file texmf.cnf not found in these directories: C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf/web2c;C:/Users/΢��/AppData/Roaming/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf/web2c.
! ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
! warning: kpathsea: mktexfmt output `c:/Users/΢��/AppData/Roaming/TinyTeX/texmf-var/web2c/pdftex/pdflatex.fmt' instead of a filename.

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

! warning: kpathsea: configuration file texmf.cnf not found in these directories: C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/win32/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/bin/texmf/web2c;C:/Users/΢��/AppData/Roaming/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/share/texmf/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-local/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf-dist/web2c;C:/Users/΢��/AppData/Roaming/TinyTeX/texmf/web2c.
! ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:935: ...s\微软\AppData\Roaming\TinyTeX\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! Running the command C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\fmtutil-user.exe

! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:\Users\΢��\AppData\Roaming\TinyTeX\bin\win32\mktexfmt

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

Error: LaTeX failed to compile 123.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See 123.log for more info.
In addition: Warning messages:
1: In xfun::read_utf8(f2) :
The file C:\Users\微软\AppData\Local\Temp\Rtmpsjit8c\stderr524820ef38e6 is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 1, 3, 7, 8
2: In xfun::read_utf8(f2) :
The file C:\Users\微软\AppData\Local\Temp\Rtmpsjit8c\stderr5248642539e0 is not encoded in UTF-8. These lines contain invalid UTF-8 characters: 1, 3, 7, 8
3: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
4: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
5: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
6: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
7: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
8: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
9: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
10: In grepl("==> Fatal error occurred", x, fixed = TRUE) :
input string 1 is invalid in this locale
Execution halted

以下为R相关信息:

> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8 
[2] LC_CTYPE=Chinese (Simplified)_China.utf8   
[3] LC_MONETARY=Chinese (Simplified)_China.utf8
[4] LC_NUMERIC=C                               
[5] LC_TIME=Chinese (Simplified)_China.utf8    

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1 

    chuxinyuan 谢谢,换一台电脑就可以。电脑名不好修改,好像只有重复系统比较直接~~

    tctcab 尝试了后回来汇报下,只是这样不行,需要把tinytex的安装路径设置下,默认的通常不行。
    通过定义tinytex:::install_prebuilt('~/Downloads/TinyTeX-v2021.01.zip',dir="D:\\temp")

    4 天 后
    1 年 后

    epoh_f 费力刨了一个星期,终于把这个问题刨到了底。装一下开发版本的 tinytex:

    install.packages('tinytex', repos = 'https://rstudio.r-universe.dev')

    然后要么把已安装的 TinyTeX 挪走,要么干脆重装:

    tinytex::reinstall_tinytex()