Pages

Saturday, March 23, 2013

PUTTING IT ALL TOGETHER - PART ONE

I have a manuscript ready to Kindle, so I'm going to follow the procedure given in this blog to make it happen.

Previous posts are my guide: CODING PUNCTUATION - PART ONE, CODING PUNCTUATION - PART TWO, PARAGRAPH STYLES, PAGE ONE, etc.

I began by re-saving the book under a new name, then I massaged the text: changed dashes to a pair of hyphens (with no spaces around them), removed spaces around ellipses. Searched for double spaces inside paragraphs and removed them. (They would only be there by mistake; I got out of the habit years ago.)

I saved again, this time as Text Only, and ran the file through Mobipocket Creator to create the html version.

I opened the version in Notepad++.

And got a shock.

I was expecting every paragraph set off with the standard tags: <p> in front and </p> at the end.

Didn't get it.

Got instead nothing in the front and <br /> at the end. OMG.

I had written a very short fake "book" to test the procedure, and everything had been great. What went wrong?

I compared the file that worked to the one that wasn't working and came up with some added procedures:

I went back to the rtf file and amended the paragraph style, eliminating the indent and converting the text to single spacing. I searched for the paragraph symbol and replaced it with two of them. Then save as Text Only.

This file came out of Mobipocket and showed up in Notepadd++ with the hoped for <p>...</p> tags.

Now I was all set to run the punctuation searches.

Twelve searches.

The first two look for material quoted in single quotes (quotes within quotes [in America]). They require you check the result of each search to see if anything needs to be done.

In the first search ("') I got no hits.

Lots of hits for the second search ([space]'), but they were almost all front-of-the-word contraction apostrophes, not the beginning of quoted material.

The other ten searches are Replace All monsters designed to have their way with the manuscript.

I laid in the code for all smart quotes, plus dashes and ellipses.

One code eluded me (the accented e in fiancée), but I found a code on the Internet (www.w3schools.com). For the record: &eacute;

I spread out my html code by clicking between brackets (><) and hitting Enter. I added the <title> code. I added <style> codes, using copy and paste from the blog, to create paragraph styles.

I replaced all <p> tags with <p class=body"> tags, then searched for "chapter" so I could modify the first paragraphs of my chapters with the non-indented "start" style. I searched again for section breaks (#) and put the "start" style to work there, too...before deleting the <p>#</p> code.

I added anchors for chapters, as well as the title-page image and the copyright page:

<div id="title_page"></div>
<div id="copyright"></div>

Then I used the code for the c-in-the-circle symbol (&copy;) to create the actual copyright notice. Acknowledgments will follow.

I put in page breaks where needed, using:

<div><br class="break"></div>

Then I went about modifying the first words of initial paragraphs. For chapter starts: <b><big><big>F</big></big>IRST LETTER OF THE FIRST WORD</b> gave me bold caps. The first few words of section starts were just set in bold, no big cap.

I have to confess I obsess about the choice of how many opening words to highlight. Going with a fixed number—no matter what they are—is a recipe for weirdness. Highlighting those words just naturally emphasizes them, and going one too few—or one too many—can distort the meaning.

(And I am of course mindful of the words of Emerson: A foolish consistency is the hobgoblin of little minds. But how do you decide when you're being foolish?)

Another thing to work out: Dumping your rtf file into text strips out a lot of formatting, including bold and italics. You'll probably want to keep the rtf version open in your wp so you can transfer these effects. As you know by now, the tags for bold and italics are <b>...</b> and <i>...</i>. Remember, italics is not just slanted, it's also thinner. In some font sizes it can come off a little spindly. When I'm working with the first few words of a chapter I like to beef up my italics with bold font-weight.

Next I trotted out files from a previous book: toc.html, toc.ncx, and content.opf. I modified them for this new work.

Now it's on to images: chapter-starts, title page, and cover.

But first, a quick look at the book.

I open it in my browser to check it out.

Uh-oh.

I discover some of my dashes haven't come out properly. They're represented as question marks.

I track the problem back to the text file: question marks in place of some of my dashes (the rest of which are now represented by double hyphens).

Back further to the original rtf: Apparently, something went wrong when I converted my dashes into double hyphens. Some of the dashes—or at least they LOOKED like dashes—were not recognized by Word as dashes and so never got converted. When the file was saved as Text Only, these non-dash hoodlums were represented by question marks. Nobody knew what to make of them.

But I swear they were regulation one em dashes, placed in the text by Auto Correct. What the hell?

I have to search the html for all question marks, weed through the legitimate ones, and replace the others with the code for non-breaking spaces and one en dashes. Some en dashes are to be followed by real spaces, others (at the end of interrupted dialogue) by another non-breaking space.

Great fun!

And I still don't know how I got into this mess!

But I've learned my lesson. From now on, I'll do my original writing with the html file in mind. No more curly quotes or em dashes—just straight quotes and double hyphens.

In this new world of e-books, the html file IS the final text. If for some reason I need an rtf version, I can use Calibre to convert the html to rtf. After that, all I'd need to do is fiddle with the formatting.

And who knows, I may never need another rtf file.

Back to work.

I went into my standard template ncx file and modified it to report the right number of chapters, etc. (See TABLES OF CONTENT.)

I also opened my captive opf file and modified it—with all due respect, and so forth. (See the POST on the opf file.)

To test my progress so far, I faked-up some cover and title page images and ran the book through KindleGen (via Kindle Previewer).

It failed!

I clicked the expansion doohickey on the failure notice to look at the details: Several open tags had been forcefully closed. The line numbers were given, so I opened the book in Notepad++ and took a peek. There was NOTHING wrong with my closing tags!

Here's a tip: KindleGen doesn't tell you the right place to look for problems. You can stare at the reported line until your head explodes, but you won't find ANYTHING wrong there. You WILL begin to doubt your sanity.

Solution? Check out the line right ABOVE the line they say is messed up. (Or maybe the line above that. The problem is around there someplace, just not where they say it is.) You'll find the problem and fix it.

After I mended by goofs, I tried again: File created, but with Warnings.

Just one error reported: No cover specified.

Okay, I went nuts trying to find out why that thing wasn't work. There was nothing wrong with the "cover" listings in either the <metadata> section or the <manifest> section. I was very careful. Rather than modify the opf file, I saved my fake cover with the name already listed there.

In fact, I made NO changes in that part of the opf file. So why wasn't it working? I searched the Internet for help, found I was doing everything I should be doing.

What the hell!

I mean, it used to WORK, right?

Then I remembered the glitch in KindleGen I reported a moment ago. I examined the line ABOVE the <metadata> listing for the cover, which turned out to be the <dc:description> item—one of the few things I changed when I modified the opf file for this new book.

Yep, I messed up right there. When I highlighted the existing description to delete it, I unknowingly included the closing tag—and failed to replace it. After I added </dc:description> to the end of the text about the book, everything worked perfectly.

The new book Kindled without error.

Anyway, NOW it's on to images: chapter-starts, title page, and the cover.

Next time.

No comments:

Post a Comment

Comments are welcome -- and moderated by me. Please be patient.