無法使用 lualatex 運行 tikz externalize,但它曾經可以工作

無法使用 lualatex 運行 tikz externalize,但它曾經可以工作

我正在嘗試使用 lualatex 來使用 TikZ 外部化庫(因為各種需求)。它曾經可以毫無問題地工作(大約 1.5 年前),但我現在已經升級了 - 我正在進行 Debian 測試,TeX Live 2016 也有,luatex 宣布自己為“這是 LuaTeX,版本 1.0.0 (TeX)直播2016/Debian) (格式=lualatex 2017.3.20) 2017 年4 月20 日20:31"。我嘗試過這個最簡單的文件,第一個範例取自 TikZ 外部化文件庫。

\documentclass{article}
% main document, called main.tex
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize % activate!
\begin{document}
\loggingall
\begin{tikzpicture}
  \node {root}
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

A simple image is \tikz \fill (0,0) circle(5pt);.
\end{document}

當我運行“pdflatex --shell-escape main”時,它工作正常,但是當我用 lualatex 替換 pdflatex 時,它會崩潰:

! Package tikz Error: Sorry, the system call 'lualatex -shell-escape -halt-on-e
rror -interaction=batchmode -jobname "main-figure1" "\def\tikzexternalrealjob{m
ain}\input{main}"' did NOT result in a usable output file 'main-figure1' (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-figure1.log'. If you continue now, I'll try to t
ypeset the picture.

有人知道這裡可能出了什麼問題嗎? 「lualatex --shell-escape」本身工作正常(我在一個簡單的文件上嘗試過),並運行'lualatex -shell-escape -halt-on-error -interaction=batchmode -jobname "main-figure1" "\ def\ tikzexternalrealjob{main}\input{main}"' 直接從命令列似乎運作正常,如果這意味著什麼的話。

謝謝!

答案1

您需要 shellesc 軟體包

\documentclass{article}
\usepackage{shellesc}
% main document, called main.tex
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize % activate!
\begin{document}
\loggingall
\begin{tikzpicture}
  \node {root}
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

A simple image is \tikz \fill (0,0) circle(5pt);.
\end{document}

相關內容