I have several times, in different lines of investigation, seen insinuations that adding something along the lines of

%& -output-directory=../output 

in the very beginning of my main .tex file will allow you to, from within the document, pass command line arguments to your compiler. The code above doesn't work for me, though, and I can't seem to find any good documentation.

Is this a common practice? How do you do it right? How does it work?

I write in Kile, and compile with XeLaTeX. EDIT: ...on Ubuntu.

  • I believe it works that way only with MiKTeX (on Windows).
    – egreg
    Oct 17, 2014 at 16:17
  • So this is an editor thing? That at least is a new angle of attack.
    – Gustaphe
    Oct 17, 2014 at 16:20
  • No, MiKTeX is a TeX distribution, independent of whatever editor you use.
    – egreg
    Oct 17, 2014 at 16:21
  • 3
    One cross platform possibility would be to use something like arara which can read comments at the head of the file and set up a pipeline of commands Oct 17, 2014 at 16:22
  • 1
    Kile cannot do this. Kile also ignores the more standard % !TEX TS-program = pdflatex lines which many editors recognise. You can specify things like this for compilation commands (i.e. not per-document). However, that does not work at all well in current versions of Kile. (There are bugs which made it unusable for me.) arara works beautifully, however, and is editor independent which is, I think, an advantage.
    – cfr
    Oct 18, 2014 at 2:07


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.