View Full Version : My ePubs render differently on Android, Apple and Aldiko


Themus
09-24-2012, 08:46 PM
I have spent about a year creating ePubs using Word. The titles are in Black with a line and author below it in Teal. I have various styles used throughout.

I save them as WebPage Filtered and import then into Calibre. I convert them and bring them into Aldiko. They look good.

If I bring them into other eReaders, I get different results. Moon+ Reader doesn't have the Title and author right along with other issues.

Stanza does a pretty good job on the Apple Ipad, except my paragraph spacing is wrong and is the same throughout the rendering despite being different in the original document. It's all or nothing as far as indents despite having them set differently in the original.

ShuBook doesn't see any of my styles, for example my bold text. That which I manually highlighted in bold in the original Word file, do show up bold. Seems none of the styles are recognized in this eReader.

Is there no universal language to make these different applications see the text the same?

What is the secret if there is one for making an ePub rendering somewhat the same on different platforms or eReaders.

Thank you in Advance.
Tom

Toxaris
09-25-2012, 02:33 AM
Yes, there is such a universal language. Although small differences will always be there caused by different rendering engines, you can limit it.

That language is XHTML with a dash of CSS. Instead of counting on Calibre to do a conversion, clean up the source from Word first and create the ePUB from that. Conversions in Calibre can be messy, even more when it has to guess.

DiapDealer
09-25-2012, 07:22 AM
What is the secret if there is one for making an ePub rendering somewhat the same on different platforms or eReaders.
No secret. Trial and error and perseverance (and a willingness to concede that; "that's close enough."). The same things it takes to make webpages render similarly in different browsers.

PageLab
09-25-2012, 08:42 AM
You can use media queries to create separate style sheets for Webkit and Adobe RMSDK. This doesn't solve all formatting problems, but allows more fine-grained control over text presentation in different rendering engines.

mzmm
09-25-2012, 10:40 AM
You can use media queries to create separate style sheets for Webkit and Adobe RMSDK.

can you actually query engines specifically? i've only ever seen device-width/height, although i guess "media screen and (-webkit-min-device-pixel-ratio:0)" for webkit might work, but i've never tried.

PageLab
09-25-2012, 11:01 AM
Yes, you can use something like this in your XHTML code:

<link href="default-rmsdk.css" rel="stylesheet" type="text/css" />
<link href="optimized-webkit.css" media="all and (min-width: 240px)" rel="stylesheet" type="text/css" />

The second stylesheet will be ignored by RMSDK, and can be used to refine your formatting in iBooks and other webkit based apps.

But it's not "querying specifically". It relies in the fact that RMSDK doesn't support media queries.

Doitsu
09-25-2012, 11:02 AM
can you actually query engines specifically?
Jellby came up with a very creative way (www.mobileread.com/forums/showthread.php?p=744547) of testing for an RMSDK engine using an .xpgt file, which is only processed by RMSDK readers.

mzmm
09-25-2012, 11:40 AM
@PageLab -- thanks for the example!

@Doitsu -- thanks for the link!

Themus
09-25-2012, 06:48 PM
Thank you all for your responses. Seems like I am a little over my head. Too bad there isn't a program where you can just place your text, set your sytles for headings, body and paragraph subheads, and then out comes the ePub you need for a given device.

I have about 200 Word files and corresponding ePubs in Calibre that do look good in Aldiko. I was trying to be open at looking at the new Apple Ipad Mini with Stanza or Shubook.

Looks like unless I want to re-do all my work, I'll either stick with my rooted Nook Color and Aldiko and Calibre Companion, or get a new Galaxy Tab 2 and just place Aldiko and Calbire Companion on it.

Mega thanks for all your advice.

Doitsu
09-26-2012, 01:41 AM
Seems like I am a little over my head. Too bad there isn't a program where you can just place your text, set your sytles for headings, body and paragraph subheads, and then out comes the ePub you need for a given device.
There are commercial ePub editors such as Jutoh (http://www.jutoh.com/) and AWP (http://www.atlantiswordprocessor.com/) that you could give a try.

Alternatively, you could have a look at the source code in Sigil (http://code.google.com/p/sigil/downloads/list). Open one of your ePubs with Sigil and have a look at a typical paragraph in Code View.

It should look like this:

<p class="calibre3">It was a dark and stormy night...</p>

Note the class name (in this example, calibre3). Then open the stylesheet and look at the corresponding definitions in the .css file :

.calibre3 {
display: block;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: justify;
text-indent: 0
}

The lines marked in red control paragraph spacing. Simply reduce the values to get the paragraph spacing that you want.
While you're at it also press F8 to check the metadata and update them as needed.