0 votes

Hello,

I’m trying to apply a page border in PTXprint, but without including the introduction pages.

When I enable the border in Tabs + Borders, it is applied to all pages, including the introduction. What I would like is:

  • the introduction pages without border

  • and the border to start only with the Scripture text (for example at Luke 1:1)

In an older version of PTXprint, I used the following code and it worked:

% start the border
\setcvhook{GEN1.1}{\def\PageBorder{"C:/Program Files/PTXprint/ptxprint/PDFassets/border-art/A5 page border.pdf"}\setbox\b@rder\box\voidb@x}

% stop the border
\setcvhook{GEN50}{\let\PageBorder\empty\setbox\b@rder\box\voidb@x}
\makeatother

But in recent versions:

  • this no longer works properly

  • or the border does not appear as expected

I have tried updating the code (using \XeTeXpdffile and different path formats), but without success.

My questions are:

  1. Has the behavior of \PageBorder changed in recent versions?

  2. Is there a recommended way to apply a border only starting from the Scripture text, without affecting the introduction?

  3. Should a different approach be used instead of \setcvhook for this?

Thank you very much for your help!

PTXprint by (125 points)

1 Answer

0 votes

I would have thought those old commands would work, but perhaps not.

However, I also think that they've created a new command to help make turning borders on and off easier (in particular, making "no border" more intuitive).

\sethook{page}{1}{\NewPageBorder{}}
\sethook{page}{2}{\NewPageBorder{"C:/test_border.pdf"}

So in your context I think it would be:

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

% stop the border
\setcvhook{GEN50}{\NewPageBorder{}}
by (1.9k points)

The old commands themselves should work, though it might be that a '\global' is missing, and the trigger on {GEN50} will never trigger, as that's not a valid trigger point. {GEN50.0} would be chapter number for ch. 50. 

But even with the correct hook-point and new commands, there's also a potential issue that you are setting global variables which take effect immediately when they are read, and actual page output might not have caught up yet.
This can result in some problems with such things taking effect 'too fast'.

E.g if you change the border to none at the end of the last verse on the last page of a book, then that will happen *before* that last page gets laid up, and so the last page will have no border.

For this reason \setbookhook{after}{GEN}{whatever} is recommended for anything that needs to happen between the end of one book and the start of the next.
 

Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
And let us consider how we may spur one another on toward love and good deeds, not giving up meeting together, as some are in the habit of doing, but encouraging one another—and all the more as you see the Day approaching.
Hebrews 10:24-25
3,036 questions
5,992 answers
5,659 comments
2,020 users