[Tex/LaTex] Sublime Text and Skim: Can’t build PDF


I used to be able to build PDF's just fine, but I haven't done any LaTeX-ing in the past few weeks. I opened up an old .tex file today and tried make some changes, only to see at bottom of the status bar of Sublime Text, No Build System.

I haven't made any changes to my settings of Skim nor Sublime Text, though I know that Skim recently had an update, which I opted for (don't know if that's relevant).

Under the sync settings of Skim I've chosen the Sublime Text preset, and in the Command field, I have "%file":%line.

What is causing the error? Why can't I no longer build my .tex files?

Edit: No changes to OS, still running on Yosemite 10.10.5

pdflatex --version gives:

pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh     (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with xpdf version 3.04

Best Answer

The No Build System in Sublime Text indicates that it doesn't find an appropriate Build System to build the document. By default, Sublime comes with syntax highlighting for LaTeX so you should see, in the bottom-right that it says LaTeX in the bottom-right of your window:

picture showing LaTeX syntax is selected

This may not seem important, but Sublime actually uses the syntax definition to determine what builder to use (assuming that Build System is set to Automatic), so this is actually the a plausible culprit for what you're seeing.

If Sublime Text already thinks your file is a LaTeX file, the next easiest thing to check is that you do, in fact, have some sort of builder for LaTeX installed. Sublime Text doesn't come with one out of the box, so you'd either have to have installed one through a plugin or using your own Builder. You can check whether you have such a builder (its usually called LaTeX) installed by checking the Tools | Build System submenu. You should see a list that includes LaTeX:

picture of Sublime Text Build System submen showing a LaTeX builder

If you do have a LaTeX builder installed you could just select it so that it will be run when you next attempt a build. Or, better yet, its possible that the Automatic setting has become unchecked (I've seen some Sublime plugins do this). If that's the case, simply recheck the Automatic and it should work.

If you don't have a LaTeX builder listed, the easiest way to get one is to install a LaTeX plugin. There are three I'm aware of:

  1. LaTeX-Plus
  2. LaTeXing
  3. LaTeXTools

All of which are installable using PackageControl. Personally, I use LaTeXTools, but I'm a developer of LaTeXTools and so a bit biased.

Two less likely scenarios that might be affecting you:

  1. Suppose Sublime recognises your file as a LaTeX file, you have a LaTeX builder installed, and the Automatic build system setting is checked. In that case, your build file is broken. If your build file is from a plugin, the best idea would be to uninstall and reinstall the plugin. If, however, your build file is in your User package directory (i.e., you are using your very own build file) its probably broken, either because it has a syntax error or its missing the line "selector": "text.tex.latex",.

  2. Suppose you have a LaTeX plugin installed but no build system. In that case, the best thing to do would be to try removing and reinstalling the plugin and if that fails, contact the plugin author.

I realise that's a lot of text. Hopefully some of it points you in the right direction.