Digital device

The global trade and standards association for electronic publishing.

IDPf's mission is to foster global adoption of an open, accessible, interoperable digital publishing ecosystem that enables innovation. IDPF's strategy to effectively advance its mssion is to develop (collaboratively) and promote EPUB as the universal accessible interchange and delivery ecosystem for eBooks and other digital publications advancing the Open Web platformRead more ›

EPUB 3 rendering in EPUB 2 reading systems

13 posts / 0 new
Last post

Although EPUB 3 is not perfectly backwards compatible with EPUB 2, a goal of the recent revision was to ensure, as much as possible, a basic level of rendering when features overlap.

In this thread, we’d like to compile a list of best practices that content creators should consider implementing for optimal rendering in both EPUB 2 and 3 reading systems, as many readers are likely to be consuming the new format initially on older systems. (As these reading systems get updated to support the new standard, this information will naturally become less relevant to production.)

In that light, the following practices are recommended at this time:

  • An NCX should be included to ensure navigation and so that reading systems don’t generate errors due to its absence.
  • Any styling employing CSS3 properties needs to degrade gracefully, as CSS3 support was not included in EPUB 2.
  • Progressive enhancement techniques must be used for scripting as per the EPUB 3 specification, as scripting will not be available on many EPUB 2 reading systems.
  • The epub:switch element should be used to include fallbacks for embedded MathML content.
  • Embedded fonts may not render, so optimal fallback fonts should be listed in your CSS style sheets.
  • Audio and video content are not likely to render using the new HTML5 elements, so embedding the object element as a fallback is a possibility for systems that supported multimedia (providing transcripts should also be considered, as many will not)

Please post any pertinent information and questions in this thread and we will update the above list accordingly.

An OPF2 meta element should be included to identify the cover image:

<meta name="cover" content="My_Cover_ID" />

The hidden attribute is not supported prior to HTML5, so content hidden in this way may appear in EPUB 2 reading systems.

If the navigation document is embedded as content -- and contains lists that are not intended for display (such as the page list and landmarks) or branches of the table of contents not intended for display -- the hidden attribute could be mapped to corresponding CSS styles:

nav[hidden], ol[hidden] {
   display: none;
   visibility: hidden;

But note that there is no guarantee that an EPUB 2 reading system will recognize the new nav elements or hide them even with CSS styles.

If epub:switch is EPUB3, how would using it to provide a fallback for, say, mathML be expected to work in an EPUB2 reader?

The switch element was also available in EPUB 2 for content switching; it's just been updated for EPUB 3.

And the EPUB 3 revision didn't change the element so that it won't still work as defined for EPUB 2 reading systems:

  • The required-modules attribute is gone, but it was only for adding XHTML modules anyway, which doesn't apply anymore.
  • The required-namespace attribute was tweaked slightly to allow any URI, which was envisioned as a way to allow experimental new HTML elements to be included in the future without having to create another attribute, but it can still take a namespace.

So, if you specify the MathML namespace in the required-namespace attribute on the case element containing your MatML, an EPUB 2 reading system that doesn't recognize the grammar should still use the XHTML in your default case.

Ah okay, I couldn't find the epub:switch attribute in the EPUB2 spec, that's where my confusion came from.


I know Epub3 very well and let me know, what are the devices supports MathML? I tried in iPad and it seems not working.

-James Collins,

There are two places I know of where this information is being tracked:

  1. The MathJax site has a page listing support:
  2. The BISG support grid:

But sometimes these are only simple claims of support and not always indicative of the current state of the reading system, or how features will render in all contexts. See Liz Castro's blog for more on iBooks and MathML, for example.


You wrote Audio and video content are not likely to render using the new HTML5 elements, can you please clarify which elements you mean?

I would like to avoid the object element if possible if there is an alternative.

Of course I am aware of the fact that the device has to support audio and video content too.

Thanks in advance,
Stephen Richards

Since EPUB 2 supported XHTML 1.1, any element that is only in HTML5 is not likely to be recognized. For text content, that's typically not such a big deal as even though the tags are not understood, the text will still be rendered either as block or inline content depending on the context in which it's used (although generally without any specific css for that element). For multimedia content, however, it means the audio, video and embed tags typically won't function (but embed is discouraged in the specification, anyway).

You're really only likely to find support for Flash videos embedded through an object tag in EPUB 2, since that's what rmsdk supported. Or, in other words, you can only "avoid" object by embedding it within an audio or video element as a fallback, but that also means duplicating and distributing your multimedia as Flash content.

Hi Matt,

Epub3 is the honestly best feature and flexible option. Even we can formatting the ebook using the advanced options like Math ML, Embed flash, audio and video. I really love epub3.

I have a one question. Whether the KF8 supports exactly the same as Epub3?


Not exactly the same, but there are many similarities because both are underpinned by HTML5, with Amazon using more of a subset of HTML5.

You won't get MathML support in KF8, as one example of the differences. KF8 also doesn't support scripting (or forms), and last I heard, it supported video but not on any of Amazon's devices (only in their Apple app).

Looking beyond HTML, there are also similarities in functionality but differences in implementation: fixed layout metadata exists in both but is different, EPUB has media overlays so authors can create their own audio sync'ed books while Amazon uses whispersync (which requires an audio book in, and you have no control over the synch that I'm aware of), Amazon does its own indexing while an EPUB indexes spec is soon to be finished. (The paternalistic nature of how Amazon controls what your content does is a turn off to me.)

Since Amazon doesn't fully state what they support in KF8, I'm not aware of all the specific differences that exist off the top of my head. Hopefully the above gives you a start, and I'm sure if you do a little searching you'll find plenty of rants comparing/contrasting the formats.

Hi Matt garrish,

You replies are reply awesome. I want to clarify one thing:

KF8 supports videos & audio and I already successfully implemented some projects. But the video support only few devices like Kindle Fire HD and even the "Kindle Previewer" does not support.

Also, I agree with your words - "Amazon doesn't fully state what they support in KF8". I also suggested those thing to Amazon Kindle support but not heard anything.


Secondary menu