Copyright

This document is Copyright © 2020 by Bruce Byfield, under the Creative Commons Attribution Sharealike License version 3.0 or later:  https://creativecommons.org/licenses/by-sa/3.0/

LibreOffice is a trademark of The Document Foundation, https://www.documentfoundation.org/. All other trademarks within this book belong to their respective owners.

Editor and publisher

Jean Hollis Weber, 544/ 60 North Beck Drive, Condon, Queensland 4815, Australia.

email: publisher@designingebooks.com

Publication date and software version

Published 31 January 2020. Based on LibreOffice Version 6.4 and later.

ISBN 978-1-921320-58-3 (print edition)

ODT, PDF, EPUB, and MOBI editions of this book are available for free download from:

https://designingebooks.com/

Photo credits

Cover photos are copyright by Bruce Byfield and released under the Creative Commons Attribution Sharealike License, version 3.0 or later.

For Trish, always

Chapter 1: Introduction

Ebooks are a major category in publishing. In 2017, over 266 million ebooks were published in the United States alone, accounting for over $350 million dollars in sales. The numbers and sales dip and rise over the years, but obviously ebooks are here to stay.

Much of the reason for the popularity of ebooks lies in the rise of self-publishing. Today, anyone with a computer can write a book and promote it on a site like Amazon, and plenty of people are eager to take advantage of this ease of publication.

However, one thing is missing: the ability to produce your own ebooks. None of the ebook formats are complicated, being based on the same HTML markup language used on web pages, yet producing an ebook remains a mystery to many. Although instructions are available across the web, the process is outside of many writers’ comfort zone. Many end up paying for ebook production, and if something goes wrong, are unable to fix the problem for themselves.

This book is designed to demystify ebook production. With the help of LibreOffice and Calibre, two applications that are free for the download, you can produce your own ebooks without paying extra.

The book explains several different ways that these applications can produce ebooks, and which is most likely to be the one you should choose. The goal is to demystify ebooks, and to teach self-publishers how to take control of production.

Understanding ebook formats

ebooks tend to be published in one of three formats. The first and oldest is PDF, a format developed by Adobe Systems. Before the other formats emerged, PDF used to be the preferred format for online publishing. It remains the format of choice when more is needed than a column of paragraphs. PDF has the advantage of being similar to Postscript, one of the languages used to send files from the computer to the printer, so that it is suited for complicated layouts, or for users to print their own copies.

The second format is EPUB, an open standard that is widely used. Whether you produce your ebook directly from LibreOffice or import it to Calibre for editing, you will be working with EPUB files, even if your goal is to prepare an ebook in another format. EPUB is a common standard that is useful for communication between different applications.

The third format is MOBI, that in modified form is used by Amazon Kindle. From Calibre, you can easily convert an EPUB file to MOBI, because both are based on HTML and use Cascading Style Sheets (CSS) for formatting. Other formats can also be converted from EPUB, although they will not be mentioned, since the process is similar to that of converting to MOBI.

Downloading the basic tools

Numerous tools are available for working with ebooks. I have chosen LibreOffice and Calibre both for their quality and for the fact that they are open source. “Open source” means that the applications are free to download, and can be installed on as many computers as you want.

LibreOffice is an alternative to Microsoft Office. Writer, LibreOffice’s word processor, is heavily based on styles, which make converting to EPUB from its files easier. LibreOffice is available for Linux, macOS, and Windows from: https://www.libreoffice.org/download/download/

Calibre is best-known as an ebook manager. Using Calibre, you can read ebooks, transfer them to an ebook reader, and find other ebooks online.

Less well-known is the fact that Calibre contains all the tools you need to design ebooks, including – as a last resort – an editor for making manual corrections.You can download Calibre for Linux, macOS, or Windows from:

https://calibre-ebook.com/download

Both download pages have installation instructions.

Overview

When you produce an ebook, you have several choices:

1. Format and write the raw document in LibreOffice Writer.

2. Do one of the following:

a. For simple documents, export to EPUB from LibreOffice.

b. For most documents, export to EPUB in Calibre.

c. For a complex layout, export to PDF.

d. Edit EPUB in Calibre.

3. If necessary, edit the CSS code manually.

The rest of this book details all these actions.

The steps in creating an ebook using open source tools.

Chapter 2: Building the source document

By far the best way to produce an ebook is to manually enter the CSS code. In that way, your document can come out exactly as you plan. However, many writers are uncomfortable with that option, leaving LibreOffice Writer a reasonable compromise.

Writer has the advantage of being a word processor, a tool with which most would-be authors are already familiar. True, many may be unfamiliar with Writer, but if they have used MS Word, then LibreOffice should be easy to learn. Moreover, Writer is more stable than MS Word, and is notably better able to handle large files.

However, the most important feature of LibreOffice Writer is that it relies heavily on styles. Styles are sets of formatting options that can be created once, then applied where needed. Should you want to change the formatting, you can change it in the style, and the entire document is updated in seconds. Not only do styles save time, but they are similar to the HTML tags within ebooks, which helps for a smoother export to EPUB. For these reasons, writers should familiarize themselves with paragraph and character styles before they write.

Other Writer styles for pages, frames, lists, and tables are irrelevant except for convenience, since EPUB format does not support Writer’s versions of them. Nor are Writer’s tools for text frames, tabs or cross-references supported. If you cannot do without these items, either you need to use a workaround or else add features once the file is transferred to  Calibre, entering the CSS code for yourself.

Note, too, that while you might logically assume that producing HTML would make conversion to EPUB easier, in practice, HTML offers no advantage. That being so, you may as well use the more human-friendly Open Document Format, to which LibreOffice Writer defaults.

In general, the basic rule for writing for ebook conversion should be: Keep it simple. The fewer character and paragraph styles used, the less likely something can go wrong, and the less you should have to edit from Calibre. For more complicated documents, the LibreOffice file can serve as a mockup of the finished ebook.

Follow these suggestions, and your production of an ebook should be trouble-free. If you are producing the ebook for someone else, try to get them to follow the guidelines in this chapter. Otherwise, the process can become difficult.

If this chapter starts to seem overly precise in its recommendations, remember that its recommendations are intended to make the process as trouble-free as possible.

Writing for a particular site

Before you spend any time writing, check any site where you plan to post for any formatting instructions. Many sites for ebooks will refuse anything that is not formatted exactly to their specifications, chiefly so that all the ebooks on the site have an identical look. Often, these specifications are completely arbitrary in the sense that you can write a properly formatted ebook that does not fit them.

These variations can be a nuisance if you are posting to more than one site and need to change the format – no denying. Unfortunately, though, your options are limited to following the specifications or not dealing with the site that relies on them. At least if you use styles, the problem of producing different versions of a document will be as simple and as quick as possible.

Working with styles

In case you have never worked with styles, here’s a quick introduction.

Styles are a collection of formatting choices. For example, a typical paragraph style would set things like the font, the indentation for the first line, and the space between lines. If you wanted to make different formatting choices than the main ones in a paragraph, you would use character styles to format only a part of a paragraph.

Paragraph vs. character styles

The advantage of using styles is that you can do the formatting once, rather than each time you need it. Given that getting the right formatting after conversion to EPUB sometimes involves a lot of trial and error, working in styles – especially for paragraphs – can save considerable time. Changing the details of a style is roughly equivalent to the number of keystrokes to change one instance of manual formatting, of which there can be hundreds in even a short file.

When you are editing an ebook, having used styles can save you time and effort. For example, I recently created an ebook for a writer who had used tabs to indent the first line of each paragraph. The tabs disappeared during EPUB conversion. The source file for the ebook was over 1500 pages, so recreating the indent manually would have taken hours. However, because only one paragraph style was used in the source file, I could correct the problem by adding an automatic indent for first lines in the paragraph style, a feature which does survive EPUB conversion. The time taken to add the automatic indent? Less than two minutes.

Besides paragraph and character styles, Writer also supports styles for pages, frames, lists, and tables. For your convenience, you might want to use some of these other styles, especially if you plan to convert to PDF format, which preserves all the settings in these styles without any difficulty.

However, EPUB format does not support Writer’s versions of them. Nor does it support Writer’s tools for text frames, tabs, or cross-references. If you cannot do without one of these features, you either need to use one of the workarounds mentioned in Chapter 3 or else add features once the file is transferred to Calibre; see Chapter 7.

You might logically assume that using only HTML-friendly styles would make conversion to EPUB easier, since EPUB files are basically modified HTML files. However, in practice, HTML offers no advantage. That being so, you may as well use the more human-friendly Open Document Format (ODF), to which LibreOffice Writer defaults. Since ODF is open source, Calibre has no problem in handling it.

Applying styles

To work with styles, you need to open the Styles and Formatting window in the sidebar. Do one of the following:

Select Styles | Manage Styles from the menu bar.

Press the F11 key.

Click More Styles...  in the Set Paragraph Style list on the Formatting tool bar.

Select the Styles button on the sidebar.

The Styles and Formatting window in Writer.

To the upper left of the window’s toolbar are icons to select the type of styles you want to list. Pause the cursor over an icon to see the style type.  For making an ebook, you only need to use the first two on the left, paragraph and character. The list of styles will highlight the style at the position of the cursor.

To apply a paragraph style, place the cursor anywhere in the paragraph that you wish to format. To apply a character style, select the text to format. Then, with either, click on the style to apply.

To modify a style, or to create a new style based on it, make a selection from the right-click menu.

At the bottom of the Styles and Formatting window is a drop-down list to filter the styles. After you have entered a page or two of text, changing the display to Applied Styles will give you a smaller list that is easier to select from.

Using the style windows

The window for each style throughout LibreOffice is divided into tabs.

Of all the tabs, the Organizer tab is most important. It summarizes the style and its relation to other styles. It has four fields:

Name: The entry in the Styles and Formatting window.

Next Style: The style you are in after you press the Enter key.

Inherit From: The style whose formatting is the basis for this style.

Category: The list view that includes the style.

In addition, the Organizer tab summarizes the formatting options selected for the style.

The window for the Text Body paragraph style.

Creating and modifying styles

LibreOffice has styles for most ordinary purposes, so one way to save time is to use only pre-defined styles, changing no more attributes than necessary. On the whole, the styles have intelligent defaults, and you usually only have to make a few changes while designing. When making an ebook, you can even confine yourself to pre-defined styles to keep the creation of the source file as simple as possible.

