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?

  • 3
    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
  • 1
    @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.

  • 3
    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
  • so if \nofiles command is not there, writing will happen by default or not? – vipin8169 Apr 15 '20 at 20:25
  • @vipin8169 The .aux files are written by default unless turned off. – Heiko Oberdiek Apr 16 '20 at 21:18
  • @HeikoOberdiek where are they written to? i could not find them in the folder which contained the .tex file – vipin8169 Apr 17 '20 at 7:12
  • @vipin8169 There are lots of possible reasons: no LaTeX format, an hidden \nofiles or \@fileswfalse, end of the TeX job before \begin{document} is executed, option setting (-output-directory in TeX Live) with a different output directory, ... – Heiko Oberdiek Apr 17 '20 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.