A team I’m helping would like the name of God to display as all caps (not small caps). What do I need to put in Changes.txt to get the contents of \nd…\nd* to display as all caps?
Hmm. if you want it to apply to all letters, not just a few given sequences, then that sounds more like a ‘translation’ problem than a regular expression substitution. I don’t think python’s regex module can do that, unless you had a whole load of
I guess you could use the TeX primitive
\uppercase, and the private-use-area characters U+FDEE and U_FDEF, which we make available as alternatives to
} respectively (as they are printable characters in USFM, not grouping characters). Hopefully ptxprint will at most moan about uppercase not being a recognised marker, but it might crash you use this in a diglot):
"(\\nd )([^\\]*)(\\nd\*)" > "\1 \\uppercase\uFDEE\2\uFDEF\3"
This of course depends on XeTeX’s idea of what’s upper-case for your characters, and it might need to be educated if you have any more interesting letters.
Ruth, are you saying that the scripture text is already marked up with something like
\nd Lord\nd* but you want it to show up as LORD? (not small caps)
Why not try a very simple change like this (substituting your language’s name for God) to see if it solves the problem:
"\\nd Lord\\nd\*" > "LORD"
Note that the double \\ is needed because \n is a special character and needs to be ‘escaped’ with an additional \.
mjpenny is of course correct, I assumed that you needed something more complex (e.g. due to affixation). If you are struggling with affixation, the team might want to think about whether it would look better with only the name portion of the word in all-caps. (Some romani translatoins have
RAIesqo [of the LORD], for example). That can be done with either
\nd Rai\nd*esqo and a changes.txt like mjpenny gives, Or there are also sub-matches.
I think the format is:
in "\\nd .*\\nd\*": "Lord" > "LORD"
(Meaning change Lord to LORD, when it’s in a chunk
For testing purposes, I’d be very tempted to enable coloured text and set a colour for text marked as \nd (see the styling tab), just in case something goes wrong. If you are doing this, then mjpenny’s example would also include the
\\nd bits in the right hand side of the arrow.