Empty first syllable in context of an initial capital; firstsyllableinitial

164 views
Skip to first unread message

Rob Leduc

unread,
Feb 5, 2021, 12:08:59 AM2/5/21
to Gregorio Users

Hi,

I'd like to be able to print the same score with and without an initial large capital letter in different locations by switching between \gresetinitiallines{1} and {0}, for example. To cut down on maintenance and typos, I'd hope to use the same .gabc file and just change capitalization with the firstsyllableinitial format, storing the score with a lower case second letter and using the formatting environment to capitalize it when \gresetinitiallines{1} happens.  This shouldn't work, because I am technically using a command rather than an environment, but because it is applied to just one letter, it seems to work (see MWE below). 

That is, it seems to work unless the initial syllable is only 1 character.  Then the rest of the first syllable is empty and none of these formats reach the second syllable, which nevertheless contains the first letter following the initial cap in this situation.

So this isn't really a bug - the formatting environments for the first syllable/word are working as defined in the documentation.  But it seems in this liminal case, it would be nice if these formats understood that they should be applied to the second syllable of the first word (although not a second word, probably) when the first syllable becomes empty after removing the initial cap.

Obviously pretty far down the list of things to worry about; it's so rare that I could maintain two separate scores for the few cases that this would come up.  Just thought I'd mention it, as some obvious care went in to handling the hyphen for an empty first syllable.

MWE:

% !TEX TS-program = lualatex
% !TEX encoding = UTF-8
\documentclass{article}
\usepackage{libertine}
\usepackage{gregoriotex}

\newcommand{\myscore}{\gabcsnippet{(c4) Re(g)de(hi)mit<sp>*</sp>(i)
e(ji)os(hg) Dó(hi)mi(h)nus(g) (,)
de(g) ma(h)nu(gf) tri(g)bu(gf)lán(e)tis.(e) (::)}
}

\begin{document}

%This shouldn't work, I guess, but it often does.  You could change \MakeUppercase to \bfseries and the 'problem' would persist.
\gresetinitiallines{1}
\grechangestyle{firstsyllableinitial}{\MakeUppercase}
\myscore
\vspace{2cm}

\gresetinitiallines{0}
\grechangestyle{firstsyllableinitial}{}
\myscore
\vspace{2cm}

\gresetinitiallines{1}
\grechangestyle{firstsyllableinitial}{\MakeUppercase}
\vspace{2cm}

\gabcsnippet{(c4) Æ(f)di(g)fi(h)cá(i)vit(ig) De(fg)us<sp>*</sp>(f) (,)
sanc(h)tí(i)fi(j)ci(i)um(h) su(i)um(h) in(gh~) ter(gf)ra.(f) (::)}

\end{document}

Fr. Samuel Springuel

unread,
Feb 5, 2021, 2:48:11 PM2/5/21
to gregori...@googlegroups.com
> On 5 Feb, 2021, at 12:08 AM, Rob Leduc <rled...@gmail.com> wrote:
>
> To cut down on maintenance and typos, I'd hope to use the same .gabc file and just change capitalization with the firstsyllableinitial format, storing the score with a lower case second letter and using the formatting environment to capitalize it when \gresetinitiallines{1} happens. This shouldn't work, because I am technically using a command rather than an environment, but because it is applied to just one letter, it seems to work (see MWE below).

See https://tex.stackexchange.com/a/249629 for a more robust way to handle this.

> That is, it seems to work unless the initial syllable is only 1 character. Then the rest of the first syllable is empty and none of these formats reach the second syllable, which nevertheless contains the first letter following the initial cap in this situation.

IIUC, you want firstsyllableinitial to apply to the first letter after the initial regardless of which syllable it occurs in (first or second).

✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

Rob Leduc

unread,
Feb 6, 2021, 3:43:49 AM2/6/21
to Gregorio Users
On Friday, February 5, 2021 at 1:48:11 PM UTC-6 Br. Samuel wrote:
> On 5 Feb, 2021, at 12:08 AM, Rob Leduc <rled...@gmail.com> wrote:
>
> To cut down on maintenance and typos, I'd hope to use the same .gabc file and just change capitalization with the firstsyllableinitial format, storing the score with a lower case second letter and using the formatting environment to capitalize it when \gresetinitiallines{1} happens. This shouldn't work, because I am technically using a command rather than an environment, but because it is applied to just one letter, it seems to work (see MWE below).

See https://tex.stackexchange.com/a/249629 for a more robust way to handle this.

Yes, thank you!  I will try it.  I have not previously had luck trying to get gregoriotex style elements to use an environment defined with the environ package, but it could be for reasons detailed in the post.

> That is, it seems to work unless the initial syllable is only 1 character. Then the rest of the first syllable is empty and none of these formats reach the second syllable, which nevertheless contains the first letter following the initial cap in this situation.

