9

I have some raw text documents, mainly novels and theater plays that I would like to convert to EPUB.

What is the best way to do that? Should I use an intermediate format?
Can it be automated?

8

Epub Format

Epub is actually a collection of files in ZIP format. You can create an epub without any specialize tool, for example taking a book's content from https://github.com/Gluejar/open_access_ebooks_ebook and running

zip -Xr9D The_Velveteen_Rabbit.epub mimetype * -x .DS_Store

Pandoc

Pandoc is an easy to use command line tool to generate epubs, and a lot more markup formats such as LaTeX, Markdown, HTML5, Word docx and ODT are supported. Here is an example:

pandoc mybook.txt -o mybook.epub

Read more about epub creation examples.

I have used it to conveniently generate epub from a Git repositories' documentation to easier reading.

Sigil

A GUI alternative is Sigil, with the benefit of in-place editors as well as extensive styling tools.


Online Epub Generators

If you cannot/do not want to install applications, there are online tools that can generate epubs, such as http://ebook.online-convert.com/convert-to-epub

  • Thank you, Pandoc looks very interesting, it seems easier to adapt the text to a format accepted by pandoc than to generate directly the xhtml code. – Emmanuel Apr 30 '14 at 9:07
1

If you are on a Windows platform, the quickest way is to use Abiword.

You can open your text (or .doc or .rtf or .odf) in Abiword. Then File==Save As==.epub.

No intermediate files are necessary. I understand Apple's Pages has the same capability.

Abiword for Mac OS has not been updated in ages and does not have this capability. Other word processors might have this capability as well; you would have to check.

Another option is Scrivener. You can import the file and then compile to epub. This gives you a good deal more control over the formatting. Scrivener is available for Windows, Mac and Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.