Creating and editing e-books with Sigil

Slashdot it! Delicious Share on Facebook Tweet! Digg!
©Nataliia Natykach, 123RF.com

©Nataliia Natykach, 123RF.com

Self-Publishing

If you want not only to enjoy e-books in EPUB format but also to create them, take a look at the easy-to-use and versatile editor from Sigil.

They're not for everyone, but e-books have become a regular part of this world. Typically, you purchase e-books as finished products that can't be modified. You can attach notes and bookmarks, but what if you want to write an e-book from scratch? The free Sigil [1] e-book editor lets you do just that. Version 0.6.2 of this remarkable software debuted in December 2012.

EPUB Format

Apart from proprietary e-book formats, such as those Amazon uses (see the "Amazon Exception" box), the Electronic Publication (EPUB) open standard is widely used [2]. It's essentially based on a number of other open standards and uses a ZIP container for the formatted content (Figure 1). The content structure is based on XML, XHTML, and CSS stylesheets. EPUB borrows from only parts of these standards, which limits the design, but simplifies the implementation.

Amazon Exception

Note that Amazon's e-book readers don't support EPUB; however, current readers can still read unencrypted MOBI format files that Calibre [3] EPUB e-books can translate. You can find many free e-books, most of them in EPUB format in Project Gutenberg [4].

Figure 1: Sigil's source code mode allows a more precise EPUB editing function.

Text can be UTF-8 or UTF-16 encoded, uses XHTML tags and is formatted via CSS stylesheets. For the sake of clarity, the source code is distributed across multiple files (which typically end in .xhtml ) that combine to form an e-book.

Along with the actual document content, various metadata belong to the e-book. The Open Packaging Format (OPF) provides a complete description of the e-book structure. It stipulates, for example, that a metadata file should have the .opf extension. This file contains a manifest (a part of the XML file) that lists all the files for the e-book.

A basic table of contents is in spine , while toc refers to a fuller version in an external file. The file with the detailed table of contents normally has the name toc.ncx . The .ncx ending indicates a "navigation" file in XML format. From it, you can navigate to sections and subsections of the e-book.

The additional e-book metadata is stored in the META-INF/ directory. The OEBPS directory contains the actual e-book content, the formatted text, images, and formatting templates. In this article, I'll take a closer look at the Sigil EPUB editor in particular. (See also the "Sigil Setup" box.)

Sigil Setup

Not all current distributions have Sigil in their repositories; however, you can get packages for Arch Linux, Fedora, Gentoo, openSUSE, Slackware, and a few other distros [5]. For Ubuntu and its derivatives, Sigil is available as a PPA [6]. Installation files are also available for Mac OS X and 32- and 64-bit Windows. To compile the source code, you need cmake , with Qt4 and support for XML, SVG, and WebKit as prerequisites.

Sigil

The Sigil EPUB editor is simple. Without a document loaded, Sigil opens with a large window for entering text, code, and images. You can start creating a new document immediately. Sigil is like a cross between a word processor and an HTML editor. If you hover over entries in the well-stocked tool bar, you get quick help for the function.

For text input and editing of existing EPUB documents, Sigil provides two distinct modes: By default, you get a classic WYSIWYG editor and, for more complicated tasks or troubleshooting, you can switch to source code editing (Figure 2). Source code mode includes all the XHTML tags that you can edit more precisely than in WYSIWYG mode.

Figure 2: Sigil lists the commonly used special characters in a palette. The nbsp represents a nonbreaking space character, while the *sp variants represent variably spaced characters.

Aside from direct text input, Sigil allows importing HTML or cleartext files (.TXT ) as well as EPUB containers into an existing EPUB document. In practice, this means that you don't necessarily need to use (or know how to use) the Sigil editor. The other components of the program are always available to you.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content