Interlinears

Does SAB handle interlinears? We have one set up in Paratext; can it be displayed in SAB?

SAB can handle displaying interlinearized texts, but it does that through multiple book collections. E.g. you can include the vernacular translation in one collection and another–like French–in another collection. Using the Layouts menu, you can set up how those interact. Is that what you’re asking?

What I was thinking of is having word-for-word glossing under text. In this case, a main text in Greek and then glosses for each word in a vernacular.

I’m guessing what you’re describing is more of a diglot situation, right? Where you have two separate texts which scroll in parallel with one another, but are only connected at the verse level (not the word leve). Is that correct, or am I missing something?

Aha, now I understand. No, SAB doesn’t do what you need. Only the diglot interlinearization.

@mjames USFM3 provides Ruby glossing that can be word by word or by phrase. You need to define it. For the mark up see Words and Characters — Unified Standard Format Markers 3.0.0 documentation

SAB does support that. Support was added back in 6.2.

Thank you. Ruby glossing seems to fit what I needed exactly!

Now, two follow-up questions:

  1. Can the base text and the gloss be styled separately? I can’t actually figure out what the style of either of them is, and the html uses a “text leaf” which I’ve never seen before.
  2. Do you know of anyone who’s written a Paratext Interlinear → Ruby converter? Doing that myself is at the edge of my perceived programming ability, which means it’s probably far beyond my actual ability.

This is what I do to answer a question 1.
Create a USFM file with Ruby glossing.

\id MAT 
\c 1
\p This is a sentence with \rb ruby|text\rb*  in it.

Load that in SAB.
Have a look how it looks in the Viewer tab.
image
So that looks like I expected.
Now export that to HTML and look at the HTML code.

<div class="p">This is a sentence with 
<ruby>ruby<rp>(</rp><rt>text</rt><rp>)</rp></ruby>
  in it.</div>

Then we look at the CSS that goes with the HTML.
image
The <rp> tags by default are hidden. But they could be used.

So we hypostasize that SAB is not currently applying any styles, it is just relying on the built in underlying CSS for Ruby.

So if the default is not what you want then start adding in some Custom Styles.
So we add a new style: ruby rt

ruby rt {
    color: red;
}

In the Viewer there is no change but in the Browser we see:
image
So I assume that will work in SAB too. But I have not tested it.

You probably won’t want to change the base text styling.

Thank you, that explanation was helpful. I’ve actually been doing most of that, but I’ve been relying on Firefox’s “Inspect Accessibility Properties” to see an overview of the styling, and in this case it didn’t give me the information I needed. But after reading your explanation I went back and drilled down further to the actual html and I see that <rt> and other elements you’re seeing.

One note for other people looking at this in the future: Ruby puts the gloss above the base word, which is the opposite how we typically create interlinearized texts in the West. As a result we’ll end up putting elements in places which don’t seem logical.
If the USFM rules for Ruby are \rb_base text|gloss1:gloss2\rb*,
it’s probably helpful to actually think of this as \rb_bottom line|top line\rb*.

I think all my questions regarding this have been answered.

The positioning as seen above the text is the default. See: ruby-position - CSS: Cascading Style Sheets | MDN for how to put under.

PTXprint can do the conversion from Paratext’s interlinear file structure to straight usfm. You may have to do some further munging. But if you set PTXprint up to do interlinear then you can raid the intermediate files out of the local/ptxprint/<project_config> folder.

Thank you very much for that idea. I just looked and the file looks pretty good–maybe minor changes will be needed but not much.

It won’t be the first time PTXprint is an intermediate step in my PT–>SAB workflow!

@mjames I’d like to see what the PTXprint SFM output looks like. By private message would be fine.

I find using this program extremely frustrating. Am I the only person trying these sorts of things, or do people have access to some source of knowledge that I don’t know about?

If I want to modify the styling for ruby text, I create a custom style called ruby, right?

The answer is NO. The correct answer is that you modify div.p. Obviously [sarcasm]. That took an hour or two of experimentation to discover.

So, to get the ruby order to switch, you add ruby-position: under; to div.p. Likewise for changing font color and family.