Gregorio: how to get selective color?
  • chonakchonak
    Posts: 9,160
    This discussion was created from comments split from: Instant chant engraving with Gregorio.
  • When writing gabc code, is it possible to have special characters (such as the R/ or V/) appear in another color, such as red? I am able to get the color to change but instead of the special character appearing in red, the code for the special character appears in red before the rest of the text. Is there a fix for this? Thanks!
  • chonakchonak
    Posts: 9,160
    This gets me color for one syllable, but I'm having a problem with the V/ and R/ symbols.


    (c4)A(g)ve(g) <v>\definecolor{Black}{rgb}{0,0,0}\definecolor{Red}{rgb}{0.9,0.3,0.3}\color{Red}</v>Ma<v>\color{Black}</v>(g)ri(g)a(g)

    [Update: corrected notation]
    Thanked by 1William_Meininger
  • benstoxbenstox
    Posts: 23
    Are you doing this in the browser? I managed to get this code to work for red V/ and R/ symbols there:

    %%
    (c3) () <v>\definecolor{Black}{rgb}{0,0,0}\definecolor{Red}{rgb}{0.9,0.3,0.3}</v><v>\color{Red}</v><v>\Vbar</v>.<v>\color{Black}</v>() Di(h)gn<v>\'</v>{a}(h)re(h) me(h) lau(h)d<v>\'{a}</v>(h)re(h) te,(h) Vir(h)go(h) sac(h)r<v>\'{a}</v>(h)ta.(f.) (::Z) <v>\definecolor{Black}{rgb}{0,0,0}\definecolor{Red}{rgb}{0.9,0.3,0.3}</v><v>\color{Red}</v><v>\Rbar</v>.<v>\color{Black}</v>() () Da(h) mi(h)hi(h) vir(h)t<v>\'{u}</v>(h)tem(h) con(h)tra(h) hos(h)tes(h) tu(h)os.(f.) (::)

    It seems to me that the colours must be redefined each time you want them in the browser app, which is annoying. If you need to do a larger project it might be worth installing gregorio + Latex on your system, where it will be easier to define changes like this. You could define all V/s to be red for instance.
  • Thank you so much for your help! That works wonderfully! Another question: Is it possible to use an apostrophe in the text under the chant notation? Gregorio doesn't seem to recognize it when it is typed. For example, in a possessive such as "God's" or to shorten an English word such as "joyfully" to "joyf'ly"?
  • chonakchonak
    Posts: 9,160
    I just ran a test here, and an apostrophe worked fine. Check that the apostrophe in your GABC file is a typewriter-style (vertical) apostrophe ('), not a left- or right-leaning curly apostrophe, also called the "single quotation mark" (‘ ’). Some users have their computers set up to automatically change the typewriter apostrophe to the left/right style.
    Thanked by 1William_Meininger