Hi, what command line can I use to change the location of the pdf, I do not want it to be in the same folder as the tex file. Also, I am not looking to change the editor's settings, because I am working on three different reports and I just need one of them to produce the pdf in another directory.
Thanks.
General ⇒ Change pdf location
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Change pdf location
The texlive version has an -output-directory command line option, e.g.:
pdflatex -output-directory=DIR myfile.tex
Not sure about other distributions.
I don't know of a command to put in the .tex file to do it.
pdflatex -output-directory=DIR myfile.tex
Not sure about other distributions.
I don't know of a command to put in the .tex file to do it.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Change pdf location
As frabjous already mentioned, there is the possibility to redirect the output as described. It works for TeX Live but I'm not sure if it does for MiKTeX by default. Moreover it is possible to make the compiler parsing the first line of a source file so that the line below is interpreted as if given on the command line.
As far as I know this line parsing is disabled in TeX Live but enabled in MiKTeX by default. But in TeX Live it can be enabled by a command line option.
You can add this line in the according settings of your editor if necessary.
Thorsten
Code: Select all
%& -output-directory=<path of the output file>
Code: Select all
pdflatex -parse-first-line
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Change pdf location
Thanks frabjous and localghost for the suggestions, I will try it. Cheers