Ebook Authoring and Publishing
By the Ebook
The right tools can make the process of authoring an ebook less laborious and time consuming. We look at several ebook authoring applications and show how to put them to practical use.
Turning raw text into an ebook might sound like a complex undertaking, but in reality, it all boils down to choosing the right tools for the job and learning how to get the most out of them. As always, which applications you choose for writing your next ebook depends largely on your requirements and skills. The easybook tool [1] is perfect for generating ebooks from the command line, whereas Sigil [2] will appeal to those who prefer to create ebooks in a graphical environment.
Another approach is to write and format the text in your text editor of choice and then use the excellent Calibre ebooks suite [3] to convert the resulting source file to an ebook in the desired format. This solution has several advantages. First, you don't need to learn a new formatting language or master a different writing tool: You can use your favorite text editor and format text using good old HTML markup. Second, Calibre provides a wealth of options that let you turn a plain HTML file into a properly formatted ebook file. Third, Calibre supports all popular ebook formats, so you can effortlessly produce the ebook in multiple formats for different publishing platforms.
Calibre also doubles as a decent ebook reader and ebook sharing application, so you can use it to preview the generated ebook, push it to your reading devices, and make it available on the web. In short, a text editor and Calibre provide a flexible and powerful solution that covers the entire ebook authoring process: from writing and formatting text to producing a ready-to-publish ebook file.
Write and Format
Although you can use practically any text editor for working with the source file of the ebook, it's a good idea to pick an application that can handle HTML syntax highlighting. If you don't already have a favorite text editor, you might want to give gedit a try. Despite its unassuming appearance, gedit is a rather capable text editor that offers all the essential features for working with text (Figure 1). Better still, the editor's default functionality can be extended using plugins (Figure 2). Gedit also comes with a handful of plugins of its own, including the Document Statistics and Spell Checker modules, which are indispensable for writing.
Snippets is another plugin that can prove to be a great timesaver (Figure 3). This module lets you insert text and code snippets by typing the appropriate abbreviation and hitting the Tab key. For example, instead of manually entering the <img></img>
tag and specifying the required properties, you can type img, press Tab, and modify the editable parameters. Snippets is a rather powerful plugin, and it's well worth investing time and effort in learning how to use it and defining your own custom snippets. The Snippets usage guide [3] provides a good starting point, and you can learn more by examining the existing snippets.
In addition to the default plugins, you might also want to install the GMate collection of third-party plugins and themes [4], which you can do by running the following commands:
sudo apt-add-repository ppa:ubuntu-on-rails/ppa && sudo apt-get update sudo apt-get install gedit-gmate
Although most of the bundled plugins are useful for programmers, a couple of modules can be useful for writing. The Restore Tabs plugin, for example, saves all current tabs when you quit the editor, so the next time you start gedit, it shows all the documents you've been working on previously. This functionality can come in handy when you work on several parts of the book in parallel.
To enable Restore Tabs (or any other plugin for that matter), choose Edit | Preferences, switch to the Plugins section, and enable the plugin. GMate also comes with a large collection of themes, and you can pick the theme you like in the Fonts & Color section of the Preferences dialog. Here, you can also choose another font for use with the editor. This feature might seem minor, but a high-quality, legible font makes it significantly easier to write, edit, and proofread the text. Not sure which font to choose? Try Open Sans, an open source font available for download at Google Fonts [5].
In the official software repository of the Debian and Ubuntu-based distros, you'll also find the gedit-plugins package, which contains other useful plugins, including Bookmarks, Word Completion, and Dashboard.
Because the source file of the ebook is basically a plain HTML file, it has the same overall structure as the example shown in Listing 1.
Listing 1
Example Source File
This example can serve as a skeleton for your ebook, and you can use the standard HTML tags like <h1></h1>
, <p></p>
, <strong></strong>
, and <em></em>
to structure and format the text. Additionally, you can control the layout and appearance of the text using a stylesheet. To do this, you should either create a separate .css
file and link to it from the main HTML document or insert the <style></style>
block directly into the source file between the <head></head>
tags (see Listing 2).
Listing 2
Example Style Block
Alternatively, you can specify the stylesheet properties in Calibre during conversion, but adding a stylesheet definition directly to the HTML file will help keep things tidy (see the "Not Only HTML" box for more).
Not Only HTML
Calibre can also handle other markups and formats, so you are not limited to using HTML for formatting your source file. Instead of HTML, you can opt for formatting the source file using the lightweight Markdown markup language. The application also supports popular document formats, such as RTF and ODT, so you can use a word processor like LibreOffice Writer to work on the source file. However, converting documents in these formats into ebooks could require some cleanup, as well as pre- and post-processing.
Convert and Publish
Once you've finished working on the source HTML file, the next step is to convert it into an ebook using Calibre. Before you actually import the source HTML file into Calibre, you should configure the application's global conversion options (Figure 4). This way, you don't have to specify the required options for every conversion operation, which will save you a lot of time and work in the long run.
In Calibre, press the Preferences button in the main toolbar and switch to the Conversion | Common Options panel. All options in the panel are grouped into sections. The Look & Feel section, for example, allows you to configure settings that control the overall appearance of the ebook. Using the Embed font family option, you can embed a font directly into the ebook (this option works only with the supported ebook formats, such as EPUB and AZW3).
Here, you'll also find an assortment of options for quickly cleaning up and pre-processing the source file. By enabling the appropriate options, you can configure Calibre to remove spacing automatically and insert blank lines between paragraphs, apply justification, and smarten or unsmarten punctuation. If you haven't specified stylesheet info in the source file or a separate .css
file, you can add a stylesheet definition in the Extra CSS section.
Options in the Heuristic Processing section can be used to scan the file for common patterns and fix them. This very powerful feature can do more harm than good in certain situations, so use it with caution. In the Page Setup section, you can specify the input and output page format. In most cases, however, you'll want to leave both options at their defaults and adjust them on the fly during conversion. Options in the Structure Detection section are also better left alone, unless you possess a working knowledge of writing XPath expressions, and your source file has a complex structure that requires advanced processing.
As the name suggests, the Table of Contents section contains a number of options that control how Calibre generates the table of contents. If you used HTML header tags (e.g., <h1></h1>
, <h2></h2>
, <h3></h3>
, etc.) to structure your text, you can specify the headings as TOC levels using the //h:hX XPath expression (e.g., //h:h1 for level 1, //h:h2 for level 2, and so on).
Finally, the Search & Replace section can be used to define search and replace actions based on specified criteria. Once you've enabled and configured the desired options in the Common Options panel, press Apply to save the changes and return to the Preferences window.
The next stop is the Output Options panel, where you can configure options for specific output formats. Each ebook format has its own set of options (Figure 5). The EPUB Output section, for example, lets you enable and configure options that preserve the book cover aspect ratio, flatten the EPUB file structure, and place the table of contents at the end of the book.
Although some options in the Common Options and Output Options panels are self-explanatory, others might need some explanation. Fortunately, Calibre provides brief descriptions of all the available settings: Hover over a specific option, and you should see its description in a pop-up box.
Once Calibre has been configured, you can use the application to transform the source file into an ebook. Press the Add books button on the main toolbar and select the source file to import it into Calibre. Select the imported file in the library list and press the Convert books button. This step opens the convert window, which configures conversion options. You can start by choosing the desired target ebook format from the Output format drop-down list. When you do this, the application automatically applies the output options you've enabled and configured in the Conversion | Output Options panel. Next, add a book cover and provide the optional ebook metadata (author, publisher, tags, description, etc.) in the Metadata section (Figure 6).
The application also applies options configured in the Conversion | Common Options panel, so if you don't need to adjust specific settings for the current conversion operation, you can press OK to start the conversion. Once Calibre has finished the processing and converting operation, you can open the resulting ebook in the built-in reader and check the final result.
When it comes to publishing your freshly baked ebook, you have several options at your disposal. It would be impossible to cover them all here, but three distribution channels are worth considering. The first one is the most straightforward: You can simply distribute the ebook via your existing website. If you want to sell the ebook, you can set up a PayPal account and integrate its seller tools into the website. This approach gives you full control of your content and distribution, but it also requires you to do all the work of managing sales, maintaining the website, and promoting your ebook.
You can also opt for a third-party publishing service like Gumroad [6], which offers a platform for distributing content (Figure 7). Such a service will take the pain of maintaining a dedicated website or page off your shoulders and give you an easy way to stay in touch with your readers. Finally, you might want to consider publishing your ebook with the Amazon Kindle Direct Publishing service [7], which lets you reach a vast audience of Kindle users and gives your ebook exposure through the world's largest ebook store. The best part is that none of these approaches are mutually exclusive, so you can publish your ebook through all or any of these and other channels.
Infos
- Easybook: http://easybook-project.org
- Sigil: http://code.google.com/p/sigil
- Snippets plugin usage guide: http://help.gnome.org/users/gedit/stable/gedit-plugins-snippets-guide.html.en
- GMate: https://github.com/gmate/gmate
- Google Fonts: http://www.google.com/fonts
- Gumroad: http://gumroad.com
- Amazon Kindle Direct Publishing: http://kdp.amazon.com
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.