我在使用 TikZ externalize 和 standalone 时遇到了麻烦。似乎没有生成所需的 PDF。首先,我怀疑最近的 PFG 更新(https://github.com/pgf-tikz/pgf/issues/932),但经过一些测试,它似乎与独立有关。
在我的 MWE 中我有四个文件。
文件2:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[class=report,11pt,a4paper,tikz,]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\end{tikzpicture}%
\end{document}
文件1:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[]{report}
\usepackage{tikz}
\usepackage{shellesc}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikzfiles/]
\usepackage{standalone}
\begin{document}
\input{file2.tex}
\end{document}
文件3:
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\end{tikzpicture}%
文件0:
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[]{report}
\usepackage{tikz}
\usepackage{standalone}
\begin{document}
\input{file2.tex}
\end{document}
File2 可以工作,但 file1 却出现错误:
主日志的输出:
! Package tikz Error: Sorry, the system call 'lualatex -shell-escape
-halt-on-e rror -interaction=batchmode -jobname "tikzfiles/file1-figure0" "\def\tikzextern
alrealjob{file1}\input{file1}"' did NOT result in a usable output file
'tikzfil es/file1-figure0' (expected one of .pdf:.jpg:.jpeg:.png:).
Please verify that y ou have enabled system calls. For pdflatex, this
is 'pdflatex -shell-escape'. S ometimes it is also named 'write 18' or
something like that. Or maybe the comma nd simply failed? Error
messages can be found in 'tikzfiles/file1-figure0.log'. If you
continue now, I'll try to typeset the picture.
tikzfiles 文件夹中的日志输出:
\providecommand \oddpage@label [2]{} ]
! Missing number, treated as
zero. <to be read again>
= l.11 \end{document}
但是,从 file1 调用 file3 可以工作,所以问题似乎与 externalize(单独)无关。
另一方面,file0 在未使用 externalize 的情况下出现错误,因此我怀疑是独立的。
日志如下:
(./file2.tex ! Missing number, treated as zero. <to be read again> = l.11 \end{document}