Does someone have a minimal Makefile, that compiles a latex document using
- pdflatex
- bibtex
- pdflatex
- pdflatex
while putting all ouput files in a special output-directory to avoid cluttering the root-directory?
Does someone have a minimal Makefile, that compiles a latex document using
while putting all ouput files in a special output-directory to avoid cluttering the root-directory?
There's another question like this here:
Here's my (slightly edited) answer:
Now, running something like
mkdir OUT
TEXMFOUTPUT="OUT"
pdflatex --output-directory OUT myfile
bibtex OUT/myfile
pdflatex --output-directory OUT myfile
pdflatex --output-directory OUT myfile
produces the expected results, and is fully scriptable.
If you are getting the message:
bibtex: Not writing to $TEXMFOUTPUT/src.blg (openout_any = p).
then you need the following little hack. The issue is that bibtex ability to write to $TEXMFOUTPUT is restricted to avoid file overwriting and the bibtex command returns an error message.
Open the file texmf.cnf, dunno about windows, but on linux:
/usr/share/texlive/texmf/web2c/texmf.cnf (UBUNTU TEXLIVE)
/usr/share/texmf-dist/web2c/texmf.cnf (ARCH LINUX TEXLIVE)
find the openout_any = p line and change it either to a for always or r for restricted (p stands for paranoid fyi).
araraorlatexmk? – Johannes_B Jan 07 '19 at 14:51rm *.auxand remove them all but mostly I don't bother and they do no harm. If you move the output from tex to another directory, you need to configure everything else to be able to find them and read them back, it's possible but tricky to get right and serves no great purpose. – David Carlisle Jan 07 '19 at 15:06arara/latexmk" - then find out aboutlatexmk(I use that, not arara) because it does exactly what you seem to want. It even has options to specify directories for temporary and auxiliary files, and advice in the documentation on how not to tie yourself up in knots if you really want to use them ;) – alephzero Jan 07 '19 at 16:12