gregowiki

Site Tools

tweaking_your_chant_output

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:

<v>\color{red}</v>

Initials

For fancy Initials (tex):

\newfontface\vectis{Vectis}
\def\greinitialformat#1{%
{\fontsize{24}{24}\vectis #1}}

Drop Caps

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

\renewcommand{\LettrineFontHook}{\vectis}

Fonts

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

\usepackage{fontspec}

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:

\documentclass{article}
\usepackage{fontspec}

\newfontfamily\Gentium[Ligatures=TeX]{Gentium}

\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
\begin{center}
\Gentium\huge
This is in the Gentium font
\end{center}
and back in the normal font.
\end{document}

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

C:\texlive\texmf-dist\fonts\truetype\public\

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:

 \textbf{Bold}\\
\textit{Italic}\\
\emph{Italic}\\
\texttt{Typewriter}\\
\textsf{Sans-Serif}\\
\textrm{Serif-Roman}\\
\underline{Underlined}\\

Colours

You can change the colour of text like this:

\color{red}
%or
\textcolor{red}

So, for your commentary, try this:

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

\setfirstannotation{\fontsize{10}{10}\textcolor{red}{Ant.}}%
\setsecondannotation{\fontsize{10}{10}\sc{\textcolor{red}8.}}%

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:

<v>\color{red}*\color{black}</v>

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

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
\usepackage[papersize={4.5in,8in},margin=0.25in]{geometry}
%or you can use this:
\geometry{letterpaper}

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

\begin{tiny}
\includescore{#filename#}
\end{tiny}

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
\usepackage[fontsize=20]{scrextend}

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

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.
\redlines

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.

Custos

• 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.

\grechangedim{\gremaximumspacewithoutdash}{0pt}

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.

Indents

• 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