IIUC, you want firstsyllableinitial to apply to the first letter after the initial regardless of which syllable it occurs in (first or second).

Well, yes, I think so.  I've attached a picture of the source I'm trying to reproduce from Sandhofe's Nocturnale Romanum.  His typesetting conventions seem idiosyncratic at times, so maybe just because I want to try to copy something doesn't mean that is the best thing to do.

Aedificavit.jpeg
The first question is really one of typesetting conventions - am I an idiot for trying to replicate this in the first place? Maybe no one does this except this guy. Or is this an edge case that tests the definitions chosen for the software?

Assuming I'm not just an idiot (which is, I confess, a bold move):

The ligature is just a distraction, but the point is that there is a single "letter" first syllable, leaving an empty syllable for the first note.  His printed text then has a capital D.  Conversely, setting this in Gregoriotex, the style element firstsyllableinitial (or even firstsyllable, but that's tangential here) can't touch the di/Di because it is the second syllable, the first being empty (after removal of the initial cap).

The text displayed in the MWE in the previous post is then

Æ -di  

regardless of the format applied to firstsyllableinitial.   I have to hard code a capital D in the gabc file to get

Æ -Di

Why it matters is that I'd like to use the same gabc file to typeset the score twice, once with and once without an initial cap, then I need to switch between D and d somehow.  The author typesets things in the format of (antiphons with large cap, possibly varying with the season/feast/feria -  psalm text - repeat of the antiphons but in smaller size without initial cap).  This arrangement serves to set the various psalm sections off from one another as they come in threes in each Nocturn, as we all know. Psalm sections begin with the antiphons with the large initial cap that all belong to the next psalm, and then the final repeat after finishing the psalm is one of the antiphons set in smaller type; the next initial caps begin the next psalm and so forth.  So rather than keep two virtually identical files, differing in the case of one letter in one position, it would be nice to keep one file but use the software to make that shift.

Thanks for your patience.  You've been a lot of help already.  This is not something that could come up very often and maybe for these few cases, I should just keep a second gabc file.

Rob

Rob Leduc

unread,
Feb 18, 2021, 5:08:17 PM2/18/21
to Gregorio Users
As detailed above in this thread, my problem was trying to define an environment to apply as a style change to gregorio styles firstsyllableinitial or firstword or anything else, really.  Fr. Samuel helpfully provided a link (https://tex.stackexchange.com/a/249629) referencing a similar problem in which the solution was to define an environment using NewEnviron from the environ package which allows you to create an environment in which a command is applied to the body of the text supplied to the environment.

Unfortunately, I've had no luck getting this to work.  I can define the environments and they work in the body of the program, but I get errors complaining of an extra } when I try to use \grechangestyle to apply them to the gregorio environments in question. 

This is obviously because I don't know enough about expansion/protection/macro arguments/scope etc.  But if someone could show me where I'm off, I'd appreciate it.  The goal is to use \MakeUppercase to make the first word upper case.  See MWE.  I enclose 4 attempts AAA, BBB, CCC, DDD,  of which exactly one should be uncommented to run.  Only the most naive works, and won't suit my purposes since \MakeUppercase is fussier in ways I understand only a little bit.

The example uses etools robustify to help, but it doesn't seem to work in my case, or I can't figure it out.

I sincerely appreciate any help or pointers.

Rob

MWE

% !TEX TS-program = lualatex
% !TEX encoding = UTF-8

\documentclass{book}
\usepackage[autocompile]{gregoriotex}
\usepackage{environ}
\usepackage{etoolbox}

% Make the body of the environment upper case.
\NewEnviron{fword}{%
\MakeUppercase{\BODY}}

%Make the body of the environment small caps
\NewEnviron{myword}{%
 \scshape \BODY}

%%% Choose one of AAA, BBB, CCCC, or DDDDD and comment out the others.
%%% The goal is to have something like AAA with \MakeUppercase work.

%%%
% AAA - what I'm trying to do.
%This does not work
\grechangestyle{firstword}{\begin{fword}}%
[\end{fword}]

%%%%%
%BBB
% Surprisingly this partially executes and is somewhat closer but obviously flawed.
%\grechangestyle{firstword}{\MakeUppercase}

%%%
%CCC
%This does not work so it's not just about \Makeuppercase
%\grechangestyle{firstword}{\begin{myword}}[\end{myword}]

%%%%%%%%%
%DDDD
%This will work even though CCC fails.
%\grechangestyle{firstword}{\scshape}

\begin{document}

\begin{fword}
Hello, World!
\end{fword}

\begin{myword}
Hello, World!
\end{myword}

\gabcsnippet{(c4)  De(g)re(g)lín(h>)quat<sp>*</sp>(g) ím(h)pi(g)us(f) vi(g)am(hj~) su(ji!jwkjk)am,(kj) (::)}


\end{document}


Reply all
Reply to author
Forward
0 new messages