When I was writing my Ebook Formatting Kit, I tried several conversion methods, all worked to varying degrees. I kept trying and distilling the process until I came up with the most effective method (so far).
However, the process is still daunting to many, so I have resurrected an older method for converting a Word file to HTML for Kindle. It utilizes the Find/Replace feature.
Kindle Formatting Tutorial Includes:
- Step by Step Find/Replace Process
- Pre-made HTML Template with Copyright, TOC
Tutorial assumes there are NO images with this HTML file for upload.
Method
This demonstration is from an iMac with MS Word 2008. Your version / and OS may vary. Please refer to your user manual for help.
What you will be doing it “cleanly” converting your file from Word coding to HTM without all the extra garbage MS includes. This can be done manually, as I describe below using the FIND / REPLACE method.
When done your final Word output should look like:
<mbp:pagebreak />
<div id=”chapter1″ />
<h1>Chapter 1</h1>
<p>This is the first paragraph of content. It continues until the next paragraph, but will not end until there is a closing paragraph tag. </p>
<p>Second paragraph, same as the first.</p>
Find / Replace
Step 1: Chapter Heading Tags
The first FIND / REPLACE you want to apply requires using “WildCards”. If your version of Word does not include wildcards, then you will need to manually add the heading tags to your Chapters.
The final results must look like this:
<h1>Chapter Name</h1>
You can manually add the opening and closing <h1></h1>tags to your manuscript, or do a find/replace (IF your chapters are titles “Chapter 1, Chapter2, Chapter 3, etc” or you can try the Find/Replace option as follows:
- Make a copy of your Manuscript — never work from the original.
- Open the Find/Replace Tool
- Under Format, select Style. This will open a new Box.
- Scroll down and select Heading 1
- Click OK
- Check “Use wildcards” box
- In the Find what field type Chapter [0-9]{1,2}
- In the Replace with field type <h1>^&</h1>
- Click Replace All
Step 2: Paragraph Tags
The majority of your manuscript will be comprised of paragraph tags:
<p>Content here.</p>
- In the Find field type ^p, (the little carrot mark is above the number ‘6’ on your keyboard: (Shift+6)) – you can also put your curser in the File field, select “Special>Paragraph Mark”
- In the Replace field type </p>^p<p> (not that the closing tag is first, </p>, this is important)
- Uncheck wildcards.
- Select No Formatting
- Click Replace All.
Step 3: Removing empty Paragraph tags
- Find <p></p>
- Replace with (nothing)
- Click Replace All.
Step 4: Remove the Heading closing Paragraph tags
- Find </h1></p>
- Replace with </h1>
- Click Replace All.
Step 5: Remove the Heading opening Paragraph tags
- Find <p><h1>
- Replace with <h1>
- Click Replace All.
Step 6: Adding Page Breaks and Anchor Tags
The Kindle requires a special page break tag. These are place just before the opening <h1> tag, with the exception of the first <h1> tag. In addition, you need an anchor tag to create your table of content links.
- Find <h1>
- Replace with <mbp:pagebreak /> <div id=”chapter” /> <h1>
- Click Replace All.
Step 7: Correct the div id tags to correspond to the chapter titles
Only use the “Find” feature. As you find each on the page, manually add the chapter number.
For Example, for Chapter 1, you would:
- Find <div id=”chapter” />
- On the page change id=”chapter” to id=”chapter1″
The id must match in the TOC.
Step 8: Creating the HTML file.
- Copy your Word converted page content
- Open the HTML page supplied with this tutorial in Notepad or other text editor
- Paste the content after the comment tag <!– PASTE CONTENT BELOW HERE –>
- Save as MyBook.html
Step 9: The TOC and Copyright
TOC: The first three chapters have been created for you. Just copy one line and paste below, modifying the #chapter(N) to the correct id. The hashtag (#) must be placed before the id.
<p><a href=”#chapter1″>Chapter 1</a></p>
<p><a href=”#chapter2″>Chapter 2</a></p>
<p><a href=”#chapter3″>Chapter 3</a></p>
COPYRIGHT: Read through the copyright and modify the areas, such as title and website.
Step 10: Upload and Preview in Kindle
Upload the saved HTML file to the KDP program. When uploading the product cover, check the box to display the cover in your book. Amazon KDP program SAYS they are now able to add your product cover image into your e-book for you — you no longer need to embed the cover into your HTML file. (I have not tested this, but they say it works.)
CAUTION: When copying and pasting code, make sure the quotes are straight quotes NOT curly quotes.
RECAP:
FIND: Chapter [0-9]
REPLACE: <h1> ^& </h1>
Style, Heading1, Use Wildcards
FIND: ^p
REPLACE: </p> ^p <p>
No Formatting, No Wildcards
Find </h1></p>
Replace with </h1>
No Formatting, No Wildcards
Find <p><h1>
Replace with <h1>
No Formatting, No Wildcards