Creating a basic template

The LibreOffice file for this book can be used to create a template by saving it from File | Templates | Save as Template... If you make formatting changes only in the template, a file based on the template will offer you a chance to update the next time you open the file. If you do not update, then the file severs its connection with the template. Usually, you should keep the connection with the template.

Updating a file after its template has been modified.

To reduce maintenance, I suggest that you use the fewest possible paragraph and character styles. This ebook was designed for use with these styles:

Heading 1: For chapter titles; starts a new page during conversion to EPUB.

Text Heading: A heading style that will not start a new page during conversion to EPUB.

Text Heading 2: A sub-heading style that will not start a new page during conversion to EPUB.

Text Body: The basic style for text.

Numbered List: Use when the order of points matters.

Bullet List: For lists when the order does not matter.

Only three character styles are used: Emphasis (Italics), Internet Link, and Example (monospaced, for code).

I have chosen to use a color for headings and hyperlinks, although I realize that many readers will use their own preferences instead.

The template used for this ebook. To minimize the chance of problems, it features a minimum of character and paragraph files.

Chapter 3: Formatting the source file

For most people, the easiest place to format is in the LibreOffice Writer source file. As described later in this book, you can format using Calibre’s editing window, and even add CSS code manually – and, in some cases, you may have to in order to get the exact effects you want. However, the source file is usually the most convenient.

Always remember, though, that all the formatting available in Writer cannot be exported to EPUB format. Some of these limitations can be worked around, others added in CSS if you really want to use them.

Remember, too, what was emphasized in the last chapter: whenever possible, keep the formatting simple and use paragraph and character styles.

If you decide that styles are more than you care to learn, you should be able to figure out to format manually, using Writer’s menus and toolbars. However, if you do, you are making the work harder than it has to be, especially if you run into problems during conversion.

The rest of this chapter is organized by general tasks. Each section will tell what you can do or can’t do, and how to do each task within Writer.

Designing a page

Unlike Writer, ebooks do not use the concept of a page. You might have noticed that, when you are reading one, the bottom of the page lists the percentage of the file that you have read, rather than pages.

All the same, if your raw document is also going to be designed for hardcopy, you might want to format pages according to your publisher’s specifications about page size and margins. You can leave off page numbers, adding them plus a footer or header to place them only in the file used for hard copy.

The dialog window for Page styles.

To format a page in LibreOffice Writer, press F11 to open the Styles and Formatting window in the sidebar. Click on the list of Page styles and edit the pre-defined pages or design your own by right-clicking in the list and selecting New.

Pay close attention to the First Page, Default, Left Page, and Right Page styles, which are the ones you are likely to use most. Using the Next Style field on the Organizer tab, for a book to be printed you can easily set up a sequence in which a First Page style is followed automatically by a Left Page, which is followed by a Right Page, which is followed by a Left Page. For an ebook, you’re more likely to need only First Page and Default. Either way, if you do not set up the Next Style field, you will have to change Page Styles using Insert | Page or by manually adding page breaks using the Edit menu.

Selecting fonts

Font selection and formatting is best done in the Font and Font Effects tabs of a paragraph style. Pay particular attention to the Text Body paragraph style, which will probably be the one used more often. A complementary font can be used for headings and titles.

However, unless you plan to convert to PDF format, do not be too concerned with font characteristics. True, you can embed fonts in ebooks, but doing greatly increases the size of the final file. In a long book, the result might be larger than a publisher accepts.

Moreover, if the ebook file is read on a dedicated ebook reader, rather than on a computer, many readers will choose  the font they prefer, casting aside your carefully calculated effect.

If you do want control of fonts, you can exercise control using CSS (see Chapter 7). However, some of the options on the Font Effects tab, like Blinking or Embossed, are not available in any ebook format.

Except when converting to PDF format, content yourself with old standards, like Times New Roman or Helvetica or new standards like Calibri or Cambria.

For each style, press F11 and click the button in the upper left for paragraph styles. Find the paragraph styles Text Body and Heading 1, and select the font on the Font tab. Use the Regular (sometimes called Roman) style, and a size of 10-12 points for Text Body and no more than 18 points for any Heading style. Readers may also change the font size to suit themselves, but these choices will give a reasonable and readable default.

The Font tab for paragraph styles. The same tab is also used for character styles.

You may also want to switch to the list of character styles, and set the pre-defined Emphasis style to an italic version of the Text Body font, and the Strong style to a bold version. These styles override a paragraph’s formatting for selected characters. If you have links, you may want also want an Internet Links style.

In the windows for each style, you will also notice a Font Effects tab. Font Color is probably the most commonly used option on the Font Effects tab. However, most of the time, you can keep the setting on Automatic, which generally defaults to Black. Remember, too, that many ebook readers and application only support black and white, so choosing another color might be futile. At the most, changing the Font Color presents the ideal way you want the ebook to look.

The Font Effects tab for paragraph and character styles.

Adding images

Images include any graphic in standard formats like PNG, GIF, or JPEG. Diagrams or drawings done with LibreOffice Draw are not exported.

To add an image, select Insert | Image.

You can modify some image settings within Writer. For example, you can crop and resize an image. Right-click and select Properties to open the Image dialog.

All images, as well as their alignment and any resizing made from within Writer, are preserved during conversion. Any cropping made from within Writer is dropped in conversion, as well as any borders or shadow.

The dialog window for resizing images.

You can edit images in an open source editor like the GIMP, which is available for Linux, macOS, and Windows from: https://www.gimp.org/downloads/

Right-click and select Edit with External Tool to open the image in your computer’s default graphics editor. After editing the image externally, select Select All then Copy, and paste it into the LibreOffice Writer file.

All images should be a minimum of 72dpi for online viewing. If you want people to be able to print from your ebook, then use at least 300dpi.

Writer’s caption tool usually keeps a caption and its image together, but the conversion to an ebook format can be erratic. For simplicity’s sake, you may prefer to make the caption part of the image, but be sure to use the same fonts and font sizes as in the main body of the text.

Anchoring images (or an image plus its caption) As Character in a separate paragraph converts reliably.

Use the settings Above and Below to help position an image. You can use the text wrap, but a less difficult choice is to use no wrap at all. If necessary, include white space in the image so that the image spans the entire space between your page margins.

In case of conversion problems, you may want to add an alternative text to the Options tab of an image’s properties. The alternative displays in place of the image to tell readers about the contents of the missing image.

As you add images, keep in mind that, during EPUB conversion, the first image in the source file is set as the cover image. While you can change the cover image in Calibre, inserting it in the source file is one less thing to do after export. In most cases, the first image should include the title and the author.

Using tables

EPUB conversion of tables is erratic, and apparently dependent the operating system. In at least some cases, only the text of tables and not their borders are exported.

As Chapter 7 shows, you can create a table manually using CSS tags, although the process is complicated. Instead, you can create a table as an image. A table image should include Alternative Text, entered in the Options tab of the Image dialog window. In either case, just make sure that the image uses the same font and font size as the paragraph styles in the document itself.

Making lists

Most formatting is lost when exporting from LibreOffice. If lists are important to your work, you should use CSS. Otherwise, you might settle for manually entering lists, typing numbers and adding bullets as special characters.

Use a numbered list when the order of items matters, and a bullet list when it does not. For example, use a numbered list in a how-to, and a bullet list for a grocery list. Both should be used only with three or more items. Two items are placed in the ordinary text.

Punctuation at the end of an item should be consistent throughout. When list items are short, you may choose not to use any punctuation.

To avoid potential problems, do not use a graphic bullet. However, you can use any special character as a bullet if you choose.

To use a special character, click Insert | Special Character and insert your selection in  the text. This method converts to EPUB format, but may not be accepted on all sites. Also, you will not be able to align a second line with the text on the first line of the list item. Instead, the second line will start directly below the number or bullet. As a result, keep list items to a length of less than one line with this method.

Writer’s Special Character window. You can insert a bullet manually using the character 7th from the left in the bottom row.

The second choice is to add lists using CSS. This method has the advantage of solving format problems. However, working with some publishers’ format specifications, you may not be able to use a CSS list.

Working with frames and columns

Frames and columns are dropped during conversion to EPUB. Most users should content themselves with simpler designs that do not require these features. An image can be substituted for these features, using the same font and font size as the Text Body paragraph style, or a column can be constructed using CSS (see Chapter 7).

One partial exception is a drop cap created from the Drop Caps tab of a paragraph style. During conversion to EPUB, the frame is dropped, but the drop capital is preserved.

Setting paragraph positioning

Paragraph positioning settings convert to EPUB without any problem. In a Paragraph style window, two main tabs contain positioning settings.

The Indents and Spacing tab has settings for indenting text, the space above and below paragraphs, and the space between lines. In addition, you can set an automatic indent for a new paragraph, but give more space than you think you need – the export may trim the sizes of the indent.

The Indents and Spacing tab for a paragraph style.

The Alignment tab sets how a paragraph sits on lines. Many people will choose Justified, so that text runs the entire length of a line from left to right.

However, justified lines take a lot of tweaking to get right, and a change of font size undoes all the effort. A Left alignment looks almost as good, and requires no tweaking.

Center and Right alignments are for more complicated layouts like a brochure. If your ebook is mostly text, you might not use Center and Right alignments at all.

You may also choose to go to the Text Flow tab to add a page break so that a new chapter always starts on a new page. Sometimes, you may want to add a manual page break, selecting Insert | Page Break. For instance, you might use a page break to separate a table of contents from the main text. Do not use hyphens or orphan and widow controls, because line breaks may shift during conversion to EPUB format.

The Alignment tab of a paragraph style.

Working with links

Internet links survive export. To add a link, select the text, then Insert | Hyperlink.

Cross-references do not always survive export. Instead, click Insert | Bookmark....

Creating a table of contents

When you use paragraph styles, you can quickly create a table of contents (TOC) or another reference table in Writer. Position the cursor where you want to place the table, and click Insert | Table of Contents and Index | Table of Contents, Index or Bibliography.... So long as Type | Create From | Outline is selected, the table will be created automatically using all the Heading styles in the document.

The Table of Contents dialog window.

