Ebooks Almost from Scratch
Makeshift ebook tool chain
ByWhile no single tool for ebook creation exists, you can combine LibreOffice, Calibre, and some manual editing of CSS tags to produce your own ebook.
In the last few years, ebooks have become standard formats for online publication. Their popularity is partly due to Amazon’s Kindle Direct Publishing, but ebooks also have the advantage of taking up much less space than PDFs, the former format for online documents. Because they are modified HTML, an ebook file takes up about a third of the space of the same PostScript-derived PDF file. This savings more than makes up for the lack of easy advanced formatting.
Unfortunately, no single tool exists for in-depth creation of ebooks. If you do some planning, you might manage to create an ebook directly from LibreOffice Writer. More likely, though, you will have to transfer the file to Calibre. For advanced formatting, you may have to manually enter Cascading Style Sheet (CSS) tags.
Creating the Source File
Writer is well-suited for creating source files for ebooks. Often, you may need to create several source files to tweak the output, and Writer’s extensive use of styles can reduce an hour of manual corrections to a few minutes.
However, CSS cannot easily match the advanced formatting of Writer’s Open Document Format (ODF). Nor does conversion to ebook format fully support all CSS tags. For these reasons, keep your format as simple as possible -- this will require less tinkering. At most, try to use only three or four paragraph styles and about the same number of character styles.
Many Writer features (including column, drop capital, and frames) can only appear in the ebook with manual editing, so avoid them when writing the source file. Similarly, use bookmarks in place of cross references. Lists, whether bulleted or numbered, are not supported, although you can add a bullet as a special character.To keep an image with its caption, add the caption to the image. In general, any feature that involves positioning paragraphs, such as indents, line spacing, and space above and below should convert without problems.
Exporting to Ebook
Writer supports limited export to ePub, a popular ebook open standard that converts easily to other ebook formats. You have three ways to export to ePub.
If your document has an uncomplicated layout, you may be able to export to ePub simply by clicking File | Export | Export As | Export Directly as EPUB. A file manager opens to add the name and path for the .epub file, and then Writer creates the file without any more input from you.
However, if this method does not give you results, try File | Export | Export As | Export as EPUB…. This option gives you a little bit of input into how the file is constructed and looks (Figure 1). You can choose:
- Split method: How the file splits pages. The most common choice is Heading. In this choice, new pages are started each time a Heading paragraph style appears. With this method, you probably want two, or, at the very most three Heading styles. Otherwise the contents of each page is extremely short, and readers may become annoyed at constantly changing pages. The alternative is Page break, which follows the manual page breaks you add in the raw document. Of the two, Heading requires the least work.
- Layout method: Choose Reflowable to have the ebook display change according to screen and window size, or Fixed layout to have the ebook layout remain the same under all conditions. Most readers are likely to prefer Reflowable, but you might choose Fixed layout if formatting is important to you. In particular, Fixed layout preserves the dimensions of graphics.
- Custom cover image: The path to the image for the title page. You may want to add the book title and the author’s name to the cover image, using an open source tool like Gimp. Alternatively, you can add another page or image with this title and author name -- a useful choice if the cover image makes for a background with too little contrast for readable text. If no image is specified in this field, the .epub file will automatically use any image with a name like cover.gif, cover.jpg, cover.png,or cover.svg. If none of these file names are used, then the cover image will be the alphabetically first image file.
- Custom media directory: The path to the optional directory for the cover image, metadata, and multimedia files. If not selected, then all these resources are stored individually in each file. A custom media directory is convenient when a large number of files use the same resources.
- Metadata: The basic information for the file that provides tags to help searches. The dialog window only has fields for Identifier, Author, Title, Language, and Date. This field is really another chance to edit metadata that is picked up by default from File | Property in Writer.
If you do not change any of the settings, Writer’s default ones are used.

