TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

How do I get pdflatex (via WinEdt) to remove all the extra output files (e.g., .lof, .blg, etc.) after compiling my .tex/.bib/.etc to a .pdf?

If there is a solution, I suspect it will come via "Options" -> "Execution Mode". I'm just not finding anything though :(

I was told by someone that pdflatex won't do this and that I would need to create a Makefile. Is that true?

share|improve this question
Related question: Prevent pdflatex from writing a bunch of files. – Juan A. Navarro Feb 22 '11 at 20:32
up vote 8 down vote accepted

Winedt has the "Erase output files" tool (on the "Tools" menu).

However, you don't want to remove the auxiliary files after each run of pdflatex because you need those files for subsequent runs.

If you are using miktex, then you can run texify with the -c option to automate running pdflatex sufficiently many times, and bibtex etc and then remove the aux files. In miktex you can access this by going to "Execution Modes...", choosing "PDFTeXify" and adding -c to the "Switches" box.

share|improve this answer
Wonderful! This worked perfectly. Thank you Lev. – lowndrul Feb 23 '11 at 1:19
I'll also add that I found online documentation for what you're talking about at <docs.miktex.org/manual/texifying.html>;. I put in --clean as the switch rather than -c. It'll be easier to remember what was going on if I ever come back to this in the future :) – lowndrul Feb 23 '11 at 1:21
I do have a follow-up question that I may have to ask in an entirely new post: how could I have determined the answer to this question without using help forums? E.g., via the Linux shell I could have found this documentation with a simple "man texify" (I'm assuming, I don't have Latex installed on my Linux box to verify). BUT, there seems to be no equivalent from MS DOS command line. I've tried "help texify" and "texify \?" to no avail. – lowndrul Feb 23 '11 at 2:35
@brianjd: texdoc texify. texify --help gives a summary. – Lev Bishop Feb 23 '11 at 3:16
@brianj: If Lev's answer worked for you, you should accept it (and up vote it, if you haven't done so). – TH. Feb 27 '11 at 10:28

I don't believe that's is possible. Anyway, if I'm not mistaken, there's an option in MiKTeX's pdflatex where you can set a temporary folder to store your aux files (This option is not available in TeX Live's pdflatex).

 pdflatex -aux-directory=DIR ...

Files won't be deleted, but at least they won't be in the same folder as your main .tex file.

When in Windows, I usually create a clean.cmd file which will remove those files for me:

del *.bak
del *.aux
del *.bbl
del *.blg
del *.log

Hope it helps. :)

share|improve this answer
pdflatex -output-directory seems to be the right command. – user13242 Apr 3 '12 at 16:37
@asrtqwftrast: Actually, -output-directory would relocate the pdf file as well, and I don't think that's desired here. – doncherry Apr 4 '12 at 7:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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