Remember, though, that one ebook option is to start a new page each time a Heading style is used. This option might make for short pages, creating a look you do not want. For this reason, you might want to create a new style with a different name to use as a heading. You can add this new style to the TOC by selecting Type | Add Style | Assign Styles... and setting its heading level. During conversion, this new style will not start a new page each time it is used.

You can structure TOC entries in the Entries tab. At the top of the tab is a simple diagram for structuring entries. Since ebooks use pages differently from the printed page, you do not need a page number, or to set up the space between an entry and its page number in most cases. In the Structures field at the top of the tab, click all unnecessary building blocks until only the entry and the hyperlink remain. The field should read LS E LE. LS stands for Link Start and LE for Link End.

Tables of Contents can be customized using building blocks.

With PDF files, you may want to keep or add other building blocks.

In the Styles tab, you can edit the Contents styles used in the TOC. Since ebooks are read online, be generous with the line spacing between entries to make reading easier. You might want to experiment with other tabs in the dialog window, but for ebooks these are mostly complications.

Clicking OK places the TOC at the current cursor position. Right-click to update, edit, or delete the TOC.

Preparing for export

The source file is by far the easiest place to make corrections. Before exporting, check spelling and grammar with Tools | Spelling. Since the conversion process reformats, do not worry about hyphenation.

For an overview of your document, click File | Print Preview.  Print Preview is also useful for checking page breaks on hard copy.

Finding more information

Although I have tried to give enough information about Writer to get you up and running, a handful of pages cannot be a complete guide. If you need more information, or want a detailed overview of Writer, you can download or buy a hard copy of my book, Designing with LibreOffice, from:

http://designingwithlibreoffice.com/download-buy/

However, an ebook is simple enough that you may not need detailed information.

Chapter 4: Creating the ebook

When you finish writing and formatting the document, the next step is to create the ebook. You can:

Export to EPUB format directly from Writer.

Save the file in ODT format, then open it in Calibre (recommended).

Export as a PDF file directly from Writer (see Chapter 5).

Which option you choose depends on how complicated the formatting is and what you want to do with the source file. Be prepared to experiment to get the results you need.

Exporting from Writer

As explained in Chapter 3, LibreOffice Writer’s EPUB export does not support many features – and some will likely continue to be unsupported. However, if your document has an uncomplicated layout, you may be able to use Writer’s EPUB export tool. The EPUB of this book was created that way.

If you decide on this method, start by trying the default settings by clicking File | Export As | Export Directly as EPUB. A file manager opens to add the name and path for the .EPUB file, then Writer creates the file without any more input from you.

However, if this method does not give acceptable results, try File | Export As | Export as EPUB.... This option gives you a bit of input into how the file is constructed and looks.

You may be able to create an EPUB file directly from Writer.

You can control:

Version: EPUB 3.0 is currently the most popular version. However, some sites continue to use EPUB 2.0. Try version 3.0 first. If it doesn’t work, try version 2.0. Version 2.0 may not support all the formatting you want.

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 may be 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 source file. Of the two, Heading requires the least work and maintenance.

Layout Method: Choose Reflowable to have the ebook display change according to screen and window size, or Fixed to have the ebook layout remain the same under all conditions. Most readers are likely to prefer Reflowable, but you might choose Fixed if formatting is important to you. In particular, Fixed 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. These fields provide another chance to edit metadata that is picked up by default from File | Properties in Writer.

If you do not change any of the settings, Writer’s default ones are used.

A third alternative is to export multiple files while working from the command line in the directory where the files are stored. In Windows, the command is:

C:\LibreOffice\program\soffice.exe" --headless --convert-to epub "%f"

In Linux or macOS, the command is:

soffice --headless --convert-to epub *.*

Checking the result

Whatever method you use, open all the newly created files in  an ebook reader like Calibre (see Chapter 6) and check the layout, preferably line by line.

If you cannot create a satisfactory EPUB file using Writer’s export tools, then save the raw document as an .ODT (LibreOffice) file and then import it into Calibre.

To import into Calibre, start Calibre, select Add books, and navigate to the Writer .ODT file. Calibre fully supports Writer files, but does not support MS Word format, which is a main reason why you should work with LibreOffice.

When the .ODT file is registered with Calibre, highlight the file to see a summary of some of its main characteristics in Calibre’s righthand pane. The format, unsurprisingly, is ODT. Click Convert books, and you can output one format at a time.

The summary of an ebook in Calibre.

The dialog window for format conversion shows the original format in the upper left, and the format to convert to in the upper right. If you are just viewing the file information, both the original and import format are listed as EPUB.

The dialog window also has fields for specifying the cover image, and for setting basic metadata, such as Title, Author, Author Sort (within Calibre’s main book listing), Publisher, Tags, and Series, and an unnamed field for any comments.

Once the settings are entered, click the OK button at the bottom right. As the converted file is created, you are returned to the Calibre main menu.

When a title is selected from the main menu, the right pane shows all the different formats in which the title is available. Click on a format in the right pane to open it.

Chapter 5: Preparing PDF Files

PDF files may seem old-fashioned today compared to other ebook formats. However, PDF (Portable Document Format) remains the file type of choice for highly formatted documents such as reports, especially ones that are meant to be printed. If LibreOffice Writer or any other word processor can support a feature, then so can the PDF format. In addition, Writer’s PDF export tool has a wide variety of well-tested options.

The main disadvantage of PDF format is that its files are much larger than EPUBs, especially when a file includes many images. That is only natural, since PDF format contains much more information. However, given the amount of memory on modern computers, the size of PDFs is usually only a problem when they are posted online.

Exporting to PDF

Compared to any other ebook format, PDF or Acrobat format is trouble-free. The PDF format is closely related to Postscript, one of the standard languages used to communicate with printers, and that means that anything you can do in Writer will display perfectly in a PDF file. In fact, PDF used to be the main choice for online documents. However, it is less flexible than ebook formats when used in readers, and results in files that are three or four times larger than the same document in EPUB or MOBI.

Like with EPUB exports, PDF exports are made from Writer’s File | Export As sub-menu. And similar to EPUB exports, PDF exports can be made using Writer’s defaults by clicking Export Directly to PDF in the sub-menu, or customized by clicking Export as PDF.... However, because PDF export has been available for over a decade in Writer, the customization options are much more extensive.

PDF options are much more extensive than EPUB options.

The following sections explain some of the choices you can make when customizing PDF export.

Setting the page range

By default, all the pages are printed when you export from Writer to PDF. However, from General | Range in the PDF Options dialog window, you can also export a range of pages, or a passage selected by a mouse.

Setting image quality

Images account for much of the size of PDF files. If quality is your priority, then select General | Images | Lossless compression in the PDF Options dialog window.

Alternatively, choose General | Images | JPEG compression, and set the percentage of compression to use in the Quality field. The higher the percentage, the smaller the exported PDF will be, but the longer the file will take to load.

You can also set the general resolution for the PDF in General | Reduce image resolution. For online viewing, you can go as low as 72dpi (dots per inch), but if you want readers to be able to print the file, you can also increase the resolution, despite the name of the field. For printing, use a minimum of 300dpi. For high quality, you can go as high as 600dpi. Anything higher will probably increase the size to no useful purpose, since many printers do not support any higher resolution.

When exporting from Writer, you can also add text as a watermark from General | Watermark. A watermark might show the name of the company using the watermark, or some sort of instruction for users, such as “Draft” or “Private.” A watermark is also sometimes used as an anti-theft device, since it is difficult to remove.

Selecting a PDF type

LibreOffice and related apps have supported the PDF format for over a decade.

Most people exporting PDF from LibreOffice just use the default settings, exporting to PDF as quickly as possible. However, those who are more hands-on know that they can do more than accept the default. On the General tab, those options include four variants of the PDF format: Hybrid, Archival, Tagged PDFs, and PDF Forms. Each of these PDF types require different preparation.

Hybrids

Hybrid PDFs are two files in one: a PDF file, and an Open Document Format (ODT) file. ODT is the default format for LibreOffice Writer. A hybrid acts like a normal PDF file in a reader, but can open in the Writer for editing.

Why would you want a hybrid? The reason is simple. LibreOffice has supported editing for PDF files in Draw for years. Draw is a useful viewer for PDF, because it supports multiple pages and includes a pane for jumping from one page to another, just like a dedicated PDF reader.

However, how much you can edit is limited. Images can be edited freely, but text in a PDF is structured line by line. You can change words within a line, and if there is enough white space, you can even add a line. However, any changes longer than a line requires editing the line below as well. In no time at all, you can have cascading changes and endless lines to edit. More substantial edits, such as adding or deleting a paragraph – let alone a page – can be almost impossible.

By contrast, the ODT file in a hybrid opens in  LibreOffice Writer and can be edited as easily as the original file. When you are finished, the changes are passed on to the hybrid’s PDF as you save. What might take an hour to edit in an ordinary PDF can be reduced to a couple of minutes in a hybrid.

As a side benefit, you can store both formats in the same document, reducing the number of files you need to track.

One drawback to a hybrid is that it is two files in one, and therefore about fifty percent larger than an ordinary PDF file. Another is that there is no way to identify a hybrid in a file manager. You can only open the hybrid in LibreOffice and check which LibreOffice module it opens in. Yet even that may not help, because tagged, ordinary PDFs, and hybrids created in Draw will all open in Draw. The easiest way to identify hybrids is simply to save all of them to a directory called Hybrid PDFs.

Archive PDFs

Changing formats – especially proprietary ones – means that the software needed to read and edit documents written today may not be available at some point in the future. Open source formats are generally considered the best hedge against this possibility, but Adobe has released an open standards solution in the form of PDF/A (ISO19005-1). In the short term, the format is useful for ensuring that a PDF can be read on any system, regardless of its resources.

A PDF/A file is a PDF that contains everything necessary to display the file, embedding fonts, images, and anything else that the document requires. In addition, when creating an archive file you might want to fill out the fields in Writer’s Tools | Options | User l Data, as well as the meta-data fields in Files | Properties. In particular, the Description and Custom Properties tabs can be used. Include any information that you think someone else using the file might need to know.

Note that Archived PDF files can be huge, especially if a document contains several different fonts. To give you an  idea, an Archived PDF file with no images that uses a single font is almost half as big again as the same document in an ordinary PDF.

Tagged PDF

