gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
162 stars 43 forks source link

bold accented syllables #1498

Closed loic-rotsac closed 3 years ago

loic-rotsac commented 4 years ago

Hello, I'm French, and i don't speek English very well... I am making a book whith all the propers for the Schola where i sing. The choirmaster would like to have the accented syllable in bold. Is it possible automatically in the tex code ? (not in the gabc file...)

Thank you !

rpspringuel commented 4 years ago

There is no completely automatic solution as TeX has no way of identifying which syllables are supposed to be accented (it’s knowledge of languages is limited to hyphenation patterns). At the bare minimum you would have to have the accents themselves in the gabc, and even then I’m not sure it’s possible.

Spitballing a little: it would be relatively easy to make the accented vowel bold. If you’re using the command versions of accents, e.g. \'e, then you can redefine the command as follows:

\let\grave\'
\def\'#1{\textbf{\grave#1}}

If your using unicode characters where the accent is part of the character, e.g. é, then you can make the character active and then define a macro which automatically makes the character bold:

\def\accentede{é}
\catcode`\é=\active
\def é{\textbf{\accentede}}

Both of these methods would require similar definitions for all possible accented characters and would only affect the accented character itself, not the whole syllable in which it appears.

I don't know if its possible to expand these ideas into bolding a whole syllable. There maybe some trickery that relies on how GregorioTeX processes syllables (i.e., it would only work within a score, not in any text that surrounds it) which would make it possible, but I'd have to dig into that code before I can make a definite assessment.