When I compile my .tex file, it generates a lot of different files (with extensions such as .aux, .log), but all I want is the .tex and .pdf files. Those files just fill my hard drive for nothing. Is there any trick to make LaTeX retain only the .pdf and .tex files and delete everything else after compilation?

  • 2
    Latex needs those files. Feb 24, 2014 at 21:03
  • 1
    LaTeX needs temporarily these files, in order to be able to make a table of contents, a bibliography, cross references, etc. Usually, dedicated tex editors have a button to delete these file, when they aren't useful anymore. In the case of TeXmaker, the Tools menu has a Cleansubmenu.
    – Bernard
    Feb 24, 2014 at 21:07
  • Though the question was closed some technical advices: Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. Also a suggestion: Do us a favour and change your username to something more telling than "user1234".
    – Speravir
    Feb 24, 2014 at 21:47
  • @Bernard Does VScode have the similar delete button stuff? I can't find it.
    – narip
    Dec 24, 2021 at 14:14
  • 1
    @narip: Unfortunately, I don't use VScode, so I have no idea.
    – Bernard
    Dec 24, 2021 at 14:18


Browse other questions tagged or ask your own question.