Tagged PDFs have several advantages over ordinary PDFs while adding little to the file size. In fact, online, you can often find suggestions that everyone should be using Tagged PDFs.

Tagged PDF contains meta-information about the structure and layout of the document, adding far more details than are contained in an ordinary PDF, which is formatted by the position of lines on a page. This information is unseen in PDF readers, but has a number of advantages.

To start with, a Tagged PDF opens quicker. For another, when all or part of a file is copied to another application, it displays as a single graphic file and does not need to be reformatted, which makes recovery of information easier, as well as making reading easier for other applications, such as accessibility tools, to import and manipulate the file. Other tags can also be added, such as geographic information. In general, a Tagged PDF makes the PDF format easier to work with, although it opens in Draw in LibreOffice.

PDF Forms

PDF Forms can be filled in by users and emailed from a web page with a simple script (examples of which can be found online for different programming languages, such as Javascript or Python). To make a form, open a new Writer file and select View | Toolbars | Form Controls. If you are doing a long, complicated form, you might also select the Form Design toolbar, which contains such useful tools as the Form Navigator, as well as buttons for toggling the design grid. Otherwise, you can get by with just the Form Controls toolbar.

To begin designing a form, toggle on Design Mode in the Form Design toolbar. You can add all the usual widgets to the form, defining their size and position with the mouse. Available widgets include input fields, option buttons, check boxes, and combo boxes. Each widget can be further defined by clicking on it and making selections from the Properties Checkbox dialog window.

When you are finished, save the form and select File | Export As | Export as PDF... | General | Create PDF form. You will also need to make a choice from the Submit format combo box to choose a format that completed forms will be sent in: FDF, PDF, HTML, or XML. You can check the results by opening the resulting PDF and trying to write in a field or use a widget.

Combining PDF types

To some extent, these different types of PDF can be combined. You can combine a Hybrid and Archive PDF without difficulty, or use either with a PDF form. However, there would be no point in using a PDF Form or an Archive with a Tagged PDF, because their purposes are more or less opposing ones.

And if you choose File | Export As | Export As PDF, simply accepting LibreOffice’s default settings? Then your only concern is to name the file you produce. I have not found a complete list of defaults for PDF export, but presumably the settings are those that are active when you open the PDF Options dialog window, including JPEG Compression set at 90%, Tagged PDF, and Export Bookmarks. These defaults work extremely well for many purposes, but it can be useful to remember that they are not the only options when you create PDFs from LibreOffice.

Setting export options

Located on the General tab of the PDF Options dialog window, the export options set what is – and is not – exported to the PDF file. Options are:

Bookmarks: Created from Heading paragraph styles in the source file. Called Outlines in LibreOffice 7.0 and later.

Placeholders: Fields to mark the content to add (Insert | Fields).

Comments: Remarks made during collaboration (Insert | Comments).

Blank pages: Automatically added for book layout purposes (Page | Page Layout in page styles).

Select View PDF after export to automatically open the resulting file to view it.

Customizing the initial view

The Initial View tab in the PDF Options dialog window sets how the file looks when it first opens. Users can change the view to suit themselves, but you might want to set the default view to emphasize an image.

You can set several features for the initial view:

Panes: Whether the page, bookmarks, and thumbnails display.

Magnification: fit to window, width, visible, or zoom.

Page Layout: single page, continuous column, or facing pages.

Which you use is largely a matter of choice, and not of contrasting advantages.

Options for customizing a PDF’s initial view.

Customizing the window

On the User Interface tab in the PDF Options dialog window, under Windows Options, you can:

Use the first page as a guide for the size of the window.

Center the window on the screen when the PDF opens.

Open the PDF window in full screen mode.

Display the title of the document in the title bar.

Under User Interface Options, you can chose what widgets to display, such as the menu or the toolbar.

Window options for a PDF file.

A PDF file’s bookmarks are created from the header paragraph styles used in the document. Each header style is the child of the one above it, which means that changes to the settings of a top header style changes the styles below it, a hierarchy that makes editing and revisions easier. You have the choice to display all bookmarks, or the number of levels in header styles to use, starting with Header 1 at the top.

The User Interface tab also includes a Transitions section. This section is used for raw documents that are Impress presentations. For Writer documents like the ones you are using, the section is grayed out and unavailable.

Handling links

The Links tab is a collection of settings that affect how bookmarks and hyperlinks function in the exported PDF.

Link options for PDF files.

The three options under General can all be selected at the same time:

Export bookmarks as named destinations: Allows objects in the PDF such as images to be linked to, both internally and with other documents.

Convert document references to PDF targets: Objects such as images can be used as links.

Export URLs relative to file system: Allows partial links to be used. For example, if you wanted to refer to a file in the same directory, then you could simply name the file, instead of giving the absolute or complete file path. Similarly, a file in a sub-directory would only need the sub-directory’s and the file’s name in the path.

By contrast, options under Cross document links are mutually exclusive of each other:

Default: Links from the PDF to other files will be treated according to your operating system’s defaults. Since the specifics of this setting can differ, do not use this option in a PDF to be used on more than one operating system.

Open with PDF reader application: If possible, a linked file will open in the application used to display the PDF.

Open with Internet browser: If possible, a linked file will open in your system’s default Internet browser.

Setting security options

Security in PDF files can be easily broken. It really only restricts inexperienced users, while annoying those with the knowledge to bypass the restrictions. For this reason, security options should not be relied upon. However, if you want to use security options anyway, you can use the options on the Security tab of the PDF Export dialog window to provide minimal password protection.

You can set two passwords: one to open the document, and one to restrict how the document can be used, the permission password. The options available on the right of the tab are grayed out until the permission password is defined and enabled.

The available permissions are divided into three categories:

Printing: no printing, low resolution (150dpi) or high resolution.

Changes: none, page orientation, filling forms, comments, any.

Content: copying, use by accessibility tools.

In each category, permissions range from complete restrictions to enabling distinct features.

The Security tab provides only light protection for PDFs.

These restrictions date from a less security-conscious era, and the reasons for them may seem arbitrary today.

In fact, before setting permissions on a PDF file, you might ask if doing so is worth the effort. As noted earlier, PDFs have been notorious for security weaknesses, and all that permissions are really useful for is for controlling the behavior of unsophisticated users. Anyone who really wants to bypass the password and the permissions will find a way to do.

Note, also, that some online publishers may not accept a password-protected PDF.

Advanced options for security

For advanced users, two secure alternatives to permissions are available from File | Export As | Export As PDF... | PDF Options | Digital Signatures. These alternatives do not allow fine-tuning how a PDF file can be used or edited, but they do provide stronger security than permissions. In addition, they guarantee that a sent file is actually from you.

Advanced users can turn to the Digital Signatures tab for strong PDF security.

These alternatives are to obtain a digital certificate from a Certificate Authority, or to generate personal keys yourself. Certificates and keys are simply alternative names for the same tool: a passphrase-protected system of encryption. They both consist of a private certificate or key and a public one that the recipient must be sent in order to read the files you send. As the originator, you can use the certificate or key to read your own encrypted files.

Digital certificates are probably best-known in corporate circles. They require interacting with a Certificate Authority, whose reputation presumably adds weight to the authenticity of the certificate you receive from it. The exact details of using a certificate varies with the Certificate Authority, your browser, and your version of LibreOffice. Probably this process is more complicated than most readers will prefer, but for the few who want it, here is a summary of the general steps:

Sign into a free-cost Certificate Authority site like the Linux Foundation’s Let’s Encrypt and follow the steps to generate a certificate.

Locate the certificate in your web browser’s preferences or set up and make it available for files.

Depending on the version of LibreOffice, you may need to make Writer aware of the certificate using File | Digital Signature | Digital Signatures...,  then restart Writer.

Add the certificate to the PDF file using File | Export As | | Export As PDF ... | PDF Options | Digital Signatures, and fill out the required information. Alternatively, use File | Digital Signature | to add a certificate to an already generated PDF.

However, using a digital signature can be an involved process. Despite the name, in recent versions of Writer, the Digital Signatures tab also recognizes keys created using a variant of PGP (Pretty Good Privacy), such as GPG (GNU Privacy Guard). Using GPG, in effect, you sacrifice whatever reassurances using a Certificate Authority may have for the convenience of doing everything yourself .

If you already used GPG, the process of adding a key to a PDF file is similar to any other use. To generate keys with GPG, run the command:

gpg --full-generate-key

GPG takes you through the five steps in creating keys: adding your name and email,  creating a passphrase, choosing the algorithm, setting the key size, and assigning an expiry date. If you are unsure about some of the technical choices, you can always accept the defaults. As a last step, you should create a revocation certificate so that you can make the new key invalid if it is every compromised with the command:

gpg --armor --output revoke.asc --gen-revoke PUBLIC KEY ID

The key can be selected and details added on the Security tab of the PDF Options window.

Once the key is created, you can send out the public key with

gpg --output YOURNAME.gpg --export KEY-EMAIL

or as a protected plain text file with the format:

gpg --armor --output YOURNAME.gpg --export KEY-EMAIL

The key can be selected and details added on the Security tab of the PDF Options dialog window.

Recipients of the file can verify it is from you with:

gpg --fingerprint KEY-EMAIL

Then create a decrypted copy of the file with:

gpg --decrypt ENCRYPTED-FILE

The file’s text appears in the command line, and an unencrypted version of the file in the same directory as the encrypted file.

Whether you choose a certificate or a GPG key depends on your preferences and convenience. From a security viewpoint, one is generally as secure as another, except that different certificate authorities may default to different levels of encryption.

If you are not familiar with public key encryption, refer to:

https://en.wikipedia.org/wiki/Public-key_cryptography

If you use either of these methods of encryption, be sure to keep track of where you store certificates and keys. If you lose them, you will be unable to recover encrypted files.

Editing PDF files

To edit a PDF file freely, choose File | Export as | Export as PDF...| General | Hybrid PDF (embed ODF file) when creating a PDF. A hybrid file functions like a normal PDF, but includes a copy of the file in LibreOffice’s default ODT format. If you open the hybrid file in LibreOffice, it will open in Writer, and can be edited freely. When you save, the PDF in the file will be updated as well.

By contrast, other PDFs will open in Draw, LibreOffice’s image editing module. If the PDF has more than one page, click View | Page Pane to see all the pages in a pane on the left side of the editing window.

