Jean Abou Samra <j...@abou-samra.fr> writes: > Le 18/10/2021 à 21:22, R. Padraic Springuel a écrit : >> I’m using some functions to allow me to select words in the lyrics >> of some hymns in a systematic way so that the same hymn can be used >> referring to one or more persons (and in some cases, either a man or >> a woman). These functions work just fine when they appear in the >> lyrics by themselves, but when there is punctuation immediately >> after one of these functions, the punctuation gets shifted to its >> own syllable. Is there a way to have the function interact with >> punctuation more intelligently? I’m thinking I need to use \concat >> somehow, but how do I write the function so that it only does the >> concatenation when the next character is punctuation? >> >> Attached is an example showing one of my simple word selection >> functions followed by a comma. > > > It's slightly tricky. What you may want is a > function recognizing the comma as its argument, > but not taking any argument if the next input > element is not punctuation.
I'd lean towards defining \man like in the question and a function \maN that takes the following markup and concatenates it. That's viciously unclever but sometimes not having to worry whether the computer gets everything right is its own reward. -- David Kastrup