epub finishing touches - o'reilly mediaassets.en.oreilly.com/1/event/49/epub finishing touches_...
TRANSCRIPT
ePub Finishing
Touches
Fixing Errors, Adding Metadata, and
Tweaking Formatting
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Top 5 Misconceptions
Publishers have about
eBooks
Copyright © 2011 eBook Architects LLC. All rights Reserved.
1.eBook conversions are easy,
because I can use tools like
calibre.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
3.I can keep the same page layout
and formatting in my eBook as I
have in print.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
4.ePub files can be easily converted
into the Mobipocket/Kindle format.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
5.I have to get my content into XML
and create an in-house eBook
creation system.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
1.Learn eBook Design, not eBook
Conversion
Copyright © 2011 eBook Architects LLC. All rights Reserved.
2.Automation tools make us lazy.
Use your hands.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
3.Clean, semantic mark-up always
makes designing easier
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Error-checking
ePubCheck and ePubPreflight
- code.google.com/p/epubcheck
- threepress.org/document/epub-validate
FlightCrew
- tinyurl.com/ePubFlightCrew
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Editing Oxygen
- oxygenxml.com
TextPad
- textpad.com
Komodo Edit
- activestate.com/komodo-edit
Text Wrangler
- barebones.com/products/textwrangler
Copyright © 2011 eBook Architects LLC. All rights Reserved.
ePub Building Apple Scripts for Zipping and Unzipping
- tinyurl.com/ePubZipUnzip
Use with Caution!
Sigil
- code.google.com/p/sigil
Do Not Use!
calibre
- calibre-ebook.com
Copyright © 2011 eBook Architects LLC. All rights Reserved.
ePub Building Windows:
- zip -Xr9D path/filename.epub mimetype *
Mac:- zip -X filename.epub mimetype
- zip -rg filename.epub META-INF -x \*.DS_Store
- zip -rg filename.epub OEBPS -x \*.DS_Store
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Most Common Errors
mimetype entry missing or not the first in archive
image file OPS/images/image1.jpg is missing
I/O error reading OPS/toc.ncx
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Most Common Errors
unique-identifier attribute in package element must reference an existing identifier element id
hyperlink to non-standard resource '…'
hyperlink to resource outside spine '…'
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Most Common Errors
'…' is not valid. The date must be in the form YYYY, YYYY-MM or YYYY-MM-DD (e.g., "1993", "1993-05", or "1993-05-01"). See http://www.w3.org/TR/NOTE-datetime."
NCX file OPS/toc.ncx is missing
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Most Common Errors
Entity 'apos' is undeclared
fragment identifier is not defined in 'OEBPS/chap01.xhtml‘
unique-identifier attribute in package element must be present and have a value
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Most Common Errors
item (OEBPS/images/0163_001.jpg) exists in the zip file, but is not declared in the OPF file
item (OEBPS/images/0163_001.jpg) missing in the package
Copyright © 2011 eBook Architects LLC. All rights Reserved.
ePubPreflight Errors
Content files that are empty
Content files that are over 300KB
Image files that are empty
Image files that are over 10MB
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Apple iBookstore Errors
Your EPUB contains characters that are
not UTF-8 or UTF-16. This is typically
caused by including accented or other
special characters in the EPUB. If they
are not properly encoded, they will not
appear as expected when the customer
reads your book. iTunes Producer lists
the exact files that have these issues in
the delivery error report.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Apple iBookstore Errors
XHTML namespace is not properly
declared in all HTML in your EPUB.
This is a strict requirement for the EPUB
standard. Check to ensure the proper
namespace is declared in each HTML
document.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Apple iBookstore Errors
All date formats are not full and
complete. There are strict requirements
for dates listed in the EPUB OPF and
NCX files. Check to see that they are
complete and properly formatted.
Apple iBookstore Errors
Your filenames have spaces or encoded
characters. If your EPUB has any
spaces in filenames, be sure the spaces
are properly encoded in the EPUB
manifest by using "%20" in their place.
Filenames may not contain periods (".")
other than to separate the filename from
its extension.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Stanza Desktop Error
Your OPF file is saved as a Unicode file, Stanza Desktop
requires ASCII encoding
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Kobo Each chapter/section within the ePub is
separated into its own html/xml file
The ISBN for the book is labeled in various areas:
- ePub Filename (eg. 9781234567890.epub)
- OPF, in the <metadata> section within <dc:identifier> (<dc:identifier>9781234567890</dc:identifier>)
- Cover image filename (eg. 9781234567890.jpg)
Copyright © 2011 eBook Architects LLC. All rights Reserved.
AppleSee the Apple iBookstore Asset Guide
Cannot have references to Kindle, Nook, etc.
Cover page cannot have backgound color specified, don’t use <svg>
Guide section in the OPF is recommended
Book will open to the first of:
- Text, acknowledgements, dedication, epigraph, foreword, preface, other.intro
- Override with other.reader-start-page
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Barnes and Noble NCX will only display one level
margins should be set as pixels, not ems
Page margins should be 30 pixels on the top and sides, 20 pixels on the bottom
Title Page is mandatory
Typical Adobe limitations (300kb file size, available characters)
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — File Structure Place all content files in an OPS or OEBPS
folder
Do not put media in a folder on the same level as the HTML
- Bug in iBooks will make videos not play
- Watch out for Sigil’s standard file breakdown
Give HTML files and images understandable names for easier editing
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — OPF Metadata section
- Fill in as much as you can
- Unique dc:creator tags for each author (despite the lack of support)
- Use a unique ISBN for the ePub
- <meta name="cover" content="coverimage" />
Spine
- Do not use linear="no" for cover HTML
Guide
- Toss-up…
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — NCX Fill in the header, include the ISBN/UUID
Include PageList
Include NavLists
- Illustrations
- Tables
- Graphs
- Charts
- Photos
- etc.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — CSS Clean code, easy for someone else to edit
Comment your sections
Minimize the number of styles (don’t give one for each paragraph)
Minimize the declared styles
- Only add formatting that is not added elsewhere in the cascade
- Watch out for color and background-color
Include body/@page margins
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — XHTML Make your code semantic
- DO NOT use the straight ID output
- blockquotes
- Lists
- Use <div> tags to separate content
Make your code human-readable
- Understandable class names
- No weird line breaks
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Best Practices — Overall Pros and Cons of single-file ePubs
Using Regular Expressions/GREP
Creating your own Scripts (Perl, Python, etc.)
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Kindle Format Basics Very Simple
HTML 3ish
No borders
No floating images
Large tables are useless
Copyright © 2011 eBook Architects LLC. All rights Reserved.
10 CSS commands supported font-size
font-style
font-weight
color
vertical-align (sub/super)
text-align
text-decoration
text-indent
margin-top
margin-bottom
Copyright © 2011 eBook Architects LLC. All rights Reserved.
ePub through KindleGen Because of these limitations in the Kindle
format’s capabilities, KindleGen’s automated conversion of ePub files has big problems
Lots of little differences in formatting, places where KindleGen misinterprets/ignores complex CSS
For example, left and/or right margins set on paragraphs will override top margins
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Forcing Amazon to accept an
ePub will not convince them
to switch to ePub.
It only hurts your customers
and gives you a reputation
for badly designed eBooks.
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Good Kindle Workflow Create a good ePub file, one that has all the
design elements you want
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Good Kindle Workflow Copy the source code to a new folder
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Good Kindle WorkflowMake the necessary changes to convert the ePub Source to Kindle Source
OPF
- Guide should be added (TOC and start)
- Remove images from manifest
Minimize CSS
Remove borders from divs, use images or <hr/> tags
Copyright © 2011 eBook Architects LLC. All rights Reserved.
Good Kindle Workflow Poetry and other hanging indents
- width="-nn" attribute instead of CSS
Hacked list outlines
Insert tables as screenshots
Images
- Size of images might need to be reduced
- width/height attributes should be added
<img width="520" height="620" alt="large image" />
Copyright © 2011 eBook Architects LLC. All rights Reserved.
If you must convert an ePub…
Recognize your limitations in formatting, and plan for them
First-level hanging indents, use:Padding-left: 1em;
text-indent: -1em;
Further hanging indents are not supported
Ems are based on font size.
- Use at least 1em top margin on P tags
- Watch out for 2em margins on headings
Kindle drops one font size at font-size: 0.85em;
Kindle does not allow left-align on list items.
Joshua Tallent
512-939-3466
Copyright © 2011 eBook Architects LLC. All rights Reserved.