0 votes
341 views

I want to break a section heading differently, so as not to split a phrase: 

Change       to     

I can achieve this by entering a tilde directly into the USFM GEN text: 'i~Sodom'. But I don't want to change the text of this project. For verse text this pattern works in changes.txt (LO screenshot so the non-breaking space appears grey):

But I can't get the non-breaking space into my section heading into PTXprint via changes.txt. I have tried all nine permutations below of NBSP marker and verse#. What am I missing?

Related question: How to enter a UTF code into changes.txt, as in my GEN 23:2 example?

PTXprint by (673 points) | 341 views

1 Answer

0 votes

Yes, there are several ways of doing what you are asking for. First decide whether you want to create a rule that KEEPS elements together (and could therefore be a more generic rule to apply everywhere), or one that forces words to SPLIT APART (tends to be very location specific).

In line 6 (currently commented out with a #) I have shown how you would keep 2 words together using the ~ tilde in order to force them onto the same line.

In your case the simplest rule would look like this:

at GEN 19:0 'i Sodom' > 'i~Sodom'

In line 8 I have shown a rule that encourages the line to break at a certain point using the // instead of a space. Again, this would look like this:

at GEN 19:0 'tou i' > 'tou//i'

Notice that because we're being so specific with the location GEN 19:0 (= the part of chapter 19 which comes BEFORE verse 1) we can use just part of the word (mamantou); and although I usually like the use of (capture) (groups) and "\1//\2" using numbered group replacements, it ends up as more work - hence the simple rule that I suggest above.

Interestingly, sometimes // won't split the line due to calculated penalties etc. and you might need to use a forced Line Separator instead, as seen on line 9. And even more curious is that the regular Line Feed (\u000A) didn't work at all - but I have no idea why. Perhaps someone else can explain that.

There is one other complication - if you are trying to use ~ tilde but it isn't working, have a look at the TeXpert Hacks to see if this setting is enabled (which should help):

by (3.2k points)
Many thanks, Mark. Very helpful!

My first question was whether the verse 0 reference was valid. You answered that one right away, and I've got it working in this instance now.

I had already tried // here and in a couple of other trials, but it hasn't worked in this PTXprint project, as you suggested. Perhaps because of 2-column format with long words?

Your comment about group replacements: I found my basic rule useful as a template for several specific paragraph endings, but I don't know the language well enough to simply replace '[space]i[space]' > '[space]i[nbsp]' everywhere. So the \1\u00A0\2 string has been a timesaver.
The issue with // is that it is a discretionary, not forced break. This is wonderful most of the time, it means that users can mark good places to break a heading if the code needs to break and it won't if there's space for the full line. It *does*, however, obey the 'maximum ragged space' for the paragraph style. If its not doing what you want it to do, then try increasing that.

U+000A is not obeyed, as it's explicitly defined as being indistinguishable from a space in USFM documentation. That way people don't get unexpected paragraphs in the middle of their text, before each verse, etc.

Related questions

0 votes
1 answer 124 views
The other section headings all appear in the text correctly, but the section heading for \c 1 is ... /view?usp=sharing> hopefully this link works. Thanks
anon095293 129 asked Mar 24, 2025
0 votes
3 answers 221 views
With an Arabic script project the existing 'A5 section head border.pdf' isn't deep enough to contain the text. I can ... the pdf behind the text or mark the pdf as transparent?
anon095293 129 asked Feb 6, 2025
0 votes
4 answers 555 views
Tildes (used in USFMs as non-breaking spaces) disappear when the view is changed in Preview view, as expected. ... . Am I missing some step that would make these disappear?
Alex W. 191 asked Jul 13, 2018
0 votes
2 answers 235 views
Given this line (from "Revised Common Lectionary [English]" at https://lingtran.net/Example-Modules): \p \bd Old ... between the colon and the book name? Thanks for any help!
Paul 642 asked Jun 14, 2024
0 votes
2 answers 215 views
We use the tilde for a non-breaking space in our project, but as of Tuesday, I can no longer enter a tilde in my ... . Does anyone have any ideas about how I might fix this issue?
KSW 106 asked Sep 20, 2024
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Just as a body, though one, has many parts, but all its many parts form one body, so it is with Christ.
1 Corinthians 12:12
3,048 questions
6,007 answers
5,672 comments
2,028 users