# Formatting for eBook



## Ankari

I've been wrapping up production on an anthology and thought I'd share my formatting experience as well as get some pointers if I"m doing something wrong.

First, some advice:

Don't use Word. Word loads your manuscript with so much fluff and forced formatting templates, it'll make any conversion a possible hell. If you're going to use Word for your document, please find some online resources that walks you through the setup of your document. Amazon has a guideline available here.

I encourage everyone to get your hands on Scrivener. It has a great compiling feature that can do 75% of your ebook creation.

I encourage everyone to download Calibre. There download page is here.

I encourage everyone to take as much time learning how to format as you would with any aspect of the industry.

*Scrivener (Windows Version) Formatting Setup*

As stated above, Scrivener does much of the ebook formatting for you. Some things I had to do manually are:


Set your paragraph left indent to 0.30
Set your paragraph right indent to 12.00
Remove indent on first line of each chapter.
Cap all the words in the start of each chapter. The number of words can be set from three to ten.
Line spacing is set to "single" with *before* and *after* set to "0".
I used the Calibri font, but most eReaders force your document to use any of the three or five they officially recognize. 
Use the "Show Invisibles" Option to catch and remove any errant spaces and paragraph breaks.
Make sure you remove all "white space." I went through the manuscript four to five times checking for spaces after sentences, extra spaces between words, and extra line breaks. When I edited in Calibre, there were still a few. White spaces will do funny things to your ebook.

*Scrivener Compiling Options*

There are many books you can download, or online guides for in depth Scriviner Compiling. The problem is that they are mostly targeted for the Mac version of Scrivener.


There are many formats Scrivener can compile to. I'm focused on the ePUB format.
In the *Content* side menu, make sure to check the options for *Pg (Page) Break Before* if you want a normally grouped item separated from the previous document. This is important for front and back matter.
Also in *Content* is the option to select what files you want included in the eBook. The option exists because Scrivener is meant for your one stop authoring needs. You can store character profiles, maps, plot notes, etc. Make sure you haven't included any of these files in your eBook.
In the *Separators* right menu I set *Text Separators* to ***, *Folder Separator* to *Page Break*, *Folder and (then) Text* to "Empty Line" and *Text and (then) Folder* to "Page Break"
*Formatting* right menu allows you to display certain types of data. I have all levels set showing "Text" and only the folder level showing "Titles."
You can ignore everything else except for the *Meta-Data* menu option. Fill in the appropriate information such as author name, publishing date, description, etc.
On the bottom, just above the dropdown menu for desired format type, is another dropdown box that allows you to enable and chose the front matter items you want to add. Front matter is the title page, copyright, dedications, forwards, etc. Don't worry about a Table of Content. When you seletected the files under the *Content* menu, you're telling Scrivener what items are supposed to be in the Toc. Scrivener will do the rest.
Compile and save to an easy location

*Calibre*

Calibre is a digital library manager. It wasn't meant to publish eBooks, but does remarkedly well in polishing your file you compiled from other sources. Since Scrivener did most of the work, the two programs work hand-in-hand.

Just a little insight. Ebooks _are_ specialized webpages. If you have a professional background in HTML/XML code, you probably know more about building ebooks than most formatters!

*Calibre Easy Mode*


First, import our eBook into Calibre. You can find the option to do so in the top left conviently named *Add Book.*
Next option is *Edit Metadata.* Click it and update/verify your metadata information you injected using the Scrivener Compiler.
On the far right is the *Edit ToC.* Click on it to verify/update your ToC file.
To the left of *Edit ToC* is the *Polish Book* feature. The only item you'll want to use is the *Remove unused CSS rules from the book.* This is an important feature. It shrinks your book size significantly. Mine went from 9 MB to just under 1 MB. This is important because Amazon has a size limit. Also, customers don't want their devices cluttered with bloated files. Besides, dead CSS code can do whonky things with your formatting.

*Calibre "WHAT-AM-I-DOING" Mode*

When you right-click on your ebook, you'll get another menu. The one we want is *Edit Book.*

There isn't a walkthrough for this. I pretty much analyzed what effects I desired, and which ones I didn't like. So, what are you looking at here?

On the left is your files. Notice they have an .xhtml suffix. Their webpages!

On the far right is your live previewer. Click on any file and you'll see what it would look like in an eReader.

