Part 3 of the Understanding EPUB 3.0 webcast series was called An Alternative to EPUB 3.0: Inside the New Kindle Format 8 (KF8). The presenter was Joshua Tallent, president of eBook Architects. (To read my other posts on this series, see EPUB 3 and EPUB 3.0 Workflow).
Joshua Tallent started the presentation with the history of the Kindle format. In March 2000, a company called Mobipocket incorporated in France. They wanted to create a format for ebooks on a variety of devices, and since it was early on in the ebook development stages, their format was based on the OEB standard using the PRC container format for Palm databases. Mobipocket was intended to be used on older devices. In May 2005, Amazon bought Mobipocket, and then launched the Kindle in November 2007. In 2009, Amazon updated mobi for the Kindle 2. And in 2011-2012, Amazon had a major overhaul with the Kindle Format 8 (KF8).
The older mobipocket format was built on HTML and CSS, and like EPUB it uses some Open eBook (OEB) files, such as .opf and .ncx. It was originally intended for low-power mobile devices, like the Palm Pilot, and it was originally a compiler engine. It started as Mobipocket Creator, then became MobiGen, and now is the KindleGen. The compiler does image downsampling for file size reduction as well as a proprietary dictionary and index markup.
One big thing to remember about the new KF8 is that it is NOT EPUB, Joshua Tallent said.
Although it is similar to EPUB, in that both are based on the concept of Open eBook and HTML, Joshua stressed that there are a lot of things you can do in Kindle, and not in EPUB, and vice-versa.
Features of KF8 include
- image downsampling
- dictionary and index markup (not directly)
- packaging in a PRC container
- some support for HTML5 and CSS3 (being developed, but not the same as EPUB 3)
- fixed layout capabilities
- comic books with panel view options
- dual old and new format packaging for backwards compatibility
One of the biggest questions concerning KF8 is, can you convert an EPUB 3 file into KF8? According to Joshua Tallent, the answer is yes and no. It won’t be an exact creation, since there is no exact connection between the two, and if you want backwards compatibility with mobipocket, then you’ll have to build specifically for KF8. According to Joshua, some reasons to build a Kindle ebook, and not just run EPUB through KindleGen are:
- the differences between Kindle and EPUB formats
- the differences in how Kindle files display on various Kindle devices
- backwards compatibility issues are easier to develop for in Kindle source code (otherwise you have a lot of extraneous code in the file)
- complexity of creating a single ePub file for all devices
- drop caps may not display correctly
- in divs with left and top margins, you will lose the top margin
- may have spacing issues
- KF8 uses webkit and has default margins
- In mobipocket, headings 5 and 6 are basically same size, but in KF8, heading 6 is much smaller (may not want to use)
- By default, mobipocket justifies text and indents
- KF8 justifies text, and margins above and below paragraphs
Media Queries are also interesting to explore. There is not yet enough support for media queries. For example, you can’t have a CSS file specifically for each device, which would make single-source files for ebooks much easier.
“It is easier to make different versions of your eBooks for the different retailers than to use media queries on a single file,” Joshua said.
But, there are some media queries you can use. For example, you can tell an ebook what to when displaying in portrait v. landscape mode on the iPad. Media queries are great for very complex books. But if you use media queries, you should test the files extensively. This means turning on and off the publisher defaults and testing landscape v. portrait view modes.
Other notes on media queries:
- useful for applying styles that work ins some devices or settings, but not in others
- most powerful in iBooks on iPad, and in KF8
- standard values are “all” and “screen”
- can also target devices based on screen dimension with width and height or min-/max+ values
- more general, use orientation
- Nook ignores CSS after a media query
You can also apply CSS in link tags. This will allow for different CSS files. For example, for general styles, portrait, and landscape. There are a lot of good resources online for media queries. However, websites are different from ebooks, so you will have to do testing.
Creating a KF8 file
If you have an EPUB file and want to make it KF8, Joshua said the key is to not think of it as EPUB anymore. First, crack open the EPUB file and pull out the OEBPS folder and related files, or just the source files.
Next, remove the cover HTML file and all references in the .opf and .ncx. It’s not necessary in the Kindle format.
Make sure that the metatag pointing to the cover image is still in place. Then, move the anchors in front of the formatting tags. Change them to name attributes, meaning name= (not id=).
Convert poetry, lists, etc. to KF8 backwards compatibility formatting. Then flatten transparent PNGs and GIFs. If you have transparent images, they will not be supported. Instead, they will show up as a black box on the screen. This is another reason not to use a single source ebook file, since Apple wants transparent images.
Lastly, make sure that small images have both width and height attributes. Otherwise, the small image will look double its size and look very pixelated.
There are a few small quirks to remember as well. For example, for poetry width=”-30″ means it’s a hanging indent. Lists are slightly different too. Use <div> classes and paragraph styles to make it look like a list in KF8–you can use them for tables too. Joshua said this works well, because you’re not relying on   to line words up. But, this does not work in mobipocket, so you will have to use a hacking system.
You can read Joshua Tallent’s book, Kindle Formatting: The Complete Guide, to learn more about all the steps to building KF8 files.
Other things you can do in KF8:
- CSS for shadows, coloring, small caps, borders, etc.
- Pull quotes (top and bottom borders to set apart)
- Small caps and transform properties are compatible
Mobipocket doesn’t allow floating content to the side, so use images for the border instead. You can hide them in KF8 format.
The best resource for KF8 is the Kindle publishing guidelines. It’s not exact, so you will have to do testing. But over time, Amazon will make adjustments. Although KF8 supports HTML5, it doesn’t require valid HTML5. However, you will want to validate your files anyway.
Amazon is working on building KF8 support into its other devices, so Joshua Tallent said we should expect to see updates to the Kindle 4 and Kindle Touch in the coming months. He recommends that you continue to build mobipocket files, unless you’re building specifically KF8, in which case always test for backwards compatibility, just in case.
KF8’s fixed layout is similar to Apple’s fixed layout, but instead of having an xhtml file for each page, there is a file for each spread. For KF8, you should use percentages instead of pixels for future-proofing. KF8 fixed format also has some extra code for magnified text boxes.
Joshua said he does not think there will be a universal format for ebooks soon. But he also doesn’t think it’s just because of Amazon. According to him, everyone is vying for a sport to stand out and become more prominent in their own ways. Nook did this with it’s children’s book builder, and Apple started with the iBooks iAuthor. Joshua said it’s an issue of capitalism. There’s a lot of competition in the market, so everyone wants to stand out in the crowd.
It’s clear, however, that Amazon will not go to EPUB, since they could have done that with KF8. Joshua said Amazon has valid reasons for going with KF8: it has a built-in dictionary index and fixed layout, which EPUB does not have yet.
One important takeaway is that it makes sense to spend time building what works. For example, if you’re going to make sales in Kindle, it makes sense to build in their format.
The BISG said that in the beginning of April it will release a live document that will show which devices support which features of EPUB 3. So at the very least, we’ll know what works for who!
THANK YOU for this awesomely comprehensive post!!
Thank you! Glad to be helpful