CSS and Ebooks
I started to look into using CSS and HTML to publish my own books late last year. As a web developer transferring my CSS skills to print seemed a far simpler prospect than learning some desktop publishing software.
After some trial and error I put together a process for publishing to multiple formats while maintaining one copy of the text, and learned something about Paged Media in CSS along the way. This presentation shares that knowledge, starting with a rundown of some of the CSS features that come in handy when creating an ebook and moving on to practical usage.
Links, resources and further reading
Starting point files – these are the files I used when writing the presentation and you can use them as a starting point and to check you have the tools set up correctly.
Tools for generating the formats
These are the tools used in my presentation, and that I recommend.
- ePub ZIP – an Apple Script for EPUB creation
- wkhtmltopdf – a free tool for doing what Prince does. Might work for small simple books, I found it created huge PDF files and it doesn’t support a lot of the CSS that Prince does.
- easybook – I haven’t tried this yet but it looks to be a nice wrapper for some of the tools I described in my presentation. You need PHP and to install Kindlegen and Prince.
- GitBook – publish books with Git and Markdown. Seems to use ebook-convert which is part of Calibre. I couldn’t find a reference as to what CSS is supported by this tool.
- CSS Paged Media Module Level 3
- CSS Generated Content for Paged Media Module
- CSS Books: Living Standard
Resources and information
The Book Toolkit – my site of resources for self publishers.
Designing for Print with CSS – my article on Smashing Magazine with more details of the CSS available when creating PDF and printed documents.
Printing a book with CSS – a very old ALA article, although much is still relevant today.
Building Books with CSS3 – also from A List Apart, a very thorough article which also covers things you need to know if you want to take your book to print.
The Prince Documentation has some very clear explanations on the parts of the CSS Spec that work when generating PDFs with Prince. Their forum is also very helpful and worth a search if you get stuck.
ePUBSecrets – not specifically about using CSS and HTML to create ebooks but there is a lot of information here on all things EPUB.
Liz Castro writes some useful tips on ebook creation on her blog.
How to Write a Book – an article from Jonathan Snook on 24 ways. Jonathan helped me out when I embarked on this process with my own book.
Creating ebooks is a guide released by the original Five Simple Steps team. Includes a downloadable template.
MobileRead wiki introduces itself by saying, “No matter whether you are a developer, admirer, or just a gadget-crazed passerby – if you love reading eBooks and tinkering with mobile technology, you came to the right place. This Wiki is a knowledge base created by users of the MobileRead community.”
If you are thinking of writing a book to sell then I highly recommend Nathan Barry’s book Authority which is more on the subject of how you build an audience and market the book than the mechanical process of making it.
How to Publish an E-Book is a frequently updated post of resources, not just technical, that may be of interest.