Images can be edited freely in Draw. Even a single line of text can often be edited fairly easily, especially if there is white space for extra lines. The trouble comes when there is no space for changing more than a few words without creating a new line that obscures an already existing line. The PDF format defines a document line by line, with the result that no more than more than a word or two can be corrected. Too often, you can get caught up with cascading edits, having to edit line after line. For this reason, you will have an easier time if you can revise in the original Writer source file and export a revised PDF file. What can take twenty minutes in Draw will probably take seconds in Writer.

PDFs can be read, but not edited in Calibre.

Chapter 6: Editing ebooks in Calibre

The Writer source file is the easiest place to edit content and format. However, exporting to EPUB format can sometimes introduce its own changes, especially when you are new to the process. In addition, some advanced formatting needs to be introduced after export. Much of this formatting can be done by converting the Writer ODT file EPUB, then using Calibre’s graphical tools.

EPUB files can be edited once they are exported, as described in Chapter 4. Some simple formatting, such as adding metadata or changing the cover, can be done directly from Calibre’s graphical interface. Other advanced formatting requires manual editing in Calibre’s text editor. This chapter serves as a guide for editing from within Calibre, from the simplest revisions to the most advanced.

Editing metadata

One of the first things to edit in a newly converted ebook is the metadata. Metadata are tags that describe the ebook, helping readers to find them in a web search. Metadata appears at the top of EPUB file. During any type of conversion, basic metadata is created based on the information in Writer found in Files | Properties and Tools | Options | LibreOffice | User Data. This basic data includes such information as the author and the title. If you have kept the information in both places up to date, you may decide not to add additional metadata.

However, you may want to add additional metadata to help readers to locate your ebook. For instance, you might want to add a version number for the ebook, the ISBN, and a language. Other information might include various words and short phrases that describe the contents of the ebook. For example, for this ebook, I would include ebooks, EPUB, Amazon Kindle, do-it-yourself ebooks, LibreOffice Writer, and Calibre.

Calibre’s window for entering metadata.

The more metadata tags you include, the easier your ebook will be to find in the immensity of the Internet. Just make sure that all the tags are relevant to the contents, or searchers may be annoyed at being misled. This information will need to be entered manually in Calibre’s window for entering basic metadata.

To enter metadata, select a title in the Calibre main window and right-click for options. You can edit the metadata for individual books or for multiple books – such as a series – all at the same time.

You must edit one format at a time, choosing from the top right of the window. Changes made in an EPUB version, for example, are not added automatically to a MOBI version. You can add your own tags in a comma-separated list in the tag field one per line, or, more conveniently, in the Comments editor on the right, using either the Normal View or the HTML View. Alternatively, you can create a text file with one line per tag.When you are done, click the OK button to save your edits.

Other ways to add metadata including the Download button to import data for a published book from Amazon or Google. The search may take a minute or so to complete. From the main Calibre window, you can also right-click to copy metadata to use it for another book.

Setting the cover

When Calibre converts a Writer document, it takes the first graphic as the cover unless another one is specified. Calibre lumps the cover in with the metadata, so editing the cover requires selecting a title in the Calibre main window, and clicking an option for metadata from the right-click menu.

The Edit Metadata dialog contains several options for editing covers about a third of the way down the window:

Browse: Add an image for the cover using a file manager.

Remove: Delete the current cover.

Trim border: Remove any white space around the cover.

Download cover: Add image for the cover from the Internet.

Generate cover: Have Calibre create a simple, stylized cover.

The pane to the left shows a preview of the selected cover.

Calibre and the EPUB format support most popular graphics formats, so you have the widest possible choice of covers.

Starting Calibre’s editor

XHTML files, like those used in an ebook, consist of text plus CSS tags for setting formatting. For this reason everything in an ebook file can be edited in a text editor. Most people probably prefer not to use a text editor, but it is not only easier than it first appears, but at times the only way to get the formatting you want.

To open Calibre’s text editor, right-click on a book title from the main page, and select Edit book. When the editor opens, you will see five panes:

Check book: Two panes for validating the ebook. Ignore for now.

File browser: A table of contents for the files in the ebook.

File editor: A editable view showing both text and .CSS files.

File preview: An uneditable view of formatted text for navigation.

The default view of the Calibre editing window. More panes can be opened, and opened panes can be moved and resized.

If you have created the ebook with Writer and Calibre, your ebook will consist of multiple files. Unless you create an ebook entirely in a text editor, there is no way to force the ebook to consist of a single file. In fact, you probably want multiple files rather than a single one, so that the ebook loads quickly.

To edit a file, double-click on it. The clicked file displays in the file editor and preview. The default names are not memorable, so you might right-click on each file and give it a memorable name so you can find passages more easily. The alternative is to navigate with only the editor and preview for landmarks, which can take some time.

Right-click on any of the content files and you can:

Replace an existing file with another in the same format.

Mark a file as the cover page.

Delete the file.

Link to a .CSS style sheet other than the default one.

Managing fonts

Choose Tools | Manage fonts to edit how the ebook uses fonts. This selection opens the Manage Fonts window, from which you can:

Change selected fonts: Affects the default view only. Readers may choose their own fonts.

Remove selected fonts

Embed all fonts (embed complete sets of fonts)

Subset all fonts (embed only font weights actually used. Recommended setting)

Font information takes up a lot of space, so the fewer fonts you have embedded, the quicker the ebook will load. Embedding only the weights actually used  will further reduce font size.

If you want to change selected fonts, you can use Add Fonts at the bottom left to make other fonts available.

The Calibre window for editing fonts.

Editing text

Text cannot be edited in the file preview of Calibre’s editor. It can only be edited from the text editor. Given that the editor has limited space, you might want to confine yourself to only small bits of editing, returning to Writer to make any major changes.

However, you can enlarge the text editor to make it easier to work with in three ways:

Dragging with the mouse on the sides to enlarge the window.

Enlarging the window by clicking the flower icon in the toolbar.

Closing other panes that you are not currently using.

You may also choose to write text and CSS tags in another text editor, and then copy and paste into the Calibre editing window.

Below the list of files that make up the ebook are other aspects you can edit by right-clicking on them.

Editing images

The list of images in an ebook.

The images in the ebook are listed towards the bottom of the file browser in the left hand column. View images by double-clicking them, and replace them from the right-click menu. If you want to add more images, either go back and create another LibreOffice source file (see Chapter 2) or else manually add a file using CSS tags (see Chapter 7).

Editing style sheets

Style sheets are lists of formatting options used for the CSS in an ebook’s files. Usually, only one style sheet exists. The style sheet generated during export is all that you need. However, you can upload another style sheet with the same styles to give some sections of the ebook a different look (see Chapter 7).

The contents of a typical style sheet, showing the formatting for individual styles.

Using Calibre’s Table of Contents

Calibre’s Table of Contents is the easiest way to  navigate an ebook, or to rearrange the order of files. Do not confuse it with the Table of Contents within the ebook. Calibre’s is for editing, the ebook’s is for readers.

To edit Calibre’s Table of Contents, select Tools | Table of Contents. The Table of Contents displays in the left hand column, and right-clicking on the display opens the TOC Edit window. From there, you can:

Generate a new TOC from headings or other sources.

Add a new entry.

Move entries and the contents to which they refer to a new location.

Calibre’s window for a table of contents.

Creating checkpoints

Editing an ebook can be an endless series of trials and error. You can save snapshots of the current state of an ebook by selecting Edit | Create checkpoint. To return to a checkpoint, use Edit | Revert.

Checkpoints make editing easier within Calibre.

Finishing the edit

After you have done all the necessary editing in Calibre, you can add finishing touches from the Tools menu. Some items are for experts only, but everyone can benefit from:

Smarten punctuation: Add smart or curly quotation marks.

Compress images losslessly: Reduce file size while keeping high-quality images.

Check spelling: Spell checking organized by word, not paragraphs. CSS tags are omitted. Work with the Writer source file open for reference.

Check book: Validating the structure of the ebook. Results display at the top of the window. You can then attempt to correct errors. This is one tool that you should also use when you are finished editing.

The Check book pane is a quick way to  correct errors in an ebook.

When you are done, be sure to save the edited files. If you need further changes, you will have to add CSS manually (see Chapter 7).

Converting to other formats

When you have finished editing the EPUB, you can convert it to another ebook format, such as MOBI, by selecting the title in Calibre’s list and right-clicking Convert Books. Books can be converted individually or together.

A variety of tools are listed on the left side of the conversion window, but in practice these should not be needed, unless you are converting multiple books and want all of them to have a uniform look. The only tools you will aways need are the source format in the upper left of the window, and the output format in the upper right.

After perfecting an EPUB version of the ebook, conversion to another format can be done in minutes.

When the conversion is complete, the available formats are listed in the right hand pane of the main window as one of the details about the book.

Advanced editing

The Convert Books function includes tools to improve the layout when you produce an ebook in another format. These tools can also be used to produce a fresh copy of an existing copy with an improved layout. Often, you will not need to use these tools, but Calibre is such a complex application that sometimes the routine conversion produces errors.

Sometimes, whatever causes these error is corrected in the next release of Calibre. If you cannot wait, the Calibre download page includes early versions that might work better than the current one. However, finding a working early version is a matter of trial and error, unless you find and record a working version.

If switching versions does not help you, or if you cannot wait, the tools listed below can sometimes help.

The tools on the left pane of the Convert window can sometimes correct formatting problems caused by conversion.

Remember to work with a backup copy of the file as you experiment.

The exact tools differ with the input format for conversion. Some useful tools are:

• Look and feel: How Calibre handles the first image in the file (the default title page), fonts, and some spacing in the layout.

Look and feel includes basic layout features.

• Heuristic processing: How automatic conversion operates. Disabled by default.

Heuristic processing controls automatic format conversions.

•  Page setup: Layout for specific ereaders. This setting is primarily for individual use, but might sometimes solve layout problems not solvable in any other way.

Page layout customizes for a specific model of ereaders.

•  Structure detection: Settings for chapter and page breaks. Contary to the icon, it does not affect lists.

At first, the sample field entries may seem intimidating. However, if you look more closely, you will see that they are either HTML paragraph styles, the names of Writer paragraph styles, or the names of formatting characters that are normally invisible in Writer. If you open any Writer document and change the settings in the View menu and select Formatting marks, you will see the information you need to edit Structure detection.

