
我在使用 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