Before you install Gregorio
If you have never used TeX before, then we strongly recommend that you start to familiarize yourself with gabc by using the Illuminare Score Editor or the Gregorio Chant Engraver. These online tools will only require you to learn about gabc itself, while handling the considerable overhead that comes with using TeX for you. You won't have access to all of the features of GregorioTeX, but you won't have to learn two things at once, making it much easier to ease into the use of Gregorio.
Once you have mastered gabc itself, and find yourself wanting access to more of the capabilities of GregorioTeX, then you need to get yourself a TeX distribution. The most common distribution is TeX Live. This distribution supports many platforms, including all the major ones (Windows, Mac, and all varieties of Linux). For Mac users, there is also a Mac specific variant of TeX Live called MacTeX which does a much better job of integrating it into the Mac environment than the cross-platform installer. Another common distribution is MiKTeX which now supports all three major platforms (Windows, Mac, and Linux in its Ubuntu/Mint varieties).
One more thing...
If you have a full installation of TeX Live (including MacTeX), then Gregorio may already be installed on your system as part of that installation. The table below indicates which versions of Gregorio shipped with which versions of TeX Live:
|TeX Live version||Gregorio version|
If you have MiKTeX, then Gregorio is also included there. Because of MikTeX's rolling update model, it is impossible for us to tell you exactly what version is there, but you should be able to find and install a fairly recent, if not the most recent, version using the MiKTeX Console.
And now, finally, the installation instructions
If your TeX distribution doesn't have Gregorio, or you want a newer version of Gregorio than is available in your distribution, then refer to the following pages:
By default LuaTeX (and all other varieties of TeX is only permitted to access a limited list of third-party programs. This is a security measure which prevents documents from doing things to you system that you might not expect or desire. Of course, in order for Gregorio to work, it has to be able to access its own exectuable. If you've installed TeX Live or MiKTeX, then access to the included executable is already setup for you. However, if you install an updated version, then you will need to enable access to the new executable. This can be accomplished in a number of ways:
--shell-escapewhen compiling documents making use of Gregorio. This option enables LuaTeX to call any shell command. Obviously this makes the compilation less secure, but that drop in security applies only to that document compilation, allowing for case-by-case differentiation in compilation behavior. It is our default recommendation because it is the simplest for most people to implement. To see how to automate this process if you are using an editor, see Editor Configuration below.
--shell-escapemode the default by setting
shell_escape=tin texmf.cnf. This will make all compilations less secure, but means that you don't have to specify the
--shell-escapeflag on any given run. You should only do this if you trust all the documents you run through TeX on your system.
To find your texmf.cnf file, execute
kpsewhich texmf.cnffrom the command line. Open the file at the given location and search for
shell_escape=pand then change the
t. If you cannot find this line, then you can simply add
shell_escape=tto the bottom of the file.
Add the new executable to the list of permitted programs in texmf.cnf. This is the most secure option as it only adds the new executable to the list of allowed programs and nothing else. However, it does need to be done each time you install a new version of Gregorio.
The list that needs editting is called
shell_escape_commandsand the program that needs to be added to it is called
x_y_zis the version number of Gregorio that you've installed. If the list is not present in your top-level texmf.cnf, then you'll need to use
kpsewhich -a texmf.cnfto find the lower-level configuration file. Do not edit those lower level files. Instead, copy the
shell_escape_commandslist into your top-level texmf.cnf file and edit that copy. Values in the top-level file automatically override those in the lower-level ones.
Create a symlink on your system that points
is the version number of Gregorio that you've installed). This symlink must be on your
PATHbefore the folder containing the TeX executables so that it hides the executable that comes with TeX. This option is as secure as the previous option, and will also need to be updated every time you install a new version of Gregorio. For instructions on how to do this, see the documentation for your system.
Resign yourself to using Gregorio in the old school way. This means turning off the autocompile feature and manually running
gregorio-x_y_zon your gabc files to generate the gtex files. This doesn't work for
\gregorioscore) and is damned inconvenient generally, but it is possible, so we list it here to be complete.
If you plan to use an editor, then you'll need to configure it once Gregorio is installed. For instructions on how to do this, refer to the following pages: