ubsicap / usfm

Unified Standard Format Markers
39 stars 18 forks source link

usfm_sb.sty - ip should not be valid in the middle of a chapter of Scripture #136

Closed tjcouch-sil closed 2 years ago

tjcouch-sil commented 2 years ago

Relevant Concepts

Problems

Problems Visualized

You can add p and q under c:

But the OccursUnder differences showed above indicate that, in usfm_sb.sty, you can add one or more ps under an ip under a c. Since you can add p under ip, p checks to make sure its rank is equal to or lower than the first marker under ip which is either nothing or another p. Since p's Rank 4 is equal to p's Rank 4, you can add another p under ip after a p here:

However, in usfm_sb.sty, you cannot add a q under an ip like you can add a p under an ip. Since you cannot add q under ip, q tries to add itself under c. q checks to make sure its rank is equal to or lower than the first marker under c which is ip. Since ip's Rank 6 is greater than q's Rank 4, you cannot add a q under c here. This document is invalid:

In the following screenshot from Paratext, on the left is a base Scripture text using usfm.sty, and on the right is a test Scripture Study Bible using usfm_sb.sty containing an added ip within a chapter. Adding ip within the chapter is valid with current usfm_sb.sty rules. However, it caused the subsequent ps from the base Scripture text to be under the ip and the subsequent qs to be invalid because they cannot go under the ip since ip is not in q's OccursUnder or close the ip since they have a lower rank: image

Possible solutions

klassenjm commented 2 years ago

Hello @tjcouch-sil ,

I've been reviewing this report. Before discussing further, I would like to point to the USFM documentation - specifically concerning USFM markup for 'Extended Study Bible Content'. You will see that \ip is intended to be supported throughout the scripture body text area for the purpose of adding division or section introductions.

The Paratext stylesheet has limitations in terms of how well it can be used to test the position and sequence of markers. The differences you see between usfm.sty and usfm_sb.sty are the effort to support the additional \e.. markers for study Bible content, and to allow more flexibility for some markers like \ip, and additional columns for tables, etc.

tjcouch-sil commented 2 years ago

Ok, thank you for clarifying! It is helpful to know that usfm_sb.sty does intend to allow ip anywhere in a chapter. That helps me to understand the issue at hand a little better, and that feels consistent with the overall styles design.

I do still believe we have a hierarchy problem of some sort. It seems important for complex content including various markers like p to be able to be under ips. However, this issue is still occurring where an ip is absorbing the rest of the content in the chapter after it and invalidating any ranked markers under it that are not allowed in an ip but are allowed in a chapter (see my screenshot of Paratext in the issue report where the p markers are valid but the q markers are not).

It seems like the style standard may need to have a way to designate when ip should end and the Scripture begin again. I suppose a couple of suggestions within existing properties come to mind:

Do you have any thoughts on how to move forward or how I can understand better what the style is supposed to indicate in this situation?

Should I change the title of the issue report to describe the real issue more accurately? Maybe something like "usfm_sb.sty - ip doesn't end in the middle of a chapter once Scripture begins again" or something.

Thank you for your time!

klassenjm commented 2 years ago

In a study Bible, \ip can exist anywhere within a chapter, but usually would be added after a section heading.

In the usfm_sb.sty stylesheet, I propose that we remove \Rank from \ip.

tjcouch-sil commented 2 years ago

@klassenjm Thank you very much for looking into this and thinking carefully about these issues! Yes, it does appear that removing rank from ip works well to allow ip anywhere in a chapter. I appreciate your thoughtfulness regarding this clean and simple solution.