sillsdev / ptx2pdf

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

Diglots include footnotes even when footnotes are disabled #928

Open klassenjm opened 8 months ago

klassenjm commented 8 months ago

Working with PTXprint 2.4.2

A diglot layout includes footnotes even when footnotes are disabled in the configurations for both primary and secondary projects.

An archive of a test project has been submitted (GNTPTXP-DiglotTestPTXprintArchive.zip)

davidg-sil commented 8 months ago

There are 2 immediate fixes available: Option A: Go to the style editor and mark the style for \f as Hide/exclude contents of marker on both projects.

Option B: add this to ptxprint-mods.tex (and enable it):

\makeatletter
\should@xist{fR}
\should@xist{fL}
\makeatother

Explanation: Clicking on the UI button to deselect footnotes does not currently alter anything set for stylesheet, instead it does 90% of what flagging the style as unpublishable does - it puts 'unpublishable' into the variable where that data is stored. The extra 10% (option B) is telling the code that someone has specified specific any styling for \f on the L and R side, which is a piece of optimization code.

By making the change in the style editor, you are ensuring that the modification to the stylesheet gets written, and thus the change is 100% registered. Equally, had you made some other change for the footnote, e.g. to the font, size, colour, etc, then the code would know that there was some styling for the relevant footnote, and the control would function as expected.

davidg-sil commented 8 months ago

@markpenny, @mhosken. Currently, there are 2 ways to turn off footntes/xrefs (neither overriding the other, but it acting as a logical AND - notes needing to be turned on both in they stylesheet and the 'include footnotes'. I predict confusion, and some kind of link would be very good. Is there a way that the 2 controls could 'simply' reflect the same underlying variable and thus there be no need for the extra code in the template?

Edit: I've hacked snippet.py to work around this. I am a bit confused why there are 2 different snippets with the same(?) net result. Are they applied in different circumstances, or is it just an editing glitch?