I'm trying to compil latex files from an external directory using output-dir option because some *.sty files are in my LaTeX directory but not in my current directory.

The command I use is like this :

pdflatex -output-directory=/LaTeXdir /LaTeXdir/main.tex

And I get an error, pictures (*.png files) not found...

How can I do to specify the pictue location ? Why -output-directory doesn't work ? Thanks

  • Why do you want to specify a output directory when the input is concerned? Input paths can be specified with the system environment variable $TEXINPUTS, for example – user31729 Jun 12 '15 at 22:07
  • Put the .sty files in your local texmf directory, or use symbolic links; put your main .tex file in one directory and make sure all the \includegraphics file paths are relative to that directory; then conpile from the directory where the main .tex file is, and put the output directory anywhere you like. – musarithmia Jun 13 '15 at 1:59
  • The idea is that you will compile from the same directory as the file, in other words. One use of changing the output directory is to move all the auxiliary files to a separate place so they are out of the way. For example in each project folder I have a /tmp directory and a /pdf directory? I use linux bash shell aliases as shortcuts to compile into /tmp and then move the finished pdf into /pdf. – musarithmia Jun 13 '15 at 2:07
  • I think my question was miss understood. I got a directory with .tex files, a .sty file and a png file. I want to compile them using an external software which can (theoretically) be launched from everywhere. If I don't use -output-directory the .sty file is not found, I have to use it then. But the png file is still not found, and modify $TEXINPUTS is getting worst... In Java I didn't find a way to know where a .jar is so I think it's impossible to know where files are supposed to be copied. – clement-D Jun 13 '15 at 17:23
  • 1
    Did you try using the full directory path for the images? – musarithmia Jun 14 '15 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.