TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed latest Build of Sublime Text 2 and Portable version of MiKTeX.

Now I want to set up Sublime Text 2 so that I can compile LATEX (.tex) documents to create PDF's.

I read the info from LaTeX Plugin for Sublime Text 2

Finally, you must check the file LaTeX.sublime-build in the directory in which you unzipped the LaTeXTools plugin to make sure that the configuration reflects your preferred TeX distribution. Open the file and scroll down to the section beginning with the keyword "windows". You will see that there are two blocks of settings for the "cmd" and "path" keywords; by default, the MikTeX one is active, and the TeXlive one is commented out. If you use MikTeX, you don't need to change anything: congratulations, you are done!

The LaTeX.sublime-build is missing from my installation. So I have created LaTeX.sublime-build file under C:\Program Files\Sublime Text 2\Data\Packages\LaTeX directory With following content

   "cmd": ["pdflatex", "$file"],
   "path": "D:\\UserData\\majeedk\\[2012] Latex\\miktex-portable\\miktex\\bin;$PATH",
   "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
   "selector": "text.tex.latex"

Now The PDF gets created but bibliography is missing from the resulting PDF. How can I enable it?

share|improve this question
You need to run bibtex or biber, whichever you normally use. – Juri Robl Aug 3 '12 at 9:46

To compile the bibliography you have to adapt your build system as follows:

    “cmd”: ["pdflatex $file_base_name && 
             bibtex $file_base_name && 
             pdflatex $file_base_name && 
             pdflatex $file_base_name && 
             gnome-open $file_base_name.pdf"],
    “file_regex”: “^(…*?):([0-9]*):?([0-9]*)”,
    “selector”: “source.latex.tex”,
    “shell”: true
share|improve this answer

If you installed LaTeX-Tools correctly, there should be a corresponding folder in the package directory which contains the build orders:

path\to\Sublime Text 2\Data\Packages\LaTeXTools

If you don't want to (re)install LaTeXTools and want to use your own build command instead, you should consider using texify instead of pdflatex. texify will trigger the necessary multiple runs to create a proper TOC and will also invoke bibtex when it is required. Your LaTeX.sublime-build should contain the following lines:

"selector": "text.tex.latex",
"cmd": ["texify", "-b", "-p", "--tex-option=\"--synctex=1\"", "$file"],
"path": "D:\\UserData\\majeedk\\[2012] Latex\\miktex-portable\\miktex\\bin;$PATH",
"file_regex": "^((?:.:)?[^:\n\r]*):([0-9]+):?([0-9]+)?:? (.*)$"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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