Last week, we had a guest post on a simple way to get your ebook formatted without worrying about dinking around with HTML or special software tools. Today, Paul Salvette is going to give us a more in-depth version for those who like to control every aspect and don’t mind reading some guides and getting into the nitty gritty of customizing their ebooks.

This kind of ebook formatting is a big topic for one guest post, so many of the links here will take you over to Paul’s site where he’s written up detailed formatting guides. While you’re there (or here), check out his first novella, America Goes On.

Ebook Formatting with HTML and Calibre

Thanks to Lindsay for letting me out of the cage here in Thailand to do a guest post. I write this eBook formatting post, not as an eBook author, but as a reader. I am getting a bit perturbed by all the eBooks out there with that have shoddy formatting: changing fonts, goofy page breaks, busted hyperlinks, etc. Self-publishers get ridiculed for being unprofessional by the suits in New York City, but I’ve found these errors in eBooks I shelled out $9.99 for from major publishing houses! There is no excuse to treat the customer with such contempt.

That is why those of us who self-publish have a real chance to set the standard for proper eBook formatting. You don’t have to be a nerd (although it helps) and you don’t need to spend a lot of time. If you have spent months writing, marketing, and updating your twitter feed 40 times a day to make it big as a self-publisher, you can take the time to format an eBook properly. I did it with my debut novella, America Goes On, and you can do it too.

First off, you have to think about eBooks differently from regular books and even the manuscript sitting in your word processor. While your word processor has a defined font, defined number of pages, and a fixed layout, and eBook has what’s called reflowable text. That means no matter what the dimensions of the eReading device, the text will wrap neatly into the next line. Not coincidentally, this is how a web browser reads HTML code. Try pressing Ctrl-U right now to see the source code of Lindsay’s most excellent blog. It may look a bit daunting, but you basically want to turn that manuscript in your word processor into this type of code.

There are two basic types of eBook formats that are commonly in use right now. There are the MOBI/PRC/AZW formats, which are primarily the domain of the Amazon.com Kindle Store. And then there is the EPUB format, which is used by everybody else (iBookstore, Barnes & Noble NOOK, etc.) It should be noted that Smashwords is a special beast, because it requires that you upload a document in Microsoft Word for their meatgrinder, which converts your manuscript into the major formats for distribution. Both MOBI and EPUB are based on old and simple HTML code that geeks were using to write Star Trek fan fiction on the internet back in the mid-90s. It’s really nothing too advanced.

The first step toward getting your manuscript converted into an eBook is obtaining some free tools. This includes a good text editor (I like Notepad++) and an open source program called Calibre which converts HTML into EPUB and MOBI. Next, you need to learn a little bit about HTML programming, and more specifically XHTML programming (XHTML has more robust standards than its cousin HTML). Don’t worry, you don’t need to be like Matthew Broderick in WarGames and hack into the computer at NORAD. You just need to have a basic knowledge of XHTML to include properly wrapping text in paragraph tags (<p> and </p>), adding styles to text (such as different font-sizes), adding margins around text, aligning text, and maybe even how to add images. Basically, every basic function you do in your word processor, you need to learn how to do in XHTML. I whipped up an XHTML tutorial for those of us who didn’t receive daily wedgies in high school, and it’s very easy to follow. If you get confused, drop me a comment and I’ll be happy to help.

Once you know the basics of XHTML, you need to take the entire manuscript out of your word processor and into a text editor. Once you are in a text editor, you can guarantee that you will have perfectly clean XHTML code. Word processor’s like to leave nasty bits of formatting and corruption within your seemingly beautiful manuscript. This crap that gets hidden in your word processor will make your eBook look all screwed up on certain eReaders, guaranteeing that your readers will NOT come back and purchase your other works. If you work from a simple text editor, you can guarantee a perfect eBook. There are some tips, tricks, and best practices regarding copying a manuscript into a text editor and then coding XHTML inside the text editor. You can learn more about taking a sloppy manuscript and turning it into perfect XHTML in another tutorial I prepared for indie authors.

Once you have the XHTML file for your book, you can run it through Calibre to get a MOBI and EPUB file that is ready to upload to the major markets. Calibre has some features on it that you need to familiarize yourself with, but I whipped up another tutorial that helps indie authors work with Calibre. However, it is a very user-friendly program. If you really want to geek out, you can even learn about regular expressions, which helps find and manipulate complex strings of text inside your text editor. This knowledge can cut your formatting time in half. You can also get real fancy and learn about building an EPUB from the ground up (without Calibre) and converting it into MOBI with a free program called KindleGen.

Whatever path you choose, there is no excuse for a sloppy eBook. It takes years to learn how to write well, but it only takes a few days to learn how to format an eBook well. hese knuckleheads charging $150 to format fiction should be ashamed of themselves. It took me less than an hour to format my first novella, and you can watch me do it on these video tutorials. I can only think of one other job where you can make $150 for less than an hour of work, and I don’t look that good in knee-high boots and a pink skirt.

I hope this gives you a decent overview of what’s in store for you when formatting an eBook, and these tutorials I hope will be useful for those of us in the self-publishing community. Please let me know if you have any questions, and drop me a line on Twitter or at my website. I’m happy to help, and I won’t charge you a $150. Good luck formatting your eBook!