While using the pdf latex chain, how can one delete the *.ps file automatically right after the pdf has been created? *.ps files can be big (~100 MB). Hence, this question.
Asked
Active
Viewed 354 times
2
1 Answers
3
One way of doing this is to compile with arara instead of the usual build chain in TeXstudio. arara is a compilation tool where you describe which steps should be part of the compilation sequence in comments placed at the top of the file. A description of setting up arara in TeXstudio can be found in https://tex.stackexchange.com/a/118899/586
A minimal example is
% arara: latex
% arara: dvips
% arara: ps2pdf
% arara: clean: { files: [ test.dvi, test.ps ] }
\documentclass{article}
\begin{document}
Hello world!
\end{document}
If this is saved in test.tex, then running arara test.tex will compile the sequence latex - dvips - ps2pdf, and then remove the test.dvi and test.ps files. Note that in %arara: ps2pdf the ps2pdf part is not the name of a binary, it is the name of a rule, which is defined by arara. As such, you can't just put the name of any program here.
Sample terminal output:
testdir$ ls
test.tex
testdir$ arara test.tex
__ _ _ __ __ _ _ __ __ _
/ _` | '__/ _` | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_| \__,_|_| \__,_|
Running LaTeX... SUCCESS
Running DVIPS... SUCCESS
Running PS2PDF... SUCCESS
Running CleaningTool... SUCCESS
Running CleaningTool... SUCCESS
testdir$ ls
test.aux test.log test.pdf test.tex
testdir$
Torbjørn T.
- 206,688
latex->dvips- >ps2pdf, it's down to the script you use for the build to do the deletion. We'll need more detail about how you do things. – Joseph Wright Jan 27 '14 at 06:56