0 votes

Is there a way to put a box/frame lines around certain parts of the text? As in have a few paragraphs of regular text, then a couple of paragraphs within the box?

I realize this won’t be built into ptxprint, but I’m willing to edit the ptxprint-mods.tex file.

PTXprint by (1.8k points)

3 Answers

0 votes

As in scripture text?

You can probably use the style start- and end-hooks, or there are chapter-verse hooks too, depending on what you want to do. You’d have the start hook say something like {\setbox1=\vbox\bgroup}, the end-hook say {\egroup ....}
with the … putting a box around your text. The text in the box wouldn’t be able to break across a page or column break.

With sufficient set-up along the lines of \let\b@drleft\tr@e \let\b@drright\tr@e ...
you could call the \mkb@rdr macro that is in the ptx-extended.tex file.

If you’re talking about non-scriprure text, (e.g. then framed \esb side bars are supported in the macros, though they’ve not been very well tested).

by (294 points)

Thank you for this.

Some background on what I’m doing: This is for a pamphlet which is basically a Bible study. A series of Bible passages interspersed with questions/answers. I’d like the Q/A visually distinct from the scripture, hence the desire for boxes.

I did this years ago in Latex, but I suspect it would take me longer to get that Latex system back up and running correctly than it would to convert things over to a Bible Module/ptx2pdf system. Plus a ptx2pdf system would allow me to bring the most recent changes to the Paratext drafts into the document.

Knowing that, is using \esb sidebars the best way to go? I found the documentation at https://github.com/sillsdev/ptx2pdf/blob/master/docs/dev/SideBars.md but it doesn’t have any examples on how the \esb marker is actually used or the syntax for its usage. I’m at a technical level where I can usually look at examples and convert them to my own use, but I can’t read code and figure out what the syntax should be.

Would you be able to give me some examples of how I might type things to get them to show up?

0 votes

Well, my intention is that sidebars will do exactly what you want, eventually - be the equivalent of a hand-crafted tex/latex document for a study booklet, I’m not sure it’s there yet for what you want but it might be.

As a first example for usage, you might like to take a look at this directory, which contains a miniature ‘is it all working properly’ file:

The result of running it looks roughly like this:

by (294 points)
0 votes

Oops, sorry, I hit reply too soon.

Styling of stuff in a side bar uses the \cat ... \cat* USFM marker to pick a category (see also Categories.md) and a stylesheet-like file to define what that category of sidebar looks like, see mycats.sty in the above directory.
If you load it with this command, below, rather than \stylesheet then it takes care of some house-keeping for you.

\categorysheet{mycats.sty}

Alternatively, make sure your stylesheet ends with \EndCategory
I don’t think the GUI has much support for editing category sheets by hand, but notice that you can - within a category - redefine how a (any!) marker behaves - thus the \p markers in the pink-background boxes are centred, but normal \p markers are not.

Background images and the \FgImage ‘category marker’ mentioned in the sidebars.md document you found are not yet implemented, but borders and background colour are. So far turning on \Breakable has been an unmitigated disaster… I think I understand why the disaster happens, just not how to resolve it.

by (294 points)

To add to David’s excellent examples, you can also use a Paratext Module. that would allow you to write your questions and then pull in passages from your project rather than having to intersperse questions in scripture. This keeps things cleaner. And you may also decide to put your scripture in the sidebars and the questions as the main text. But that’s your call and design.

I am trying to do something similar to mnjames with the introductions to each book of our NT. I would like the introduction to be in a box with a gray background. Each introduction is about two pages A5 long. As best as I can tell, presently,  as was the case in 2021 when this thread was active, it does not seem that a box created by \esb can break across a page boundary. So I am wondering whether anything has changed and I am missing something, or whether there is a workaround.

Related questions

0 votes
2 answers
0 votes
1 answer
PTXprint May 10, 2021 asked by jeffh (1.3k points)
0 votes
2 answers
0 votes
1 answer
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Finally, all of you, be like-minded, be sympathetic, love one another, be compassionate and humble.
1 Peter 3:8
2,627 questions
5,369 answers
5,043 comments
1,420 users