使用 Texmaker 中的 tikz externalize 功能编译论文时遇到了一些麻烦。我创建了用户命令:
"D:/laTex/texlive2014/bin/win32/pdflatex.exe" -synctex=1 -interaction=nonstopmode --shell-escape %.tex
我在我的序言中用到了这个:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external} %if I comment this
\tikzexternalize[prefix=tikz/] %and this the process goes fine
\usepackage[mmddyyyy]{datetime}
\begin{document}
\today
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^2 - x +4$}
]
% use TeX as calculator:
\addplot {x^2 - x +4};
\end{axis}
\end{tikzpicture}
\end{document}
但无论如何它不起作用。
我在错误窗口中收到此信息:
Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact
ion=batchmode -jobname "tikz/minexample-figure0" "\def\tikzexternalrealjob{mine
xample}\input{minexample}"' did NOT result in a usable output file 'tikz/minexa
mple-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you h
ave enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Somet
imes it is also named 'write 18' or something like that. Or maybe the command s
imply failed? Error messages can be found in 'tikz/minexample-figure0.log'. If
you continue now, I'll try to typeset the picture.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
但是我已经创建的文件夹中没有日志文件。
答案1
我通过重新安装 texlive 解决了这个问题,我注意到在 cmd 中输入 pdflatex.exe 时没有找到任何东西。现在我让它工作了,我在问题中写的字符串是正确的。即使没有 optimize=false 也可以工作。
pdflatex.exe -synctex=1 -interaction=nonstopmode --shell-escape %.tex