0 votes
223 views
How do you make sure that all \q2 lines are always on the same page as the prior \q1 line?
PTXprint by (1.4k points) | 223 views

3 Answers

0 votes
Best answer

I actually know one way to do this, but I wanted to post it here so that I can find it next time I need it!

In the ptxprint-mods.tex file (check the box for that file on the Advanced tab and click Edit...) add this line:

\sethook{before}{q2}{\nobreak}
by (1.4k points)
0 votes
Of course if you want to take your question very precisely and only avoid breaking between q1 and q2 (and say allow a break between q2 and q2) then the problem gets a little more interesting:

\catcode`\@=11
\addtoparstylehooks{\xdef\lastmarker{\m@rker}}
\m@kedigitsletters
\def\@qone{q1}
\m@kedigitsother
\sethook{before}{q2}{\ifx\lastmarker\@qone\relax\nobreak\fi}

Here we grab the marker of the previous paragraph at the end of each paragraph, then before a q2 we  test that the last paragraph marker was a q1 and if so insert the nobreak. Notice that to compare the marker against q1, we store q1 as something to compare, but the 1 in q1 is a letter not a digit so we have to recategorise digits as letters while we do that def and then put them back. sethook is clever in that it does the recategorising for us without having to do that kind of thing.
by (656 points)
0 votes

I know there have been other answers, but Martin's is overkill when this exists...
 

\setbetweenhook{q1}{q2}{\nobreak}


by (1.1k points)
I assume if you used this that you would also want:

\setbetweenhook{q2}{q2}{\nobreak}

So that if you had multiple \q2's in a row, that they would also be kept together.

Related questions

0 votes
1 answer 24 views
Our poetry is all in sfm \q1 and most of the lines are short enough to be within the margin. However a few times when the ... when a \q1 line runs more than one line on the page.
debbodaneejo 118 asked Feb 4
+1 vote
1 answer 332 views
Some translation projects do not want to have periods at the end of their footnotes. Simply leaving them off will ... at the end of footnotes - Helps - Paratext Supporter Site
[Expert]
Jeff_Shrum
2.9k
asked Aug 30, 2022
0 votes
2 answers 69 views
In the reference settings in PTX, is there an option to mark the reference below the verse?
Shivaji 117 asked Mar 7, 2025
0 votes
2 answers 186 views
Greetings all, We are trying to get the poetry word "Selah" to be right aligned even though it is on the same ... the following... Is there something we are missing? Thanks, GY
gyip 109 asked Sep 4, 2024
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
3,037 questions
5,994 answers
5,661 comments
2,022 users