It is a (maybe not so great) feature of \include
to just tell you on the terminal that the file does not exist. You get a one-liner like this:
No file transformtaion.tex.
which is quite hard to spot if you're not looking for it.
Redefining the internals of \include
is not advisable, so you can use the include
hooks to explicitly check for the existence of the file, and error accordingly:
\documentclass{article}
\makeatletter
\def\mkfilename#1{%
\if\relax\detokenize\expandafter{#1}\relax\else#1/\fi}
\AddToHook{include/before}%
{\IfFileExists{\mkfilename\CurrentFilePath\CurrentFile}{}
{\GenericError{}{Error: File \mkfilename\CurrentFilePath\CurrentFile.tex not found!}{\@gobble}{}}}
\makeatother
\begin{document}
\include{transformtaion}
\end{document}
then you'll see an error:
! Error: File transformtaion.tex not found!.
Type H <return> for immediate help.
...
l.15 \include{transformtaion}
?
In older releases (before 2020-10-01), without the built-in support for include
hooks, you can use filehook
and currfile
:
\documentclass{article}
\usepackage{filehook}
\usepackage{currfile}
\makeatletter
\AtBeginOfIncludes
{\IfFileExists{\currfiledir\currfilebase.tex}{}
{\GenericError{}{Error: File \currfiledir\currfilebase.tex not found!}{\@gobble}{}}}
\makeatother
\begin{document}
\include{transformtaion}
\end{document}
interaction=nonstopmode
.\include
does not complain if the file is not found.\input
does.interaction=nonstopmode
.