View Full Version : Is it possible to create interlinear text epubs?


Doitsu
12-12-2010, 06:15 PM
I'm trying to create an epub with interlinear text in it for language learning purposes, but I'm not sure whether this is possible at all.

I created a small test epub (attached) with Calibre which displays fine with the Firefox epub plugin, but not so in ADE and ADE based hardware ebook readers.

Has anyone ever succeeded in creating epubs with interlinear text without having to use images? If so what kind of markup did you use?

Jellby
12-18-2010, 09:03 AM
I see you are using <ruby>, which, from what I can tell of the specs, is not a required component, so there is no guarantee that it is supported by a reader (and I'd guess it will be unsupported by most readers).

Then you are using "display: inline-table" and "display: table-footer-group", which looks OK, and maybe you can the same using <span class="ruby">, <span class="rb">, etc. instead of the ruby tags, since you are alrady forcing the display type anyway...

The main drawback I see is that you have to translate word by word, which is seldom appropriate. You could translate whole sentences, but then each sentence is a table and does not break across lines.

I really don't see any way to make it look right with current ePUB spec and readers...

Doitsu
12-18-2010, 09:14 AM
I see you are using <ruby>, which, from what I can tell of the specs, is not a required component, so there is no guarantee that it is supported by a reader (and I'd guess it will be unsupported by most readers).

I used <ruby> because I assumed that the ePub standard would support it for Japanese texts.

maybe you can the same using <span class="ruby">, <span class="rb">, etc.

Thanks for the idea. I'll give it a try.


The main drawback I see is that you have to translate word by word, which is seldom appropriate.

I'm aware of the drawbacks, but I found interlinear texts occasionally more helpful than translations of whole sentences.


I really don't see any way to make it look right with current ePUB spec and readers...
Thanks for confirming my suspicions.

Waya
11-20-2011, 03:34 PM
How is your working with interlinears progressing?

Doitsu
11-22-2011, 07:16 AM
How is your working with interlinears progressing?
It's on hold until reader are available that can actually display interlinear ePubs.

Doitsu
05-24-2012, 06:33 AM
I recently stumbled upon Sean Boisen's 2006 article CSS for Interlinear Styling (http://semanticbible.com/blogos/2006/09/27/). Boisen suggested using the display: inline-block; property instead of tables. I decided to give it a try and found out that it actually works for ePubs, too.

I created a short test epub that validates and displays correctly in ADE; the compiled Kindle KF8 version also displays correctly, but the regular .mobi version doesn't.

pholy
05-24-2012, 08:50 AM
That is pretty cool! It works on my old PRS505 as well as my PRS-T1, and on my BeBook-2010. It's not flummoxed by changing font sizes, too.

But I'd hate to have to do a long document by hand... I think I'd want to experiment with interleaving by line or paragraph, as well. A lot of Canadian legal docs are published in two columns, aligned by paragraph, French on one side, english on the other. Perhaps a wide right margin for one, and a wide left margin for the other would look OK.

Ideas are free... it's the implementation that costs money.

Doitsu
05-24-2012, 09:23 AM
That is pretty cool! It works on my old PRS505 as well as my PRS-T1, and on my BeBook-2010. It's not flummoxed by changing font sizes, too.
Thanks for testing my ePub. It's good to know that even some older devices will display this ePub correctly.

A lot of Canadian legal docs are published in two columns ...
I don't think that this template would work for that. You'd probably be better of with the traditional 2 page layout or maybe two documents with interlinked paragraphs.

I had more language learning in mind. I'm toying with the idea of parsing each paragraph in an .html file and then automatically adding interlinear translations from a tab-delimited dictionary.
Of course, the result probably wouldn't be perfect, but should be helpful anyway. Unfortunately, the Kindle version of FBReader can't read this ePub format correctly.

Jellby
05-24-2012, 12:12 PM
Note that inline-block is not among the allowed display values in the ePub spec. This doesn't mean it's not valid, as the CSS spec says unknown/unsupported values should just be ignored, but it means you shouldn't rely on it being properly supported. In other words, perfectly compliant readers could simply ignore inline-block and you couldn't blame them.