4

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?

1
  • You need to run bibtex or biber, whichever you normally use.
    – Juri Robl
    Commented Aug 3, 2012 at 9:46

2 Answers 2

3

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
}
0

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]+)?:? (.*)$"
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .