-
-
Save bjmorgan/4349538 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": ["bibtex", "$file_base_name"], | |
"path": "$PATH:/usr/texbin:/usr/local/bin", | |
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)", | |
"selector": "text.tex.latex" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd": ["latexmk", "-C", "$file"], | |
"path": "$PATH:/usr/texbin:/usr/local/bin", | |
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)", | |
"selector": "text.tex.latex" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// 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" } | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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
orbibtex
without invoking the switch in focus to Skim, i.e. if you're essentially just "debugging" the LaTeX source.