The third method is to save the ODT source file and open it from within Calibre. Currently, this is the recommended method, because Calibre’s EBOOK filter is more advanced than Writer’s. You will probably want to use the source file again, because it is the easiest place to make changes.
Editing in Calibre
Calibre is best-known as an ebook manager. However, it also has a complete set of tools for editing ebooks. Unless your source file is simple, you will almost certainly need to edit the ebook before publishing.
To start editing, import your ebook by clicking the Add books icon. Once the ebook is added, right-click and select Edit metadata to add tags that describe the ebook, helping readers to find them in a web search (Figure 2) or use Convert book to export to ePub or other ebook formats. Some formats such as MOBI are proprietary and cannot be edited, so keep the source ODT file and any ePub file in case you want to use them again. Calibre can store multiple formats of the same file.
For other editing, select Edit book to open the editing window to edit the separate files that make up the ebook (Figure 3). From the editing window, you can edit the text, as well as:
- Set and edit the cover image.
- Upload images to add manually (see below)
- Embed fonts so readers all see the same layout
- Validate CSS tags
- Check HTML and spelling
Note that the panes of the editing window can be resized as needed while you work.
Manual Editing
For fine-tuning or advance features such as columns or tables, you can edit the CSS code directly in the Calibre editing window. If you have created HTML or JavaScript any time in the last two decades, you probably have a nodding familiarity with CSS. Not only is CSS commonplace on the Internet, but popular ebook formats like ePub and MOBI use it as well. Moreover, since CSS is meant to be human-readable, if you know English, you can understand much of what is being done without actually learning the details. However, a formal look at CSS is likely to reveal details that you have missed, not least of which is the number of options it provides. Tutorials on CSS and a complete list of tags are available online.
Whenever possible minimize editing CSS. Not only does manual editing increase the risk of error, but CSS is less convenient to edit than ODT. Just as importantly, some sites may arbitrarily limit the CSS allowed.
Makeshift but Possible
If all this sounds rough and ready, there’s a good reason -- it is. It’s not unusual for any but the simplest of ebooks to require some form of editing. At times, Calibre’s graphic tools are enough, but at other times, manual editing is required. In extreme cases, a beginner might find editing the source file the easiest route. Often, several trials must be run. Even so, for most users, the steps described here are likely less intimidating than creating a CSS document completely from scratch.
But if the process is messy, at least a usable tool-chain exists. Plan the format of your ebooks systematically, be patient as you work, and producing an ebook is at least possible.
next page » 1 2 3
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
-
OpenMandriva Lx 6.0 Available for Installation
The latest release of OpenMandriva has arrived with a new kernel, an updated Plasma desktop, and a server edition.
-
TrueNAS 25.04 Arrives with Thousands of Changes
One of the most popular Linux-based NAS solutions has rolled out the latest edition, based on Ubuntu 25.04.
-
Fedora 42 Available with Two New Spins
The latest release from the Fedora Project includes the usual updates, a new kernel, an official KDE Plasma spin, and a new System76 spin.
-
So Long, ArcoLinux
The ArcoLinux distribution is the latest Linux distribution to shut down.
-
What Open Source Pros Look for in a Job Role
Learn what professionals in technical and non-technical roles say is most important when seeking a new position.
-
Asahi Linux Runs into Issues with M4 Support
Due to Apple Silicon changes, the Asahi Linux project is at odds with adding support for the M4 chips.
-
Plasma 6.3.4 Now Available
Although not a major release, Plasma 6.3.4 does fix some bugs and offer a subtle change for the Plasma sidebar.
-
Linux Kernel 6.15 First Release Candidate Now Available
Linux Torvalds has announced that the release candidate for the final release of the Linux 6.15 series is now available.
-
Akamai Will Host kernel.org
The organization dedicated to cloud-based solutions has agreed to host kernel.org to deliver long-term stability for the development team.
-
Linux Kernel 6.14 Released
The latest Linux kernel has arrived with extra Rust support and more.