sillsdev / ptx2pdf

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

v2.5 failed to produce the PDF for project KEIPOA #965

Closed davidc86 closed 2 days ago

davidc86 commented 5 days ago

Hi, I'm helping out the Kei project and I copied our Selaru "CEK-OA-Pertanyaan" (Check UNS Qs) template over to the KEIPOA project and wanted to test it out for the team. But when I selected to printout Luke 1-2, I got this exception:

image

Any clues?

This same template worked fine for the Selaru UNS Qs project (SLUOA). So I'm a bit puzzled. And it means the Kei team can't move forward with this until we sort this out. Thanks

mhosken commented 5 days ago

I find the text:

\f + \f*

Worrying and very liable to blow up. Of course in theory it shouldn't but we can't forguess every way people can mess up their USFM.

davidc86 commented 5 days ago

Yes, we just deleted that spurious footnote and PTXprint behaves nicely again. Is it possible/recommended that PTXprint graciously handle empty footnotes? (Like ignore them?)

davidg-sil commented 5 days ago

It looks to me like the code is actually \f +\f* or \f +\f*Tabe If so... well,
USFM allows multi-character callers and the end of the caller is the obligatory space after the caller. Thus, to TeX's understanding of the rules of USFM, that's not an empty footnote, that's a footnote that uses a caller of +\f* (or +\f*Tabe) It then tries to send that "complicated caller text" into the code that puts it in a box, (as parameter #3, on line 6 of the error message), and unsurprisingly gets confused about what on earth is going on.

markpenny commented 5 days ago

We don't want to get into the habit of PTXprint covering up (or hiding) USFM markup issues - especially as they will eventually surface in other software like SAB and PubAssist; so it would be best for us to flag it in order that it can be fixed in the text. [But don't ask me how we go about doing so!]

davidc86 commented 4 days ago

Valid point about cleaning up bad USFM. But oddly, this was a well formed (but empty) footnote in Paratext and it showed up just fine in the display, with a superscript in the text and a spot in the footnote pane to add our footnote text. So it wasn't a "bad" footnote. It wasa an empty footnote. (Granted it wasn't supposed to be in this text of comprehension questions, but that's beside the point. It was a well-formed footnote placeholder, that someone had accidentally added to the text but never filled in.) Still, PTXprint probably shouldn't just HIDE this kind of weirdness, but maybe it shouldn't crash either. Maybe it should just ignore/not display empty footnotes, like it doesn't display the picture caption if the picture is missing for some reason. But it should fire off a "Warning. We found an empty footnote at Jhn. 3:16" -- or some such. But maybe that could be caught by Paratext's Basic Checks?

markpenny commented 2 days ago

This has now been added and will be in 2.5.2; but there is no option to control it, and no warning message to say that it found an empty footnote/xref and deleted it/them - it just drops them quietly. If people feel we need to add something to toggle this behavior, we could, but it doesn't seem like a priority at this point in time.

davidc86 commented 2 days ago

Cool! That will help field teams who don't yet have a handle on the details of correct USFM. I'm closing this now.