# LaTeX does not generate the aux file

I am executing the following command in the terminal, but that does not generate the *.aux file:

pdflatex main.tex


Why is it not generating the main.aux file?

• The auxiliary file is not written, if \nofiles was used or if the compilation finishes (on purpose or because of error) before \begin{document} . – Heiko Oberdiek Jul 19 '16 at 20:55
• Why was this tagged as latex3 ? – user31729 Jul 19 '16 at 20:56
• @HeikoOberdiek, thanks \nofile was the issue. Thank you :) – J4cK Jul 19 '16 at 21:03
• @ChristianHupfer latex3 was tagged by mistake :( – J4cK Jul 19 '16 at 21:04
• Are you using the res document class, perhaps? – Werner Jul 20 '16 at 1:39

The writing of the .aux files in LaTeX is controlled by switch \if@filesw (w short for writable). The command \nofiles sets the switch to false to prevent the rewriting of the auxiliary files.
The main .aux file is opened for writing in \begin{document}. If the LaTeX job does not reach this point, for example, because of an error or on purpose, the auxiliary files are also not written.
• not that it matters (or is documented anywhere) but I think @filesw is short for file - switch not files - writable :-) – David Carlisle Jul 19 '16 at 22:09