Pandoc Markdown ebook template
This project defines a skeleton repo for creating ebooks out of Pandoc Markdown. Pandoc is a great tool for
writing ebooks with simple to moderately complex formatting, but I've found that
in practice, creating an EPUB isn't quite as simple as just running
-o book.epub book.md.
The author of Pandoc has written a short tutorial for creating EPUB files with Pandoc. This repo just expands on MacFarlane's tutorial a bit and wraps things up in a Makefile.
Installing and running
- If you have not already done so, install:
- Clone this repo with git.
- From the top of the project, type
make bookor simply,
make. This generates three versions of the sample book in a
Replacing the sample material
Edit these files:
ch01.md and ch02.md
Replace the dummy text with your own. You can add, subtract, or rename these
*.md chapters as you please, but you must edit the
CHAPTERS variable in
Replace this with your own cover image or delete it entirely.
BOOKNAMEto something appropriate for your book. This determines your book's filename.
CHAPTERSto a space separated list of Pandoc Markdown chapters, in the order in which you want them to appear.
COVER_IMAGE. You might want to move your cover image elsewhere, or use a different file format such as PNG.
If you don't want a cover image, delete this variable and the
--epub-cover-imageoption in the EPUB target.
LATEX_CLASS. The default of
reporthandles multi-chapter books pretty well, and uses the same template for even and odd page numbers. However, you are free to substitute in any other LaTeX document class. For example,
bookprovides a left-side/right-side template that is suitable for print, and
articleis good for shorter manuscripts (short stories, technical briefs).
Replace the contents of this file with the real manuscript title and author name.
Replace with your actual copyright statement, language, and any other Dublin Core metadata you wish to provide.