TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

marked as duplicate by Jubobs, David Carlisle, Werner, Martin Schröder, Speravir Feb 24 '14 at 21:24

This question was marked as an exact duplicate of an existing question.

Latex needs those files. – David Carlisle Feb 24 '14 at 21:03
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 '14 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 '14 at 21:47