使用 floatrow 時,pgfplots 的外部 PDF 包含多個頁面

使用 floatrow 時,pgfplots 的外部 PDF 包含多個頁面

使用 pgfplots 和外部庫進行繪圖可以根據需要為每個繪圖建立單一 PDF。但每個 PDF 都包含多個頁面,每個頁面都顯示相同的情節。有時有三頁,有時更多。我無法弄清楚是什麼觸發了頁面數量。

由於主文檔中僅包含第一頁,因此我得到了正確的結果。但我猜編譯速度會慢很多,因為所有相同的頁面都必須單獨建立。當我比較使用和不使用外部函式庫的編譯時,我使用它的時間要長得多。

它對你來說表現同樣嗎?對此我們能做些什麼呢?

編輯:最小的例子。看來 floatrow 套件是這裡的問題...在這種情況下會產生兩個檔案。如果取消註釋 \tikzsetnextfilename{testplot},您只會得到一個文件,但其中有兩頁。

\documentclass{standalone}

\usepackage{floatrow}

\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[mode=list and make]
\tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}


\begin{document}

Testplot:

%\tikzsetnextfilename{testplot}
\ffigbox
    {}
    {\begin{tikzpicture}
    \begin{axis}[]
    \addplot {sin(x)};
    \end{axis}
    \end{tikzpicture}}
\end{document}

編輯 2:日誌檔案也報告繪圖完成兩次...

Opening 'test.figlist' for writing.
Opening 'test.makefile' for writing.
\tikzexternal@outmakefile=\write5
Writing 'test-figure0' to 'test.figlist'.
Writing 'test-figure0' to 'test.makefile'.
Writing 'test-figure1' to 'test.figlist'.
Writing 'test-figure1' to 'test.makefile'.

編輯 3:當包含一個簡單的 PDF 圖像而不是 tikzpicture 時,日誌也會顯示兩個呼叫...

<test-figure0.pdf, id=4, 248.42511pt x 179.13223pt>
File: test-figure0.pdf Graphic file (type pdf)
 <use test-figure0.pdf>
Package pdftex.def Info: test-figure0.pdf used on input line 25.
(pdftex.def)             Requested size: 248.42448pt x 179.13177pt.
File: test-figure0.pdf Graphic file (type pdf)
<use test-figure0.pdf>
Package pdftex.def Info: test-figure0.pdf used on input line 25.
(pdftex.def)             Requested size: 248.42448pt x 179.13177pt.

相關內容