Tuesday, June 7, 2011

ebook Formatting Workflow

Since I've trial'd and error'd it out for myself, and it's not that difficult, here's the Official David Barron eBook Formatting Workflow! Note that it doesn't include how to do images, because I haven't tried that yet. It's also pretty bare-bones, but you can probably figure it out... (This doesn't count as my Friday article) If you totally want to hire me to format an eBook, first, seek professional help because you're insane, then give me $50 and I'll do it, I guess. Free money, am I right? (This takes...15 minutes.)

eBook Formatting

Programs

FocusWriter for text
Microsoft Word 2007 for DOC and pre-formatting
jEdit for HTML
calibre for conversion to EPUB and MOBI
GIMP for cover art
Kindle Previewer

FocusWriter text

type, use -- for — (em dash)

Microsoft Word 2007 preformatting

double quotes : " with "

single quotes : ' with '

em dash : -- with —

ellipses : ... with …

Ctrl-i to <i>^&</i>

jEdit entities

paragraphs: ^(.+)$ with <p>$1</p>

search for <p></i> and fix

” with &rdquo;

“ with &ldquo;

‘ with &lsquo;

’ with &rsquo;

… with &hellip;

— with &mdash;

è with &egrave;

é with &eacute;

Bold with <strong>Bold</strong>

Strikethrough with <del>Strikethrough</del>

jEdit styles

Apply this header, wrap with body tags


<?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">
   <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-indent: 1.5em;
         margin-bottom: 0.2em;
       }
       p.noindent
       {
         text-indent: 0em;
         margin-bottom: 0.2em;
       }
       p.preview
       {
         margin-top: 5em;
         margin-bottom: 2em;
       }
       p.title
       {
         page-break-before: always;
         font-size: 3em;
         font-weight: bold;
         margin-top: 5em;
       }
       p.subtitle
       {
         text-indent: 3em;
         font-size: 2em;
         font-weight: bold;
       }
       p.author
       {
         text-indent: 3em;
         font-size: 2em;
       }
       p.matter
       {
         text-indent: 3em;
         font-size: 1.5em;
       }
       p.chapter
       {
         page-break-before: always;
         text-indent: 1.5em;
         font-weight: bold;
         font-size: 2em;
         margin-top:5em;
         margin-bottom:2em;
       }
       p.story
       {
         text-indent: 1.5em;
         font-size: 1em;
         margin-top: 5em;
         margin-bottom: 0.2em;
       }
       p.centered
       {
         text-indent: 0em;
         text-align: center;
       }
       span.centered
       {
         text-indent: 0em;
         text-align: center;
       }
     </style>
   </head>
   <body>
   </body>

Book Chapters/Collection Stories =
<p class="chapter">Chapter Title</p>

Individual Short Story 'chapter' (for clean ToC) =
<p class="chapter" style="display:none">Short Story Title</p>
<p class="story">First paragraph of text</p>

Apply other styles

*** with <p class="centered"><span class="centered">***</span></p>

Search for & in browser window, then manually replace & with &amp; in jEdit

Calibre conversion

Add HTML to Calibre, edit metadata, add cover

Convert to EPUB

Table of Contents
Level 1 TOC (XPath Expression) = //h:p[re:test(@class, "chapter", "i")]

EPUB Output
check 'Preserve cover aspect ratio'

Convert to MOBI

Check DOC in Word 2007, upload to Smashwords
Check MOBI in Kindle Previewer, Upload to Amazon KDP
Check EPUB in calibre, Upload to Others

Samples
Collection


Short Story

Friday, June 3, 2011

Sexy eBooks

I finally formatted an eBook up the right way, and I just want to lay out what I did. My main text was Guido Henkel's Take Pride in Your eBook Formatting and I don't intend to repeat any of it. Consult that guide,just consider this a personalized companion article as well as a guide to people who are using jEdit to follow that series because they don't own a Mac. Your Mileage May Vary, I'm just muddling through while taking notes. If you want somebody to design your ebook for you, send Guido Henkel an e-mail. (Don't ask me.)

I don't really feel like waiting until Friday to post it. It still counts as my Friday article for this week, because it's really freakin' long, OK? Let's just jump into the freezing water.
UPDATE: I've formatted two more eBooks since I wrote this, so I'm updating the workflow to reflect what I actually do. I'll update the actual HTML head later, because I'm narrowing in on a universally useful one for my purposes.

Programs you will need:

Microsoft Word 2007 
or the word processor of your choice. If you're on Linux, you can use OpenOffice.

jEdit

Calibre
you should have this already if you own or publish eBooks. Get it now.

Workflow

Word 2007
Make all the paragraphs, italics, and punctuation that you want, make sure the smart quotes and other auto-replace options are on and Find and Replace:

double quotes : " with "
single quotes : ' with '
em dash : -- with —
ellipses : ... with …

Just replace them with themselves and this will transform them into the appropriate special characters, and you won't have to think about changing all the straight quotes into curly quotes. Easy. If it doesn't happen, make sure the appropriate AutoFormat options are on in Word.

If you have a bunch of italics scattered through your text, do this!

italics : Ctrl-i to <i>^&</i>

Warning, when I did this, and there was a </i> at the end of the paragraph, when I later ran <p>$1</p> (see below) it put the </p> before the </i> and sent that to the start of the next paragraph. So, in addition to the jEdit stuff below, search for </i> and make sure your tags are closed.

jEdit Cleaning

Copy and paste your text into jEdit. Good. Now we want to put in our paragraph tags, so go to Search - Find, check the 'Regular Expressions' box, and Find and Replace like so:

paragraphs: ^(.+)$ with <p>$1</p>

Sexy. Now, save it as an html file. And make a backup for when you screw up. Then, if you took Option 1, you'll want to do all these Find and Replace
(DO NOT do & with &amp; at this time!)

“ with &ldquo;

” with &rdquo;

‘ with &lsquo;

’ with &rsquo;

… with &hellip;

— with &mdash;

Bold with <strong>Bold</strong>

In mine, I had these things too, so I assume you might too:

è with &egrave;

é with &eacute;


Strikethrough
: <del>Strikethrough</del>

Good times, but now we have to make it look pretty.
jEdit Styles

Go Here for super details from Guido Henkel, so I'll just put the head I eventually cobbled together for a collection of short stories. (Feel free to steal it, if you can, but it's easy enough to make your own.)