Structure detections set chapter and page breaks.

•  Search and Replace: Changes strings of characters in the output.  Like Heuristic processing, except that changes are made manually.

Search and replace controls conversion manually. It is especially useful for making small changes for updating an ebook.

•  EPUB output: Settings specific to EPUB format. You may recognize some of these settings, such as the version of the EPUB format, from the Writer conversion tools.

EPUB output settings. MOBI and other ebook formats have their own output settings.

Other formats have their own output settings.

These tools are barely documented, so you will have to experiment, converting and then checking the results, to get what you need.

After trying these tools, if nothing works, return to Writer and try dividing the file into smaller pieces then merging them within Calibre. Some releases of Calibre convert with fewer errors when you use files of twenty pages or less.

As a last resort, you can edit the CSS data manually, as described in Chapter 7.

Saving an eBook from Calibre

To save an eBook outside of Calibre, find its title in the list of books and select Save to Disk from the right-click menu. The sub-menu has three main choices:

• Save to Disk: Save the title in all formats.

• Save only EPUB format to disk: Only the EPUB is saved, Calibre’s default ebook format.

• Save only single format to disk: Select the eBook format to save.

Exporting an eBook from Calibre.

From the right-click menu, you can also select Save to device and Connect/share.

Chapter 7: Manually editing ebooks with CSS

LibreOffice Writer and Calibre are a powerful combination of tools. However, if you run across a problem that neither can solve, or if you want complete control over ebook production, you can work directly with the CSS code.

All you need is a text editor like the one in Calibre. Alternatively, you could work in Writer and save as plain text, although you need to remember to do so.

CSS is not complicated, and you can learn the basics and become productive with the guidance of online help.

Detailing CSS would require a book longer this one. For this reason, this chapter only explains the structure and placement of CSS and how to use some of the tags that do not survive the export from Writer to EPUB.

For some readers, CSS may look intimidating, but that appearance is deceptive. The truth is that CSS is precise and detailed, but always follows the same structure. Once you are familiar with CSS, you can easily use online references to write your own CSS, using formatting not mentioned in this chapter.

Using Calibre to edit manually

To edit manually in Calibre, right-click a title in the main display, then click Edit book. Depending how the ebook was made, the text in the editing pane will probably look crowded. You can improve the view by closing other panes in the window, and enlarging the editing pane. You can also adjust the display, adding more spacing between lines by clicking the flower icon in the toolbar.

In addition, you can select View | Live CSS. The Live CSS tool opens in the right hand column. When you place the mouse cursor in an HTML tag, Live CSS lists the CSS rules that apply to that tag. However, the Live CSS pane is only a guide, and cannot be directly edited.

Calibre’s Live CSS pane displays details of a selected piece of text.

If you are writing CSS from scratch, use a text editor like Gedit, Notepad, or Kate. Whenever possible, copy and paste from online instructions to minimize the chances of error.

What is CSS?

If you have created HTML or Javascript any time in the last two decades, you probably have a nodding familiarity with Cascading Style Sheets (CSS). Not only is CSS commonplace on the Internet, 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 formatting options it provides.

CSS is intended to keep format and content separate. At first, markup languages like HTML were designed to do the same, but the distinction became blurred. CSS was intended to restore the distinction by being a style sheet that gave designers control over how pages are viewed. In that goal, it was only partly successful, since different web browsers continue to display some elements differently, and to allow readers to over-ride CSS with their own preferences. All the same, CSS remains popular, if only because most designers prefer to have some control over formatting.

At any rate, CSS continues to be a standard feature of modern computing. Its specifications are developed and maintained by the World Wide Web Consortium (W3C), which also provides a CSS validation service. However, be aware that different uses of CSS, such as for the publication of ebooks on Amazon or Lulu, often have their own, sometimes arbitrary standards for CSS style sheets. A style sheet can be valid by W3C standards, yet still fail to be accepted by a given publisher.

Establishing rules

A CSS style sheet is like a collection of styles in a word processor. Making a change in an element listed in a style sheet changes all instances of that element in a document that uses that element. You might also choose to have different style sheets for different types of pages to keep such structures as simple as possible. For example, you could have a paragraph style in both a copyright page and a body text page, but format them differently by having them use a different style sheet.

When building a style sheet, keep in mind the requirements of the site to which you plan to upload your ebook. Many sites have detailed lists of rules about what  features they will accept, and will reject files that do not conform.

A style sheet is a series of rules about how to format different elements in the text. For the convenience of humans – including you when you edit – the style sheet usually adds an extra space between each rule. The basic format for a rule is:

SELECTOR {DECLARATION}

The Selector is the element to which the rule applies, while the Declaration is the formatting choice(s) that makes up the rule.

The Selector can take several forms. The simplest is an HTML element, such as h2 (heading 2). It may or may not be followed by a class or sub-version of the h2 tag, marked by a period. For instance:

h2 .example, h2, h3

would be a complete selector. You could add other selectors in a comma separated list.

Alternatively, the Selector can refer to a non-standard element named in the file that makes use of the style sheet, with <class="NAME">. If the file uses <div> before the end of the section marked by </div>, you could also add <id="NAME”>.

You could also do the same with a section marked with a <span> tag. Strictly speaking, a span tag is supposed to be used like a character style to mark a nested selection to be formatted differently, but in practice the distinction between <div> and <span> is not always observed. Since both function in the same way, the distinction is blurred.

The Declaration follows the Selector inside curly brackets. The Declaration begins with the property (or properties), followed by the setting for the property, and ending with a semi-colon. For example:

h2 {color:green;}

You could make a separate rule for each property, but, to save space, you can place a semi-colon separated list of properties within the same curly brackets. So the complete rule might be:

h2 .example, h2, h3 {color:green; weight:bold;font:”Liberation Sans”;}

If you want the style sheet to be easily readable, you can take advantage of the fact that CSS ignores white space and separate properties by lines, so that the last example above can also be formatted as:

h2 .example, h2, h3

{

color:green;

weight:bold;

font:”Liberation Sans”;

}

No matter how you format the rule, the punctuation is simple but essential, so check it carefully.

Positioning CSS rules for a file

Sometimes, CSS rules are given at the start of paragraphs or phrases where they are needed within a file. Since browsers generally can read a valid piece of CSS, this positioning is practical when a file has very few sections that are specially formatted. On the whole, though, it is like manual formatting in a word processor, since both are cumbersome when you make changes while editing.

More often, CSS rules are used globally, where any changes only have to be made once. One choice is to place the CSS in the <head> section of an HTML file:

<html>

<head>

<style type="text/css">

h2 {color:black;font:”Liberation Sans”}

h2 .example {color:green; weight:bold;

font:”Liberation Sans”;}

p {color:black;font:Gentium;}

</style>

</head>

This location reduces the work and has the advantage of only requiring that you keep track of a single file.

However, increasingly, the preference is to place CSS in a separate file, and add at the top of a file a declaration. Assuming that the style sheets and the files are in the same folder, and the style sheet is called “stylesheet,” the declaration would be:

<link href="Styles.css" rel="stylesheet" type="text/css"/>

This link is useful for minimizing work and giving a uniform look to the pages on the web site or the different XHTML files in an EPUB file. If you want to completely change the look of a file or page, then all you need to do is replace the existing style sheet with another of the same name but with different formatting for each rule in the file. Nor do you ever have to worry about accidentally changing content while editing formatting. The disadvantage is that you need to keep track of at least two files, and the loss of the style sheet means the loss of all your formatting.

Since both style sheets in the head section and a separate file can be long, you may want to group properties into categories. /* marks the start of a comment, and */ the end. For convenience, you can add in the comments a description of the colors designated in hexadecimal or RGB format – assuming that that these notations are meaningful to you – so you do not have to keep looking them up. Comments are ignored when a file is formatted using the style sheet, so add whatever hints are useful to you.

CSS properties

Most uses of CSS depend heavily on formatting defaults. On web pages, you normally see less than two dozen CSS properties specified. However, for other purposes, such as ebook production, dozens more are available. In fact, CSS has enough properties to reproduce almost every design feature available in a word processor, although you should always check which are supported by which browser, and which ones your publisher permits. You can check which properties are available on the reference page on https://www.w3schools.com/css/default.asp, which not only lists valid values for each property, but also link to pages where you can experiment online before changing your own files.

The start of w3school’s CSS tutorial online.

As you work, remember that CSS supports nested properties. A passage marked by a nested property will automatically take the characteristics of the top level property, unless there is a conflict. For instance, if a top level property is {color:red;} and a nested property is {font-style:italic;}, the text that is italicized will be red like the text around it. Only if another color is specifically listed in the nested property will the italics use a different color. This inheritance of properties is the feature from which CSS derives its name: properties cascade down from one declaration to others. Only when an end tag like </p> is used will a declaration cease to apply.

Another feature to note is that the same formatting can sometimes be obtained with different properties. For instance, margin and padding are different ways of setting the same feature: the space between the text and the edge of a page. Similarly, while you can use margin to set all the margins to the same value, you can set each individually with properties like margin-left and margin-top.

Appearance vs formatting properties

Most properties are one of two types: those that set appearance, and those that set position and spacing. Among the most common properties for setting appearance are Font, Font-Size, and Font-weight. These properties give designers firm control of how text looks, but a case can be made for using them sparingly in some cases. For instance, if you are designing an ebook, being too specific about a font can cause display problems in some ereaders. Moreover, most ereaders allow readers to choose their own fonts to display, so specifying too much about fonts is simply a waste of time. At the most, specifying serif or sans-serif is all you might want to define.

Other major appearance properties are the color or background of text. If you have any links, you might also want to choose color for them using the properties Links, Visited, Hover, and Active – or, at least the first two, since users are unlikely to remember the last two distinctions. All these properties can take a basic ANSI color such as red or dark red, but, if you prefer you can use hexadecimal notation, such as #00ff00 for blue, or an RGB color value such as rgb(0,0,255) for red. You can find the hexadecimal RGB value for colors with the help of a graphics editor like the open source GIMP graphics editor.

Position-defining properties not only include margin and padding but also, for images, float-clear (how text flows around an image), height and width. Such properties can take values expressed as pixels, a percentage, or em spaces – that is, the space take up by a lower-case letter “m.” As values, pixels are fixed, while percentage and em spaces are proportional.

