+2 votes
384 views

I’d like to have a horizontal rule (line) at the end of the introduction.
Adding this to changes.txt adds a rule before chapter 1 in each book:
'(\\c 1 ?\r?\n)' > '\\zrule |width=".6"\\*\r\n\1 '

Alas, I’m publishing a collection of OT portions in which chapter 1 is frequently omitted. So, I’ve written a series of rules like this to changes.txt, one for each book:

at NUM 0 '(\\c )'	>	'\\zrule |width=".6"\\*\r\n\1 '
at JDG 0 '(\\c )'	>	'\\zrule |width=".6"\\*\r\n\1 '
at 2SA 0 '(\\c )'	>	'\\zrule |width=".6"\\*\r\n\1 '

This adds a rule before the first \c to occur in “chapter 0”. Is there a way to write a rule which would do this in all books, so I don’t need to specify the book names and I could replace my \c 1 rule above?

Wouldn’t this be a nice feature to add to the PTXprint UI?

PTXprint by (607 points) | 384 views

7 Answers

0 votes

I can’t think of something that would catch all the “other first chapters” of each book. I wonder if the TeX guys could use some kind of a (only-used-once) hook to achieve the same thing.

But one shorthand for your rule is to put multiple refs on the same line:

at NUM 0 JDG 0 2SA 0 '(\\c )' > '\\zrule |width=".6"\\*\r\n\1 '

by (3.2k points)
0 votes

I think I’m missing something. Are you asking for something to fire on the first transition from introductory material to chapter? Or for any such transition?

Some kind of \sethook{first}{c}{code} (i.e. code that fires when the implicit \c 0 at the start of a book ends?)

by (1.1k points)
0 votes

Yes, almost… We need to insert a \zrule just before the first \c of a book (regardless if it is chapter 1 or chapter 99).

by (3.2k points)
+1 vote

Seems to work (current github):

\sethook{first}{c}{\zrule|width="0.6" \*}

Mechanism:
\id sets the chapter number to 0 (zero). When \c is reached then if the chapter number is zero, the above hook code is executed, just before the new chapter number gets set.

by (1.1k points)
+1 vote

Thanks Mark, you saying “before the first \c of a book” gave me an idea of how to do this in RegEx. This changes.txt rule seems to work for all books:

'(?s)(\\id .+?)(?=\\c)' > '\1\\zrule |width=".6"\\*\r\n '

  • (?s) causes . to match line breaks too
  • (\id .+?) finds \id followed by any other stream of characters.
  • (?=\c) is a positive lookahead which finds \c
    So, this expression captures into group \1 everything from \id up to the last character before the first occurrence of \c.

The right side of the rule “replaces” everything before \c with what was there (\1) followed by a rule and a new line.

by (607 points)
+1 vote

Nice work @EricP! Just to make it clear for anyone else following this thread, the RegEx rule above would go into the changes.txt file. (BTW, is there a stray space after the final \n and if so, you might want to take it away. Or perhaps I’m missing something about why it is needed.)

But if you want to use the \sethook method instead, then that would go into the ptxprint-mods.tex file instead.

by (3.2k points)
0 votes

Is there a way to add a rule using the \ie marker?

by (153 points)

If you already have \ie markers in the text then adding this to changes.txt will print a rule (line) right after \ie.
'(\\ie)' > '\1\\zrule |width=".57"\\*'

Related questions

0 votes
1 answer 196 views
I have a case where I am getting a page break after the introduction, but it seems like there is plenty of room to ... to start the chapter?! 2.5 paragraphs? Is that adjustable?
jeffh 1.4k asked Mar 25, 2022
0 votes
2 answers 470 views
Is it possible to add an introduction/foreword section to the NT (that's in addition to the introduction for each book)? When I ... any sort of a workaround? I'm using 9.2.102.17.
skim1124 219 asked Aug 2, 2022
0 votes
4 answers 612 views
As we come to publish the NT, I'm a little surprised that the list of possible books in PT does not include: ... ) Is there a best practice for where to place these introductions?
wdavidhj 1.4k asked Nov 25, 2019
0 votes
3 answers 285 views
Hello, Anytime I use the \ip Introduction - Paragraph marker in Paratext, the words turns grey. I would be grateful if you can help me correct it. Thank you. anon878803
anon878803 132 asked Nov 8, 2019
0 votes
2 answers 70 views
Hello everyone, I hope you are doing well. I am working on the layout of a book and have added a decoration at the ... . Thank you in advance for your help! Thanks for your help
Roger Beramgoto Nado 125 asked Nov 7, 2024
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Accept the one whose faith is weak, without quarreling over disputable matters.
Romans 14:1
3,045 questions
6,005 answers
5,671 comments
2,026 users