外部未知的 TikZ/pgfplots 錯誤

外部未知的 TikZ/pgfplots 錯誤

我正在嘗試編譯一個大型文件(博士論文),並且在不使用 的情況下編譯沒有問題external,但是一旦我啟用該功能,它就會出現問題。到目前為止,我還沒有在其他各種類似主題中找到答案。我嘗試使用lualatex和進行編譯pdflatex,兩者均-shell-escape啟用。該文檔本身編譯得很好,但當它到達圖像時我收到錯誤TikZ。在我的 Windows 機器上使用 MikTeX 以及 Ubuntu 上的 TeX Live 並直接從終端運行以及在 TeXmaker 中可以重現此錯誤。

奇怪的是,使用相同的包列表和語法但僅包含對 MWE 中文件的調用TikZ會生成一個可以成功工作的文檔,因此我的文檔或文件系統本身中顯然有一些東西阻止了它在我執行操作時正常工作實際的論文文件。

無論如何,.log從我的實際文件中檢查該文件顯示以下內容:

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact
ion=batchmode -jobname "img/cache/sac-thesis-figure0" "\def\tikzexternalrealjob
{sac-thesis}\input{sac-thesis}"' did NOT result in a usable output file 'img/ca
che/sac-thesis-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify
that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-esca
pe'. Sometimes it is also named 'write 18' or something like that. Or maybe the
command simply failed? Error messages can be found in 'img/cache/sac-thesis-fi
gure0.log'. If you continue now, I'll try to typeset the picture.
See the tikz package documentation for explanation.

當檢查.log文件中的圖形本身時,會出現以下錯誤:

\@writefile{toc}{}
! Undefined control sequence.
\pgfmathsetlength ...\pgfmath@onquick #2\pgfmath@ 
                                                  {\begingroup \pgfmath@sele...
l.34 \end{tikzpicture}

作為參考,這是.tikz我正在嘗試編譯的文件。引用的是我僅使用 MATLAB 建立的圖形,在本例中我主要在該圖形上添加註釋(儘管其中也.pdf有更多資料密集型圖片)。TikZ你可以誠實地.pdf在那裡放置任何圖片來嘗試一下,但這不會改變這裡問題的本質。

\begin{tikzpicture}
    % Styles
    [pointer/.style={thick}]

\node[anchor=south west] (diagram) at (0,0)
    {\includegraphics[width=4.5in]{img/ch1/2mode/5DC-2mode.pdf}};
    \begin{scope}[x={(diagram.south east)},y={(diagram.north west)}]

        % Temporary gridlines
        %\draw[step=0.1,gray,ultra thin] (0,0) grid (1,1);

        % Wall label
        \draw {(0.5,0.08)} node[anchor=center,color=white] {Wall};

        % Trapped acoustic wave
        \draw {(0.66,0.2)} node[anchor=west,color=red] {Trapped acoustic wave};

        % Sonic line
        \draw {(0.55,0.29)} node[anchor=west] {Sonic line: $\overbar{M}^2 = 1$, $y = y_a$};

        % Inner layer
        \draw {(0.05,0.2)} node[anchor=west] {$\overbar{M} > 1$};

        % Outer layer
        \draw {(0.05,0.4)} node[anchor=west] {$\overbar{M} < 1$};

        % U(y)
        \draw {(0.45,0.66)} node[anchor=center,color=blue] {$U(y)$};

        % y-axis
        \draw {(0.24,0.94)} node[anchor=east] {$y$};

    \end{scope}
\end{tikzpicture}

老實說,我現在沒有想法,而且真的很想這樣做,externalize因為我將在文件中包含很多數字,並且編譯時間會變得不規則。

相關內容