Configuring TeXShop for Gregorio

Automatic score compilation

Gregorio needs a lualatex engine that is able to launch the gregorio program during compilation in order to compile gabc scores automatically (i.e. the engine has to have the --shell-escape option active). Unfortunately, TeXShop does not come with such an engine configured by default.

To make life easier, we've included an engine which is set up correctly, in the contributed add-ons which were installed as part of Gregorio: LuaLaTeX+se.engine. You can find it in /Users/Shared/Gregorio/contrib/TeXShop if you used the installer or in #/gregorio-git/contrib/TeXShop if you cloned the repository (where # is the directory you cloned the repository to). Simply copy this file to ~/Library/TeXShop/Engines and the engine should show up in the drop down list the next time you start TeXShop.

Nota Bene: If you have never opened TeXShop before then this directory will not exist on your system. Open and close TeXShop and it will create the missing directory (along with all the other configuration directories and files). You can also reset your configuration to the default by simply deleting all the configuration directory/files and then opening and closing TeXShop.

The name LuaLaTeX+se is arbitrary, but it's important to use it, so that everyone can have the same scores. This will also serve to differentiate it from the normal LuaLaTeX engine where the shell escape option is not active (TeXShop comes with this engine in its Inactive folder).

Ease of use of .gabc files (optional)

If you want to be able to filter files with .gabc and .gtex extensions in the file dialogs of TeXShop, open a Terminal window (it's in Applications/Utilities) and enter the following commands:

defaults write TeXShop OtherTeXExtensions -array-add "gabc"
defaults write TeXShop OtherTeXExtensions -array-add "gtex"

You can also make it so that the "Trash Aux Files" button removes the intermediate files created by Gregorio with the following Terminal commands:

defaults write TeXShop OtherTrashExtensions -array-add "gaux"
defaults write TeXShop OtherTrashExtensions -array-add "gtex"

Nota bene: Because the gtex files do not share the same name as the root project file, they will not be deleted unless you ask TeXShop to aggressively go after the Aux files. This can be done by holding down the option button when clicking on "Trash Aux Files" or by setting the hidden preference to always do the aggressive delete:

defaults write TeXShop AggressiveTrashAUX YES

Using TeXShop

Once TeXShop is ready, refer to the introduction page to start using Gregorio!