Other position properties are available, but should be used sparingly in some circumstances. For instance, multiple columns are generally avoided in many uses of ebooks, and so are both number and bullet lists, although CSS properties for both exist. Similarly, the general consensus is that page-break-before and page-break-after should be used only with an h1 heading for the sake of simplicity.

These are only some of the most commonly used properties that can be specifically set. In many cases, the fewer you need to define, the less is likely to go wrong. Test as you work to avoid having to revise at the last moment before publication.

The limits of CSS

CSS cannot reproduce all the features found in a word processor. If you have elaborate layouts such as a brochure, you may be better off working in a word processor and then publishing in PDF, a format that can handle complex design. Another possibility is to add charts, diagrams, and screen shots with captions as an image. Even if it proves possible to reproduce a complex layout in CSS, the amount of effort and testing required is likely to be more trouble than it is worth.

CSS is designed for large bodies of text laid out in a regular column – in other words, for articles and books. For such purposes, CSS provides the tools for a surprisingly sophisticated layout, especially when you take the time to study what is available.

Getting started

If you right-click on an ebook in Calibre, and select Edit ebook you will see that it consists of a number of HTML files – generally one per chapter. There may also be files for title pages. Each of these files will be formatted with CSS tags, and will have a link to a style sheet in its header. For example:

<link href="Styles.css" rel="stylesheet" type="text/css"/>

In addition, each ebook generally begins with a cover, with a reference to an image. The cover image as well as any other images should be stored  in the same directory as the ebook files. So should the style sheet.

A sample style sheet

Here is a simple style sheet:

/* Character Set */

@charset "utf-8";

/* Page Layout */

body {

margin: 0px;

}

/* Foreground (Black) & Background (White) */

html, body {

color: #000; background: #fff;

}

/* Body Font */

body {

font: 1em  sans-serif;

}

/* Heading Font and Size*/

h1, h2, {

font-family: sans-serif;

}

h1 { font-size: 2.5em; }

h2 { font-size: 2em; }

/* Link Colors: Blue and Dark Blue */

a:link { color: #00f; }

a:visited { color: #009; }

Edit this basic style sheet as needed, changing details and adding tags as necessary.

Too many CSS tags exist to cover them all here. However, the names of most CSS tags are chosen so that their purpose is obvious to anyone comfortable in English. You might be able to simplify your work by choosing a template from:

https://www.w3schools.com/css/css_rwd_templates.asp

A tag is most likely to appear in the head of a file or a linked style sheet. For example, here is a style for defining a font property or weight as italic. It is started in a style section, as part of the head section:

<html>

<head>

<style>

p.a {

font-style: italic;

}

</style>

</head>

<body>

Then, when you want to apply the style to a paragraph, begin the paragraph with <p class="a">. Alternatively, you can define a div class or <div class="a">, or define the style in a separate style sheet.

Formatting fonts

ebooks give their creators only limited control over fonts. Since readers often set their own font preferences, worrying over using the exact font is likely to be futile. However, if you really want some control over fonts, you can use CSS tags.

A style can have many different characteristics. For instance, a style can include a list of fonts in order of preference. If a reader’s device has the first font in the list,  the ebook will use it. If it does not have the first font, it will use the second one, and so on through the list. Such lists usually end in “serif” or “sans-serif,” two of the most general category of fonts. A serif font has cross-pieces at the tops and bottoms of its strokes, while a sans-serif does not.

On the left is a serif character, with hooks at the end of its lines; on the right, a sans-serif character, with no hooks.

To create a list of applied styles, start by adding a style definition in the head of the style sheet. For example, here are two classes of styles used for paragraphs:

p.a {

font-family: "Times New Roman", Times, "Liberation Serif", serif; }

p.b {

font-family: Arial, Helvetica, "Liberation Sans", sans-serif; }

</style>

Or, if you prefer, instead of specifying a paragraph tag, you could use a div tag with the same structure.

Liberation Serif is actually a font whose characters occupy the same space as those of Times New Roman. Similarly, Liberation Sans’ characters occupy the same space as those of Arial. That means that by using the Liberation fonts, you gain an additional bit of control over how the fonts will look.

Other aspects of font style that can be specified include:

font-style property: normal, oblique, italic, or small-caps.

font-size: specified by pixels (px), a description (large), or percentage.

font-kerning: normal or none.

font-weight: names like normal or bold, or .CSS weights (for instance, 100 is ultra thin, 300 regular, and 700 bold)

If you know that your ebook will be read on a device with an Internet connection, you can also use the font-family tag to specify one of the hundreds of free fonts on Google Fonts (https://fonts.google.com/). You can view the available fonts, and see how they look in a paragraph.

Then, when you have chosen a font:

Click the red plus sign to the right of the font name on its page.

Click the 1 Family Selected button on the bottom of the page.

Follow the instructions for use with CSS in the pop-up window.

For example, for the Fanwood font, you would add to the head of the style sheet:

<link href="https://fonts.googleapis.com/css?family=Fanwood+Text" rel="stylesheet">

Then, use Fanwood to complete the font-family tag.

Using lists

As you may know from HTML, two types of list are available: bullet or unnumbered lists (<ul>, </ul>) and numeric or ordered lists (<ol>, </ol>). Use these tags to indicate the start and the end of a list. Each list element is started by <li> and ended with </li>. For instance, here is the code for an unnumbered list:

<ul>

<li>

African Grays

</li>

<li>

Amazons

</li>

<li>

Cockatoos

</li>

</ul>

Often, these will be all you need. By default, lines after the first will begin at the start of the text in the first line in each list item.

However, you can choose to make fancier lists using styles. With list-style-type, you can define circle or square for unnumbered lists, and  upper-roman and lower-alpha for ordered lists. With list-style-position, you can use outside so all lines in list items have the same indent, or inside so that all lines after the first align with the bullet or number.

For convenience, you can combine all the definitions into a single list-style-image tag:

ul {

list-style: square inside url("Triangle.gif");

}

The last option references an image in the same directory as the style sheet.

Designing tables

If you have trouble with tables in the conversion to EPUB format, the most reliable solution is to construct a table in CSS. Unfortunately, tables are one of the most difficult features to set up in CSS.

However, if you do want to design a table, begin with a table style in the head. This style can contain such elements as:

order: pixel width; solid, dotted, double line; color.

padding: up to 35 pixels between border and contents.

margin: up to 35 pixels. Alternate for padding.

table-layout: fixed; pixel width (px) or auto.

Tags like border-left or margin-right can be used to set individual sides of a table.

A sample table style is:

<style type = "text/css">

.Table1

table, td, th {

border: 1px solid black;

}

.Table1 tr:nth-child(odd)

{

background: #b8d1f3;

}

.Table1 tr:nth-child(even)

{

background: #dae5f4;

}

</style>

To build a table (from https//www3schools.com):

Use the <table> tag to mark the format definitions and contents.

Use <tr>, </tr> to define table rows.

Use <th>, </th> for table headings, left to right.

Use <td>, </td> for other rows.

A basic example:

<table>

<tr>

<th>Q1</th>

<th>Q2</th>

<th>Q3</th>

<th>Q4</th>

</tr>

<tr>

<td>€15,000</td>

<td>€11,500</td>

<td>€18,763</td>

<td>€14,392</td>

</tr>

</table>

Using columns

How columns display depends on the browser. If the layout you define is not read, the result may not be what you want. Further complicating the matter is the CSS implementation of columns gives you minimal control. For these reasons, many prefer not to use columns in CSS at all.

However, if you do choose to use columns, the CSS tags you need are column-count and column-width.

Column-count is defined either by a number or by auto, meaning that the CSS creates multiple columns as best it can. If column-count =1 is set, then the result can be a paragraph with a short line.

Column-width sets the ideal width for each column, using any unit of measurement supported by CSS, such as px or em. CSS adds as many columns as the space allows. The remaining space becomes a narrower column. Column-width can be completed by auto to let CSS take care of the format, which makes the columns flexible enough to be used with different browsers and screen sizes.

To design for major browsers, you can use webkit-column-count for Chrome, Safari, and Opera, and moz-column-count for Firefox.

When creating CSS columns, test frequently. If you find a lot of ragged lines, or successive lines that end in a hyphen, experiment with font size and the number of columns.

Here is a CSS rule for columns:

.newspaper {

-webkit-column-count: 3; /* Chrome, Safari, Opera */

-moz-column-count: 3; /* Firefox */

column-count: 3;

}

To apply it, use <div class="newspaper">.

Chapter 8: Uploading to Kindle Direct Publishing

Perhaps the most common reason for creating an ebook is to upload it to Amazon’s Kindle Direct Publishing. However, even if you are uploading elsewhere, you will need to fill out much the same information: your contact and banking information, and information to define and find the ebook. Appendix A lists some other places to upload.

Before uploading

To avoid delays in uploading to Kindle or any other publisher, gather everything you need before you start. You should have:

Your finished ebook. You can either upload an EPUB and have the site convert it to MOBI, or, better yet, convert it to MOBI first so you can catch any mistakes.

The ebook cover in a separate file.

A tax ID or the equivalent, such as a Social Insurance Number.

Your bank and account information.

A unique ISBN number for the ebook.

An Amazon account.

The cover and ISBN number are optional, but without them you will have a much harder time marketing your book.

To begin uploading your book, go to:

https://kdp.amazon.com/en_US/

If you choose, you can upload during the process to Amazon in other countries.

Your Kindle account requires:

Your personal information, bank information, and taxes.

Basic book information.

Book details.

Pricing.

When your account is set up, you can log in to edit information, see sales records, or manage promotions.

Getting a Tax Identification Number

A Tax Identification Number is the generic name for the registration that you use when paying taxes in a country. Its actual name may be a Social Insurance Number, Social Security Number, Tax File Number, or something similar, depending which country you live in. Look at past income tax returns, or contact the government department that collects taxes in the country where you pay.

When you fill in the information on Kindle, be sure to indicate that you want to pay taxes in your own country, if that is what you want.

Many nations, such as the United States or Canada, have reciprocal tax treaties. These treaties mean that, if you have income from Amazon.com and are not an American, you can pay taxes on your sales in your own country, and the United States will not try to collect from you.

Getting bank information

In order to receive payment for your sales, you need:

The name of your bank.

Your bank’s routing number (the first sequence of numbers on your checks, if you have them).

Your branch number, if your bank has them.

Your account number.

The easiest way to get all this information is to contact your bank.

Getting an ISBN

An International Standard Book Number (ISBN) is a unique identifier for your book in a particular format. A version in EPUB requires a separate ISBN from one in MOBI. Similarly, a paperback edition has a separate ISBN from a hardcover edition or from any ebook edition.

The ISBN is usually given in numerals below the same numbers in a bar code on the back of the book. You do not need an ISBN to upload to Kindle, but having one ensures that your title will not be confused with anyone else’s. If you live in a country that allows you to register ISBNs for free, you may as well take the time to get one. Even if you don’t, the registration fee is generally inexpensive.

If you are designing a cover, you can find free software on Linux, macOS, and Windows for creating a bar code of the ISBN.

You can find where to register at the International ISBN Agency at: https://www.isbn-international.org/

Getting an Amazon account

Kindle Direct Publishing uses the same account as other Amazon services. If you have bought from Amazon in the past, you can use the same account. If not, click the Sign Up button on the Kindle home page and follow the instructions.

Entering personal information

Use your Amazon account to log into Kindle Direct Publishing at:

https://kdp.amazon.com/en_US/

In the top right of the page, click My account to log in. Follow these steps:

1. Enter your personal information.

Kindle Direct Publishing: Author-Publisher information.

2. Under Getting Paid, add a bank account where Kindle can deposit your money. Consult your bank if necessary.

Kindle Direct Publishing: Bank Information.

3. If you choose, you can set up different accounts in different countries for different Amazon marketplaces (national versions of Amazon). You can also set up how and when checks are deposited.

Kindle Direct Publishing: Amazon Market Places.

4. To enter or view tax information, click the View /Provide tax information button on the Tax Information pane. Save the information already entered on the page before you switch screens.

Kindle Direct Publishing: Tax Information.

5. On the Tax Dashboard, click the Tax Information button to enter or edit basic tax information. Whether you are an individual or a company may affect your taxation rate, while whether you are an American citizen determines where you will pay tax on income.

Kindle Direct Publishing: Personal Tax Information.

6. Enter your personal information, including whether you have an American TIN.

Kindle Direct Publishing: Tax Identify Information.

7. Click the Continue button to enter the information on the page. Missed fields are marked in red.

8. Back on the Tax Dashboard, select whether to receive paper or paperless accounts. Just before taxes are due, Americans can also view relevant tax forms.

9. Click Exit to return to the My Account page.

10. Click the Save button at the bottom of the screen to return to the main Kindle page.

The information you enter is used for all uploaded books.

Entering book information

To enter book information:

1. From the main page, select a title from your Kindle Bookshelf or click Add a New Title. If you want to edit, select an item from the Kindle ebook options the right of the cover and title.

Kindle Direct Publishing: Selecting a book to edit.

2. Enter your book details. Ignore any that are irrelevant. The following panes are available:

Language

Book Title: Include any sub-title.

Series: The Series’ name and this book’s number in the series.

Edition: This information can be important because some readers collect editions, especially first ones. Different editions may also have unique features, such as illustrations.

Author

Contributors: Usually only used for anthologies and other collections.

Description: A blurb that will be used on Amazon. Up to 4000 characters can be used.

Kindle Direct Publishing: The book description.

Publishing Rights: A declaration of whether you own the rights or not.

Keywords: Seven tags that will help readers find the book. Keywords can be phrases, not just single words.

Kindle Direct Publishing: Keywords.

Categories: Two categories to classify your book under in searches. Categories are chosen from a pre-defined list.

Age and Grade Range: Stats that can help target your book if it is intended for children or young adults.

Pre-Order: Whether pre-orders are allowed. After publication, this category is irrelevant.

Kindle Direct Publishing: Subject categories.

3. Click the Save and Continue button to move on to details for the book.

Setting book details

Book Details can be set after Book Information when you first enter information. If you want to edit later on, select Edit ebook details from the Kindle ebook options the right of the cover and title.

You can set:

Manuscript: Whether the book uses Digital Rights Management to prevent copying, and the uploading of the book. Supported formats are listed, and the file is converted to .MOBI format, the format used by Kindle. The page indicates whether the upload is successful, and whether any possible spelling errors were found, offering you a chance to correct them.

Kindle Direct Publishing: Uploading the manuscript.

Kindle ebook Cover: Upload a cover or have Kindle produce a cover for you. Using your own cover is recommended. If you do not have the skill to make a cover with graphics tools, artists who will do a cover for you can be found on the Internet, often at surprisingly low prices. Although covers are less important for online publications, they are still a way to make your book stand out. The page indicates if the upload of your cover is successful.

Kindle Direct Publisher: Uploading a cover.

Kindle ebook Preview: Check the appearance of the book, either on your computer or on a Kindle ebook reader.

Kindle ebook ISBN: Add a optional ebook and Publisher (see “Getting an ISBN”)

When you are finished, click the Continue button to enter pricing.

Setting pricing

Pricing is set for the first time after you complete Book Details. If you want to edit later on, select Edit ebook pricing from the Kindle ebook options the right of the cover and title.

You can set:

KDP Select Enrollment: Your participation in Kindle’s promotional program.

Territories: Whether you own world-wide rights, or rights in specific territories.

Royalty and Pricing: Royalties are the money you receive from sales. Books under $10 can be set at 70% royalties to compensate for the lower price. Books over $9.99 must be set at 35%. You can set different prices in different Amazon marketplaces.

Matchbook: Whether you participate in a program in which buyers of a hardcopy of your book have the option of buying the ebook at a reduced rate.

Booklending: Whether you participate in a program in which buyers of the ebook can let others borrow it for 14 days.

Terms and conditions: Your agreement to Kindle’s terms of sales.

Kindle Direct Publishing:  Royalties and Pricing.

When you are ready, click the Publish Your Kindle ebook button on the bottom of the page. Your ebook will typically be available for sale within 72 hours. It may take several minutes to finish processing the ebook. Meanwhile, the site returns to the main page.

Using promotions and viewing sales

To view sales, select a title on the main page. From the Kindle ebook Actions drop-down list on the far right of the book listing, you can set up various promotions for the book.

From the top of the main page, select Reports to view various graphs to track sales for individual books, or for all your books.

Appendix: Other sites to post and sell ebooks

The number of publishers shows just how booming the ebook market has become these days. Some sites are online book stores, while others are print-on-demand services or  self-publishing agencies whose goal is to have users sign up for as many extras as possible.

With each site, the two things to consider is whether it is a site to market your books, and the formatting requirements. Check, too, whether the site insists on exclusive use of your ebook or not.

Note, too, that mention of a site here is not an endorsement – just a guide to begin your research into potential publishers. Look at these sites carefully before uploading to any of them.

On the surface, the website for Apple Books is short on specifics. You have to register to find the detail of how to upload. The procedure is famous for being arbitrary, but, since the site replaces part of iTunes, taking the trouble to meet the requirements is well worth the effort. Note that you must have an Apple device to use the site.

Barnes and Noble Press was formerly Nook Press. It offers a full range of services, including the development of web sites and covers. Given the parent company’s financial problems over the last couple of decades, the site is possibly less desirable than it used to be, but still worth consideration.

BookBaby positions itself as a rival to Kindle Direct Publishing that offers more services to authors. Among its services are a template for use with Apple Books.

Draft2Digital offers self-publishing surface. Its ebooks use EPUB or MOBI format, or, to accompany hardcopy print  on demand, PDF.

ebookMall boasts over 600,000 titles in EPUB and PDF format. Its E-Guide series include many titles for self-publishing.

e-junkie is a general marketplace for selling indie comics, recipes, photos, games and other merchandise. Most of the ebooks on the site are in PDF format.

Fast Pencil advertises single-sourcing to Print, PDF, EPUB 3.0, and Mobi formats. You can download a booklet of instructions.

Google Play is best known for Android apps for mobile devices. However, it is also a place to upload books in EPUB and PDF format. No unusual requirements exist, but there are basic instructions if you need guidance.

Hive is a UK seller of hardcopy books and ebooks. The site includes ebooks in both EPUB and PDF format.

Ingram Spark is a print-on-demand company that does EBUB and PDF ebooks. Its instructions are for MS Word, although you should have no problem using LibreOffice Writer with them.

At i-Universe, EPUBs are produced alongside hard copies.  The company will distribute EPUBS to major outlets. No information is give about formatting, except  a suggestion to avoid special characters if distributing to Apple ebooks.

Kobo, Inc. is a Canadian based-company that sells ebooks and readers. It is the equivalent of Kindle Direct Publishing, although on a smaller scale. A complete set of instructions is available.

Luminare Press is a hybrid company, which means that authors are likely to pay for features like cover art. The site includes a free download of a booklet for ebook construction.

Lulu, Inc. provides resources for printing books on demands and ebooks. Its instructions for printing ebooks are extremely specific, with layout and elements such as the paragraph and character styles that can be used clearly defined.

Notion Press is an Indian-based publishing service for both hard copy and ebooks.

Outskirts Press specializes in publishing ebooks for Kindle Direct Press, Barnes and Nobles, and Apple Books. It offers a special price for publication to all three.

Payhip specializes in ebooks. Its services are available for a 5% transaction fee, and for monthly fees plus reduced transaction fees.

Smashwords exists to publish and distribute ebooks, particularly to libraries and other ebook services. As with Lulu, its style guide is extremely specific, requiring, among other things, the EPUB 2.0 format rather than EPUB 3.0.

Sony ebook Library includes detailed style guides for both academic and general library, including reasons why a submission might be rejected. Submissions must be in PDF 1.4 or lower.

The main advantage of XLibris is that you retain all rights for any ebooks you upload. Fill out the form on the main page, and you will receive a guide to the site’s standard. xLibris also does print on demand.

Table of Contents

Section 1

Section 2

Chapter 1: Introduction

Chapter 2: Building the source document

Chapter 3: Formatting the source file

Chapter 4: Creating the ebook

Chapter 5: Preparing PDF Files

Chapter 6: Editing ebooks in Calibre

Chapter 7: Manually editing ebooks with CSS

Chapter 8: Uploading to Kindle Direct Publishing

Appendix: Other sites to post and sell ebooks