Gregorio Tutorial (part III)
Here we continue the gabc tutorial that began on this page.
We will talk about some features of GregorioTeX, whose documentation can be found here.
Kyrie XVII (end)
We have been working to typeset this score:
Our gabc notation file currently looks like this:
name:Kyrie XVII; %% (c4)KY(f)ri(gfg)e(h.) *() e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) <i>bis</i>(::) Chri(ixj)ste(jv.hijv.) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) <i>bis</i>(::) Ký(f)ri(hj)e(ixjjkij.) (z) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) (::) Ký(f)ri(hj)e(ixjjkij.) *(,) (ixf!hjjkij.) **(,) (z) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) (::)
And the resulting score looks like this:
We also still have some changes to make to the score: add the mode notation "VI" before the first clef (an annotation) and add "XIV s." (which stands for "14th century," in Latin, the date of the piece) above the first stave (the commentary). I'd like to experiment with a different typeface for the text. Last of all, it would also be nice if we could add more vertical space between the staves.
Adding annotations
While we could add the annotation and commentary directly in the main project file, let's make use of the gabc headers so that this information stays with the score and can easily be reused if we decide to create another project using this score.
To do this, we need to add two lines to the gabc file (highlighted in red):
name:Kyrie XVII; mode: 6; date: XIV\textsuperscript{o} s.; %% (c4)KY(f)ri(gfg)e(h.) *() e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) <i>bis</i>(::) Chri(ixj)ste(jv.hijv.) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) <i>bis</i>(::) Ký(f)ri(hj)e(ixjjkij.) (z) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) (::) Ký(f)ri(hj)e(ixjjkij.) *(,) (ixf!hjjkij.) **(,) (z) e(ixjvIH'GhvF'E)lé(ghg')i(g)son.(f.) (::)
You'll note that we've used some TeX code in the date header in order to create the ordinal indicator (something lacking in the original score). We could also have used the Unicode character º
for the same purpose, but that would be more sensitive to font changes, so I prefer to use the explicit TeX code. Of course, you could just leave it out entirely and get something closer to the score.
Now, the mode header will be picked up by default (and placed as an annotation) once it's been added to the gabc file, but the date header will not. In order to add place the date header in the commentary position, we need to add a line to the project file (highlighted in red):
\documentclass[12pt, a5paper]{article} \usepackage{fullpage} \usepackage{fontspec} \usepackage{libertine} \usepackage[autocompile]{gregoriotex} \begin{document} \gresetheadercapture{date}{grecommentary}{} \gregorioscore{kyrie-17} \end{document}
Once that's done, run that file through LuaLaTeX, and the resulting score looks like this:
We've got the elements in place, but I don't like the way the date commentary looks. Instead of italics, I want it to be bold. However, I still want to keep it the same size, which is slightly smaller than the font used for the lyrics. To make this happen I need to modify the project file again:
\documentclass[12pt, a5paper]{article} \usepackage{fullpage} \usepackage{fontspec} \usepackage{libertine} \usepackage[autocompile]{gregoriotex} \grechangestyle{commentary}{\small\bfseries} \begin{document} \gresetheadercapture{date}{grecommentary}{} \gregorioscore{kyrie-17} \end{document}
I think that's a bit better. However, having made that change, it's now obvious that the mode number and the date commentary are not printing the same. This is because by default the mode number uses small capitals, not normal majuscule characters. I'm going to switch this to get a more consistent look.
I also want to put a title at the top of the page, so I'll add that directly after \begin{document}
.
\documentclass[12pt, a5paper]{article} \usepackage{fullpage} \usepackage{fontspec} \usepackage{libertine} \usepackage[autocompile]{gregoriotex} \grechangestyle{commentary}{\small\bfseries} \gresetmodenumbersystem{roman-majuscule} \begin{document} \begin{center}\begin{huge}\textsc{Kyrie XVII}\end{huge}\end{center} \gresetheadercapture{date}{grecommentary}{} \gregorioscore{kyrie-17} \end{document}
Changing the typeface
To see how the score looks in Arial font, I looked for the line that sets the typeface to Linux Libertine:
\usepackage{libertine}
and I changed it:
\setmainfont{Arial}
Here's how the score looks after that change:
This result is kind of ugly, so we'll change it back to Linux Libertine, but this should give you some idea of how to change the font. Other fonts, including most of the ones already installed on your system, can be loaded using the fontspec
package, just like we loaded Arial above. You can also find a list of free fonts which are readily available for TeX see The LaTeX Font Catalogue. The best-looking font for Gregorian Chant is a matter of taste, so we'll leave it up to you to explore the use of other fonts on your own.
Changing vertical spacing
To add more space between the staves, I adjusted a spacing variable by adding the following line to the preamble:
\grechangedim{lineskip}{1 cm plus 0.36 cm minus 0.09 cm}{scalable}%
This gives us this final project file:
\documentclass[12pt, a5paper]{article} \usepackage{fullpage} \usepackage{fontspec} \usepackage{libertine} \usepackage[autocompile]{gregoriotex} \grechangestyle{commentary}{\small\bfseries} \gresetmodenumbersystem{roman-majuscule} \begin{document} \begin{center}\begin{huge}\textsc{Kyrie XVII}\end{huge}\end{center} \grechangedim{lineskip}{1 cm plus 0.36 cm minus 0.09 cm}{scalable} \gresetheadercapture{date}{grecommentary}{} \gregorioscore{kyrie-17} \end{document}
And here's how the score looks after that change:
That completes this tutorial. For reference, you may want to print a copy of this PDF summary of gabc, which shows the notation for some gabc features we haven't demonstrated here. For more, see this reference.