2

I'm trying to customise the build function on Sublime text 3 to include separate outputs for the build files and the pdf. I am using Miktex and xelatex (by adding %!TEX program = xelatex) at the top of my document. How would I customise the Latextools compiler to add,

-aux_directory=../intfiles

and

-output-directory=../pdffiles

Which I believe will do this?

1 Answer 1

1

Update: LaTeXTools now supports aux_directory and output_directory via settings or using comments such as %!TEX output_directory = out_dir. There are a few caveats to this support which are included in the documentation.


LaTeXTools doesn't support -aux-directory or -output-directory (yet). However, if you can stomach having a couple of symbolic links in the same directory as your main tex document, you can use something like roeeebar's suggestion from this issue, which adds a settings block to your sublime-project file (I've modified this for Windows, but I haven't tested it).

"settings": {
    "builder": "script",
    "builder_settings":
        "windows": {
            "script_commands": [
                "latexmk -cd -f -xelatex -synctex=1 -interaction=nonstopmode -auxdir=Aux -outdir=Output $file_name",
                "mklink Output\\$file_base_name.pdf .",
                "mklink Output\\$file_base_name.synctex.gz .",
                "mklink Aux\\$file_base_name.log ."
            ]
        }
    }
}

This basically places symbolic links to the appropriate files where LaTeXTools expects to find them, so it should continue to work as expected.

A couple of notes:

  1. latexmk is not installed by default on MiKTeX. It's easily installable using the package manager, but because it's a Perl script, you'll also need a version of Perl, such as Active Perl or Strawberry installed and on your %PATH% to get it working. Unfortunately, the usual builder LaTeXTools uses on MiKTeX (texify) will stop with a fatal error if you try to pass it the -aux-directory or -output-directory flags.

  2. You may need to alter the latexmk command of you are not using xelatex.

5
  • I installed Strawberry Perl, but how would you install it on your '%PATH%' to get it working? Commented Apr 7, 2016 at 22:40
  • @JindhaSingh it should do it automatically. Try typing perl -version in a cmd.exe window. If you get an error, see this answer on superuser.
    – ig0774
    Commented Apr 7, 2016 at 23:20
  • @JindhaSingh any progress?
    – ig0774
    Commented Apr 9, 2016 at 0:19
  • Yeah i cant get it to work unfortunately. Im still trying, but yeah it wont compile. Commented Apr 9, 2016 at 2:28
  • Do you get an error of some sort?
    – ig0774
    Commented Apr 24, 2016 at 11:35

You must log in to answer this question.

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