首页 > 解决方案 > RMarkdown 没有编译成 PDF

问题描述

我需要使用 RMarkdown 编译成一个 pdf,但它不起作用。我所有的脚本都可以自己完美运行,但不想在 RMarkdown 中创建 pdf。我需要做什么,我没有使用 RMarkdown 足够知道该怎么做。

这是我的错误输出:

output file: R-Markdown-Midterm.knit.md

A new version of TeX Live has been released. If you need to install or update any LaTeX packages, you have to upgrade TinyTeX with tinytex::reinstall_tinytex(). If it fails to upgrade, you might be using a default random CTAN mirror that has not been fully synced to the main CTAN repository, and you need to wait for a few more days or use a CTAN mirror that is known to be up-to-date (see the "repository" argument on the help page ?tinytex::install_tinytex()).

tlmgr: Local TeX Live (2019) is older than remote repository (2020).
Cross release updates are only supported with
  update-tlmgr-latest(.sh/.exe) --update
See https://tug.org/texlive/upgrade.html for details.
! LaTeX Error: File `xcolor.sty' not found.

! Emergency stop.
<read *> 

Error: LaTeX failed to compile R-Markdown-Midterm.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See R-Markdown-Midterm.log for more info.
In addition: Warning messages:
1: In in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,  :
  You changed the working directory to /Users/eruiz/Desktop/Stevens/Summer 2020/FE630 Portfolio Theory and Applications/Midterm/Summer 2020/Code (probably via setwd()). It will be restored to /Users/eruiz/Desktop/Stevens/Summer 2020/FE630 Portfolio Theory and Applications/Midterm/Summer 2020. See the Note section in ?knitr::knit
2: In in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,  :
  You changed the working directory to /Users/eruiz/Desktop/Stevens/Summer 2020/FE630 Portfolio Theory and Applications/Midterm/Summer 2020/Code (probably via setwd()). It will be restored to /Users/eruiz/Desktop/Stevens/Summer 2020/FE630 Portfolio Theory and Applications/Midterm/Summer 2020. See the Note section in ?knitr::knit
3: In system2("tlmgr", args, ...) :
  running command ''tlmgr' search --file --global '/xcolor.sty'' had status 1
Execution halted

标签: rpdfcompilationr-markdown

解决方案


推荐阅读