问题描述
Quarto 每次编译 PDF 文档都会检查和升级 tlmgr 及 LaTeX 包。有时候,不想等了,点了红点🔴,打断进程。后果就是,下次编译文档的时候,开始报错
LaTeX Error: Mismatched LaTeX support files detected.
然后整个 TinyTeX 没法用了,也是上面的原因。如果一直等下去,可能不会出现 Mismatched 的问题。
复现
一个比较简单的示例,如下
---
title: "Quarto 入门"
author: "张三"
lang: zh
format:
pdf:
include-in-header:
- text: |
\usepackage[heading=true,UTF8]{ctex}
\usepackage{amsmath,bm}
toc: true
mathspec: true
number-sections: true
colorlinks: true
documentclass: article
papersize: b5paper
---
# 线性模型 {#sec-lm}
@sec-lm 介绍线性模型,线性模型的矩阵表示见 @eq-lm 。
$$
\bm{\mathsf{y}} = \bm{\mathsf{X}}\bm{\beta} + \bm{\epsilon}
$$ {#eq-lm}
- 在导言区加载一个本地没有安装的 LaTeX 宏包,就会触发问题。
- 或者在导言区不加载 bm 包,但正文中使用 \bm 宏命令,也会触发问题。
附
下面是个真实项目的编译日志,仅作参考。
Rendering:
[1/5] index.qmd
processing file: index.qmd
1/9
2/9 [unnamed-chunk-1]
3/9
4/9 [fig-rongelap-concentration]
5/9
6/9 [fig-gdal]
7/9
8/9 [unnamed-chunk-4]
9/9
output file: index.knit.md
[2/5] data-preperation.qmd
[3/5] intro.qmd
[4/5] references.qmd
[5/5] appendix-a.qmd
pandoc
to: latex
output-file: index.tex
standalone: true
toc: true
number-sections: true
top-level-division: chapter
pdf-engine: xelatex
variables:
graphics: true
tables: true
default-image-extension: pdf
metadata
crossref:
chapters: true
documentclass: book
papersize: letter
block-headings: true
lang: zh
bibliography:
- references.bib
classoption:
- UTF8
- twoside
- openany
- table
lof: true
lot: true
geometry:
- tmargin=2.5cm
- bmargin=2.5cm
- lmargin=3.0cm
- rmargin=2.0cm
colorlinks: true
link-citations: true
title: Quarto 中文书籍模版
author: 黄湘云
date: 11/23/2022
running xelatex - 1
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
updating tlmgr
updating existing packages
compilation failed- error
LaTeX Error: Mismatched LaTeX support files detected.
(LaTeX) Loading 'expl3.sty' aborted!
(LaTeX)
(LaTeX) The L3 programming layer in the LaTeX format
(LaTeX) is dated 2023-08-11, but in your TeX tree the files require
(LaTeX) at least 2023-08-29.
For immediate help type H <return>.
...
l.78 \ExplLoaderFileDate{expl3.sty}}
%
see /Users/xiangyun/Documents/quarto-book/index.log for more information.
环境信息
quarto check
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.450
Path: /Applications/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.11.5
Path: /usr/local/opt/python@3.11/bin/python3.11
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.3.1
Path: /usr/local/Cellar/r/4.3.1/lib/R
LibPaths:
- /usr/local/lib/R/4.3/site-library
- /usr/local/Cellar/r/4.3.1/lib/R/library
knitr: 1.43
rmarkdown: 2.24
[✓] Checking Knitr engine render......OK