我已经安装了latex,并在RSTUDIO_PDFLATEX环境变量中指定了路径。但它仍然无法找到它,并一直让我安装Miktex或tinytex,而我并不想这样做。有人知道为什么吗?
> Sys.getenv("RSTUDIO_PDFLATEX")
[1] "/home/victor/local/texlive/2020/bin/x86_64-linux/pdflatex"
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS ddd.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output ddd.tex --lua-filter /home/victor/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/victor/R/x86_64-pc-linux-gnu-library/3.6/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in'
output file: ddd.knit.md
! sh: 1: pdflatex: not found
Error: LaTeX failed to compile ddd.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See ddd.log for more info.
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
error in running command
Execution halted
No LaTeX installation detected (LaTeX is required to create PDF output). You should install a LaTeX distribution for your platform: https://www.latex-project.org/get/
If you are not sure, you may install TinyTeX in R: tinytex::install_tinytex()
Otherwise consider MiKTeX on Windows - http://miktex.org
发布于 2021-01-16 12:03:32
我在系统环境变量PATH中添加了texlive的目录,并重新启动系统后,Rstudio终于可以找到pdflatex了!
但是,如果有人知道如何使用RSTUDIO_PDFLATEX,欢迎留下评论!
https://stackoverflow.com/questions/65746136
复制相似问题