这似乎是 tufte-book 和图表库的奇怪组合。我注意到能够外部化多于 1 个图表,但我不明白为什么。
% !TeX program = lualatex
\documentclass{tufte-book}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing, external}
\usegdlibrary{circular}
\tikzexternalize
\begin{document}
\tikz{\graph{A};}
\tikz{\graph{B};}
\end{document}
编辑:
- 完整日志在这里:https://pastebin.com/sbqSVQgx
- tufte-lua-figure0.log:https://pastebin.com/uD1hgANe
- tufte-lua-figure1.log:https://pastebin.com/VVYVAXWZ
软件包:tikz 2020/01/08 v3.1.5b (3.1.5b)
编辑:
我调查了tufte-通用.def以下行会导致错误:
\ifthenelse{\boolean{@tufte@letterspace}}{%
\ifthenelse{\boolean{@tufte@pdf}\AND\boolean{@tufte@letterspace@pkg@prereqs}\AND\NOT\boolean{@tufte@xetex}}{%
% load letterspace pkg
\IfFileExists{letterspace.sty}{%
\@tufte@letterspacing@letterspace
}{}%
}{}%
% load soul pkg
\@ifpackageloaded{letterspace}{}{%
\IfFileExists{soul.sty}{%
\@tufte@letterspacing@soul % <---- ERROR
}{%
\@tufte@warning@noline{Couldn't locate `soul' package}%
}% soul not installed... giving up.
}%
}{}
\newcommand{\@tufte@letterspacing@soul}{%
\RequirePackage{soul}%
\sodef\allcapsspacing{}{0.15em}{0.65em}{0.6em}%
\sodef\smallcapsspacing{}{0.075em}{0.5em}{0.6em}%
\sodef\sotextsc{\scshape}{0.075em}{0.5em}{0.6em}%
\renewcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{##1}}}%
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{##1}}}%
\renewcommand{\textsc}[1]{\sotextsc{##1}} % <---- ERROR
}
答案1
正如我在帖子中提到的,问题出在
\renewcommand{\textsc}[1]{\sotextsc{##1}}
我不知道为什么这只会导致错误\tikzexternalize
。我也不知道是否letterspace
应该soul
与 lualatex 一起使用,但解决方法是再次调用 letterspace:
\makeatletter
\@tufte@letterspacing@letterspace
\makeatother