TikZ 外部化无法在装有 Tex Live 2016 的 Windows 7 上运行,我似乎无法找出原因。
我用编译lualatex -shell-escape main.tex
,main.tex
内容在哪里
\documentclass[a4paper]{report}
\usepackage{float}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{tikzscale}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
\begin{axis}
[%
xmin=0,
xmax=100,
xmajorgrids,
ymin=0,
ymax=0.9,
ymajorgrids,
]
\addplot [color=blue,solid,line width=2.0pt,forget plot] table[row sep=crcr]
{
5 0.885230548905366\\
7 0.706932087191873\\
9 0.58113883008419\\
11 0.491951469859456\\
};
\end{axis}
\end{tikzpicture}
\end{center}
\caption{CAPTION.}
\label{LABEL}
\end{figure}
\end{document}
我得到了错误
===== 'mode=convert with system call': Invoking 'lualatex -shell-escape -halt-o
n-error -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjo
b{main}\input{main}"' ========
lualatex -shell-escape -halt-on-error -interaction=batchmode -jobname "main-fig
ure0" "\def\tikzexternalrealjob{main}\input{main}"
! Package tikz Error: Sorry, the system call 'lualatex -shell-escape -halt-on-e
rror -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjob{m
ain}\input{main}"' did NOT result in a usable output file 'main-figure0' (expec
ted one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system c
alls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also name
d 'write 18' or something like that. Or maybe the command simply failed? Error
messages can be found in 'main-figure0.log'. If you continue now, I'll try to t
ypeset the picture.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.38 \end{tikzpicture}
?
它在 Overleaf 上确实有效:
https://www.overleaf.com/read/dtkwynbzqhsp
我究竟做错了什么?
答案1
Lualatex 在 '16 版本中发生了很大变化。Latex 团队提供了两个新软件包,它们仍允许您访问已更改的内容。
一个问题是 shell 转义,您可能需要 shellesc 包以及命令行选项。