I recently (2 days back) started using LaTeX, I use Sublime Text 2 (ST2) for most of the programming. I found that ST2 has LaTeX package. So what I am doing is write the document with ST2 and run it with TeXWorks to see any errors/debugging. Is there a way I can run/debug the tex file directly from ST2? Is there any better practice than what I am doing currently?
It's not easy to work with ST2 the first time . You need to install some tools.
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.
I'm the developer of the LaTeXTools plugin. Ctrl-B (⌘-B on OS X) launches a specially modified build system that:
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).
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:
Another way is to set up
and have a build project with latexmk:
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.