下面的例子来自TikZ 文档(p610)。它无法在我的计算机上工作。请注意,当我注释该选项时,它可以工作[prefix=figures/]
。知道这里可能出了什么问题吗?
\documentclass{article}
% main document, called main.tex
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=figures/] % activate
\begin{document}
\tikzsetnextfilename{trees}
\begin{tikzpicture} % will be written to ’figures/trees.pdf’
\node {root}
child {node {left}}
child {node {right}
child {node {child}}
child {node {child}}
};
\end{tikzpicture}
\tikzsetnextfilename{simple}
A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to ’figures/simple.pdf’
\begin{tikzpicture} % will be written to ’figures/main-figure0.pdf’
\draw[help lines] (0,0) grid (5,5);
\end{tikzpicture}
\end{document}
答案1
感谢 Christian Hupfer 的评论:所命名的目录figure
必须已存在于工作目录中。就这样!