The only file which was meant to be compiled in my Main.tex was specified by the following line:


It was compiled without any error using the following command:

pdflatex -synctex=1 -interaction=nonstopmode Main.tex

However, the generated PDF file was empty. After investing a large amount of time, I learned that the problem is with misspelling of the file, i.e. transformtaion instead of transformation.
The question is how to force the compilation process to give a compile-time error which indicates the misspelling problem.

  • Get rid of interaction=nonstopmode. Oct 28, 2021 at 13:47
  • 3
    @IanThompson that probably does not do much \include does not complain if the file is not found. \input does.
    – daleif
    Oct 28, 2021 at 13:49
  • @daleif --- I didn't know that. I'd still get rid of nonstopmode, though. Oct 28, 2021 at 13:52
  • @IanThompson This is not the solution. No error will be shown with or without interaction=nonstopmode.
    – Naghi
    Oct 28, 2021 at 17:44
  • If you are an AUCTeX/Emacs user, this error should not happend. When inputing files for input or include, you are prompted with a list of valid files. with auto-completion.
    – gigiair
    Oct 31, 2021 at 22:13

1 Answer 1


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:


     {\GenericError{}{Error: File \mkfilename\CurrentFilePath\CurrentFile.tex not found!}{\@gobble}{}}}


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:


     {\GenericError{}{Error: File \currfiledir\currfilebase.tex not found!}{\@gobble}{}}}

  • Undefined control sequence. \AddToHood; Is it related to my document class which is report? If this is the case, what is the alternative solution?
    – Naghi
    Oct 28, 2021 at 17:05
  • 1
    @Alish No, report is fine. You have an older LaTeX distribution (pre 2020). I added an alternative for older releases. I'd recommend an update though Oct 28, 2021 at 17:43
  • Now the error appears regardless of whether or not the file exists.
    – Naghi
    Oct 28, 2021 at 17:57
  • @Alish I just tested with a file named transformtaion.tex and it works. Can you show me the .log, please (you can upload it to pastebin or something like that) Oct 28, 2021 at 18:00
  • 1
    @Alish Sorry, I missed the case of files in subfolders. The code should work now. Aside: you seem to have forgotten to add \makeatletter...\makeatother to the code in your document. Oct 31, 2021 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .