Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Build files, keymap entries, and `run_latex_build.py` plugin for adding the option for running bibtex and cleaning up auxiliary files for LaTeX in Sublime Text 2. Added the ability to run bibtex, and changed key bindings.
{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
{
"cmd": ["latexmk", "-C", "$file"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
[
// Run bibtex
{ "keys": ["super+shift+b"],
"command": "run_latex_build",
"args": {
"build_system": "Packages/User/Bibtex.sublime-build",
"reset_to": "Packages/LaTeXTools/LaTeX.sublime-build"
},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
]
},
// Clean up LaTeX auxiliary files.
{
"keys": ["super+shift+c"],
"command": "run_latex_build",
"args": {
"build_system": "Packages/User/CleanLatexFiles.sublime-build",
"reset_to": "Packages/LaTeXTools/LaTeX.sublime-build"
},
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
]
}
]
import sublime
import sublime_plugin
class RunLatexBuildCommand(sublime_plugin.WindowCommand):
def run(self, build_system, reset_to):
self.window.run_command( "set_build_system", {"file": build_system } )
self.window.run_command( "build" )
self.window.run_command( "set_build_system", {"file": reset_to})
@dpo
dpo commented

I just wonder why you add a BibTeX command. Latexmk will take care of that.

@bjmorgan
Owner

@dpo: I think it was a hangover from running separate LaTeX and BibTeX commands the "old-fashioned" way, but sometimes it's convenient to run just latex or bibtex without invoking the switch in focus to Skim, i.e. if you're essentially just "debugging" the LaTeX source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.