LaTeX with Sublime Text 2

I'm the developer of the LaTeXTools plugin. Ctrl-B (-B on OS X) launches a specially modified build system that:

  • collects errors and warnings, and displays them in Sublime Text's output panel; you can then click on the errors to jump to the corresponding line in your source text file;

  • sets up forward and inverse search

  • upon completion, invokes forward search in your PDF previewer (Skim on Mac, SumatraPDF on Windows, Linux not there yet) so you get to see the current page

Take a look at the README file in the plugin's directory (which you can open in Sublime Text using the "Browse Packages..." menu item).


It's not easy to work with ST2 the first time . You need to install some tools.

Firstly, you can read this readme Readme LaTeXTools then you can download the archive .zip here LaTeXTools.

The readme explains how to install the package. You get something like TextMate after that (Personally I prefer TextMate on OS X) but this editor is really fine tool.

idea from kgr

A good thing, it's to add the package control, with this package you can LaTeXTools directly and very important this will keep it up to date. It's the better way. You need to read carefully the explanations to install the package control.


There is no default functionality for that, but you can easily create your own. in ST2 you can add build systems in Tools -> Build System -> New Build System... and if you want to run your file with PDFTeX, your build system definition file would look like:

{
    "cmd": ["pdflatex","$file_name"],
        "selector": "text.tex.latex"

}

Another way is to set up latexmk for your project, which can be as simple as creating a project file like this (name that latexmkrc):

$pdf_mode = 1;
@default_files = ('myfile');

and have a build project with latexmk:

{
    "cmd": ["latexmk"],
    "selector": "text.tex.latex"
}

If you now select select that build system in the same menu you can now press command-b or ctrl-b the TeX file will get compiled. You can manually switch to the log file and see what is in there.