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.
I've personally found the following to work just fine for me:
Here's an explanation as requested.
This is the build file code that I use in Sublime Text 3 (this works fine in ST2 as well) to compile my LaTeX (I use MikTex). If you go to Tools -> Build System -> New Build System you can use what I have to build your .tex file. I've used this successfully on Linux (Ubuntu) and on Windows 8.1. You might have to check your PATH to ensure that MikTeX is there. I've explored LaTeXTools, but have found it much simpler to use this instead of the package; there's virtually no setup. However, if you're looking for something a bit more complicated, LaTeXTools is the way to go.
If you want to compile more options, for example:
you can write a Makefile with content:
and make a new sublime build for example: makeThesis.sublime-build with content:
The path "~/Tesis/TeXiS" content your all project of latex and "make -C" is to compile from anywhere (Ctrl+b)
Well only go to: Tools > Build Systems > makeThesis for compile
PD: in Makefile
TeXiS es your master latex file (ie: TeSiS.tex) and acronimos.gdf content you glossary words. Keep in mind that the makefile is in linux SO.