User Tools

Site Tools


Tweaking your Chant Code

There are some tweaks that cannot be done in gabc code, and must be made, instead, in your tex file. Remember that if you include these in your “main” tex file, then they can be included in all of your scores. If you just want the tweaks in an individual score, then first run your gabc through Gregorio, and then place your tex tweaks in the resultant tex file.

Here are some links to some useful tex tutorials (in case this page doesn't have what you need).

Also, it is important to note that much of the ``tex`` code can be used right in with the ``gabc`` code. This will allow you to style the actual chant text. All you have to do is place it in v-tags like this:



For fancy Initials (tex):

{\fontsize{24}{24}\vectis #1}}

Drop Caps

and making matching drop caps with the lettrine package (tex):



The LaTex package fontspec lets you use TrueType (.ttf) fonts. You initiate them like this:


And then, if you've installed the font, you can set the font as the main font for your chant text. Now, notice below that Gentium is listed three times. That is because the actual font files are called “Gentium Basic Bold.ttf”, “Gentium Italic.ttf” and “Gentium.ttf”. So you need to make sure the font names match the font file names. :?: (I think)

\setromanfont[BoldFont={Gentium Basic Bold},ItalicFont={Gentium Italic}]{Gentium}

If you want to change the font for a single word or two, try this:

\begin{document}    %You can only have one of these declarations, so just make sure what is above is declared
This is in the normal font
This is in the Gentium font
and back in the normal font.

To install a TrueType Font, place the files in this folder:


See this question over at Tex Stack Exchange for some very nice details regarding fonts and formatting. There is another question here.

Text Styles

There are complete tex references out there, but here are some quickie text styles:



You can change the colour of text like this:


So, for your commentary, try this:

\commentary{{\color{red}\small \emph{myCommentary}}}

For your annotations, try this:


Now, if you want coloured text within your chant text below the staves, then you can add the colour codes right in the gabc file like this:

<v>\color{red}My Red Text</v>

or, simply:

<c>My Red Text</c>

but, for just a single character (such as a *), you have to do this to set the color back to the previous color:


Here is a sample score for colouring both text and staff right in the gabc file (click to unfold):

Here is a page on the Tex Stack Exchange dealing with tex colours.


Annotations: (tex)

\setfirstannotation{\tiny Ant.}%
\setsecondannotation{\tiny \sc{iii}}

or, in gabc:

annotation: Ant.;
annotation: 5;

Page Size

Place this toward the top of the .tex file somewhere around \document class

%set the margins of the outputted page
%or you can use this:

Text Size

Toward the end of the .tex file, find where your score-tex file is included.
Wrap that in size tags. You can use any of these: tiny small normal large huge


You can also use those tags on your title.

\begin{center}\begin{huge}\textsc{My Chant Title}\end{huge}\end{center}

Another thing you should probably do is to install two tex packages (you can use texlive just as well as gregorio, you know. texlive is its own application), called, koma-script and extsizes. To install them (in Windows), open your Tex Live Manager and find the “Match” box. The default repository will already be loaded. In the “status” groupbox on the left, make sure that “not installed” is checked.“ Just check the box and push the “install” button! That's it. It's pretty easy. Now that you've installed the two font sizing packages, you can add this to your tex code, just below \documentclass toward the top:

%increase the text size to 20 for the entire document

Here is a screenshot of the Texlive Manager Package Installer: .

See also some nice notes here.

Staff Width

Place this after the \usepackage entries, but before \begin{document}

%control the width of the staff and accompanying text
\textwidth 4.5in

Red Staff

% We set red lines here, comment it if you want black ones.

Staff Break

Adding z or Z along with the gabc code will add space to the staff.
This is useful if you want to force-fill a line.


  • You can suppress the custos at the end of a staff by placing ``\greblockcustos`` in the tex template just after ``\begin{document}`` .
  • To add a custos within the staff, perhaps before the double-bars, try this: ``(z0::c4)``
  • To manually place a custos anywhere, use ``g+`` or ``h+`` where the letter is the level you want the marker.

Nonbreaking Space

In the gabc file, there are several things you can do:

  • Try putting ``!`` before spaces.
  • Put a regular space within the neum's parenthesis: g(g )
  • Put a space within the text area(the separators are just to show the boundary: (:) g (g)(:)

Another thing you can do is to use a neumatic cut, which is just this: ``/`` or ``/````/``

And if you place a ``!`` before a ``/`` then it makes the neumatic cut unbreakable across staves: ``!/``

Increase spacing

These two tricks can be inserted in your main tex code just before the inclusion of your tex score.

\tolerance=9999 %(or less)
\pretolerance=500  %default is -1  This will spread your chant out over the bars

Forced Syllables

Say you need to force hyphens to appear between syllables. You can try placing this before the score in your tex template. This inidicates maximal space between two syllables for which we consider a dash is not needed. You may also try adjusting the value. A negative value (-20pt for example) may do the trick. The idea is to get a dimension that is just small enough.


Change Clefs

Changing Clefs midstaff is easy - just type your clef within the parentheses of the last double-bar, like this: ``(::c3)``.

Compress Space

  • Reduce the spacing between syllables or glyphs: ``\hspace{-.2ex}``
  • or, put the syllables or glyphs between inside this: ``\mbox{…}``
  • or, use ``( z)`` to push the neums closer to the start of the staff. The more spaces in the parentheses, the more it crunches the space.


  • To remove any unwanted indentations, you can wrap your ``tex`` code with ``\begin{flushleft}`` and ``\end{flushleft}``. But don't wrap your inclusion (``\includescore{myscore.tex}``)!

Back to Start Page

tweaking_your_chant_output.txt · Last modified: 2015/03/20 16:14 by bgm