json - run shell script/bash commands in Sublime Text latex build without any file arguments -
i have sublime text build system running latex. using shell script (with no arguments) delete various extensions generated latex. problem sublime-text thinks filename.tex argument script.
so tried following script:
{ // general settings "target": "make_pdf", "selector": "text.tex.latex", "cmd": ["latexmk", "-e","\\$dvipdf = 'dvipdfmx %o -o %d %s'", "-e", "\\$latex = 'latex %o -interaction=nonstopmode -synctex=1 %s'","-f", "-pdfdvi"], "variants": [ { "cmd":["my_script.sh"], "name": "clean" } ] }
here used ls in place of script illustrate. when run build-file, tries run
my_script.sh filename.tex
instead of my_script.sh. can run build file ?
i have been there , done . . . there , again . . . , visited again , again . . .
the solution use custom plugin (not relying upon .sublime-build
, possible too) can refer *.tex file open. have solutions unaware of, 1 of own, , 1 modify popular plugin latextools.
latexmk cleans big -c (everything) or little -c (some things pre-defined, , additional things can user-defined) -- there no need use separate custom cleaner script.
https://github.com/lawlist/latextools-unofficial-modification
https://github.com/lawlist/st2-plugin-latexmk-save-build-clean
fyi: recommend putting latex (or that) in subject line of question -- missed question . . . , happened see short summary , realized knew issue.
sample -- multitaskbuild plugin located here: https://github.com/bizoo/multitaskbuild
{ "cmd": { "latexmk -pvc . . .": { "cmd": ["latexmk", "-r", "/users/home/.latexmkrc", "$file"] }, "latexmk -pv . . .": { "cmd": ["latexmk", "-e", "\\$pdflatex = 'pdflatex -enable-write18 %o -interaction=nonstopmode -synctex=1 %s'", "-recorder-", "-pvc-", "-f", "-pdf", "-pv", "$file"] }, "latexmk -c": { "cmd": ["latexmk", "-c", "$file"] }, "latexmk -c": { "cmd": ["latexmk", "-c", "$file"] } }, "path": "$path:/usr/texbin:/usr/local/bin", "file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)", "selector": "text.tex.latex", "default_task": "latexmk -pv . . .", "target": "multi_task_exec" }
Comments
Post a Comment