sillsdev / ptx2pdf

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

Verses being deleted when creating a diglot #810

Closed mnjames closed 1 year ago

mnjames commented 1 year ago

I'm trying to create a diglot with two RTL project, and one of the projects (the "main" one) is having most of it's verses removed.

I've sent in an archive to the Support email address (not placed here for security reasons).

davidg-sil commented 1 year ago

eek. This seems to be the 'alternate merging' getting totally confused. There are hardly any paragraphs in the RITD text, and I guess that's throwing it into a state of confusion. Options include:

  1. Turn off alternate merging
  2. Merge using the perl merge program (run once to generate the .tex file, merge with perl prog, use runtex.sh from the archive to run the .tex file)
  3. Wait for @mhosken to work out what's going wrong.
davidg-sil commented 1 year ago

Note that (2) isn't a perfect solution, because something in the TeX is getting confused because of there being an empty \mt in one of the files. Removing that seems to allow alignment to work. Example command line for (2) style merging is :

diglot_merge.pl -p -r  -o 01GENSSV-RL_Diglot_2-diglot.SFM 01GENRITD-diglot_prep.SFM 01GENSSV-RL_Diglot_2.SFM
mnjames commented 1 year ago

Thank you very much. Actually, just turning off alternate merging did exactly what I wanted it to. Because of the lack of paragraph markers, I don't expect the two texts to be much more aligned than at the chapter level.

Since PTXprint has a setting which makes my book print, I'm not sure if there's a bug or if the "solution" is just for me to change the setting. I'll leave it to you guys to decide if you need to fix the merging problem in the "alternate merging".

A couple of observations: I never turned "Alternate Merging" on, and so didn't realize it was an option. If there's a bug in the system, I'd say it's in have default settings that don't work (but maybe that's the correct default for most projects). Reading the tool tip for alternate merging, I would expected for it to be the correct merging system.

davidg-sil commented 1 year ago

As an update on this... Neither of the current merge strategies do a wonderful job on every piece of text. I've just introduced code for a third one that is polyglot-friendly (don't hold your breath) and seems to do a reasonable job. As part of fixing up that I've (accidentally!) fixed a bug were text in the first 'non-paragraph' after a \c 8 \nb .... type construction was getting deleted by one of the merge strategies. That bug fix will be in the next build.

Once @markpenny (possibly with assistance, I don't know how hard this magic is) has made the tick-box into a drop-down menu, or possibly an entire pop-up widget (we like options, don't we?) then the other merge strategy will be available.

davidg-sil commented 1 year ago

@mnjames in case you've missed it, there are now 5 merge options! Document: the old one that ptxprint used to use, gives priority to paragraphing, and verses may get out of sync. Chapter-verse: the old 'alternate strategy' Scored - align texts when there's a paragraph break at the same place. (should distinguish between pre-, post- and mid-verse paragraphs). Scored-chapter - align at each chapter, don't align based on paragraphing. (but it might align at headings, I can't remember) Scored-verse - align at each verse, ignoring paragraph structure. (Coming eventually: the ability to decide what it calls an alignment point.)

mnjames commented 1 year ago

Thank you for these additional options.

My immediate problem was solved earlier, when I turned off alternate merging. I would imagine that more work will eventually be done on merging, but that would probably be outside the scope of this issue. So this issue is resolved, at least from my standpoint.