論文の一部を非表示にしながら、その部分に対応する相互参照を維持するにはどうすればよいでしょうか?

論文の一部を非表示にしながら、その部分に対応する相互参照を維持するにはどうすればよいでしょうか?

ページ 1 とページ 2 があるとします。ページ 1 を非表示にして、論文がページ 2 の内容から始まるようにしたいと思います。ページ 2 にはページ 1 の定理の相互参照がいくつかあります。ページ 1 を非表示にしながら、ページ 1 の定理の相互参照を利用できるようにするにはどうすればよいですか? (ページ 1 を削除すると、ページ 2 の相互参照が疑問符になります) ありがとうございます!

答え1

David Carlisle はすでに完璧な答えを出しています。それを補足するために例を挙げて説明します。

ここで、まず、すべてのインクルード ファイルを含む完全なドキュメントをコンパイルすることが重要です。これは、インクルードされた各ファイルの aux ファイルを取得するために必要です。

したがって、最初のコンパイル パス中にすべてのファイルを含めるか、includeonly-command を完全にコメント アウトする必要があります。

% \includeonly{%
% firstinclude,
% secondinclude,
% thirdinclude,
% }

これが完了したら、含めるファイルを選択できます。たとえば、次のようになります。

\documentclass{article}
\usepackage{blindtext}

\begin{filecontents*}{firstinclude.tex}
\section{First include}
 \blindtext\footnote{Here be the first footnote.}
 
\blindmathfalse
\blindtext\footnote{Here be the second footnote.}
\end{filecontents*}

\begin{filecontents*}{secondinclude.tex}
\section{Second include}
Here we have a some really interesting text we wish to reference at some later point\label{super-interesting}
\blindmathpaper\footnote{Here be the third footnote.}
\end{filecontents*}

\begin{filecontents*}{thirdinclude.tex}
\section{Third include}
Only a couple of pages ago there was some really interesting Text, see page \ref{super-interesting}.\footnote{Here be the fourth footnote.}
\blindenumerate[8]
\end{filecontents*}

\includeonly{%
firstinclude,
% secondinclude,
thirdinclude,
}

\begin{document}

\include{firstinclude}
\include{secondinclude}
\include{thirdinclude}

\end{document}

3番目には

関連情報