0 votes

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?

PTXprint by (138 points)

2 Answers

0 votes

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 "a">"A" entries.
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 { and } 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.

by (699 points)
0 votes

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 \.

by (2.6k points)
reshown

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 \nd ....\nd*)

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.

Related questions

0 votes
6 answers
0 votes
2 answers
PTXprint Feb 28, 2023 asked by mnjames (1.8k points)
0 votes
6 answers
PTXprint Feb 20, 2021 asked by anon054969 (123 points)
0 votes
2 answers
Paratext Oct 15, 2019 asked by binoy (327 points)
0 votes
3 answers
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
For just as each of us has one body with many members, and these members do not all have the same function, so in Christ we, though many, form one body, and each member belongs to all the others.
Romans 12:4-5
2,610 questions
5,346 answers
5,036 comments
1,420 users