In the middle is the actual coding, and about that is a set of tabs for each file you have open.

What I did:


First, I clicked on the Contents.XHTML and made sure my ToC looked right. It didn't, so I tinkered with it.
Second, I went to a chapter (shor story in my case), and analyzed the code. I didn't like the *** separators that Scrivener put between my chapter (story) title and the first page of that story. I clicked on the item I wanted to delete and noticed that cursor in the center window moved to a string of coding containing the separators. I justed deleted the line. It worked!
I also noticed some centered items I had in the body of the story weren't centered with the story title. Since these items were always visible with the story title, the book looked crooked. I discovered the coding that centered the title and applied it to the content in the story.
The center code viewing window highlights areas of possible concern. For some reason, legitamate spaces between words were flagged. Experimenting, I deleted the space, then inserted a new one. It worked. Why? Who cares! I'm just glad I removed something of possible concern.
Be careful with the previous step. em dashes were similarly highlighted. I didn't want to touch them.
I also inserted line breaks around the *** section separators to give it a cleaner look. The code for that is simply <p></p>


----------



## Svrtnsse

What about line spacing?
I'm using OpenOffice to save as HTML and importing that into Calibre to create a MOBI file (kindle). For the most part I'm happy with the formatting but I've noticed that my files are a lot denser than for books I've purchased from Amazon. Turns out most ebooks I've bought come at 17 lines per page and the ones I create myself come at 21 (or something thereabout). Admittedly I haven't spent much time tinkering with it in Calibre (I fiddled with the most obvious option but it didn't work so I decided to wait and ask someone some other time, and look what happened...).

So, what settings do you use for line heigh/space?


----------



## psychotick

Hi,

First - Absolutely do use Word! This should be the format you upload in. You can hate Microsoft all you want, rage at their money grubbing ways, despair of their products, but in the end the publishing industry has settled on Word 1997 - 2003 as their standard.

I cannot begin to tell you how many threads I have read which start off "I'm using program X,Y,Z and my book won't format correctly when I upload it." Nor how many absolutely horrible answers I've read which go on about converting files to .mobi or some other program.

The sad and simple fact is that Kindle takes two file formats - Word and HTML. CreateSpace takes one PDF. And Smashwords takes Word and a few others. You will have far less problems with the basic Word file.

By all means write in whatever you want - and I'm told scrivener is a brilliant writing program. I personally use Libre Office. But always convert your program to Word before uploading, and then check that there were no conversion issues there. You will have less problems.

Cheers, Greg.


----------



## Ankari

psychotick said:


> First - Absolutely do use Word! This should be the format you upload in. You can hate Microsoft all you want, rage at their money grubbing ways, despair of their products, but in the end the publishing industry has settled on Word 1997 - 2003 as their standard.



Scrivener allows you to compile documents into .doc or .rtf (both are Word or Word compatible). The difference is that Scrivener won't bloat your document witn unnecessary formatting/macros. It's a better .doc program than Word.

Also, Amazon takes ePUB files and converts them into Kindle files.


----------



## Chessie

Svrtnsse said:


> What about line spacing?
> I'm using OpenOffice to save as HTML and importing that into Calibre to create a MOBI file (kindle). For the most part I'm happy with the formatting but I've noticed that my files are a lot denser than for books I've purchased from Amazon. Turns out most ebooks I've bought come at 17 lines per page and the ones I create myself come at 21 (or something thereabout). Admittedly I haven't spent much time tinkering with it in Calibre (I fiddled with the most obvious option but it didn't work so I decided to wait and ask someone some other time, and look what happened...).
> 
> So, what settings do you use for line heigh/space?


This is kind of what I'm doing with Libre Office. I've been thinking of getting Scrivener but I can't decide whether to get that or Windows 8.


----------



## KC Trae Becker

Is there a site or someplace that lists the different venues and what formats they will take files in?


----------



## Steerpike

Chesterama said:


> This is kind of what I'm doing with Libre Office. I've been thinking of getting Scrivener but I can't decide whether to get that or Windows 8.



Get both


----------



## psychotick

Hi Guys,

If I can just quote from KDP's own page:

Types of Formats 

https://kdp.amazon.com/help?topicId=A2GF0UFHIYG9VQ

"Kindle Direct Publishing (KDP) lets you upload and convert your final draft from several formats. For best results, we recommend that you upload in DOC/DOCX (.doc/.docx) or HTML (.html) format. Be sure to read through the tips below for your preferred format prior to publishing your work with KDP."

Yes, you can use other formats - just don't. Why make a rod for your own back?

Cheers, Greg.


----------



## Ankari

Greg,

This guide is focused on compiling books to ePUB. You can do the exact same thing to compile to .Doc or .RTF. Also consider that Scrivener *is not* the best way to compile stories to eBooks. As I've noted, there is a ton of unused CSS coding that bloats the file by 20 times (it's not an exageration).

This is important because, depending on your royalty rate you select with Amazon, you lose money for larger files. To compare, my ePUB file is less than 500 KB, while my .Doc file is over 2,100 KB.

Amazon _converts everything to their file format._ So, why not have all the behind-the-scene coding incorporated into the document instead of a plain .Doc file?

From the same website you sourced with that quote, I give you two others:



> Word (DOC or DOCX)
> 
> KDP accepts most DOC & DOCX files for eBook conversion; *however, some files which contain complex formatting may not convert well.* Be sure to use the previewer to check your files conversion if it contains tables or is graphic intensive to ensure conversion was successful. For more tips on formatting in Microsoft word please visit our Help page.
> 
> Kindle books can be viewed in different font sizes, depending on the reader's preference. Page numbers, font sizes and margins set in Word do not apply. The "Page Break" feature in Word should be used to create intentional page breaks (i.e. ending a chapter for a smoother transition and better reading experience).
> 
> Images can be added using the 'Insert' function in Word to create interest within your eBook. Do not use the copy/paste function.
> 
> If you're submitting your file in DOC or DOCX format, the entire book text should be uploaded in one file. Please do not include a cover in your file, as we will automatically embed your product image as the cover of your book.





> ePub (EPUB)
> 
> KDP converts unzipped EPUB files. *Prior to uploading an EPUB file, we recommend validating the file using epubcheck.* This will ensure your file converts properly for Kindle.
> 
> To validate your file using epubcheck, please visit: EpubCheck Tool



From these two items, you can see that both have their concerns. The one with .Doc files is all manually corrected. The one with ePUB can be fixed with the suggested tool, or by using the walkthrough I've provided.

Why use ePUB? Because you're editing code. This is a fixed science and not open to interpretation. You can identify errors with tools such as the EpubChecker, or the Calibre ebook editor and fix them. As long as the coding is clean, so will your conversions.


----------



## Steerpike

Isn't .mobi ultimately HTML as well. I remember the first self-published book I did, saved the Word doc as HTML and edited it directly in a programming text editor, to strip out all the extraneous code. If I recall correctly, I pretty much just zipped up the HTML file and sent is over to my Kindle and it was done.


----------



## MichaelSullivan

Gah...I did a big write up and lost it all.  Dang!

Let me start by saying that what I do may not be the easiest way - and outputting from Scrivner is probably a good way to go.  But generally my writing process is as follows:


While writing the book I use scrivner
When it comes time to share with others I export to word
Any editing is done in word so the word file is more "up to date" than the Scrivner file and it becomes the new master
I don't convert the word file back into Scrivner so by the time I make the ebook I'm already in Scrivner

So I start the ebook while in word, but I disagree with pschyotick that you should upload a word file or export to .html from a word file as it will have all kinds of "formatting" code in it which will bloat the file, making it big, removing control from the user for changing font size, and make it more expensive to deliver - due to a bloated file.

In general, my process is:

Do some simple global search/replaces in word
Copy and paste out of word into notepad (a nice flat file)
Feed the simple .html file into Calibre
Export a .mobi from Calibre and upload to Amazon for kindle
Export a .epub from Calibre and upload to Pubit, Kobo, and other sites that take .epub

Using a .html file sounds scary but it really isn't. You only need to know a few basic things:

<p>...</p> is put around paragraphs
<i>...</i> is put around italics
<b>...</b> is put around bold
<h1></h1> will use a larger font and start a new page

A few other things to know.  Some characters need to be translated to show up properly.  Some people use "straight" quotes but I like "curly" quotes so I do some substitutions as follows:


&rdquo; and &ldquo - for double curly quotes
&ldquo and &rdquo for curly single quotes
&mdash; for em-dashes
&hellip; for ellipses
[*}&bullet: for bullets

Also note some other characters might need replacement for instance if you write naive with the dots over the i like this naÃ¯ve. You'll need to replace Ã¯ with #&239;  If you don't replace these special characters they will show up in the file as either a square block or a ?.  A full list of all the codes can be found here.

99% of the changes can be done with some global find/replaces.  The quotes, dashes, and elipsis are easy.  

To do italics and bold is a little harder. You need to use do the find with a blank field but use the More >> format >> Font to specify to find all the italic (or bold) - do them as two steps) and when you specify replacement use the "Find What Text" to stand in for "any italic".  In other words do the following to do italics:


