Org mode epub export
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 80 commits behind ofosos:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Generate .epub files directly from OrgMode. This will export EPUB version 2, which should give broad compatibility. It should also be relatiely easy to convert the resulting .epub to a .mobi (Kindle).


This depends on Emacs 25 and OrgMode 9, it won’t work on OrgMode 8 or any version of Emacs before 25.


Use org-epub like this:

(setq org-publish-project-alist

	 :base-directory "~/bjcp-reader-1/"
	 :base-extension "org"
	 :publishing-directory "~/bjcp-epub/readerZ/"
	 :recursive t
	 :publishing-function org-epub-publish-to-epub
	 :headline-levels 4
	 :auto-preamble t
	 :preparation-function org-epub-publish-finish
         ;; epub specific - these *MUST* be set
	 :epub-file "bjcp.epub"
	 :epub-cover "bjcp.jpg"
	 :epub-cover-width 800
	 :epub-cover-height 600
	 :author "Beer Judge Certification Program"
	 :publisher "Mark Meyer"
	 :rights "t.b.d."
	 :toc-depth 2
	 :uid ""
	 :title "Beer Judge Prep - Reader 1"
	 :language "en"
	 :subject "non-fiction beer"
	 :description "Beer Judging Prep Class, Reader for Session One"
	 :epub-date "2017-01-01")

	  :base-directory "~/bjcp-reader-1/"
	  :base-extension "jpg"
	  :publishing-directory "~/bjcp-epub/readerZ/"
	  :recursive t
	  :publishing-function org-publish-attachment)

	 ("reader-1" :components ("reader-B-html" "reader-1-static"))))

Then M-x org-publish RET bjcp RET. Should work reasonably.

After that you’ll have an output directory with all the important files. The final EPUB file will be the file you specified as :epub-file ....


Currently org-epub can do the following:

  • simple cover images
  • direct .epub generation


These will eventually be fixed:

  • Stylesheets not implemented.
  • Can’t have space or anything special in your filenames.
  • Part headings are not included
  • Headline levels are borken
  • The assumption that your org-mode files end in `.org’ is hardcoded everywhere.