I want pdflatex to just run

pdflatex 'current_file'.tex

And then afterwards compile my main.tex which is in another directory. So to make my realtive paths working I have to use a change directory command like 'cd'.

Using a normald shell in windows work when I say

 pdflatex 'current_file'.tex && cd home/tex/ && pdflatex main

However, in Kile this did not work. Is it somehow possible as I can just configure the pure Pdflatex command. Is it possible to add in its arguments something like a change directory so to have:

pdflatex -synctex=1 -interaction=nonstopmode 'change directory command' file


  • 1
    can't you just do pdflatex -synctex=1 -interaction=nonstopmode -output-directory='/path/to the/new/' '/path/to the/new/file.tex' ? Commented Aug 28, 2018 at 19:48
  • oh wow that works. i was thinking this command just provide a new path as i already tried pdflatex 'path-to-directory'_filename and this failed as the current directoy is still the wrong one. but your code is working fine
    – SRel
    Commented Aug 28, 2018 at 20:27
  • @AndreasStorvikStrauman Would you like to convert your comment into an answer? Commented Sep 13, 2018 at 9:20

1 Answer 1


You can set the -output-directory argument of pdflatex, like so:

pdflatex -synctex=1 -interaction=nonstopmode -output-directory='/path/to the/new/' '/path/to the/new/file.tex'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .