Designing ebooks with free software
Custom Conversion
With LibreOffice Writer and Calibre, you can publish your own ebooks with better results than most online conversion tools.
If you are publishing an ebook, you can find numerous conversion tools online. The trouble is, most of these tools give you minimal control over the results. Too often, the results are poorly formatted, partly because Cascading Style Sheets (CSS), the language used to format ebooks, is limited, but mainly because automatic formatting is often too inflexible. You have far more control if you do the conversion yourself. Without being an expert, you can produce better ebooks with just two open source tools: LibreOffice Writer and Calibre. However, expect some trial and error before you get the results you want.
Creating an ebook involves these steps:
- Create the raw file in LibreOffice Writer.
- Convert to EPUB format.
- Edit glitches in Calibre.
- Edit CSS directly, if necessary.
- Add finishing touches in Calibre.
Creating the Raw File
You can begin by writing your ebook in LibreOffice Writer. I would strongly advise using styles, since they make fine-tuning the format quicker. Use as few styles as possible, and remember the limitations imposed by the conversion process. The following rules apply to LibreOffice 6.2 and later:
- Use only character and paragraph styles. Styles for frames, pages, lists, and tables only partially work and are best avoided. Mostly, settings for positioning and text should work.
- You can either add page breaks or use Heading styles to signal the start of a new page.
- Frames, sections, columns, tabs, and tables will require coding in CSS if you insist on using them. They will not survive the initial conversion to ebook format.
- Use bookmarks instead of cross references.
- If you are using the same file for a hard copy version of an ebook, you can use headers and footers. Be aware: Headers and footers are dropped during conversion to ebook format.
- Do not worry about fonts. On ebook readers, users often set their own fonts. As a result, embedding fonts makes an ebook file larger for no real purpose.
- Make images the same width as the space between the left and right margins. If necessary, add white space. This habit will prevent any problems with how the text wraps around images. Note that unless otherwise specified, the first image in the file will be used as a title page.
- Use Writer's built-in caption tool for images. It will keep the caption and the image together in the ebook.
- The Table of Contents (TOC) exports mostly without trouble. Use the TOC building blocks to create a live link and add the text (Heading). Ignore page numbers and tabs, since they will not convert.
Remember that the raw file is the easiest place to get formatting right. The simpler your formatting, the less you have to do.
Converting to EPUB
LibreOffice files convert handily to EPUB format. If your file is very simply formatted, you may be able to convert with File | Export as | Export As EPUB (Figure 1). The EPUB Export window opens, which gives you a limited set of options. The EPUB version may need to change if you plan to publish on a site with it own formatting conventions. You also have the option of starting new pages with a page break or a heading and of making the text flow fixed or flowable. In addition, the window allows you to set basic metadata, such as the author and publisher. You can import to Calibre by using Calibre's Add books button.
However, if your format is more complicated, you may want to save the raw file in ODT format, LibreOffice Writer's default format, and then open it in Calibre by clicking Add books. To convert to an ebook format, click Convert book. The most likely formats are EPUB and MOBI (Kindle), but others are also available. You can maintain multiple formats of the same title and click on the format to open in the summary pane for the selected file.
Either way, decide your next step by opening the ebook and examining the results. Some problems can be edited within Calibre (see below), but, especially in your first attempts, it may be easier to go back and edit the raw file.
Editing with Calibre
You can use Calibre's graphic interface to edit several things. By right-clicking on a title, you can edit an ebook's metadata (Figure 2). You can edit tags manually or download metadata from Amazon. From the same window, you can change or crop the title page.
However, most editing with Calibre's interface is reached by right-clicking and selecting the Edit book window (Figure 3). Much of the editing requires CSS knowledge. However, from the Calibre-generated ebook, you can often make small changes by modeling them on the existing code.
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
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.