6

Please excuse me if I've posted this in the wrong area. I've just started using Sublime Text 2 for Latex with the LaTeX tools plugin. It's wonderful. I'm using Mac ox 10.6.8

I'm wondering about adding an engine/build for processing .gabc files. Using gregoriotex I can run this in the command line gregorio *.gabc and it will process the file and output a .tex file.

I can also do this with TeXworks which uses an engine with this :

#!/bin/tcsh

set path= ($path /usr/texbin /usr/local/bin)
set filename = "$1"
set texname = "${filename:r}.tex"
gregorio "$filename"
echo "produced $texname"

any help you can provide would be much appreciated.

4
  1. Save the script you pasted in your question to a file, say for example at the file /Users/yourusername/bin/run-gregorio and give it execution permission (chmod +x /Users/yourusername/bin/run-gregorio).

  2. In Sublime Text 2, go to Tools -> Build System -> New Build System, this will create a buffer containing:

    {
        "cmd": ["make"]
    }
    
  3. Edit it and change it to:

    {
        "cmd": ["/Users/yourusername/bin/run-gregorio", "$file_name"]
    }
    
  4. Save it as Gregorio.sublime-build (Sublime Text 2 will pick the correct folder for you).

That's all! Now you can choose Gregorio as build system and then build a file. You will see the message produced filename.tex in the console.

  • Thank you, after wrestling with the path a bit it works like a charm. – theobear Mar 1 '13 at 1:45
  • I suggest to use /usr/local/bin folder instead. Mac OS X with MacPorts installed threats the shell script better :-) I mean, $PATH makes no problem. – user27609 Mar 18 '13 at 21:36
  • I tried your method using this gist.github.com/macmadness86/5269856 script and it would not work. For some reason, Sublime Text 2 adds an extra slash to the export path. Works find in TexShop – Jonathan Komar Mar 31 '13 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.