入力ファイルが見つからない場合に強制的に停止するにはどうすればいいですか?

入力ファイルが見つからない場合に強制的に停止するにはどうすればいいですか?

ファイル名を誤って入力するなどして、存在しないファイルを誤って \include した場合、エラーや警告は表示されず、単に「colophon2.tex というファイルがありません」というメッセージが表示されてコンパイルが続行されることに気付きました。これは、\include で tex ファイルを取り込んだ場合にのみ発生し、\includegraphics や \includepdf では発生しません。さらに悪いことに、このメッセージは、興味深くない/重要でない他の多くのコンパイル メッセージの中に埋もれてしまいます。

このような場合に、エラーでコンパイルを強制的に停止するにはどうすればよいでしょうか。あるいは、何かが欠けていることを、より目立つ方法で警告するにはどうすればよいでしょうか。

私は Macbook Pro、OS X 10.6.8 を使用しており、Sublime Text、Texshop、TexMaker、TexWorks、その他私が見つけたあらゆる Tex IDE でこれを試しました。すべて同じ問題が発生します。

pdflatex のバージョンは次のとおりです。

pdflatex -v
pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
kpathsea version 6.0.1
Copyright 2011 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.2; using libpng 1.5.2
Compiled with zlib 1.2.5; using zlib 1.2.5
Compiled with xpdf version 3.02pl5

前もって感謝します!

答え1

入力内容を変更するには

No file no-file-like-this.tex.

エラーに

! LaTeX Error: File `no-file-like-this.tex' not found.

不足しているファイルを受け入れるのではなく、\include通常のものを使用するようにパッチを適用できます。\input

\documentclass{article}
\usepackage{etoolbox}
\makeatletter

\patchcmd\@include\@input@\input{}{}

\makeatother
\begin{document}
\include{no-file-like-this}
\end{document}

関連情報