1

With reference to this question:

Path for saving PDF in TexStudio

Is there any way I can have a custom output path for the PDFs for each different .tex file I compile?

For instance, I want to put File1.pdf in one folder on my computer, and File2 in completely different one.

1
  • If you're talking about TeXstudio, I think you can try with magic comments. Though personally I would do a copy of the pdf into custom folders, instead of directly outputting them there. In this case, Tim's answer in your linked qn should work well if implemented as a magic comment, specific to each .tex file. Commented Mar 23, 2018 at 12:11

2 Answers 2

3

You could use magic comments to mv the pdf file into a folder of your choice after compilation:

% !TeX TS-program = pdflatex % | mv %.pdf ./test/. \documentclass{article} \begin{document} test \end{document} 
6
  • % !TeX TXS-program = txs:///compile | mv %.pdf ./test/ should be more generic Commented Apr 29, 2023 at 19:24
  • I think you should cp so the previewer can find it. Nevertheless upvoted. Commented Jul 10 at 15:33
  • @John One can tell the pdf viewer where the pdf is - no need to litter the computer with multiple copies of the same file Commented Jul 10 at 15:36
  • But the built-in previewer... again, might be solvable with yet another txs link. Commented Jul 10 at 15:37
  • @John The build in pdf viewer can open pdf from any location texstudio has access to. Commented Jul 10 at 15:38
1

I had the same question as the OP.

As far as I know, this is not possible within TexStudio.

One could of course use an external script (in your preferred programming language) that would determine by e.g. a prefix in the filename where to move the compiled PDF (e.g. all tex/tikz figures output PDFs end up in a "figures" folder etc.).

It would however be a very nice feature, if this would be included in TexStudio.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.