sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
21 stars 7 forks source link

Detect rare situation where the footnote caller gets pushed to next/final page #922

Open markpenny opened 8 months ago

markpenny commented 8 months ago

A PDF we were discussing had an interesting end-of-book situation where the footnote caller got pushed to the final page of the book, while the footnote stayed on the previous pg. Given that this is unacceptable, I feel that we should at least alert the user to the fact that this has happened so that they can take measures to solve the chicken-and-egg problem some other way, for example by shrinking previous pages to make it all work as it needs to.

Along the same lines, it might be possible/appropriate to warn the user of pages that have large amounts of unintentional white-space on them.

davidg-sil commented 8 months ago

An archive is probably necessary so that we can identify how this happened. It certainly shouldn't! Possibly it was something to do with it being the final page. A potential solution:

Thoughts/problems with this:

davidg-sil commented 8 months ago

The unique ID could become some kind of PDF anchor, giving clickable send/return feature. Is that a good thing?

markpenny commented 8 months ago

All good questions! Yes, I am almost certain that this was as a result of being the last page of a long book, and something different happening there compared to the rest of the publication. The PDF is still in the Archive dropbox if it helps: "Laarim NT+ LOH 4810 Body_LowRes.pdf", pg 1041 is the page in question, footnote i at PHP 4:22.

If TeX generated the file with the data, it would be relatively straightforward for Python to parse and analyze it. That's probably a much neater solution that trying to implement it in TeX.

davidg-sil commented 8 months ago

The TeX side of things is now partly functional - It cannot work with old-style paragraphed notes without destroying the output. New-style paragraphed notes are OK. Python or TeX code to check that the results are sensible is the next step.