尝试运行 Rmarkdown 时出错 - 错误:LaTeX 无法编译

问题描述 投票:0回答:1

我尝试在 Windows 上运行 Rmarkdow 代码来创建 pfd 并收到以下错误:

! ...וסף\AppData\Roaming\TinyTeX\bin\windows\runscript.tlu:941: ...וסף\AppData\Roaming\TinyTeX\bin\windows\runscript.tlu:864: no appropriate script or program found: fmtutil
Running the command C:\Users\���� ����\AppData\Roaming\TinyTeX\bin\windows\fmtutil-user.exe

Error: LaTeX failed to compile gg.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See gg.log for more info.
In addition: There were 27 warnings (use warnings() to see them)
Execution halted

我已经尝试按照这里的说明进行操作 RStudio 未检测到 TeX 安装 #103

R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)


Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
  LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
  LC_TIME=English_United States.utf8    

time zone: Asia/Hebron
tzcode source: internal

Package version:
  base64enc_0.1.3   bslib_0.4.2       cachem_1.0.7      cli_3.6.1         digest_0.6.31    
  ellipsis_0.3.2    evaluate_0.20     fastmap_1.1.1     fontawesome_0.5.1 fs_1.6.2         
  glue_1.6.2        graphics_4.3.0    grDevices_4.3.0   highr_0.10        htmltools_0.5.5  
  jquerylib_0.1.4   jsonlite_1.8.4    knitr_1.42        lifecycle_1.0.3   magrittr_2.0.3   
  memoise_2.0.1     methods_4.3.0     mime_0.12         R6_2.5.1          rappdirs_0.3.3   
  rlang_1.1.1       rmarkdown_2.21    sass_0.4.5        stats_4.3.0       stringi_1.7.12   
  stringr_1.5.0     tinytex_0.45      tools_4.3.0       utils_4.3.0       vctrs_0.6.2      
  xfun_0.39         yaml_2.3.7       

Pandoc version: 2.19.2
> tinytex::tinytex_root()
[1] "C:\\Users\\עידן יוסף\\AppData\\Roaming\\TinyTeX"

比:

> Sys.getenv('PATH')
[1] "c:\\rtools43\\x86_64-w64-mingw32.static.posix\\bin;c:\\rtools43\\usr\\bin;C:\\Program Files\\R\\R-4.3.0\\bin\\x64;C:\\Program Files (x86)\\Razer Chroma SDK\\bin;C:\\Program Files\\Razer Chroma SDK\\bin;C:\\Program Files (x86)\\Razer\\ChromaBroadcast\\bin;C:\\Program Files\\Razer\\ChromaBroadcast\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\עידן יוסף\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\עידן יוסף\\AppData\\Roaming\\TinyTeX\\bin\\windows;C:\\Program Files\\RStudio\\resources\\app\\bin\\quarto\\bin;C:\\Program Files\\RStudio\\resources\\app\\bin\\postback"

这没有任何作用

tinytex::tlmgr_path()

还有:

> file.info(p)
                                                                      size isdir mode mtime ctime
C:\\Users\\עידן יוסף\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe   NA    NA <NA>  <NA>  <NA>
                                                                      atime  exe
C:\\Users\\עידן יוסף\\AppData\\Roaming/TinyTeX/bin/win32/pdflatex.exe  <NA> <NA>

我希望它有用,我可以检查其他事情,但不知道该怎么做

任何建议都会有帮助

问候

r pdf latex r-markdown tinytex
1个回答
0
投票

这个问题最近已在 R 包tinytex中得到解决。基本上,您需要将 TinyTeX 移动或重新安装到路径不包含非 ASCII 字符的位置,例如,

install.packages('tinytex', repos='https://rstudio.r-universe.dev') tinytex::reinstall_tinytex()
    
© www.soinside.com 2019 - 2024. All rights reserved.