Creating an ebook with LibreOffice Writer

Old and new If you have an idea for a book, you’re no longer at the mercy of an editor at a big (or even small) publishing house somewhere. Thanks to computers, we can all be publishers — and for more than just one day.

Yes, you guessed it. ebooks are the great leveler. Or, at least, they can be. If you have a fairly recent Linux distro and LibreOffice Writer you can publish your own ebooks quickly and easily.

OK, you’re probably thinking: using a word processor as an ebook publishing tool? There’s no reason why you can’t. People have written and published ebooks using LibreOffice Writer (and Writer) in the past. Admittedly those ebooks were PDFs but …

Thankfully, PDF isn’t the only ebook format in town. An arguably better one is EPUB. Thanks to an extension called Writer2ePub, you can use LibreOffice Writer (and Writer, too) to publish ebooks in EPUB format.

Let’s take a look at how.

Getting set up

The first thing to do is download the extension. From there, fire up LibreOffice Writer and select Tools > Extension Manager and then click Add. Find the extension, and then click Open. You’ll have to restart Writer.

You’ll notice a new toolbar:

The Writer2ePub toolbar

Now, you’re ready to go.

Preparing your ebook

That’s pretty simple. Just start writing as you normally would. You’ll need to keep your entire book in one file. Writer2ePub doesn’t work with master documents. At least it didn’t when I was using it — the toolbar disappeared whenever there was a master document window open.

When you’re preparing content for conversion to EPUB with Writer (and even if you aren’t), always keep this in mind: use styles. Don’t apply formatting manually — for example, don’t create a heading by highlighting text, making it 22 point DejaVu Sans, and applying bolding. Apply the Heading 1 style instead.

The reason you need to do this is simple. EPUB files are very structured. Styles, while they can help make a document look nice, are there to enforce consistency and structure. If you don’t use styles, there can be problems. The biggest one is that the table of contents for your EPUB file won’t generate properly. Which means you won’t have proper navigation or structure.

Generating your EPUB

That’s easy. Open your book file and then just click the Writer2EPUB button on your toolbar. You’ll be prompted to enter metadata (information about the book).

Writer2ePub metadata editor

At the very least, you need to enter:

  • Your name (or the name of the author, if you’re doing the conversion for someone else
  • The title of the book
  • The book’s language

You can also tell Writer2ePub where to find a cover image for the book. Assuming, of course, you created one. If you haven’t, then maybe you should consider doing that before going any further.

Once you’re ready to go, click OK. I’ll be honest: I’ve only experimented with files about 50 or 60 pages long at the most. That said, the conversion was fairly fast and quite smooth. The book looked good to boot.

Checking out your book

So you’ve got an EPUB file. It has the extension .epub, to boot. What now? You should check out your book. A great way to do that is to open it in Sigil. Sigil is a WYSIWYG tool for creating EPUB files, and it’s also a good application for viewing and checking your files.

Your ebook, in Sigil

If you’ve done everything properly, then the EPUB you created in Writer should be fine. Chances are, though, you won’t like the default look and feel of the text. I don’t. It’s not ugly, just not to my liking.

To fix that, you can edit the stylesheet that controls the formatting of the book. You can do that in Sigil, obviously.

Something else you should do is validate your EPUB. Validation is the process of making sure that your EPUB books contain all the elements that ebook readers expect. Like what? Here’s a partial list:

  • Complete metadata
  • The proper directory structure in the EPUB file
  • Valid XHTML
  • Working links and references to files in the EPUB file
  • A table of contents

All of that should be fine, but it’s best to check. To do that in Sigil, select Tools > Validate Epub. Validation only takes a few seconds but it’s a useful step.

Final thoughts

While Writer (or any other word processor) isn’t my first choice for writing a book, it’s possible to use it to do the deed. And with Writer2ePub, you’re not stuck with just PDF as an ebook format.

This work is licensed under a Creative Commons Attribution 4.0 International License.

Flattr this!

  • Pingback: Links 4/11/2011: Fedora 16 Goes Gold, Apple Bats for Sacred Cow (Brand) | Techrights()

  • Pingback: business model innovation design » Bookmarks for November 6th through November 7th()

  • Trinae Ross

    Informative article that lends itself a big help to writers, like myself, who self-publish while seeking traditional publication.

  • Yuramarca

    Thanks for this article, I’ll check that extension for LibreOffice

  • Elizabeth L

    What about Writer and MOBI? I’ve been having to convert EPUB through Callibre and it would be nice if I could create a MOBI file directly with Writer.

  • Scott Nesbitt

    There isn’t an add-on for Writer that supports exporting a file to .mobi. You either have to continue using Calibre or use Amazon’s KindleGen utility. I have a post coming up that outlines how to use KindleGen.

  • Scott Nesbitt

    There isn’t an add-on for Writer that supports exporting a file to .mobi. You either have to continue using Calibre or use Amazon’s KindleGen utility. I have a post coming up that outlines how to use KindleGen.

  • average joe

    If Writer, or any other word processor, is not your first choice, then what’s your favorite environment for doing it? Thanks!

  • Scott Nesbitt

    I prefer to use Sigil, which is a dedicated EPUB editor. Sigil does have its drawbacks, but it also has a number of strengths including a built in validator and the fact that it uses EPUB as its native format.

  • Pingback: How to Create an eBook The Open Source Way | Classroom Aid()

  • Thomas Levine

    I am working on an ebook but it is mainly images I am making in photoshop. Can I use the writer to insert the images or is it just for text?

  • Scott Nesbitt

    I’ve never tried with with images, but I’ve been told by a few people that you can include images in your book and they’ll be included in the EPUB. I remember reading somewhere that images in frames aren’t exported.

    The developer of Writer2EPUB recommends you use GIF, PNG, JPG, or SVG images a maximum of 600 x 800 pixels.

  • Thomas Levine

    Thank you Scott! It’s children’s book, and we are using the text on top of the images to make a connection between the words and the idea. The whole page can be just one jpeg or whatever….