<?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">
   <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-indent: 1.5em;
         margin-bottom: 0.2em;
       }
       p.noindent
       {
         text-indent: 0em;
         margin-bottom: 0.2em;
       }
       p.title
       {
         font-size: 3em;
         font-weight: bold;
         margin-top: 5em;
       }
       p.front
       {
         text-indent: 3em;
         font-size: 2em;
       }
       p.chapter
       {
         page-break-before: always;
         text-indent: 1.5em;
         font-weight: bold;
         font-size: 2em;
         margin-top:5em;
         margin-bottom:2em;
       }
       p.centered
       {
         text-indent: 0em;
         text-align: center;
       }
       span.centered
       {
         text-indent: 0em;
         text-align: center;
       }
     </style>
   </head>
   <body>

Put </body> at the end of the html file.

Now we can put the appropriate chapter styles in (in this case, the title is "The Littlest Barnacle"):

<p class="chapter">The Littlest Barnacle</p>

We can find and replace our section dividers (replace *** below with whatever you happen to use):

*** with <p class="centered"><span class="centered">***</span></p>

Sprinkle the html file with the other appropriate style tags. Mostly I used "noindent" to remove the indentation for some paragraphs, but I also formatted the front and back matter to taste.

Finally I opened the saved html in a browser window and searched for &, then manually found it in jEdit and replaced:

& with &amp;

I only had three in the whole eBook, so it didn't take long.

So, now if you didn't do anything wrong, you have a sexy html to convert to various eBook formats. Thus:
Calibre

Go Here (Part IX of Take Pride in Your eBook Formatting), Do That. Basically, in Level 1 TOC (XPath Expression) add:

//h:p[re:test(@class, "chapter", "i")]

I don't have anything to add, except to note that when it converts to MOBI, it will add a linked table of contents to the end of the ebook, so don't bother to put one in yourself. As for my actual html, I claim no special expertise, so if you spot any stupid errors, shout out!

Now put that MOBI up on Kindle and use the EPUB wherever they'll take it. It'll be pretty. Comment below with a link when you do, then consider joining me as I try to get Smashwords to take my pretty EPUB (or even PDF) instead of my utilitarian DOC.

Conclusion
And but so: check out my newest short story collection on Amazon. Preview it. It looks pretty damn good!

Friday, May 27, 2011

Fiction Writers Lie

...and I'm a fiction writer and a liar. I suppose the real question is: which came first, the liar or the fiction? You would be foolish to believe my first answer, but it would probably be true. Probably. Let's just assume I'm a liar who has stumbled into the most honest line of work for liars. That should save time.

Pictured: The Kids Today
I just make up stories, all the time, based on nothing but boredom and audience reaction. Sure, if they're about me, the stories usually have a smidgen of truth dust in to polish the lie stones. I've got plenty of truth dust, it's just not all nearly as interesting without a bit of polish. Mostly it just goes until it stops. You'll note that 'truth dust' is my new fancy word for 'experience'. I assume The Kids Today use it as a word for some hallucinogen. 

It doesn't help that I'm almost certainly smarter than you, having saved all the time that non-liars usually spend racing cars or hotdogging to boogie tracks (or whatever) and spent it on reading, speaking, wandering around, meeting people, and yes: Lies. LIES! The elixir of youth, the crowning achievement I'll lie to my grandkids about in my old age. Good stuff.

Apropos of nothing: The World's Longest Articulated Bus!
I've been messing around with Guido Henkel's Take Pride in Your eBook Formatting because I figured I should take my formatting up a notch. It's not really that hard, you should try it. Obviously, Smashwords still only accepts .doc (a major failing), but your Kindle books will look all snazzy. Or at least the Table of Contents will work right, which is just as good. In other dramatic news...

I stole this image from the article.
Kristine Kathryn Rusch's Writing Like It's 1999
Michael A Stackpole's House Slaves vs. Spartacus

These two articles have pretty much convinced me that I will never sign a publishing contract. It seems like altogether too much work and hassle and waiting for altogether too little reward. (We need not mention agents.) You know who was 'self-published'? Mark Twain. I'll be like him, except I won't lose all my money investing in bean harvesters or whatever he did.

But that was pretty much what I was going to do anyways.

Carry on.
Related Posts Plugin for WordPress, Blogger...