E-book formatting — the copy

So yesterday I did a quick and dirty post on covers using free photos and the free Gimp program. Today, I’ll talk about the actual formatting. First thing to understand is, you have to learn another language, HTML, which is a programming language for websites. Again, I was kind of familiar with this language because I used to work on a magazine, and we used these codes in a much simplified format. So it’s probably terrifying for those of you who have no experience in it. Don’t panic! There are great sites to help. And if you wonder, “Gee, I wonder how I can get that little copyright symbol thingy,” just Google “html copyright symbol,” and you’ll get a link that gives you just that. But every  paragraph has to be wrapped in code, which has to be explained at the beginning of the file, and all symbols inside the file (apostrophes, quotes left and right, dashes, ellipses) have to be replaced with codes. That’s the pain in the butt part. But Guido is there to help!

THE FORMATTING

The site I understood best was Guido Henkel’s. He’s got EIGHT blog entries covering how to do this:

http://guidohenkel.com/2011/01/take-pride-in-your-ebook-formatting-part-i/

He had you download an editing program to turn your Word file into html:

(http://www.jedit.org)

He then had you download the Calibre book creating program:

(http://calibre-ebook.com)

He assumes you know more than I did, so I had to ask some dumb questions (like how to open your html file in a web browser? Click START, MY COMPUTER, then follow the levels to your Jedit file and double-click; maybe I’m dumb, but it took me awhile), but he’s so patient and will answer your questions either in the blog or even by email. I did change some of the codes he used because I couldn’t get them to work. For example, I couldn’t change the size of the type on my title page until I went to H tags, which he doesn’t like, but it was the only thing that worked for me. Another problem was that the chapter heads were coming up as “unnamed” on the table of contents in Kindle and Nook (the little “Dedication,” “About the Author,” “Chapter 2” type flags at the tops of the pages in Nook were just “unnamed” as well) doing it his way, so I used the codes listed in the Calibre website, and it worked.

In the Word file or Jedit file, you have to do a global search for certain symbols that will not translate, such as quote marks and dashes. For example, if you wanted to say “author’s name,” you would have to really say “author’s name.” Crazy, huh? In Jedit, I would highlight the first instance where it appeared, click at the top “Search,” then “Find,” then mouse to “Replace with” and fill in the appropriate code, then click “Replace All” to the right of the box, and it was pretty easy.

Things you have to change in your Word or Jedit file (all codes have to have the & at the beginning and the ; at the end!):

“ — left open quote

” — right close quote

’ — apostrophe

&nbsp; — gives you a page break (already in the code below; if you add one in the middle of type, you would write it <p>&nbsp;</p>)

&mdash; — dash

&hellip; — ellipses

&copy; — copyright symbol

Here’s my final code (if you have trouble with it, try replacing the ” characters — Jedit didn’t like them, but once I deleted them and put new ones in, it ran just fine):

<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd“>
<html>
<head>
    <style type=”text/css”>
      html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin: 0; padding: 0em; }
p
{
  text-size: 1em;
  text-indent: 1.5em;
  margin-bottom: 0.2em;
}
p.h1
{
  text-size: 5em;
  text-weight: bold;
  page-break-before: always;
  margin-top:8em;
  margin-bottom:2em;
}
p.chapter
{
  text-weight: bold;
  text-size: 1.5em;
  page-break-before: always;
  margin-top:5em;
  margin-bottom:2em;
}
p.by
{
  text-weight: bold;
  text-size: 1.5em;
 }
p.centered
{
  text-indent: 0em;
  text-align: center;
}
span.centered
{
  text-indent: 0em;
  text-align: center;
}
h3 {
text-align: center;
text-indent: 0;
margin-top:5em;
}
p.page { page-break-after: always; }
    </style>
  </head>
<body>
<p class=”centered”><span class=”centered”><p class=”h1″><font size=”7″><b>YOUR BOOK TITLE HERE</b></font></span></p>
<p class=”centered”><span class=”centered”><p class=”by”><font size=”5″>By YOUR NAME</font></span></p>
<p class=”page”></p>
<p class=”centered”><span class=”centered”><p class=”h1″><font size=”5″><b>DEDICATION</b></font></span><p/>
<p  class=”centered”><span class=”centered”>YOUR DEDICATION HERE</font></span></p>
<p class=”page”></p>
<a id=”start”/>
<h3 class=”calibre6″>
     <a name=”ch01″ class=”calibre9″ id=”ch01″>CHAPTER 1</a>
     <br class=”calibre3″/><br class=”calibre3″/></h3>
<p>YOUR COPY HERE — each paragraph gets the “p” codes!</p>

<a id=”chap2″/>
<h3 class=”calibre6″>
     <a name=”ch02″ class=”calibre9″ id=”ch02″>CHAPTER 2</a>
     <br class=”calibre3″/><br class=”calibre3″/></h3>
<p>YOUR COPY HERE — REPEAT FOR ALL CHAPTERS</p>

<p class=”page”></p>
<p class=”chapter”><p class=”centered”><span class=”centered”><b>ABOUT THE AUTHOR</b></span><p/>
<p>YOUR BIO HERE. Please check HIS/HER website at <a href=”URL”>http://YOUR WEBSITE HERE</a>.<p>
<p class=”page”></p>
<p class=”centered”><span class=”centered”><b>YOUR TITLE HERE</b></p>
<p class=”centered”><span class=”centered”>ISBN: IF YOU HAVE ONE HERE</p>
<p>&nbsp;</p>
<p class=”centered”><span class=”centered”>Copyright &copy; YEAR by YOUR NAME HERE</p>
<p>&nbsp;</p>
<p class=”centered”><span class=”centered”>Stock photo image courtesy of YOUR PHOTOGRAPHER HERE, <a href=”URL”> www.YOUR PHOTOGRAPHER’S WEBSITE HERE</a><p>
<p>&nbsp;</p>
<p class=”centered”><span class=”centered”>This eBook is copyright material and must not be copied, reproduced, transferred, distributed, leased, licensed, or publicly performed or used in any way except as specifically permitted in writing by the author, as allowed under the terms and conditions under which it was purchased or as strictly permitted by applicable copyright law. Any unauthorized distribution or use of this text may be a direct infringement of the author&rsquo;s rights and those responsible may be liable in law accordingly.</p>
<p>&nbsp;</p>
<p class=”centered”><span class=”centered”>This is a work of fiction, and any resemblance between the characters and persons living or dead is purely coincidental.</p>
</body>

(Some of the quotes are coming up weird when this is published, I think because the website wants to translate the html formatting with “curly quotes” — html uses straight quotes for both sides; in Word, you would need to replace any wonky quotes with the curly quote in the correct direction.)

I’m sure there’s extra stuff in there that isn’t needed, but it worked, so I don’t care. You can just copy that and paste in into your Jedit file, fill in the boldface blanks, and be pretty good.

BOOK CREATION:

I then ran it through the Calibre book creator, and again, Guido Henkel has a great post (number VIII, I think) on doing that, so I won’t do a lot of detail here. The only things I did different were, in the Calibre mobi or epub section (you have to have separate files, mobi for Kindle and epub for Nook), in the “Structure Detection” section (to the left of the screen), I typed in:

//*[((name()=’h1′ or name()=’h3′) and re:test(., ‘.*‘, ‘i’)) or @class = ‘chapter’]

Then, in the “Table of Contents” section (again to the left of the screen), in the  “Level 1” line, I typed //h:h3.

Other than that, I followed Guido’s instructions. Not so tough, huh?

Advertisements

About alisaacarter

I am a writer of young adult novels, wife, mom of three, lover of animals, former magazine editor, reader of anything paranormal, and coffee fanatic.
This entry was posted in E-publishing. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s