The point is simple, how to set the "master file" that always will be compiled in Sublime Text 3 editor using standard Ctrl-b command (it could using sublime's projects).

Additional feature I'm looking for is setting compilation directory. Where it should be specified?


I'm the developer of LaTeXTools. To set the master file, you need to add the following line at the very top (i.e. as the first line) of any included files:

%!TEX root = yourmasterfile.tex

The README has further details.

Right now there is no support for setting a compilation directory other than the one where the master file resides. It's something a few users have requested, so I may get to it eventually, but it will require some pretty extensive changes (I think).

Update: If you're using a .sublime-project file, you can add the master file under the settings property. See the official README.

  "settings": {
      "TEXroot": "yourfilename.tex"

In my case I had to provide the absolute path for the TEXroot file.

  • 6
    Kudos for creating LatexTools - really awesome work, and I use your stuff all the time. I have a my_thesis.tex file with include directives to main/xyz.tex files. I've tried putting both %!TEX root = my_thesis.tex and ../my_thesis.tex. At first it didn't work, but when I put the bibliography command directly into my_thesis.tex it started working great. – axel22 Jul 31 '14 at 15:46
  • I should add that I only noticed this on Windows with MikTex. On linux and osx, the bibliography command did not have to be in the main my_thesis.tex file. – axel22 Aug 1 '14 at 9:09
  • I just realized how many hours I could have saved if I had known that when starting my thesis. Thank you!!! It also jumps right to the edited part in the pdf when you build it. – Verena Haunschmid Nov 7 '15 at 9:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.