Kindle Publishing - Create NCX File – and Block Paragraphing
Kindle publishing is a web-based platform provided by Amazon for writers to publish electronic books that are sold worldwide in Amazon stores. That sounds very good but the process of uploading your book to Amazon can be frustrating if you do not read carefully their fine prints. The truth is, if you don’t know how to do it, you can find yourself spending hours, days or weeks in just trying to upload your book in a format that is acceptable.
Amazon recommends that you first write your book as a Microsoft Word document, then convert it to web filtered html file, and then upload it to Amazon’s for final conversion to kindle format.
The setting for block paragraphing in MS word is set to default using a crude logic such that those without formatting knowledge, including children, can use MS word to prepare simple documents. We have grown used to that - you just need to hit the enter tab twice and you have a block paragraph. You hit the tab a few times to the right and you have an indent paragraph. The assumption here is that those with know-how can format MS word to their liking, and that those without know-how need not format anything to make acceptable documents. On the other hand, kindle is set to indent the first line of a paragraph by a default amount if the paragraph formatting is not set in your document.
The default first line indent in kindle is a good setting for those publishing novels who may only need just that default indent. Trouble starts if you did block paragraphs by just using default settings for MS Word. It’s because of this that you may upload a good documents with block paragraphs for kindle formatting and the document comes out with paragraphs joined contrary to your expectation. This presents the first problem. To solve it you need to set MS word first line indent to 0.01 inch which is an indent but not easily noticed by the reader.
In this step-by-step guide on creating ncx file and block paragraphing for kindle publishing, we are going to use the text shown below. That text will represent our imaginary book.
Places to Travel
On Your Honeymoon
By Alan Smith
This e-book is covered by international copyright and thereby protected from being reproduced or transmitted in any form or by any means, electronic or mechanical, including writing, photocopying, recording, taping, or by any information storage and retrieval system, or in any other manner used illegally….
Table of Contents
If you are planning on getting married to a person who is passionate about nature, you should as well be planning to travel to Africa where you can follow the migration of Wildebeests from Serengeti to Masai Mara….
2. Destination Africa
South Africa is a wonderful destination. A destination to South Africa would be full of real beauty, culture, and plenty of history. Morocco in the north of African is also a very romantic destination….
2.1 The Royal Family
But destinations in Kenya have been popular with the royal family of Britain….
2.1.1 Treetops Kenya
Travel to Treetops in Aberdare National Park, Kenya, would be a neat destination… On February 5-6, 1952, a girl by the name Elizabeth Mary was at Treetops, in a giant fig tree overlooking a waterhole frequented by wild animals, when her father died making her the Queen of Great Britain, Ireland and of the British Dominions beyond the seas…..
2.1.2 Lewa Wildlife Conservancy
And it was at Lewa Wildlife Conservancy in Kenya that Prince William proposed to Kate Middleton….
2.1.3 Lake Victoria
Lake Victoria, named after Queen Victoria, is another cool destination in Kenya that has recently been popularized by the name of Mr. Obama as travelers seem to be curious of finding the linkage of this lake and ….
What you have learnt in this book has been drawn from many years of experience traveling in Africa. Take the opportunity of your honeymoon to visit Africa….
Step 1: Settings for Block Paragraphs
Copy the text shown above and paste it on a blank word document. After you have pasted the text, insert page break for the title page, copyright page and table of contents page. To insert page break: place the cursor where you want the page break to start, go to insert, break, select break, and then OK.
After you have pasted the text and have page breaks in place, go to edit and select all. Then go to format, paragraph, indents and spacing, and select special indentation of first line and insert a value of 0.01” as shown in the figure below, and then OK. You can now check any first line of your text and you will find the indent is formatted as 0.01 inch. Different versions of MS word may have slightly different ways of doing it, but find it and do it.
Step 2: Insert the Table of Contents
Our text is in MS Word normal formatting. Use bigger font sizes and bolding for titles and sub-titles. No style formatting of heading 1, heading 2, and heading 3 is used. Avoid them because when the document is processed by kindle, the formatting seems to be lost and your formatting for block paragraphs is lost as well. Without style formatting of heading 1, 2 and 3, the ability to insert instant table of contents is lost. But it’s better than having to deal with lost formatting after the file is uploaded to kindle. You proceed as follows:
Put the cursor one/two lines below the heading, ‘Table of Contents’.
Go to Insert, Reference, Index and Tables, Table of Contents, unselect show page numbers, select use hyperlinks instead of page number, click show outlining tables, and two buttons will form on the formatting toolbar as shown in the table below. Also, just where you had put your cursor, you will get this message:"Error! No table of contents entries found". Just leave that message there as it will be overwritten by your first entry.
Highlight your first title that you would want included in the table of content. In this case we highlight “1. Introduction” and on the outline level shown we select level one, and then we click update TOC button as shown in figure below. The title select will appear under the table of contents. We repeat the same process, each time selecting the appropriate level until we are done with the text of our book.
At the end, our table of contents should look as follows:
Table of Contents
2. Destination Africa
..2.1 The Royal Family
....2.1.1 Treetops Kenya
....2.1.2 Lewa Wildlife Conservancy
....2.1.3 Lake Victoria
Highlight the entire text of table of contents and add the block paragraphing indent of 0.01" as we had done earlier for the rest of the document.
Step 3: Start and TOC Are Mandatory Bookmarks
It’s mandatory that a hidden mark called bookmark should be placed at the start page and at the table of contents. The start and table of contents marks should be labeled as 'start' and 'toc' respectively.
Center the Title. Then, place the cursor immediately above the title of the book, go to insert, bookmark, type bookmark name as start, click add. Place the cursor at the table of contents, go to insert, bookmark, type bookmark name as toc, click add.
Save your work as places_to_travel.doc . If you are using MS Word 2007 and above, save the file again using the older .doc format, say, Word 2003. Make note of where you have saved your files. You can create a new folder specifically for that.
Save the file again as a web filtered html or htm, perhaps on your desk top.
Step 4: Mobipocket Creator And Kindle Previewer
Download and install
i) Mobipocket eBook Creator - On October 31, 2016, Amazon permanently shut down the Mobipocket website and servers.
Step 5: Enable Files Extensions
Enable 'show file name extensions': Go to control panel, click folder options, view tab, advanced setting, un-tick hide extensions for known file types, and then OK. You will need to do that to facilitate in the creation of ncx file.
Step 6: Open Mobipocket Creator
Open Mobipocket Creator. Import your filtered html file, places_to_travel.html to mobipocket creator. The screen of mobipocket creator should look as shown below:
Step 7: Add Cover Image
On mobipocket creator, select cover image and import your jpeg cover image which you should have stored in your computer. In this case, which is for illustration only, I am importing an image of Queen Elizabeth which is in public domain at Wikipedia. Click update.
Step 8: Add Metada
On mobipocket creator, omit create 'table of contents' since we had already created one earlier on. Omit 'book setting' since the information there is obvious and it’s already filled for you. Click on Metada and fill the information on spaces marked in red. Click update.
Step 9: Add start Guide Item
On mobipocket creator, click guide, then new guide item, select start, browse for the file 'places_to_travel.html' that you imported to mobipocket creator. It should be located in ….\Documents\My Publications\places_to_travel. On the space marked file name, you should now have the file places_to_travel.html. Add "#start" at the end of the file so that your file in that space becomes places_to_travel.html#start.
Step 10: Add toc Guide Item
When you are still on guide, again click new guide item, select toc for table of contents, browse for the file 'places_to_travel.html' that you imported to mobipocket creator. It should be located in ….\Documents\My Publications\places_to_travel.html. On the space marked file name, you should now have the file places_to_travel.html. Add "#toc" at the end of the file so that your file in that space becomes places_to_travel.html#toc . Click update.
Step 11: Build
On mobipocket creator, save by clicking save on the top buttons, and then click build. Hopefully, your build so far should have no errors, and if it has, you have to do it all over again.
Step 12: Create toc.ncx File
On the folder containing ….\Documents\My Publications\places_to_travel.html , right click below the file icon, select new, then text document, rename the new text document as toc.ncx. Make sure you delete the .txt extension so that you do not end with a text file called toc.ncx.txt. ".ncx" is the file extension of a file called toc. Right click toc.ncx, select open with Notepad. Alternatively, you can open your notepad editor by: go to open file, and navigate to where the toc.ncx file is located and open it. Copy the following standard text shown in between the +++++ signs. Do not copy the +++signs. Paste the text you have copied on the open toc.ncx file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
<meta name="dtb:uid" content="uid"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
<docTitle><text>Places to Travel In Africa On Your Honeymoon</text></docTitle>
<navPoint id="titlepage" playOrder="1">
<navPoint id="toc" playOrder="2">
<navlabel><text>Table of Contents</text></navLabel>
<navPoint id="nav-3" playOrder="3">
<navPoint id="nav-4" playOrder="4">
<navlabel><text>2. Destination Africa</text></navLabel>
<navPoint id="nav-5" playOrder="5">
A). In step 3, we created the mandatory bookmarks on the headings of start page and table of content page. When we created a table of contents on our documents, hidden bookmarks were created on each of the pages that the items of the Table of contents link to. These bookmarks are not mandatory and we may, or may not, include them in the NCX file. In our case, we shall only include the toc items of level one only.
Open your file saved as web filtered html with Notepad. You do that by right clicking the file and then selecting open with Notepad. From the text, find “introduction”. Take number href="#_Toc325752883” appearing before the word “introduction” and insert it at the end of the paragraph containing “nav-3” as "places_to_travel.html#_Toc325752883". This is already done, but you have to include the number generated by your computer for your web filtered html file because this number will be different for computer. So, replace that number by the number you have in your web filtered html file.
B). Then find “Destination Africa”. Take the number href="#_Toc325752884” and insert it appropriately on the paragraph of nav-4 as we have done in A) above. Your href="#_Toc will be different from mine. So, use the number you have in your web filtered html file. In my case, I have inserted "places_to_travel.html#_Toc325752884".
And finally find “Postscript”. Take the number href="#_Toc325752889” and insert it appropriately on paragraph of nav-5 as we have done in A) and B) above. In my case, I have inserted "places_to_travel.html#_ Toc325752889".
When you open your web filtered html file with Notepad, the text there should look as shown in the image shown below:
C) Carefully replace all “.” with “ .” in:
“2. Destination Africa”, and
So that you get:
“2. Destination Africa”, and
This is because all non-alphabetic and non-numeric characters have to be replaced by HTML code equivalent. Characters such as, !, ?, :, %, &, ), (, +, etc. will need to be replaced if you are to use them. You can search for HTML ASCII Characters from the internet or from this website.
D) In our document, the “title’ comes before “tables of contents”. The “copyright” is in between. The bookmarks “start” and “toc” for the title and table of contents are mandatory and we have reserved them for playOrder 1 and playOrder 2 respectively. This is to say that the bookmark “start” corresponds to playOrder="1" and bookmark “toc” corresponds to playOrder = “2”. If we had included a bookmark for “copyright” because we felt it should be included in the NCX, then, the “copyright” playOrder would be =”2” and the playOrder for toc would then be changed to playOrder =”3”. All other playOrders coming after the toc heading would then have to be increased by one.
E) We decided to use five headings, including the mandatory title and table of contents, in our document. If we had a big document and felt we need to show, say, 19 headings for NCX, then, we would have used 19 playOrders. Obviously, every bookmark used for NCX has to be marked by either the use of hyperlinks on the table of contents or directly on the headings on the body of the document.
F) Take note of the tag <docTitle> where we have put the title, Places to Travel in Africa on Your Honeymoon, as well as the tag <docAuthor> where you put the name of the author, Alan Smith. Take note of that so that when you create toc.ncx file for your real book, you will replace the content of those spaces with the title of your book, and your name as the author.
When you are done with A) to F), save and close your open toc.ncx file.
Step 13: Manifest and Spine Tags
Open the file places_to_travel.opf from ….\Documents\My Publications\places_to_travel.opf with Notepad and insert the following:
After the first manifest tag, add the following:
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml"/>
So that the entire manifest tag for this example will look as follows:
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml"/>
<item id="item1" media-type="text/x-oeb1-document" href="places_to_travel.html"></item>
Replace the first spine tag, <spine>, with <spine toc="ncx">
So that the entire spine tag for this example will look as follows:
After the changes, save and close the file places_to_travel.opf in the open Notepad.
Step 14: Build Once More
On mobipocket creator, Open the places_to_travel.opf file again and click build once more. If there are no errors listed, then you can go ahead and open the .PRC file with Kindle Previewer which you had installed earlier on. If there are errors, then you have to correct them. Sometimes it can be easier to start all over again rather than trying to imagine where the errors are.
Step 15: Open .PRC File with Kindle Previewer
Open the file places_to_travel.prc in ….\Documents\My Publications\places_to_travel with the Kindle Previewer which you had initially installed. Once open, check if the NCX, TOC and Cover have been successful done to your expectation. If so, you have succeeded.
Naturally, if you would like to do a correction to the document, you would have to do it at the Word .doc file and then save it as filtered html file to overwrite the previous one. Then copy the filtered html file and paste it to overwrite the html file at …/Documents\My Publications\places_to_travel. On mobipocket creator, open the places_to_travel.opf file and then build. Preview places_to_travel.prc by Kindle Previewer and you will see the correction you have made.
The file places_to_travel.prc is what you upload to Amazon for kindle publishing. Finally, disable file extensions which you enabled in step 3 above.
Step 16: Results
Our results as previewed through Kindle Previewer are as follows:
A) The Cover is as shown in the image below:
The results of the cover image are within our expectation. This image is a picture of Queen Elizabeth II which is in public domain at Wikipedia. Image Credit goes to NASA/Bill Ingalls
The results of the Table of Contents are not within our expectation. We expected the TOC will show entry up to level 3. But as you can see, entries for level 3 were put in level 2, the same level as entries for level 2. Entries for level 1 and level 2 are OK. It is important to take note of this before building the table of contents. If we do, we can avoid showing sub-titles of level 3 in the Table of Contents; otherwise, we have to bear with limitation of kindle technology that is available for now.
The results of the body matter are within our expectation.
The results shown above are what we got here. We thought that if we used the same text of a document with the reader for this worked example, it would be easier for the reader to follow how to go about creating block paragraphs as well as creating the toc.ncx file for kindle publishing. If you can be able to do what we have done here on your own, then, you can be able to do better for your 2000-plus page book.
You can search at Amazon for the “Indie Author Guide To Publishing For The Kindle With Amazon’s Digital Text Platform, Mobipocket Creator & MS Word 2003 Or Higher” for fullest details about creating NCX file and block paragraphing for Kindle publishing. Once you can do the basics, the sky is the limit to what you can create for kindle publishing.
Good luck with your book.