Quarto 每次编译 PDF 文档都会检查和升级 tlmgr 及 LaTeX 包,是 BUG 还是 Feature?
手动重新安装 texlive-scripts
tlmgr install texlive-scripts
fmtutil-sys 就可以用了。
- 已编辑
我都是使用笨办法一劳永逸地解决这个问题:直接安装全集版 TeX Live,如 TinyTeX-2,texlive-full,或 MacTeX。
Cloud2016 TinyTeX-2 全家桶 比 texlive-full / MacTeX 那些全家桶能省一两 G 空间。不过就算装全家桶,也没法彻底一劳永逸,因为每年 TeX Live 三四月份时会更新、CTAN 也在更新中,而老版本的 TeX Live 无法从新一年的 CTAN 中安装或更新包,所以还有微小的可能性你需要每年重装一遍全家桶,不过一年折腾这么一回应该也还能忍受。
Cloud2016 这个应该给个选项可配置,我不知道 Quarto 有没有,但 tinytex 里给了:https://github.com/rstudio/tinytex/blob/a45272c/R/latex.R#L99 options(tinytex.install_packages = FALSE)
就可以了。
Cloud2016 yihui 我就觉得可能是默认值问题,查了一下还真有这个选项,设置一下 latex-auto-install 好像就可以了。具体的逻辑是在 quarto-cli/src/command/render/latexmk/pdf.ts 实现的。
POC:
---
title: "Untitled"
format:
pdf:
include-in-header:
- text: |
\usepackage{zzz}
latex-auto-install: false
---
## Placeholder
得到
compilation failed- missing packages (automatic installed disabled)
LaTeX Error: File `zzz.sty' not found.