Pull up the find/replace dialog
Click on More to expand the dialog
Click on Format > Font
In the font style box specify italic then hit Okay
In the replace box use the "Special" drop down and specify "Find What Text" it will put ^& in the box.  Before that put <i> and after it put </i> so that it looks like this: <i>^&</i>
Replace all

You can repeat the above for any bold with <b> and </b> for bold.

For pararagraphs, look for the paragarph mark (use the Special drop down on the find) and replace it </p> then <p> (NOTE this is opposite italics which is <i></i>.  So the replacement line will look like this </p>^p<p>.  This will put <p></p> around each paragraph --- except that the very first paragraph will be missing it's opening <p> which you need to add separtely.

At this point I high light and copy everything from word and past it into notepad.

Then I put <h1> and <h1> around each Chapter title to put them on a new line and make them larger.

If you want a table of contents in a particluar spot in the file (Calibre will make one at the end of the file) You can by using ID's to specify chapter headers for instance if you had
<h1 id="Chap1>Chapter One</h1>  Then you could have <a href="#Chap1">Chapter 1: All in Good Time</a> in the table of contents.

There are just a few more things you need to do.

At the front of the file put: <html><head><title>Title of book by Name of author</title></head><body>


At the end of the book put: </body></html>


If you want to get "fancy" you can do some centering, make things different fonts and do some indenting.  Anywhere that you want a blank line use <br/>. 

Here are some examples:

Indenting with bullets:
<div style="text-indent:30px; left-margin:30px">&bullet; First bullet<br/></div>
<div style="text-indent:30px; left-margin:30px">&bullet; Second bullet<br/></div>

Chapter Head with image and two different sized titles:
<h1 id="Chap1">&nbsp;</h1><p class="header" align="center"><img src="chapter1.jpg" alt="Chapter 1"><br/><br/><font style="font-variant:small-caps"><font size="+3">Chapter One</font><br/><font size="+4">Running Out of Time<br/><br/></font></font></p>

Note: Not all readers will recognize the "small caps" font but for those that do it makes it look a little more distinct.

Note: You should always use "relative" font size changes like +2, +3, +4 rather than an exact size like 12pt. This way the user still can control the size of font whereas if you hardcode it to a particular font it will be fixed.  Likewise.  Never specify a font type type (such as courier or times new roman) again, you want the reader to control the font and hardcoding will take that flexibility away from them.

That's about it. As I said, I'm sure that there are other ways to do this - but this is what I do and it produces a very tight file and I can convert to this in about half an hour.


----------



## MichaelSullivan

KC Trae Becker said:


> Is there a site or someplace that lists the different venues and what formats they will take files in?



Not that I know of but it's pretty simple:


 Amzon - .mobi
 Nook - .epub
 Kobo - .epub
 Smashwords - .epub or a very simple word file
 Draft2Digital - .epub


----------



## Ankari

Update:

I found a webpage that allows you to verify an ePUB is 100% error free. I got it from Smashwords.

International Digital Publishing Forum ePUB Validator (beta)


----------



## MichaelSullivan

Ankari said:


> Update:
> 
> I found a webpage that allows you to verify an ePUB is 100% error free. I got it from Smashwords.
> 
> International Digital Publishing Forum ePUB Validator (beta)



Yes I should have mentioned that I always run my ebooks through that when I'm done.  Usually if there is a problem it is a matter of not closing off a html code (i.e. Having to open paragraphs without a closing).  It is really good at telling you where the problem is.


----------



## Fyle

My work in progress is all done in Microsoft word... I am around 450 pages in...

I hope the person who said do use word is correct here. If not... that could get a bit messy somehow.


----------

