![pgfplots からの外部 PDF には floatrow を使用すると複数のページが含まれる](https://rvso.com/image/286977/pgfplots%20%E3%81%8B%E3%82%89%E3%81%AE%E5%A4%96%E9%83%A8%20PDF%20%E3%81%AB%E3%81%AF%20floatrow%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E8%A4%87%E6%95%B0%E3%81%AE%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%8C%E5%90%AB%E3%81%BE%E3%82%8C%E3%82%8B.png)
pgfplots と外部ライブラリを使用してプロットすると、必要に応じてプロットごとに単一の PDF が作成されます。ただし、これらの PDF にはそれぞれ複数のページが含まれており、それぞれに同じプロットが表示されます。3 ページの場合もあれば、それ以上の場合もあります。ページ数が何によって決まるのかわかりません。
最初のページだけがマスター ドキュメントに含まれているため、正しい結果が得られます。ただし、すべての同等のページを個別に作成する必要があるため、コンパイルはかなり遅くなると思います。外部ライブラリを使用した場合と使用しない場合のコンパイルを比較すると、外部ライブラリを使用した場合の方がはるかに時間がかかります。
あなたにとっても同様に動作しますか? これに対して何ができるでしょうか?
編集: 最小限の例です。ここでは floatrow パッケージが問題になっているようです... この場合、2 つのファイルが生成されます。\tikzsetnextfilename{testplot} のコメントを解除すると、2 ページを含む 1 つのファイルのみが生成されます。
\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: ログ ファイルにも、描画が 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: tikzpicture の代わりに単純な PDF 画像を含めると、ログには 2 つの呼び出しも表示されます...
<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.