Contents | Start | End | Previous: KB0289: Why does Kindlegen execution fail? | Next: KB0291: How do I copy and paste formatting from a Microsoft Word document?
See also:
How to target Kindle in the Jutoh manual
Can I send Epub files to Amazon KDP instead of generating Kindle files?
Why does Jutoh warn about generating Epub and Kindle formats in a single configuration?
Why is list indentation greater than expected when viewing in Kindle Previewer 3 or devices?
Although Kindle and Epub formats are very similar, there are a few differences, and Jutoh needs to perform certain optimizations in the Epub file that it generates before it invokes Kindlegen.
Quite apart from the optimizations, when compiling a Kindle file, Jutoh will emit Kindle-specific warnings and tips based on Kindle guidelines and also years of experience, so this will provide an important insight into creating good Kindle formatting compared with simply creating a regular Epub.
Some optimizations are done for the benefit of older e-Ink Kindles using the KF7 format, that have not or could not be updated to the newer KF8 format. You can switch off all or some KF7 compatibility code using the configuration option KF7 compatibility. For full KF7 compatibility, use the value all, and for no compatibility, use none. You can also specify further comma-delimited options to switch individual optimizations on: table, tablespacing, tableborder, tablesize, tablealignment, tablecolour, list, paragraph, image.
By default, this option is set to all, meaning that the maximum amount of KF7 compatibility will be kept. This can potentially interfere with optimal KF8 output (for example, guessing table borders which are specified differently in KF7) so you can switch all or some of this compatibility off. Very few KF7 devices remain in use, and even old devices such as the Kindle Keyboard have been updated to use KF8. However, particularly when emailing .mobi files (which can lose KF8 formatting), it may be useful to ensure compatibility is maintained.
The following optimizations are performed when Generate Kindle and Optimize for Kindle are checked, depending on the value of KF7 compatibility:
Bookmarks are moved outside paragraphs if Kindle anchor optimization is enabled. Amazon used to recommend this, even though it is not strictly correct HTML; the reason is that navigating to bookmarks inside a paragraph caused Kindle readers to omit correct formatting for that paragraph. However, this issue seems to be fixed, and Amazon have removed the recommendation from its guidelines. So unless you are targeting an extremely old device, you can clear this option.
List formatting is simplified for the benefit of old Kindles, if KF7 compatibility contains all or list. In particular, HTML paragraph tags cannot be used for KF7 so multi-paragraph list items are separated by line breaks. List and list item CSS also has to be treated differently than for pure Epub.
Table formatting includes additional, older-style HTML syntax as well as modern CSS, for compatibility with older Kindles, if KF7 compatibility is all or table.
Further Table formatting: regardless of KF7 setting, Jutoh will convert table size properties to minimum size properties for compatibility with Kindle for viewers including Kindle Previewer 3 and Kindle for iOS. Otherwise, the table size may be ignored. A similar conversion will also happen for cells if Use minimum size for cells is checked).
Indentation will be optimized for older Kindles. Older Kindles can have problems with full paragraph indentation, so for KF7, full indents are turned into first-line indents, and on KF8, the normal indent is used. This is most likely to affect a table of contents that shows multiple levels. This can be controlled by setting the styles to be fixed in Styles for indent fix. Blank this value to avoid the fix.
A separate HTML Cover page will not be generated, since Kindle ebooks use a cover image and not HTML page. Since Kindlegen 2.3, which was released in 2012, Kindlegen automatically removes the HTML cover page anyway to avoid duplication.
Maximum width and maximum height CSS properties are not emitted since Kindle does not support them.
Image sizes, if specified, are specified as HTML attributes as well as CSS, for the benefit of KF7. This happens if KF7 compatibility is all or image.
To work around a logical contents bug on Kindle where clicking on the first item can go to the cover instead of the correct page, a special bookmark is added to the start of each section and used in the NavMap.
For fixed layout ebooks, Jutoh generates Kindle-specific meta syntax in the OPF file: orientation-lock, original-resolution, fixed-layout, book-type, RegionMagnification. There are further differences between Kindle fixed layout files and Epub 3 fixed layout files including the way page types are specified, and support for region magnification, a Kindle-only feature. Double-page spreads in a Kindle book must be created as a single HTML file, but this is manually controlled by the Pages per spread configuration option.
New Kindle configurations have Use default list indentation enabled, because of a bug in Kindle enhanced typesetting that makes list indents too big. For more information, see this note.
Differences between CSS generated for older Kindles and recent ones are catered for by using CSS 'media queries', allowing each kind of reader to use the most appropriate CSS.
It's recommended that you use the Kindle configuration and view ebooks in the Kindle Previewer, but if you wish to use Epub (or can only use Epub, for example if Kindlegen is not supported on your platform), check the Generate Epub option in your Kindle configuration and use the ..._Kindle.epub file that Jutoh generates.
Be sure to distribute only the Kindle-optimized book to Amazon, and the regular Epub book to other distributors that use the Epub format.
The following notes describe KF7 file implementation details; given that there are very few KF7 devices around now, you are unlikely to need this information.
You may be wondering why there is no inter-paragraph spacing in your Kindle file when viewed on older devices even though you specified it in Jutoh.
When Jutoh is configured to use relative units, Kindle rounds paragraph spacing (before or after) to the nearest 'em' unit, so for example 1.4em becomes 1em and 1.5em becomes 2em. In fact you specify spacing in tenths of a mm within Jutoh, which are then converted to em by multiplying by 0.02, so 25 tenths of a mm become 0.5em. From this you can see that 25 is the minimum value you should use to add spacing in a Kindle file using relative units, since anything less will be rounded to zero. To fix this and ensure accurate dimensions on older Kindle devices, set the option "Paragraph dimension units" to Default in your Kindle configuration. Note that this may cause poor spacing in some implementations of the Kindle 'Look Inside' feature.
KF7 does not honour line spacing, although this can be changed by the book end-user on some readers.
KF7 may also omit inter-paragraph spacing if there is a left indent.
KF7 doesn't support list type specification, so ordered lists can only have arabic numbering. Also, paragraph specification will only work for the outer list level due to the paragraph tag not honouring paragraph margins. To work around this, Jutoh places the vertical margins (before and after paragraph spacing) on the list item tags for the first level only. Specifying the margins for nested items would cause space to be accumulated after closing list item tags.
KF7 lists don't honour custom indentation specification so the defaults will be used.
You may find that the table of contents page isn't indenting items as you expect, when viewing the Kindle version of your ebook. This is because Kindle (KF7) implements custom first-line indent, but not full left indent. The solution is to edit the paragraph styles for table of contents entries, such as TOC Entry 2, and give them first-line indents instead of full left indents. Go to Project Properties/Styles and in Indents & Spacing, set Left to 0 and Left (first line) to a non-zero indent value such as 120.
The downside of this is that long items that wrap will not be fully indented, but in most cases the items will fit and will appear indented appropriately.
Alternatively, you can adjust the Kindle configuration option Styles for indent fix, which converts matching paragraph styles to first-line indent instead of full left indent. The value "TOC*" applies this change to all table of contents entry styles. You can clear this entry if you do not want to adjust any styles.
Contents | Start | End | Previous: KB0289: Why does Kindlegen execution fail? | Next: KB0291: How do I copy and paste formatting from a Microsoft Word document?