Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I use LaTeX a lot but I find quite obnoxious all the crappy files it leaves behind when you compile: .aux, .log...

Fortunately TeXMaker has the option "clean" that deletes all of these.

However, I don't like having to remember to click on it every time I'm going to close a document, ie I'd like a button that both closes a document and cleans all that stuff.

Any hint as how to do it? I suppose if I knew how to access the program code I'd be able to do it as I'd just have to put together two options that already exist.


share|improve this question

You can go to the menu:

Options → Configure → QuickBuild → User and define there (in User) the actions that you want by specifying the command pipeline.

For example, I have the following pipeline:

latex -interaction=nonstopmode %.tex | bibtex %.aux | bibtex %.aux | bibtex %.aux | 
latex -interaction=nonstopmode %.tex | latex -interaction=nonstopmode %.tex | 
dvipdf %.dvi | rm %.aux %.bbl %.blg %.dvi %.log %.out %.toc

Note that at the end of the pipe, I removed files specifying them by their extension (.toc, .aux, etc)

Hope it helps.

share|improve this answer
note that texmaker complains about the missing log file, so I removed the %.log from the command above. Keeping the log file around also means you can more easily troubleshoot errors. – amc Jun 23 '13 at 23:36

Finally, what worked best for me was to compile TexMaker from source merging the methods to clean and to close. So any time I close a file the auxiliary files are removed.

share|improve this answer

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.