Create and edit an ePub

How to create and edit a valid electronic publication using open source tools.
You will need the following tools:

  • A basic knowledge of the ePub format, the international standard for electronic publications : “EPUB defines a means of representing, packaging and encoding structured and semantically enhanced Web content — including XHTML, CSS, SVG, images, and other resources — for distribution in a single-file format.”
  • Libre/OpenOffice Writer: to prepare your document
  • Writer2ePub or Writer2xhtml extensions: to turn it into ePub format
  • Sigil: to edit the ePub
  • Calibre to display your content and copy it to devices


LibreOffice Writer : prepare your text.

The most important part is : keep it simple and respect the styles ! The body will be styled in Text body, your different headings with the heading styles #1 to #10, quotations, code insertion etc. also should be designated as such. Do not work outside the styles.

As part of the KISS principle, forget about fonts : every device has it default one, every user may change it. However, if ever you should persist in embedded a font, remember that it may not render clearly on all device (and now I speak like the kindlegen).

For a complete set of useful recommendations, take a look at:


Writer2epub : convert your document

The Writer2ePub Libre/OpenOffice extension allow you to convert document into ePub. Get it on the author’s website, double-click on it, it should install automatically. A new W2E toolbar should appear, with 3 options : create ePub / Edit metadata / Preferences.

Edit your metadata (title, author, date, subject, description, cover) and ePub preferences (split HTML files over 150 Ko, split before headings, create index etc.) and press OK when done: the ePub file is generated in your document folder.

Writer2xhtml : a better solution ?

The writer2xhtml plugin doesn’t offer as many metadata & export option as the previous one, however its ePub output seems way more optimized : code is cleaner, CSS lighter. Feel free to try both of these solutions according to the complexity of your documents.

Writer2xhtml doesn’t add toolbar : properties of your document will be add as metadata in the ePub content.opf. Use the “file > export…” menu and select .ePub output.

In both cases, if you prepared and styled your document carefully, ePub export should be clean and well organized : open it with Calibre or send it on your device and check the layout, index and such.

However if you need to edit it, know that an ePub file is just a archive package (with a specific set of compression) which you can open using any archive tool, such as 7-zip. Or if you’d prefer edit your ePub through a GUI, Sigil is your best choice.

Sigil : edit your ePub

You’ll need to add a ppa (for Ubuntu based distros) in order to install Sigil.

sudo apt-add-repository ppa:sunab/ppa
sudo apt-get update && sudo apt-get install sigil

Version is 7.2 at this time, 7.4 is available for PC/Mac. Anyway : Sigil is easy to use, learn it, test your ePub, when all is OK : save.

sigilOf course you may want to validate your file with the inner flightcrew, or much better run ePubcheck.

Once again, once polished, open your ePub on Calibre and check its layout and metadata display.



Comments are closed.

Blog at

Up ↑