Created
June 1, 2012 15:13
-
-
Save arthuralvim/2852859 to your computer and use it in GitHub Desktop.
Sublime Text 2 - build commands for bibtex and clean auxiliary files
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
// It's saved under path_to_Packages/User/ | |
{ | |
"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
// It's saved under path_to_Packages/User/ | |
{ | |
"cmd": ["latexmk","-CA","$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
// KeyBindings - User | |
// You should add the lines above without brackets to your keybindings (user) file or only download the file | |
// and overwrite it. Set the shortcuts the way you want. | |
[ | |
{ "keys": ["ctrl+shift+b"], "command": "run_build", "args":{"build_system":"Packages/User/Bibtex.sublime-build"}}, | |
{ "keys": ["ctrl+shift+l"], "command": "run_build", "args":{"build_system":"Packages/User/CleanTexFiles.sublime-build"}} | |
] |
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
# It's saved under path_to_Packages/User/ | |
import sublime | |
import sublime_plugin | |
class RunBuildCommand(sublime_plugin.WindowCommand): | |
def run(self, build_system): | |
self.window.run_command( "set_build_system", {"file": build_system } ) | |
self.window.run_command( "build" ) | |
# all credits for these guys http://www.bit-101.com/blog/?p=3439. =) |
Finally made it work after much fiddling. ST2 seriously lacks documentation on this.
https://gist.github.com/4298916
Here's a modified version of this & dpo's gist, with bibtex support added back in.
https://gist.github.com/4349538
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can't make this work under OSX. Is there anything else to it? I placed
RunBuild.py
andCleanTexFiles.sublime-build
in myPackages/User
and also changed the key binding tocmd+shift+l
but nothing happens. Sorry for my ignorance about ST2...On another note, the argument
-CA
tolatexmk
is obsolete and should be replaced with just-C
.