0 votes
276 views

How can I prevent page/column breaks between the glossary keyword and its defnition?

My glossary looks like this:

\p \k angel\k*
\p A winged flying creature

I use changes.txt to change “\p \k” to “\m \k”. How do I keep the \m and the \p paragraph together? Something is keeping \s section headings with their following paragraph. Should I change my glossary keywords to \s?

PTXprint by (607 points) | 276 views

3 Answers

0 votes

Eric,

This is untested, but I think something along these lines should work.

In your ptxprint-mods.tex file, add
\sethook{after}{k}{\penalty10000}

by (1.9k points)
0 votes

Thanks!
\sethook{after}{m}{\penalty10000}
does work, now how do I restrict it so that it only applies in GLO?

by (607 points)

Once again, untested, but I think this works:
\sethook{after}{id:GLO|m}{\penalty10000}

One of the things I couldn’t remember was whether \penalty10000 applied to the beginning of the line it occurs on, or the end. I thought it occurred at the end, which is why I set the hook on {k}–because that would tell \k to stick to whatever comes below it. But maybe you tested that and it didn’t work.

{k} didn’t do anything, but {m} worked. Adding id:GLO doesn’t appear to change anything, so I guess it works. Probably the best practice would be to use a marker unique to the glossary instead of using \m.

0 votes

By adding the id:GLO| you are already specifying ‘only in the GLO book’, so there’s no benefit to using another marker, unless you want to format it differently.
Even if you want to format \m differently in GLO, you can still leave the USFM unchanged, and format the marker id:GLO|m The only reason I’d use a special marker would be if it’s not a \m ‘at heart’.

FWIW, \penalty applies at exactly the place it’s met, whether that’s in horizontal (breaking a line of text into paragraphs) or vertical (breaking paragraphs into pages).
Since at the end of the \k it’s in horizontal mode, inserting it after the \k says ‘don’t start a new paragraph here’. TeX then meets the \p or \m which includes in its definition “If we are in horizontal mode, fill the paragraph with whatever has been specified and \penalty -10000, and so it breaks there instead (even if there were no end-of-par fill, penalties are not cumulative, so it would obediently not break at the 10000 and obediently break at the -10000).

FWIW2, Don’t get tempted to try to make a hook to try to insert a paragraph break after a character style. I tried it several ways, and concluded that it just gets the code really really confused if you ask it to set up a new paragraph while it’s processing the end of a character style.

by (1.1k points)

Related questions

0 votes
1 answer 12 views
I have read through "Glossary Best Practices" (https://support.bible/3952/glossary-best-practices?show=3952#q3952). The information ... 'off', I'd sure appreciate it! Thanks, Paul
Paul 639 asked Oct 21, 2025
0 votes
0 answers 160 views
Click in the window of your project, to make it the active window. From the Tools menu, select Biblical Terms . Find and ... t/how-do-i-filter-terms-in-the-biblical-terms-tool/230)
[Expert]
anon421222
735
asked Feb 23, 2017
0 votes
1 answer 21 views
We're using /xt in footnote cross-references, set to use 'short name' of book. But in the glossary I'd like to use ... name, is there a different USFM code I could use for that?.
Lenice 180 asked Oct 7, 2025
0 votes
1 answer 271 views
I am an administrator in this project. Another administrator has made changes in GLO and other books and done send/ ... Project History but have not updated in the GLO book.
anon399461 123 asked Mar 13, 2024
+1 vote
1 answer 302 views
When you enter a glossary entries through either the Biblical terms tool or the Biblical terms renderings window, ... following video also describes this procedure in more detail:
[Expert]
Jeff_Shrum
2.9k
asked Mar 23, 2021
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Don’t you know that you yourselves are God’s temple and that God’s Spirit dwells in your midst?
1 Corinthians 3:16
3,037 questions
5,994 answers
5,661 comments
2,022 users