User Tools

Site Tools


tweaking_your_chant_output

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tweaking_your_chant_output [2015/03/19 16:07]
bgm [Custos]
tweaking_your_chant_output [2015/03/20 16:14] (current)
bgm [Colours]
Line 1: Line 1:
 +====== 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).
 +
 +  *[[https://​en.wikibooks.org/​wiki/​LaTeX/​Text_Formatting|Text Formatting]]
 +  *[[https://​en.wikibooks.org/​wiki/​LaTeX/​Paragraph_Formatting|Paragraph Formatting]]
 +  *[[https://​en.wikibooks.org/​wiki/​LaTeX/​Text_Formatting#​Manual_spacing|Manual Spacing]]
 +
 +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:
 +<​code><​v>​\color{red}</​v></​code>​
 +
 +=====Initials=====
 +For fancy Initials //(tex)//:
 +<code Lua>
 +\newfontface\vectis{Vectis}
 +\def\greinitialformat#​1{%
 +{\fontsize{24}{24}\vectis #1}}
 +</​code>​
 +
 +=====Drop Caps=====
 +and making matching drop caps with the lettrine package //(tex)//:
 +<code Lua>
 +\renewcommand{\LettrineFontHook}{\vectis}
 +</​code>​
 +
 +
 +=====Fonts=====
 +The LaTex package fontspec lets you use TrueType (.ttf) fonts. ​ You initiate them like this:
 +<code lua>
 +\usepackage{fontspec}
 +</​code>​
 +
 +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)
 +<code lua>
 +\setromanfont[BoldFont={Gentium Basic Bold},​ItalicFont={Gentium Italic}]{Gentium}
 +</​code>​
 +
 +If you want to change the font for a single word or two, try this:
 +<code lua>
 +\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}
 +</​code>​
 +
 +To install a TrueType Font, place the files in this folder:
 +<code lua>​C:​\texlive\texmf-dist\fonts\truetype\public\</​code>​
 +
 +See this [[http://​tex.stackexchange.com/​questions/​25249/​how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document|question over at Tex Stack Exchange]] for some very nice details regarding fonts and formatting. ​ There is [[http://​tex.stackexchange.com/​questions/​147296/​how-to-change-font-without-changing-document-font|another question]] here.
 +
 +=====Text Styles=====
 +There are complete tex references out there, but here are some quickie text styles:
 +<​code>​
 + ​\textbf{Bold}\\
 + ​\textit{Italic}\\
 + ​\emph{Italic}\\
 + ​\texttt{Typewriter}\\
 + ​\textsf{Sans-Serif}\\
 + ​\textrm{Serif-Roman}\\
 + ​\underline{Underlined}\\
 +</​code>​
 +{{:​gregowiki:​tex_text_styles.png?​nolink&​200|}}
 +
 +
 +=====Colours=====
 +You can change the colour of text like this:
 +<code lua>​\color{red}
 +%or
 +\textcolor{red}</​code>​
 +
 +So, for your commentary, try this:
 +<code lua>​\commentary{{\color{red}\small \emph{myCommentary}}}</​code>​
 +
 +For your annotations,​ try this:
 +<code lua>​\setfirstannotation{\fontsize{10}{10}\textcolor{red}{Ant.}}%
 +\setsecondannotation{\fontsize{10}{10}\sc{\textcolor{red}8.}}%
 +</​code>​
 +
 +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:
 +<code lua><​v>​\color{red}My Red Text</​v></​code>​
 +or, simply:
 +<code lua><​c>​My Red Text</​c></​code>​
 +but, for just a single character (such as a *), you have to do this to set the color back to the previous color:
 +<code lua><​v>​\color{red}*\color{black}</​v></​code>​
 +
 +
 +++++Here is a sample score for colouring both text and staff right in the gabc file (click to unfold): |
 +<code lua>
 +%%
 +(c4)To(e)ta(e)
 +<​v>​\color{green}</​v>​pul<​v>​\color{blue}</​v>​(c)<​v>​\color{green}</​v>​chra<​v>​\color{blue}</​v>​(e)
 +<​v>​\color{green}</​v>​ es, <​v>​\color{blue}</​v>​(g.)
 +<​v>​\color{green}</​v>​O<​v>​\color{blue}</​v>​(g) <​v>​\color{green}</​v>​Ma<​v>​\color{blue}</​v>​(f_e)<​v>​\color{green}</​v>​ri<​v>​\color{blue}</​v>​(fg)<​v>​\color{green}</​v>​a,<​v>​\color{blue}</​v>​(e_d_) (,)
 +</​code>​
 +
 +++++
 +
 +Here is a [[http://​tex.stackexchange.com/​questions/​17104/​how-to-change-color-for-a-block-of-texts|page on the Tex Stack Exchange]] dealing with tex colours.
 +
 +=====Annotations=====
 +Annotations:​ //(tex)//
 +<code Lua>
 +\setfirstannotation{\tiny Ant.}%
 +\setsecondannotation{\tiny \sc{iii}}
 +</​code>​
 +or, in gabc:
 +<​code>​
 +annotation: Ant.;
 +annotation: 5;
 +</​code>​
 +
 +=====Page Size=====
 +Place this toward the top of the .tex file somewhere around <​html>​\document class</​html>​
 +<code Lua>
 +%set the margins of the outputted page
 +\usepackage[papersize={4.5in,​8in},​margin=0.25in]{geometry}
 +%or you can use this:
 +\geometry{letterpaper}
 +</​code>​
 +
 +=====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: <​html>​tiny small normal large huge</​html>​
 +<code lua>
 +\begin{tiny}
 +\includescore{#​filename#​}
 +\end{tiny}
 +</​code>​
 +You can also use those tags on your title.
 +<code lua>
 +\begin{center}\begin{huge}\textsc{My Chant Title}\end{huge}\end{center}
 +</​code>​
 +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 <​html>​\documentclass</​html>​ toward the top:
 +<code lua>
 +%increase the text size to 20 for the entire document
 +\usepackage[fontsize=20]{scrextend}
 +</​code>​
 +Here is a screenshot of the Texlive Manager Package Installer: {{gregowiki:​texlive:​texlivemanager_packageinstall.png?​75x100}}.
 +
 +See also [[http://​tex.stackexchange.com/​questions/​45021/​latex-does-not-adjust-font-size|some nice notes here]].
 +
 +=====Staff Width=====
 +Place this after the <​html>​\usepackage</​html>​ entries, but before <​html>​\begin{document}</​html>​
 +<code Lua>
 +%control the width of the staff and accompanying text
 +\textwidth 4.5in
 +</​code>​
 +
 +=====Red Staff=====
 +<code lua>
 +% We set red lines here, comment it if you want black ones.
 +\redlines
 +</​code>​
 +
 +=====Staff Break=====
 +Adding <​html>​z</​html>​ or <​html>​Z</​html>​ 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:​ <​html>​g(g )</​html>​
 +  * Put a space within the text area(the separators are just to show the boundary: ​ <​html>​(:​) g (g)(:​)</​html>​
 +
 +
 +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.
 +<code lua>
 +\tolerance=9999 %(or less)
 +\pretolerance=500 ​ %default is -1  This will spread your chant out over the bars
 +</​code>​
 +
 +=====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//​.  ​
 +<code lua>​\grechangedim{\gremaximumspacewithoutdash}{0pt}</​code>​
 +
 +=====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
tweaking_your_chant_output.txt · Last modified: 2015/03/20 16:14 by bgm