Problems with 2 column layout

We are having some problems with 2 column layout. In one place, the chapter number is overlaid on top of the text (2 Chr 5:1).
2 Chr 2 col overlay

In several other places, the text extends beyond the margins.

When I use 1 column layout, the problems do not occur. How can we get 2 column layout working correctly? Are there some other options that need to be set? Or is there a programming error that needs to be corrected?

I was able to code a temporary bypass for the 2 column layout problems like this in PrintDraftChanges.txt

Nice work in getting the wrapping working after using some context-specific change rules!

Are you still getting the issue with the bad chapter number cutout? If so, please send an archive of the job so we can replicate and fix it. I was unable to get the same behaviour when testing on one of my own projects. It would also help to see more of the context. Is this happening at the end of a page (where the book has been appended to the previous book)?

The chapter number cutout problem is still there, but I can bypass it with one of the change I made above (line 49). It is easily reproducible just by printing 2 Chr by itself. I created the archive file for it. I’ll send it to the support email with the subject of this post. If you also need an archive file to reproduce the text overflow problem, I can easily do that as well.

Another 2 column layout problem that we just discovered. Most of the pages get filled up correctly to the bottom of the page. However, several of the pages have lots of blank space at the bottom. Here is one example:


When I print chapter 7 alone, it does not have the blank space. When I print chapters 6 and 7 alone, it has a smaller amount of blanks space. However, when I print chapters 5 to 7, it does have the large amount of blank space.

Is there a setting that controls this or is this another problem that needs to be investigated?

The most common reason for large gaps at the end of a page is due to the macros being unable to BALANCE the columns. Usually stretching the length of a paragraph on that page (or to a paragraph that should be on that page) by just one line solves the problem. Sometimes, depending on the text within a paragraph, you can REDUCE the length by one line makes it fit.

Either of these can be achieved by using an Adjust List - accessible on the View+Edit tab/page. Use the Generate… button to create a list of paragraphs, and then change the +0 to a +1 to grow or or -1 to shrink a paragraph. It isn’t always possible for a paragraph to grow or shrink, so this takes some time and effort.

If balanced columns are not important at all, and you just want the text to use all the available space on the page, then you could add these two lines to your ptxprint-premods.tex file (accessible from the Advanced tab) and it will ignore column balancing.

\clubpenalty=0
\widowpenalty=0

And you could always examine the “unbalanced” output afterwards and then stretch or shrink columns to manually balance the pages.

I tried adding the 2 lines to the ptxprint-premods.tex file and I got an error:
PTXprint Version 1.9.2
Please send to: ptxprint_support@sil.org

PTXprint [1.9.2] - Error!

Failed to create: ptxprint-Piaroa-REVPBT.pdf

The log file shows: ! Undefined control sequence.

Oops! Something unexpected happened causing this error.

Just enabling the Apply Initial Settings (ptxprint-premods.tex) causes the above failure, even after I restored it to just the 2 default comment lines.

We don’t need column balancing, so if we can figure out how to get the column balancing turned off, that may solve the problem with the extra space at the bottom of many pages.

Through some trial and error, I found out that the 2 lines above have to go in ptxprint-mods.tex (not in ptxprint-premods.tex). When I used both clubpenalty and windowpenalty, there was some stuff at the bottom of the page that should have started on a new page. When I used windowpenalty alone, it looks like it works better.

Regarding the overhanging words… I wonder if you have ‘prevent orphan words’ turned on. That seems like the most likely cause of that. ‘Prevent orphan words’ basically makes any last two words in the text have to appear on the same line, so if they’re long to fit and there’s no hyphenation rules, then you’re getting exactly what you’ve asked for.

Oops. I didn’t hit ‘reply’ on this:
Regarding the chapter number not sitting properly, I wonder if re-running the job will fix that. Sometimes working out the right place for a drop-cap needs more re-runs than ptxprint is happy to give it. TeX does notice that it’s needed, and gives a ''Re-run…" notice in the output.

Thanks for the suggestion to check ‘prevent orphan words’. That helped with the overhanging words. The option was set on by default and since I didn’t know what it meant, I just left it as it was. Now I have it turned off and no more overhanging words.

For the chapter number not sitting properly, it happens consistently everytime I run it (without the first mod I made in PrintDraftChanges.txt. I never did see a ‘Re-run’ notice on the panel.

This is a wide ranging post!

On the subtopic of balancing columns. You can try adding some fuzz to the column balancer if you are happy with unbalanced columns (in ptxprint-mods.tex):

\def\BalanceThreshold{1}  % number of lines of unbalance

This is a little tested area, so thank you for being a beta tester :slight_smile:

The next released version will have this as an additional setting on the Layout tab: