Showing posts with label Microsoft Word. Show all posts
Showing posts with label Microsoft Word. Show all posts

Monday, February 18, 2013

Convert To HTML

This is part 2 of a multipart tutorial on How To Publish An Ebook: Convert to HTML.

You may not know this, but an ebook is a lot like a web page. You're looking at a web page right now, and what makes it work is a markup language called HTML. The people who keep track of internet standards can tell you the difference between HTML4, HTML5, XHTML, XML and several other similar data format standards. You probably don't care. I'll be inexact in my terminology: when I say HTML I may be playing fast-and-loose and really mean XHTML instead. Will this hurt anything?

I hope not. I'd rather you get a few niggling details wrong and get the overall concept right.

Let's suppose you've gone through the process of writing a book. And that book just happens to be in DOCX format. This is the file format that Microsoft Word uses. If you use another word processor, you can probably get it converted to DOC or DOCX format easily enough. Otherwise, ask and we'll work out that contingency.

There are a lot of ways to convert a DOCX file into HTML. And they all work fairly well. However, they tend to generate bloated HTML code. You can generally represent something in many different ways. And when you have a Word document, it can have a lot of odd formatting things that anyone might put in for any reason. But that's not you because you're writing an ebook.

However, file format translation programs don't know that, and they can add a lot of just-in-case code in their HTML translations. Maybe you like having all that bloat in your HTML files, but I like to be able to see what's going on when I inspect an HTML file. (Generally this happens after something goes wrong and I need to find out why.)

That's why I like a clean, lean, light-weight HTML translation that's relatively minimalist. (And if your ebook design is not minimalist, you're doing something wrong.)

That's where Rick Boatright's translation comes in handy for me. Go here to see what i mean.

You'll see two boxes. One on the left and another on the right.

Go into Word. Hit Control-A to select everything. Then hit Control-C to copy everything.

Go into your browser and Rick's translation page. Click in the left box and hit Control-V to paste everything.

Select the checkboxes you want, then click the button marked "Clean up Word Text" and wait for a few minutes--depending on how long your document is. If it barfs, break up  your ebook into chapters and try again.

When you get each piece of your ebook translated to HTML, click in the right box and hit Control-A to select everything, and Control-C to copy everything. Then paste your buffer into a Notepad file and save it off with an extension of HTML into project directory.


When done, you should be able to double-click on each HTML document to see what it looks like in your browser. Pictures can be a bit tricky. You may want to get some help to get pictures put in the right places. It's not hard to do, just hard to explain in a brief post like this one.

Now is a good time to look for badly translated symbols like smart-quotes, copyright or trademark symbols and other bits of noise that'll hurt the appearance of your ebook. It's best to find these errors as early in the workflow process as possible to avoid rework

Do you have to use Rick Boatright's translator? No. Can you use other HTML translators? Probably. I'm only telling you what worked for me. And you might have some other way that works better. I certainly haven't cornered the market on truth. Can you avoid Word altogether and use another tool that generates clean HTML automatically? Idunno. Haven't tried.

Let me know if you have tried something different--like, say, Scrivener.


(You can find the bullet-point outline of How To Publish An Ebook here.)

Saturday, February 16, 2013

Write A Book

This is part 1 of a bigger collection of posts of "How to publish an ebook."

First you have to write a book. If you have paid attention to Robert Heinlein's five commandments, you've been doing just that. I strongly suggest you NOT try to publish your deathless prose until after you've written a million words.

In addition to your deathless, prose you may want to think of ebook design.

I suggest you use your favorite word processor, but you only want to use a subset of its formatting capabilities. Microsoft Word is a big bloated beast of a program because it enables a ton of different functions you won't use. You won't use multiple columns in an ebook. Things like tables and drop-caps are troublesome--avoid them.

The rationale is that you're going to end up with either a MOBI or an ePub file which are both built on top of XHTML. If you don't see a cool typesetting feature in a lot of web pages, you probably can't put it in an ebook, either. In later steps you'll be converting your book into XHTML and if the converter program barfs, you have to back up and revise your book to avoid the typographic thang which caused the barfage.

Easier to start with a vanilla word processing file. I'm assuming you will be starting with a DOCX file generated by Microsoft Word.

I've never used Scrivener, but if someone reading this has any strong opinions about it I'm all ears. Just keep in mind that whatever you use has to have some mechanism for generating XHTML.

Typefaces are not fonts, but fonts are specific implementations of a particular typeface. If you're not into typography it behooves you to learn just enough to not-suck at book design.

Typefaces come in three flavors: serif, sans-serif, and display. Use sans-serif for forms and signage. Use serif for body text. Use display for headers and titles. This is because centuries ago the monks copying texts found that adding those tittles at the ends of letters made reading faster/easier than without them. Besides, when the Romans carved words in stone, they took pains to make them look nice. That's why many serif typefaces have Roman in their names. And when people used to read newspapers, they often chose the London Times or the New York Times. That's why many typefaces have Times in their name, too.

However, just a word or two works in sans-serif. Popular with Nazis, Communists and highway departments, sans-serif is the typeface of totalitarians. 

There are other times when you want your text to evoke a time or place. Ferinstance, a book about camping might have its title rendered with letters that look like bent pieces of logs. An Algerian face evokes thoughts of the Victorian era, and the Star Trek face evokes a Science Fiction vibe. These are all instances of Display typefaces. They vary to an incredible extent and you don't care about Display typefaces until you get to cover design.

You need to pick a typeface for your ebook that is supported by your e-reader hardware. If you are using Microsoft word, use Times New Roman for everything. That's not exactly what Kindle or the Nook uses, but it's so close you have to be a typeface designer to know.

Next you have to worry about which letters you use in your ebook. You want to use 'single quotes' or "double quotes" and not use ‘single quotes’ or “double quotes”. If you don't replace all these characters, you'll end up with unsightly blocks where these characters are used in your text. Same goes for several other special character.  Microsoft Word likes to make your documents look better and they do so by changing what you type into something that means the same but looks better.

The more of these characters you remove up front when you write your book, the less tweaking you have to do when you get to future steps.

Yes you can fix things downstream, but consider the problem of typos. You want to fix typos in the Word file, and if you do a ton of manual tweaks downstream from the Word file, all those manual tweats will make you not-want to fix typos--or worse, fix those typos in both your Word file and also in the manually tweaked downstream files.

For this reason, it makes sense to tell Word to not-change what you type automagically.

(You can find the bullet-point outline of How To Publish An Ebook here.)


Those more worthy than I: