6

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?

doncherry
  • 54,637
lowndrul
  • 5,323

2 Answers2

8

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. :)

Paulo Cereda
  • 44,220
  • pdflatex -output-directory seems to be the right command. –  Apr 03 '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 04 '12 at 07:58
8

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.

Lev Bishop
  • 45,462
  • Wonderful! This worked perfectly. Thank you Lev. – lowndrul Feb 23 '11 at 01:19
  • I'll also add that I found online documentation for what you're talking about at http://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 01: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 02:35
  • @brianjd: texdoc texify. texify --help gives a summary. – Lev Bishop Feb 23 '11 at 03: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