0 votes
317 views
I would like page borders around Scripture text, but not around introductions. I've used some work-arounds in the past, including (if I'm publishing a single book) just typesetting the introduction along with the title pages and create a PDF that gets loaded before the text. I've also done some tricky (ugly) things in the past with TeX macros that swap out different page borders behind the scenes. It should be clear that in this case the introductions need to be on pages by themselves, but there is a checkbox that can help on the Body page, "Start 1st Chapter on a New Page".

Is there a currently "recommended" method for doing this? I would think this would be an important functionality to implement, as certain major religions require borders around "Holy" text, but not around human-produced text (like Introductions).
PTXprint by (1.4k points) | 317 views

4 Answers

0 votes

I have now found this post: https://support.bible/11876/multiple-borders, which has useful information.

But it would be helpful to have some specific examples of how \sethook commands are used. I'll start us off with one simple one that I created. I leave the page border configuration UNchecked (because I want to start without a border), I've checked the option Start 1st Chapter on a New Page (which separates the intro from the text), and I put the following into the ptxprint-mods.tex file, which turns on the border when GEN 1.1 starts, and (just to show that it is possible) turns the border off again on the page that contains GEN 5.1

\makeatletter
\setcvhook{GEN1.1}{\def\PageBorder{"C:/Program Files/PTXprint/ptxprint/PDFassets/border-art/A5 page border - no footer.pdf"}\setbox\b@rder\box\voidb@x}
\setcvhook{GEN5.1}{\let\PageBorder\empty\setbox\b@rder\box\voidb@x}
\makeatother

Can other people post some working examples from their projects, from their ptxprint-mods.tex file, so we can learn what hooks are useful for this kind of task?

by (1.4k points)
edited by
0 votes
\makeatletter
\sethook{bookstart}{FRT}{\def\PageBorder{"front.pdf"}\setbox\b@rder\box\voidb@x}
\sethook{before}{is2}{\global\let\PageBorder\empty\global\setbox\b@rder\box\voidb@x}
\sethook{bookstart}{XXA}{\def\PageBorder{"background.pdf"}\setbox\b@rder\box\voidb@x}
\makeatother

I have Front Matter defined inside of PTXprint, and I want the first page of that (the title page) to have the "front.pdf" border around it.
The second page of the Front Matter starts with \is2. I want no border around that and following pages.
When the Front Matter is done and I get into the main text, XXA, I want a new border "background.pdf".

Both my pdfs are stored in the project\local\ptxprint\config_name directory. This allows me to use the pdfs without having to define the full directory structure.

by (1.9k points)
edited by
0 votes

The current recommended way to change page borders is to use a hook (page or chapter.verse) and the \NewPageBorder{} TeX command.  If set to empty, then there will be no page border.

E.g.
\setcvhook{GEN1.1}{\NewPageBorder{../../../figures/scripturepageborder.pdf}}

\sethook{page}{24}{\NewPageBorder{}}

\setbookhook{start}{GLO}{\NewPageBorder{}}

I'm suggesting that (rather than in local, where they might be lost), page borders should exist in the figures directory, where they are shared by send/receive. This probably depends on your team. As far as I know, TeX on windows doesn't mind separating directories with forward slashes, even if they "look wrong".

 Be aware that the definition of \PageBorder (which \NewPageBorder changes) is checked when the page is complete, just before it is written to the PDF, not when the first material on the page is added. I.e. turning off page borders when you reach Rev 22:21 will mean that there is no border on the page containing that verse.

Also note that I am writing here about fixed page borders, which are not to be confused with text-borders (which use ornament-including rules to put a variable-sized border around the scripture-text portions of a page, but not around footnotes).

by (1.1k points)
0 votes

I wanted to start the borders at the beginning of GEN text (but after the introduction), turn off the border for the PSA intro, and then turn it back on for the PSA chapters (which start with chapter 5). This code worked:


% start the border
\setcvhook{GEN1.3}{\NewPageBorder{"c:/Program Files/PTXprint/ptxprint/PDFassets/border-art/A5 page border - no footer.pdf"}}

% stop the border
\setbookhook{start}{PSA}{\NewPageBorder{}}

% start the border
\setcvhook{PSA5.3}{\NewPageBorder{"c:/Program Files/PTXprint/ptxprint/PDFassets/border-art/A5 page border - no footer.pdf"}}

But if I use the references GEN1.1 and PSA5.1, then the border appears around the introduction pages as well. I have to move a few verses forward (GEN1.3 and PSA5.3) for it to work correctly. Is that a bug?

by (1.4k points)
It's not so much a bug as a consequence of how TeX builds pages. For example, take a paragraph that crosses the page-boundary; TeX will read the entire paragraph, and then decide how to split it into lines, and then split those lines across pages.  Even if there's a paragraph end, at the page-end, then TeX will probably read a little more than fits on the page.

\NewPageBorder, however, gets acted on as soon as it is read, so if you're in the it-got-read-beforehand portion of the new page, then it will have done its stuff before the pagebreak.

Related questions

0 votes
1 answer 16 views
Hello, I'm trying to apply a page border in PTXprint, but without including the introduction pages. When I enable the ... \setcvhook for this? Thank you very much for your help!
Roger Beramgoto Nado 125 asked Mar 25
0 votes
1 answer 67 views
Hi I'm working on a layout and I wanted to limit my page borders to chapter 24, verse 10, as shown in the screenshot. ... for the rule I used. Thank you in advance for your help.
Roger Beramgoto Nado 125 asked Dec 13, 2024
0 votes
2 answers 228 views
After updating PTXprint it is now putting a text border around all the Scripture text. How do I get rid of that? It is ... . This is different from the border we put on the page.
debbodaneejo 118 asked Aug 23, 2023
0 votes
5 answers 467 views
I'm trying to use hooks to set multiple borders in a doc. I can set the first one, and I can turn ... \PageBorder{path_to_border_2}} What am I doing wrong? Is that possible?
mnjames 1.9k asked Jan 2, 2023
0 votes
1 answer 147 views
(I seem to remember discussion about this but can't find it now ) On a PDF that I'm producing with PTXprint, I would ... not to put the border around the pages on the GLO book?
jeffh 1.4k asked May 10, 2021
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
If anyone destroys God’s temple, God will destroy that person; for God’s temple is sacred, and you together are that temple.
1 Corinthians 3:17
3,038 questions
5,994 answers
5,661 comments
2,022 users