参考文献のサブセットのみを使用してさまざまな章をコンパイルするにはどうすればよいですか?

参考文献のサブセットのみを使用してさまざまな章をコンパイルするにはどうすればよいですか?

私は\input{chapterXX}メインの tex ファイルにさまざまな章を含め、\includeonly{chapterXX}複数の tex ファイルで使用して、毎回 1 つの章のみをコンパイルしているので、複数の PDF (章ごとに 1 つ) があります。

しかし、各章の tex ファイルには当然引用コマンドが含まれており、引用コマンドは によって無視されません。つまり、最終的に各章の参考文献を印刷しようとすると、原稿全体の参考文献が印刷されます。コマンドに特定の章からの引用コマンドのみを含める\includeonly方法はありますか?\includeonly{}

答え1

コメントで述べたように、モダン パッケージをbiblatexと一緒に使用すると非常に簡単ですbiber

\documentclass{report}
\usepackage[refsection=chapter]{biblatex}
\addbibresource{biblatex-examples.bib}
\includeonly{\jobname-mary,\jobname-peter}
\begin{filecontents}{\jobname-peter.tex}
    \cite{ctan,companion}
\end{filecontents}
\begin{filecontents}{\jobname-paul.tex}
    \cite{aristotle:physics,westfahl:space}
\end{filecontents}
\begin{filecontents}{\jobname-mary.tex}
    \cite{herrmann,shore}
\end{filecontents}

\begin{document}
\include{\jobname-peter}
\include{\jobname-paul}
\include{\jobname-mary}
\printbibliography
\end{document}

関連情報