Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
32
October | November 2009
Making eBooks
from InDesign,
Part One
next page » full screen
EBooks: Part 1
In Part 1 of this 2-part series, you’ll day, the eBook revolution is finally upon us. What’s an EPUB File?
learn how to create portable eBooks aren’t meant to replace traditional paper The EPUB (electronic publication) file format is a free,
books, but they are a convenient alternative. After open eBook standard that was developed by the
EPUB files that can be read on ordering an eBook, you can instantly download it International Digital Publishing Forum (IDPF). Unlike
a computer, smartphone, or to your computer, smartphone, or dedicated eBook PDF, which is a fixed-page format, EPUB was designed
reader and start reading it. You can search through to enable content to adapt to the capabilities of
dedicated eBook reader. the text for a specific word or phrase. You can adjust various reading devices, whether they have wide or
the size of the text and choose a different font. You narrow screens, a high or low screen resolution, broad
can add digital bookmarks and non-permanent or limited font support, and so on.
annotations. And you can fit an entire library into a Note: For a list of eBook reading devices that
single reading device. natively support EPUB content, visit http://www.
With all these benefits combined with an adobe.com/products/digitaleditions/devices/.
increased consumer appetite for eBooks, it’s no An EPUB file is really a package that consists of
wonder that publishers are making material available XML files, XHTML files, and optional CSS style sheets.
in digital format. It can also contain fonts and images. You can open
When you think of an eBook, you likely imagine an EPUB file with a compatible reader such as Adobe
a PDF file that has been designed and packaged Digital Editions, the Stanza application for the iPhone,
for commercial delivery via the Internet. The and the Sony Reader, or you can convert it into a file
standard PDF format is certainly widely used. But format that can be opened on other reading devices,
more recently, a new XML-based eBook format has such as the Amazon Kindle, various smartphones,
emerged, called EPUB. It’s specifically designed for and Palm OS devices.
reflowable books and other publications. The EPUB file format is fast becoming the preferred
In this article, I’ll first introduce you to the EPUB industry standard. Rather than create eBooks in a
file format. Then I’ll teach you best practices to variety of formats, it’s more efficient to start with
follow when setting up an InDesign document that a single EPUB file that’s then converted into other
will be exported as an EPUB file. Finally, I’ll walk you formats as necessary.
InDesign allows you to export EPUB files. So after and accurately translated into an EPUB file. So before captions, the position of those elements will be
producing a print version of a publication, you can you reach for the File menu, read the rest of this section! discarded in the EPUB file and all the content will be
convert the same content into an EPUB file (Figure 1). What follows are several best practices and displayed in one continuous flow—with the sidebar
important things to keep in mind while producing an notes, images, and captions inline with the main
Creating an EPUB File InDesign document that you plan on exporting as an body text. This can cause havoc for a design-heavy
Creating an EPUB file is really quite easy—as easy as EPUB file. magazine or textbook. But for a novel, you probably
choosing File > Export for Digital Editions. However, won’t notice much of a difference between the print
the most critical part of the process is to set up your Page Layout. Perhaps the most important thing to version and the eBook version.
InDesign document in such a way that it can be easily understand is that the EPUB file you create won’t look Some eBook readers implement their own
the same as the printed version of your book unless layout system. For example, Adobe Digital Editions
Figure 1: This book, Spy Killer by L. Ron Hubbard, was initially laid
out in InDesign (below) and then exported as an EPUB file. Adobe your original design is quite simple. For example, if automatically creates a two-column layout if the text
Digital Editions allows you to read and manage EPUB files and other your book contains sidebar notes and images with size is decreased past a certain point. Stanza and
digital publications (far right).
eReader allow you to control the size of the page page in your InDesign document, link all the text differently than the main body text. For example, you
margins. So you should expect the layout of your frames together so they are part of one continuous might italicize and center a note or a figure caption.
eBook to change depending on the reading device story, and then flow all the content of your book If your book contains graphics, you should anchor
it’s viewed on. within that story (Figure 2). If your book contains them to their corresponding text so that they travel
To control the exact position of all the layout sidebar notes, callouts, figures, and so on, you’ll with the text as it reflows.
elements in an EPUB file, set up one text frame per probably want to format them so they appear For more complex layouts, I usually create two
InDesign documents, one for the printed version and
another for the EPUB version. And not all content
is a good fit for the EPUB format. If your book has a
complex design, I recommend exporting it as a PDF file
instead since this format gives you complete control
over page layout and presentation.
Figure 2: All the text, images, and captions in this book flow within
a single story, which is a series of linked text frames. This layout
method gives you the most control over the position of the text and
graphics in the EPUB version of your publication.
Page Breaks. Since the EPUB file format doesn’t define indents. The initial formatting you’ve specified in your
page structure, all the content of an EPUB file flows InDesign document can change radically, depending
together regardless of how it’s laid out in the InDesign on the reading device your eBook is viewed on.
document. Consequently, all the page breaks are For example, you may have specified left-aligned
ignored even if you’ve used page break characters to text, but it can appear justified when viewed as
define where pages begin and end. an eBook. Some formatting, such as drop caps
Fortunately, there is a way around this issue. If and paragraph rules, is lost altogether. I highly
you want a specific section of your book to start on recommend that you test your EPUB files on different
its own page, create a separate InDesign document eBook readers so you know what to expect and
for it. So for a typical book, you would create separate can fix problematic formatting before you start
documents for the cover, title page, copyright page, distributing your eBooks.
table of contents, and each chapter. Then you would
combine the documents together into an InDesign Apply Paragraph and Character Styles. It’s vital to
book file (using File > New > Book) from which you consistently apply paragraph and character styles to all
will export the EPUB file. the text in your document, including single words and before you export your document, you’ll need to apply
phrases that have unique formatting applied to them, actual character styles to all the text that is formatted
Page Numbers. Automatic page numbers are also such as bold or italic. InDesign uses the styles you’ve with nested styles—if your document contains them.
conveniently ignored in the exported EPUB file. This is applied as a basis for creating the CSS style sheets There are a couple ways to speed up this process.
due to the fact that EPUB files are designed to adapt in the exported EPUB file, and the CSS style sheets One method is to use the Find/Change dialog box
to various reading devices, which makes it impossible determine the formatting of the text in the EPUB file. (Edit > Find/Change). Leave both the Find What and
to predict where pages should begin and end. Some If you’re using InDesign CS3, local formatting is not Change To fields blank. Instead, use the Find Format
eBook readers add page numbers for you. They’ll even retained in the EPUB file. So if you’ve made a word section (click the More Options button if you don’t see
recalculate the page numbers after you’ve resized the italic without using a character style, that word will this) to locate all the text to which a nested character
text or chosen a different font. not appear italicized in the EPUB file. InDesign CS4 style is applied. For example, if the nested style applies
includes an option for basing the CSS style sheets on a character style called “Bold Intro” then use the Find
Text Formatting. Don’t get too caught up in your local formatting (we’ll look at that in detail later in this Format section to search for text to which the “Bold
document’s typography and text formatting. Most article), but I’ve found the results to be unpredictable, Intro” character style is assigned.
eBook readers let the viewer customize their reading so I still recommend that you apply styles to all the text Then, use the Change Format section to apply
environment. Some let you modify just a few settings, in your document. the “real” character style to the text (Figure 3). Click
such as the font, the font’s size, and the background Change All to apply the character style. Technically, the
color. Others add formatting controls, such as Nested Styles. Unfortunately, any formatting defined text then has both the nested style and the character
alignment, line spacing, paragraph spacing, and with nested styles is not retained in the EPUB file. So style applied to it, but it looks the same, so no harm is
Figure 5: Forced line breaks were inserted at the end of the first
three lines in this InDesign document (left). They are preserved in
the EPUB file, which prevents those lines of text from running all
the way to the edge of the available viewing area in Adobe Digital
Editions (below left). Not good!
done. Perform this procedure for each nested style in
your document. fonts, and when converted to the eBook reader’s font,
You can also convert nested styles to “hard- these special characters may show
formatted” character styles using InDesign’s Map Tags up as different characters or as a
to Styles feature, or with a script, as mentioned in an simple square. If your document
article on InDesignSecrets.com. uses special characters, especially
the extended characters found in
Fonts. InDesign includes an option for embedding some OpenType fonts or ornaments,
fonts into the exported EPUB file. So if your document special fractions, and “expert” font
uses a particular font, such as Myriad Pro, it can be glyphs, test their display on different
copied into the EPUB file so that the text can continue eBook readers.
to be displayed in that font. For a font to be embedded As technology evolves, more
into the EPUB file, the font must be OpenType or eBook readers should start
TrueType. However, some TrueType fonts aren’t supporting embedded fonts and full
supported, so test them to make sure they can be Unicode sets.
embedded before you use them.
Figure 4: Instead of inserting extra paragraph returns between the Replace Extra Returns with
chapter number, chapter title, and body text, I applied Space After Real Formatting. If you’ve typed
to the chapter number and chapter title to create the additional extra paragraph returns between
space around them. The Space After control is in the Control panel
or Paragraph panel when the Type tool is selected.
paragraphs, be aware that they will
Unfortunately, not all eBook readers take be ignored in the exported EPUB
advantage of the embedded fonts. Adobe Digital file. Instead, you should use InDesign’s Space Before
Editions uses the embedded fonts, but in my tests, and/or Space After controls to add space between
other eBook readers ignore the embedded fonts and paragraphs (Figure 4).
use their own default font instead. Happily, even when
the readers use another font, they still maintain the Remove Unnecessary Line Breaks. Unfortunately,
font styles. So a word or phrase formatted with Myriad forced line breaks (also known as soft returns:
Pro Bold, for example, will become Times New Roman what you get when you press Shift-Return/Enter)
Bold on an eBook reader that uses Times New Roman are preserved in the exported EPUB file. So if your
as its default font. document contains them, the text in the EPUB file will
Another important thing to be aware of is that probably look odd when it reflows to fit on different
some special characters are not available in other screen sizes (Figure 5). Therefore it’s important to
remove all unnecessary forced line breaks from your Bullets and Numbering feature to create them— because your InDesign document pages have no real
document before you export it. even better, apply paragraph styles formatted with meaning in the reader app.
To quickly find and delete forced line breaks, use automatic bullets or numbering. This way you have That said, keep in mind that a few eBook readers
the Find/Change dialog (Edit > Find/Change). To find more control over how the lists are created and ignore hyperlinks and cross-references entirely. And
the Forced Line Break character, click the @ symbol to formatted in the EPUB file. among those eBook readers that do support them, not
the right of the Find What field. every destination type is supported, so once again,
Hyperlinks and Cross-References. If your test your eBooks on different reading devices before
Bulleted and Numbered Lists. If your book will publication contains hyperlinks and/or cross- distributing them.
contain bulleted and/or numbered lists, use InDesign’s references, don’t worry: Most of them are maintained
in the EPUB file. InDesign exports all cross-references. Footnotes. If your publication contains footnotes, they
Figure 6: Footnotes conveniently become clickable hyperlinks in
the EPUB file, so when you click the reference number (below) you’re
Hyperlinks that jump to Web pages, email addresses, will be maintained in the EPUB file (Figure 6). However,
taken to the footnote text (right). If you click on the number of the files, and text anchors are also exported. However, they will be converted to endnotes, which are
footnote text, you’ll jump back to the reference number. hyperlinks that jump to specific pages are discarded displayed at the end of the eBook or a section of the
Figure 8: This eBook uses both types of TOCs: the navigation map in
the panel at the left and a typical TOC at the beginning of the eBook.
Each TOC entry on the page is a hyperlink, which is indicated by the
blue underlined text.
eBook. Footnote numbering styles other than regular belong, or at the very end of the eBook. To create
numbers, such as letters or symbols, will be converted clearly defined sections within your eBook, you should
to regular numbers in the EPUB file. create separate InDesign documents for each section
and then combine them together into a book file.
Images and Illustrations. Unless images and To control where in the text flow an image will
illustrations are anchored within the main body of appear, anchor it inside its own paragraph (Figure 7).
text, they’ll be at the end of the section to which they This way you can format that paragraph, which will
modify the position of the image. For example, you
Figure 7: I anchored this image to a separate, center-aligned
may want to center-align the paragraph and use Space
paragraph . I added space below the image by applying Space After
to the paragraph. After to add space below it.
For maximum productivity and design consistency,
apply a paragraph style to all the returns that your
images are anchored to. Remember, the paragraph “class” attributes in the XHTML file and the table styles
styles you apply will be used as the basis for creating will become CSS rules that you can further customize.
the CSS style sheets in the exported EPUB file. Cell styles aren’t converted into CSS rules, so you’ll
Note: Your anchored images should use the inline have to add them to the CSS file manually.
position option, which is the default position of an Note: In my testing, I’ve discovered that not
anchored object. If an anchored image uses the Above all eBook readers support formatted tables, so I
Line or Custom position options, it won’t be positioned recommend testing each eBook reader before creating
correctly in the eBook. an eBook for it.
Tables. If your publication contains tables, InDesign Create a Table of Contents. Every eBook should
will export them as XHTML tables in the EPUB file— contain a table of contents (TOC) so that readers can
but all the table formatting will be lost! Hopefully quickly and easily jump to specific sections. There are
the next version of InDesign will be able to export two types of TOCs you can include in an eBook: the
formatted tables. For now you’ll have to format your typical TOC that you see at the beginning of a book,
tables by editing the XHTML and CSS files that are and a TOC that functions as a navigation map in an
created within the EPUB file (see Part 2 of this article eBook reader (Figure 8).
on CreativePro.com in late January 2010). To set up a TOC that will become a navigation map,
To expedite that table formatting process, you you first need to create a TOC style (Layout > Table of
should apply table styles and cell styles to all your Contents Styles). When you export the EPUB file, you
tables. The table and cell style names will become simply specify the TOC style you created and InDesign
will generate the navigation map for you (more on that Figure 9: The Description tab of the File Information dialog box
(below). The information you enter can be displayed within most
process later in this article).
eBook readers. In Adobe Digital Editions, choose Item Info from the
If you don’t create a TOC style, InDesign can Reading menu to display information about an eBook (right).
still generate a navigation map, but the InDesign
document titles will be used as the entry names
(probably pretty ugly).
Note: Not all eBook readers display the navigation
map in the same location. Adobe Digital Editions
displays it in a panel, whereas other eBook readers
might display it in the form of a menu.
To set up a typical TOC at the beginning of your
eBook, you might think you could use the same
TOC style that will generate the navigation map.
Unfortunately, if you do, you won’t be able to add
hyperlinks to the TOC. It’s quite frustrating. So if you
want to create a hyperlinked TOC, you’ll have to
manually create the TOC.
If you’re using InDesign CS4, you can insert cross-
references instead of hyperlinks. The advantage ❱❱ Document Title: Enter the title of your book.
of using cross-references is that each TOC entry ❱❱ Author: Enter the author’s name.
is generated from its destination text, so if the ❱❱ Description: Enter a description of your book. For
destination text changes, the TOC entry can be quickly entered the data into the File Information dialog box example, this might be the same information found
updated with that change. And, as I mentioned earlier, (File > File Info). on the back of the book.
cross-references are automatically converted into Note: If you’re exporting an EPUB file from a ❱❱ Keywords: Enter one or more keywords that describe
hyperlinks upon export. book file, make sure you enter the metadata into the your book’s subject category. I suggest that you
document that is specified as the source file (the one select a subject from a controlled vocabulary, such
Add Metadata. Metadata is an integral part of every that has a little icon to the left of it in the book panel), as the list that the Book Industry Study Group (BISG)
eBook file. It can describe such things as the title, otherwise the metadata won’t get exported. provides. The BISG is the U.S. book industry’s leading
author, and publisher of an eBook. Most importantly, The File Information dialog box displays many trade association for research and supply chain
it makes your eBooks searchable. The EPUB file format different properties (Figure 9). Not all of them are standards and policies.
supports several metadata entries. InDesign can exported to the EPUB file, so I recommend filling out ❱❱ Copyright Notice: Enter your book’s copyright
automatically export some of these entries if you’ve the following fields within the Description tab: information, such as “Copyright © 2009 John Doe.”
Organize Sections into a Book File. If your the first page gets rendered. Some eBook
publication is made up of multiple sections or readers won’t even load an eBook if one
chapters, it’s important to create separate InDesign of the XHTML documents is really large.
documents for each section and then combine them
into a book file (Figure 10). When you export the EPUB Exporting the EPUB File
file, InDesign creates a separate XHTML stream for Once you’ve laid out your publication,
each section, which improves the performance of the the next step is to export it as an EPUB
eBook reader. Having a single XHTML document that file. Choose File > Export For Digital
includes the entire contents of a publication requires Editions, or if you’ve created a book
the entire document to be loaded into memory when file, open it and choose Export Book For
Digital Editions from the Book panel
Figure 10: This book file contains all the documents that make up a
menu. You’ll be presented with a number
typical book. I laid out the cover, title page, copyright page, forward, of options, which allow you to specify
and each chapter in a separate InDesign document. how the EPUB file should be created
(Figure 11A, 11B, and 11C). Note: If you
are using InDesign CS3, choose File > Cross-media and character styles to the text in your publication,
Export > XHTML / Digital Editions to export a single select Defined Styles; otherwise select Local
document. Formatting. The third option, Style Names Only, tells
Here’s a brief explanation of each option: InDesign to include a CSS file with empty styles.
I wouldn’t select this option unless you want to
❱❱ Include Document Metadata: Select this option if define the CSS rules yourself.
you’ve added metadata to your InDesign document ❱❱ Bullets: If your book contains bulleted lists that were
(you should!) and you want to include it in the EPUB created with InDesign’s Bullets and Numbering
file. If you’re exporting from a book file, make sure feature, choose whether you want to map them to
that the document containing the metadata is set as unordered lists or convert them to text. If you want
the style source before you export the EPUB file. your bulleted lists to be formatted as a hanging
❱❱ Add Publisher Entry: This metadata field isn’t in the indent in the EPUB file (you normally would), choose
File Information dialog box, so if you want to include Map to Unordered Lists. To convert all bullets to
Publisher information, you’ll need to enter it here. actual text characters, choose Convert to Text.
❱❱ Base For CSS Styles: This option lets you determine ❱❱ Numbers: If your book has numbered lists created
which text formatting is included in the CSS file with InDesign’s Bullets and Numbering feature, you
within the EPUB file. If you’ve applied paragraph can map them to ordered lists or static ordered
lists, or you can convert them to text. If your lists TrueType fonts. Postscript fonts won’t be embedded. I recommend that you choose Optimized from
use a numbering system other than normal, Arabic As I noted earlier, many eBook readers ignore the Copy Images menu and then choose either
numerals (and it’s important to keep them in embedded fonts, so you might want to keep your file Automatic, GIF, or JPEG from the Image Conversion
that style), choose Convert to Text. The difference size smaller and leave them out. pop-up menu. If you choose Automatic, InDesign
between an “ordered list,” and a “static ordered list” is ❱❱ View eBook After Exporting: If you have an EPUB will determine which format to use in each instance.
subtle: An ordered list relies on the eBook reader to reader installed on your computer (such as Adobe Specify the GIF and JPEG options as necessary for
assign numbers; a static ordered list includes values Digital Editions or Stanza), select this option and the your publication. Select the Formatted option to
for each item so they can’t easily be renumbered. EPUB file will automatically open after it’s created. preserve the formatting you’ve applied to your
❱❱ Include Embeddable Fonts: Select this option to ❱❱ Image Options: The Images pane of the Digital images, such as rotation or scale, as much as possible.
include all the fonts in the EPUB file that are allowed Editions Export Options dialog box allows you to ❱❱ Contents Options: The Contents pane of the Digital
to be embedded. The fonts must be OpenType or specify how the images in your book are exported. Editions Export Options dialog box lets you specify
Figure 11B: The Image options in the Digital Editions Export Figure 11C: The Contents options in the Digital Editions Export
Options dialog box. Options dialog box.
Making eBooks
from InDesign,
Part Two
next page » full screen
EBooks: Part 2
In Part 2 of this 2-part series, In part 1 of this series (see CreativePro.com), readers, you will likely need to tweak the EPUB file
you’ll learn how to unlock the you learned how to create a file in InDesign that itself, after exporting it from InDesign.
successfully exports to a format eBook readers can 2. Different eBook readers display the contents of an
full potential of EPUB files display. But after exporting an EPUB file from InDesign, eBook in different ways, so after editing an EPUB
by opening and editing them after it’s sometimes necessary to modify it. For instance, file, test it on the eBook readers you’re going to
you might want to insert a forced page break, add publish it on.
exporting them from InDesign. metadata to the file, or change table formatting.
In this article, I’ll walk you through the process of Opening an EPUB File
opening an EPUB file, and I’ll explain how the file’s An EPUB file is really just a ZIP-compressed package
components work. You’ll learn how to make common that contains all the pieces of a digital publication.
edits, and I’ll direct you to some tools you can use to There are two ways to open an EPUB file: extract the
validate an EPUB file after you’ve made significant contents of the file or use Oxygen XML Editor to open
changes to it. the file directly without extracting it.
To edit an EPUB file, you need a basic
understanding of XHTML, XML, and CSS. If you’ve Extracting the Contents of an EPUB File
never been exposed to these technologies, you’ll To extract the contents of an EPUB file, change its file
want to learn more about them before you try your name extension from .epub to .zip, and then use a ZIP
hand at EPUB file editing. utility to extract the contents of the ZIP archive. (On
Once you have that grounding, follow these two the Mac, you must use a tool such as BetterZip or The
guidelines when modifying an EPUB file: Unarchiver to unzip the files; the operating system’s
1. Since it’s easier to modify an InDesign document built-in ZIP utility won’t unzip these files.)
than an EPUB file, first try making the changes You can then view and edit the various
in your original document and re-exporting it. components of the EPUB file using a simple text editor,
Then, only if necessary, modify the EPUB file. So, such as Notepad on the PC or TextEdit on the Mac
for example, if you need to add a new section (or, better, the free TextWrangler application). You
to your publication, you should create a new can also use a dedicated HTML editor such as Adobe
InDesign document, add it to your book file, and Dreamweaver or even a dedicated XML editor.
then export a new EPUB file. But if you want to After making the necessary edits, archive all the
add more metadata or customize the navigation components as a ZIP file again. If you’re working on a
map that’s displayed as a menu in most eBook PC, you can simply copy the modified files back into
Figure 1: The Oxygen XML Editor interface provides many tools for
working with the contents of an EPUB file.
$1,347, but it’s well worth it if you’ll be publishing a lot Figure 3: Viewing the contents of an EPUB file with Oxygen What’s Inside an EPUB File?
XML Editor.
of eBooks. (The developers of Oxygen XML Editor also As I noted earlier, the EPUB file format is basically a
sell Oxygen XML Author, which is a simplified editor ZIP file that contains all the files necessary to create
that can also edit EPUB files and that costs less for an eBook, including a table of contents, the text, a
some license types.) To download Oxygen, visit www. CSS file, and so on (Figure 4). Technically, the EPUB
oxygenxml.com.
Using Oxygen to open an EPUB file directly is the
most straightforward method since you don’t have to mimetype
format is based on three open standards: Open Figure 5: An example OPF file as it is viewed in the Oxygen XML <?xml version="1.0"?>
<package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/"
Editor. The text is color coded to make it easier to distinguish
Publication Structure (OPS), Open Packaging Format between the markup and the data.
unique-identifier="bookid" version="2.0">
<metadata>
<meta name="generator" content="Adobe InDesign"/>
(OPF) and Open Container Format (OCF). OPS is based <dc:title>Spy Killer</dc:title>
<dc:creator>L. Ron Hubbard</dc:creator>
<dc:subject>Fiction</dc:subject>
on XML and describes the content of the eBook. The <dc:subject>Thrillers</dc:subject>
<dc:description>This classic 1936 Hubbard tale takes listeners to pre-Communist China where
a man named Kurt Reid has fled murder charges only to find himself thrust into the
OPF standard defines how the eBook components metadata, identifies all of its components, describes exotic world of foreign espionage.</dc:description>
<dc:publisher>Galaxy Press, LLC</dc:publisher>
are related. OCF is a zip-based standard that defines the reading order for the contents of the eBook, and <dc:date/>
<dc:source/>
<dc:relation/>
how all the components of an eBook should be provides the fallback information for files that are not <dc:coverage/>
<dc:rights>© 2008 Galaxy Press LLC. All Rights Reserved.</dc:rights>
<dc:identifier id="bookid">urn:uuid:31bd0356-5605-1ce4-1acc-48b33799c145</dc:identifier>
encapsulated into a single file. core content types. The file’s structure and content is <dc:language>en</dc:language>
</metadata>
Here’s a detailed look at the various components based on the OPF standard.
<manifest>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<item id="css" href="template.css" media-type="text/css"/>
of an EPUB file and how they’re organized: You’ll find three required elements in the <item id="cover" href="Cover.xhtml" media-type="application/xhtml+xml"/>
<item id="titlepage" href="TitlePage.xhtml" media-type="application/xhtml+xml"/>
<item id="copyright" href="Copyright.xhtml" media-type="application/xhtml+xml"/>
content.opf file: <metadata>, <manifest>, and <item id="toc" href="TOC.xhtml" media-type="application/xhtml+xml"/>
<item id="foreword" href="Foreword.xhtml" media-type="application/xhtml+xml"/>
<item id="chapter01" href="Chapter01.xhtml" media-type="application/xhtml+xml"/>
mimetype File: This plain text file, which must be <spine> (Figure 5): <item id="chapter02" href="Chapter02.xhtml" media-type="application/xhtml+xml"/>
<item id="chapter03" href="Chapter03.xhtml" media-type="application/xhtml+xml"/>
in the archive’s top level, identifies the content type ❱❱ The <metadata> element is used to provide <item id="chapter04" href="Chapter04.xhtml" media-type="application/xhtml+xml"/>
<item id="chapter05" href="Chapter05.xhtml" media-type="application/xhtml+xml"/>
<item id="backmatter" href="BackMatter.xhtml" media-type="application/xhtml+xml"/>
within an EPUB file. information about the publication as a whole. If <item id="f001-01-fmt-jpeg" href="images/f001_01_fmt.jpeg" media-type="image/jpeg"/>
<item id="f003-01-fmt-jpeg" href="images/f003_01_fmt.jpeg" media-type="image/jpeg"/>
<item id="f006-01-fmt-jpeg" href="images/f006_01_fmt.jpeg" media-type="image/jpeg"/>
you choose to include the document metadata <item id="f0100-01-fmt-jpeg" href="images/f0100_01_fmt.jpeg" media-type="image/jpeg"/>
<item id="f0101-01-fmt-jpeg" href="images/f0101_01_fmt.jpeg" media-type="image/jpeg"/>
but it’s included in EPUB files exported from InDesign are part of the publication, including the NCX file,
and, in this case, is only used to encrypt the fonts all of the XHTML content files, the CSS style sheet, element determines that reading order. When you
used in a publication. If you don’t include the and any embedded image files. The actual order export an EPUB file from an InDesign book file, the
embeddable fonts when you export an EPUB file, the of the <item> elements in the <manifest> is not order of the documents in the book file determines
encryption.xml file won’t be created. significant. the reading order of the EPUB file.
❱❱ The <spine> element is used to determine the
content.opf File: This XML-based file is the root file linear reading order of the publication. The order toc.ncx File: This XML-based file gives eBook readers
of the EPUB package. It contains the publication’s of the <itemref> elements within the <spine> detailed navigation information. The file’s structure
and content is based on the OPF standard. Don’t eBook. In Adobe Digital Editions, the navigation map
Additional EPUB Documentation
confuse its purpose with the purpose of the <spine> is displayed in the panel at the left of the application While the EPUB format is relatively simple on the
element in the OPF file. Where the <spine> element window (Figure 6). Other eBook readers display the surface, it has a huge number of permutations. These
determines the reading order of the eBook, the navigation map in a different location. links will help you find your way as you start creating
NCX file serves as a navigation map that is generally When you export an EPUB file from InDesign, and editing EPUB files (and the files within them):
displayed as a menu in an eBook reader, enabling you the NCX file is generated in one of two ways. If you
• International Digital Publishing Forum (IDPF)
to jump directly to any of the major sections in the specify a TOC style when you export the file, the NCX homepage: www.idpf.org
• Open Publication Structure: www.idpf.org/2007/
ops/OPS_2.0_final_spec.html
Figure 6: A typical navigation map as seen in Adobe Digital Editions (below left). The NCX file
(below right) determines the order and names of the items in the navigation map. It also provides
• Open Packaging Format: www.idpf.org/2007/opf/
links to the XHTML documents that are listed (not all records are visible in this example). OPF_2.0_final_spec.html
• Open Container Format: www.idpf.org/ocf/ocf1.0/
download/ocf10.htm
<?xml version="1.0"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/
ncx-2005-1.dtd">
• EPUB Best Practices Guide (Requires Adobe
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head> Digital Editions): www.adobe.com/devnet/
<meta name="dtb:uid" content="31bd0356-5605-1ce4-1acc-48b33799c145"/>
<meta name="dtb:depth" content="4"/> digitalpublishing/epubs/EPUBBestPractices-1_0_3.
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head>
epub
<docTitle>
<text>Spy Killer</text>
• EPUB Data Sheet: www.adobe.com/devnet/
</docTitle>
<navMap> digitalpublishing/pdfs/EPUB_datasheet.pdf
<navPoint id="navpoint" playOrder="1">
<navLabel> • Adobe Digital Publishing Technology Center: www.
<text>Contents</text>
</navLabel>
<content src="TOC.xhtml#toc-anchor"/>
adobe.com/devnet/digitalpublishing/
</navPoint>
<navPoint id="navpoint-1" playOrder="2">
• Adobe Digital Editions Product Information: www.
<navLabel>
<text>Foreword</text> adobe.com/products/digitaleditions/
</navLabel>
<content src="Foreword.xhtml#toc-anchor"/> • Adobe Digital Editions Blog: http://blogs.adobe.
</navPoint>
<navPoint id="navpoint-2" playOrder="3">
<navLabel>
com/digitaleditions/
<text>Spy Killer</text>
</navLabel>
<content src="StoryTitle.xhtml#toc-anchor"/>
<navPoint id="navpoint-3" playOrder="4">
<navLabel>
<text>Chapter One</text>
</navLabel> file is based on the parameters of the TOC style. If
<content src="Chapter01.xhtml#toc-anchor"/>
</navPoint>
<navPoint id="navpoint-4" playOrder="5">
you don’t specify a TOC style, the NCX file is based on
<navLabel>
<text>Chapter Two </text>
</navLabel>
the document titles and the order of the documents
<content src="Chapter02.xhtml#toc-anchor"/>
</navPoint> in the InDesign book file, if you’re exporting from
<navPoint id="navpoint-5" playOrder="6">
<navLabel>
<text>Chapter Three</text>
one. After exporting an EPUB file, you might want to
</navLabel>
<content src="Chapter03.xhtml#toc-anchor"/>
</navPoint>
customize the names that appear in the navigation
...
map. See “Customizing the Navigation Map” later in
</navMap>
</ncx> this article for how to do this.
If an element contains data, it will have both a start Figure 9: A <navPoint> element within the toc.ncx file. Figure 10: I added the page-break-before property to the heading
tag and an end tag; otherwise it will show up as an selector and set its value to “always” so a page break will occur
<navPoint id="navpoint-14" playOrder="15"> before each heading in the publication.
empty closed element, such as <dc:date/>. To fill out <navLabel>
<text>The Stories from the Golden Age</text>
an empty element, simply remove the slash from the </navLabel>
<content src="BackMatter.xhtml#toc-anchor"/>
p.heading {
page-break-before: always;
tag, insert your data after the start tag, and then insert </navPoint> font-family: "Times";
line-height: 1.20em;
the appropriate end tag to complete the element. font-size: 1.50em;
margin-bottom: 0.00em;
margin-top: 0.00em;
Tip: Don’t change the value of the <dc:identifer> contains the text that is displayed in the navigation text-indent: 0.00em;
margin-right: 0.00em;
element. It contains the unique document ID, which is map. Simply modify this text to edit the name. margin-left: 0.00em;
text-align: left;
needed for the embedded fonts to function properly. Note that the first time you open the toc.ncx file font-weight: normal;
font-style: normal;
color: rgb(0,0,0);
Note that the first time you open the content.opf into Oxygen, you will be asked to associate the file }
file into Oxygen, you will be asked to associate the file with a known file type. Choose XML Document and
with a known file type. Choose XML Document and make sure to select the Associate File Type With Editor Alternatively, if you had a paragraph style that
make sure to select the Associate File Type With Editor option before clicking OK. you didn’t want to show up at the top of a page (for
option before clicking OK. example, the first paragraph after a heading), you
Inserting Page Breaks. The EPUB file format was could use the page-break-before property and use the
Customizing the Navigation Map. With some designed to let content adapt to the characteristics value “avoid” instead.
publications, you might want to customize the of various reading devices. Consequently, it doesn’t While these work in Adobe Digital Editions, there
navigation map that’s displayed as a menu in many define page structure: All the content of an EPUB file are many other eBook readers that disregard page
eBook readers. For instance, if you’ve used a TOC flows together regardless of how it’s laid out in your breaks defined by the CSS file. Test your EPUB file on a
style in InDesign to generate the navigation map, InDesign document. As I’ve said before, if you want particular reading device before you publish to it to be
the main section headings in your publication will be a section of your publication to start on a new page, sure that the page breaks are supported.
the same names that appear in the navigation map. the best practice is to put it in a separate InDesign
Let’s say that one section heading is “The Stories from document and then combine it in an InDesign book Tools for Validating EPUB Files
the Golden Age,” but you want it to appear as “List of file, from which you export the EPUB file. After making significant changes to an EPUB file, it’s
Stories” in the navigation map. You’ll have to edit the But there is another way to force page breaks: a good idea to validate it to make sure it’s error free
name in the EPUB file to fix it. use the CSS page-break-before or page-break-after and fully compliant with IDPF specifications. There are
To customize the navigation map, open the EPUB property. For example, to insert a page break before several validation tools that are currently available.
file and then open the toc.ncx file. Each item in the each instance of a heading that has the paragraph ❱❱ EpubCheck is a Java-based tool that checks
navigation map is contained within a <navPoint> style “heading” applied to it, open the template.css file the OCF container structure, OPF and OPS mark-up,
element (Figure 9). Each <navPoint> element contains inside the EPUB file. Then locate the “heading” selector and internal reference consistency. It can detect
a <navLabel> and a <content> element. Within the and add the page-break-before property to it. The many types of errors. To download this tool, visit
<navLabel> element is a <text> element, which value of the property should be “always” (Figure 10). http://code.google.com/p/epubcheck/.