lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Markup functions and punctuation in lyrics


From: Jean Abou Samra
Subject: Re: Markup functions and punctuation in lyrics
Date: Wed, 3 Nov 2021 11:19:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2



Le 03/11/2021 à 04:26, Aaron Hill a écrit :
Okay, would text replacement be viable as opposed to writing a bunch of individual functions?

%%%%
feminine =
#'(("man/woman" . "woman")
   ("his/her" . "her")
   ("he/she" . "she"))

\markup \replace \feminine {
  The man/woman, tightly clutching his/her jacket, braved the
  bitter cold as he/she searched for his/her missing dog.
}
%%%%

Note that you can install such text replacements at the global level to affect all markup without needing the explicit call to \replace:

%%%%
neutral =
#'(("man/woman" . "person")
   ("his/her" . "their")
   ("he/she" . "they"))

\paper { #(add-text-replacements! neutral) }

\markup {
  The man/woman, tightly clutching his/her jacket, braved the
  bitter cold as he/she searched for his/her missing dog.
}
%%%%


The original spec was putting "man/men" in italic — but typographically, the comma should stay upright. If one can give up on that, text replacements are certainly the simplest solution. (I guess you could also write a function to do the replacements yourself.)

Perhaps we should take this thread as a feature request for replacing strings with arbitrary markups rather than just strings?

Best,
Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]