minted は outputdir オプションが指定されている場合、キャッシュを使用しないようです

minted は outputdir オプションが指定されている場合、キャッシュを使用しないようです

私はソースコードなしでビルドしているので、ビルドコマンドは次のようになります

pdflatex -shell-escape --halt-on-error -output-directory="/tmp/build" book.tex

私は構文の強調表示にmintedを使っています

\newcommand{\mintedoptions}{cachedir=/tmp/mint}
\usepackage[\mintedoptions]{minted}
\begin{document}
\inputminted{c}{program.c}
\end{document}

ここまでは問題なく動作していましたが、導入しようとすると\begin{minted}{c}...\end{minted}次のエラーが発生しました:

! Package minted Error: Missing Pygments output; \inputminted was
probably given a file that does not exist--otherwise, you may need 
the outputdir package option, or may be using an incompatible build tool.

この問題は解決された、私は自分の文書に修正を適用しました

\newcommand{\mintedoptions}{cachedir=/tmp/mint,outputdir=/tmp/build}

ドキュメントは明らかに正しくコンパイルされますが、生成されたキャッシュは使用されていないようです。生成されたコードスニペットはすべて毎回最初から再コンパイルされるため、コンパイルは非常に遅くなります。

outputdir を指定してキャッシュを使い続けるにはどうすればよいですか?

完全なMWEはこちら

\documentclass[a4paper,10pt]{scrbook}
\newcommand{\mintedoptions}{cachedir=/tmp/mint2,outputdir=/tmp/xxx}
\usepackage[\mintedoptions]{minted}
\begin{document}
\inputminted{c}{program.c}
\begin{minted}{c}
int main ();
\end{minted}
\end{document}

コンパイル

mkdir /tmp/xxx && pdflatex -shell-escape --halt-on-error -output-directory="/tmp/xxx" mwe.tex

関連情報