Possible Duplicate:
Can one TeX file output to multiple PDF files?
Let's say I have a tex file foo.tex
. Now, I want to achieve that pdflatex does not only create a file foo.pdf
but simultaneously a file fooxy.pdf
which is identical (!) to foo.pdf
. Is there a simple solution to this problem?
PS:
- Yes, I could just do this by copying and renaming the file in the file manager. But I want to have an automatic solution.
- No, I am not crazy. Please don't ask me why I want to do this.
Best Answer
I can think of three ways to approach this:
&&
You could just add a copy command after
pdflatex
as in the following:The does everything you want in one line and it is a simple solution.
Make
You could make it slightly more sophisticated by making a Makefile such as the following:
This gives you more flexibility when it comes to naming file and it does not compile or copy unless it is needed. You only have to issue
and
make
decides what needs to be done.tee
This does not work but was the first approach I came to think about. The command
tee
reads from standard input and writes to standard output and the files given as arguments. Ifpdflatex
would write the pdf to standard output you could have usedbut as
pdflatex
does not this approach fails.