14 Replies Latest reply on Jun 16, 2013 9:13 AM by JamesLande

    How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

      The procedure involves creating a well-formatted Kindle book first, and then converting it to epub using the free Calibre software.


      Building of Kindle books is described here. The simplest basics of the HTML language are explained here. A good HTML template for an ebook can be found here (right-click and save as an html file).


      First, you need to edit your HTML file (from the procedure above) to make some adjustments to the .epub format. Create a separate file folder for the Nook book and copy and paste all your .mobi book files (NCX, OPF, HTML, JPEG and all other files). I recommend creating this Nook book folder in the same location where your MobiPocket book directory is located and giving it the same name plus N at the end. Now you need to edit the new mpb_toc.html file (using Notepad) to correct the name of the directory in all HTML links (keep in mind that in HTML
      references, %20 means a space, %5C a backward slash, and %3A is the code for the colon symbol “:”). If you used my HTML template for your Kindle book, you need to delete all extra line breaks after each heading in the HTML file of your prospective Nook book. In Microsoft Word, you can do this easily using the “Replace” feature, which can be found on the right-hand side of the “Home” ribbon in Word 2007 and 2010 or in the “Edit” menu (Word 2003 and earlier). How to use Word to edit your HTML file was described in detail above. In the “Replace” dialog box, type </h1><br> in the “Find what” field and </h1> in the “Replace with” field. Click “Replace all.” Do the same for the h2 tags. This operation is necessary because epub-converting software creates extra line breaks after each heading and you already have those in my HTML template. In a similar fashion, replace all occurrences of “color: windowtext” (without quotes) with “color: #084B8A” (without quotes). I also recommend replacing all occurrences of </p><br> with </p><br><br> because epub-converting software deletes all spaces between paragraphs if you have them in your book.

      If you have internal links (cross-references) inside your book (aside from the Table of contents links) you may want to insert a friendly warning at the beginning of the book along the lines of: “Because currently there is no “go back” button in Nook reading applications, please remember your current page number before clicking on any link inside this ebook.” Strangely enough, Nook reading applications are not link-friendly at the time of this writing, although this may change in the future.

      Now build the new .mobi file using KindleGen and your Nook files and select no compression (use the new file folder name and -c0 instead of -c1 in the command line).

      Download and install the free Calibre software. Start the “Calibre – E-book management” application and press the “Add books” button. Navigate to the new version of the .mobi file in your Nook book directory and click “Open.” Calibre will import your ebook and add it to the Calibre library. After that, select your ebook in Calibre (single left-click) and press the “Convert books” button. By default Calibre will convert your book to the .epub format, exactly what you need for the Nook eReader. In the “Convert” dialog window, click the “Page Setup” tab and select “Nook” as your output format and “MobiPocket books” as your input format. Do not change any other settings. Click “OK.” Calibre will convert your .mobi book and place the .epub file (the finished NookBook file) in the same directory as your imported ebook files (depending on where you chose to place the “Calibre library” directory when you installed the software). The whole process can take several minutes depending on the size and complexity of your ebook. As soon as “Jobs: 1” changes to “Jobs: 0” in the lower right-hand corner of Calibre main window, you can go to the “Calibre library” folder and check out your .epub file. There are several things
      you need to know about this conversion process:


      1) Calibre automatically creates the NCX table of contents and you do not have to do anything yourself. This is good news. The bad news is that this NCX is based on and identical to the regular table of contents that you created in MobiPocket Creator awhile back. To be precise, the Calibre NCX contains navpoints corresponding exactly to all of the items in the mbp_toc.html file. If you created a custom NCX file that is different from your regular table of contents, this custom NCX will disappear from your .epub book file.

      2) Be sure to check what your ebook looks like in the Nook for PC application. To do this, start “Nook for PC,” click on “My library” -> “My Stuff” -> “Add new item.” Then navigate to your .epub file in the dialog box. Now you can browse your book and check the formatting. Most likely you will have to edit your HTML file and rebuild the book many times until you achieve a nice format. If you close the Nook for PC application while your book file is open, it may produce an error message; this is normal and should not be a cause for concern (any software contains bugs). To delete this ebook from “My Stuff,” go to the “My Documents” folder on your PC, open the folder “My Barnes & Noble Books,” and delete the .epub file manually.

      3) You can also check the formatting of your book in the Calibre eReader by pressing the “View” button in Calibre. The Calibre eReader contains a few bugs at the time of this writing and it does not match the appearance of your ebook on the Nook eReader exactly. You can also preview your book in some other software or by means of the “Preview” function on the Barnes & Noble self-publishing website after you upload your ebook for publication.

      4) If you have a lot of internal links inside your book, make sure all of them work properly because Calibre may screw them up. (The nice thing about Calibre is that it is free; thank you, Kovid Goyal! But free software, in my view, tends to have more bugs than paid software.) Calibre breaks up your HTML file into many small HTML files, mostly using your page breaks for this purpose and also making sure that all files are less than 260KB. If you have h1 or h2 tags (headings) that are associated with named anchors (internal links), and if these headings are not preceded by a page break, then Calibre will create separate HTML files for the portions of the book corresponding to these headings and your anchors and headings may end up in different files. To prevent this problem, make sure that all headings and subheadings in your main HTML file are preceded by a page break (and make sure that a named anchor and its associated heading are not separated by a page break).

      5) If a named anchor is located at the very end of a chapter (i.e., at the very end of a separate small HTML file created by Calibre), then the link associated with this anchor will not work well and will be pointing to a location several lines of text upstream of your anchor. To prevent this problem, you can insert approximately 30 line breaks (<br> tags) before each page break.

      6) Calibre does not handle ordered and unordered lists well (the ol and ul tags in your HTML code). If you use a small font size for the HTML lists, Calibre will convert it to the normal size. Calibre also makes all lists left-aligned. You can either ignore these minor problems or you can do some tinkering with the conversion options and/or your HTML code.

      7) The quality of the cover image created by Calibre is rather low and the dimensions are down-sized to 530x706 pixels. You can open the .epub file using the free 7-Zip software and replace the file with a good-quality image using the following approach. Resize your original JPEG cover image to the 600x730 pixel dimensions in your graphics editor (according to B&N, these are pixel dimensions of the Nook screen and the optimal cover size) and save it with good or best quality options (compression to 96-97% JPEG quality will produce an image about 250KB versus the Calibre cover at approximately 80KB). The size of your image file should be less than 260KB because some .epub reading software cannot handle large files. Change the name of your cover image file to “cover.jpeg” to match the name and extension of the .epub cover file. Delete the cover image from the .epub file while it is open in 7-Zip and then drag and drop your good-quality cover image to replace the deleted file.

      8) The double conversion process (from .html to .mobi and then from .mobi to .epub) will significantly reduce quality of the images inside your book, if you have any. For example, if you started with a JPEG file at 35KB before creating a .mobi file, you may find that the final image file inside the .epub file is only about 5KB (!). If you open your .epub file in 7-Zip, all of your interior images are located inside the “images” folder. They are named consecutively 00001.jpg, 00002.jpg, and so on. You can extract those images to your desktop to see which file is which image and you can replace them all with good-quality images as described above for the cover image (making sure that file names and extensions exactly match the image files you are replacing inside the .epub file).


      You are all set. After your .epub book is ready, you can go to the PubIt! website, create an account (if you do not have a Barnes & Noble account) and then set up your NookBook for sale on the Barnes & Noble website. You will see most of the same options as you have on the Amazon’s KDP website. For example, you can select digital rights management (DRM-protection) for your book and enter book description, list price, select a category, etc. The PubIt! platform requires you to enter the name of the publisher, and you can either use your own name or simply enter “PubIt.” After you fill out all fields, upload and preview your book, you can click the “Put on sale” button, and your ebook will appear on the Barnes & Noble website within one to two weeks. Although the description states that the publication process takes 24-72 hours, in reality it often takes longer, and you shouldn’t get worried if the web page of your ebook does not appear on the B&N website after 3 days.

      Be advised that if you enter editorial reviews on the detail page of your NookBook, the field “Where Review Was Published” does not work and whatever you put in there will not be shown on the web page of your NookBook. On the other hand, the first and last name of the reviewer will be displayed successfully. If this is the very first time you are entering an editorial review for your NookBook, you can enter both the first and last name of the reviewer in the field “First Name” and the name of the source (e.g., “The Library Journal”) in the field “Last Name.” This way, both the reviewer’s name and where the review was published will be displayed successfully. If the editorial reviews have already been published on the B&N web page of your ebook and the review source is not displayed (because you used the field “Where Review Was Published”), then there is nothing you can do, aside from trying to contact pubit@bn.com asking them for help.

        • 1. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

          Very useful information, but wow the hoops to jump through.


          So how's this process under Linux?

          • 2. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

            Well, I agree that the post is a little confusing :smileyhappy:

            I tried to change the title to "How to convert a Kindle book to NookBook, but it's too late for that. I guess editing of posts is only allowed for the first few hours.

            • 3. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

              I know an easier way, in fact just used it to publish a Kindle picture book on Nook. 


              Don't know if man2010 and torrence are the same person, but I owe man2010 a thank you for pointing out some stuff with *.html.  Made the Kindle and Nook postings possible.  Put your TOC in while in Word.  Follow directions under HELP. 


              First it is a good idea to read about modifying *.html as mentioned above.  Some things are not so obvious.  The tags for blank lines may be very long, for instance.  And images may be inserted in the middle of paragraph lines.  With enough looking around and comparing, you can figure out what tags do what inside your *.html version.  I separated and stripped images, captions, and paragraphs, arranging everything the way it looked best.  Just a matter of finding an image or paragrah you like, copying the format, and sticking in the image or paragraph you really want. Then you can bounce back and forth between *.txt and *.html versions making corrections.  Once you have the *.html version with TOC you like, you are close.

              I used SIGIL (free download) to change *.html into *.epub.  Also used SIGIL to correct mistakes in TOC.  When I was satisfied with this, I used Calibre to convert to *.mobi.  Thanks to man2010, I found all the extra spaces and trash in *.html that were screwing it up.  The new *.mobi version is much better. I uploaded the *.mobi version to Kindle.

              Now the counter-intuitive part.  The *.epub file made by SIGIL will not upload correctly to Nook, at least not with images.  So, I used Calibre again.  I uploaded the SIGIL *.epub version into Calibre and converted it to Calibre *.epub version.  (They are stored in different folders, so don't overwrite one another).  The Calibre *.epub with images does upload correctly to Nook.  Done!

              If you want to look at a book with 204 images, download the sample of What Your Doctor Won't Tell You About Your Lower Back from either Kindle or Nook site.

              And thanks, again, to everyone who gave me hints.  Hope this helps others.

              • 4. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                This thread needs to stay up front where newbies can find it.  If you agree, attach a note like this and it moves the thread to the front of the pack.

                • 5. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                  For those wanting to publish to Nook or Kindle, I wouldn't waste a minute trying to format, or create HTML.

                  Even though I'm a programmer, and could, it is just complicates the whole process far too much. Especially for newbies who don't program.


                  Simply check out Sigil, and it's capabilities. All you need. Whether it is a picture book, text with images, or just text. Type just like you are in word. Cut and Paste images just like word. Simple.


                  It isn't that complicated. Works for Kindle and Nook both.

                  • 6. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                    Lastly, Sigil works fine with images. Not sure why you were having issues, but I create my children's books with Sigil. Most image failures occur from improperly formatted images.

                    • 7. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                      I put the text and images into a Word .doc and it uploaded like a dream.

                      I do have Sigil, but didn'r use it.

                      My book is simple, so I can't speak to a complicated book.

                      • 8. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                        I have a manuscript in Times New Roman I would like to transfer to Word.  The computer I have has a starter version of Office 2010 with Word on it.  Seems to do everything Word should do.  How do I find out if it's compatible to be uploaded to PubIt?


                        I have a simple book; maybe 180 pages, with a B&W line drawing cover, and maybe twenty small line drawings to be inserted in the text. Centered, or flush left or right is OK.  Also some drawn first alphabetic character in each of 10 chapters.


                        I'm hoping to do the text in Word, and maybe scan the line drawings into jpegs and then choose them to be inserted into the text.


                        Also, if I choose a smaller page size in Word, i.e. from 8 1/2 x 11 down to 6 x 7 say, will that be what is printed out if someone chooses a print version rather than an ebook?  I would like the printed book to be small, about the size of the Nook screen.


                        Any Word formatting help would be appreciated by this newbie. :-)

                        • 9. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                          Still not sure whether my version of Word can be uploaded to PubIt or not.  I don't want to go through retyping the whole thing if it's not.  I've contacted some of the services recommended, but no reply.


                          I'd be interested in the experiences of anyone who's tried to do the formatting themselves, and are happy with the result.

                          • 10. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template



                            I used Calibre v0.8.26 to format my html-formatted text into MOBI and EPUB formats. The table of contents shows up fine in the MOBI book, but not in any of my EPUB readers (Nook, Sony).  Is there any special coding that needs to be added to the source material for the TOC to be generated?



                            • 11. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template



                              I really like Sigil too. However, I'm having problems with adjusting font size, font type, and line spacing on the Nook itself. And it doesn't matter which device. I've tried it on the Nook Color, Simple Touch, first gen, Nook app for Adroid, iPhone, and for PC.


                              Any suggestions on how to fix this? Readers should be able to change font size, especially.



                              • 12. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                                Here's a curious problem with my Nook ePub TOC. When displayed in the NookPress Manuscript Editor Preview the TOC has extra entries, such as id1145, inserted in between the Content entries. 






                                In Medias Res


                                Chapter One



                                These extra entries do not display is any other viewer (Calibre, Kindle, Kindle Previewer, Adobe Digital Editions) or in other formats created by Calibre (pdf, rtf, txt).


                                In the book, most chapters open with two parts - a chapter intro followed by a page break, and the chapter.



                                In Medias Res ...                 (this is tagged with h2 in the html)

                                Dramatis Personae

                                Fokie Tom - renegade English pirate of the China seas    

                                (other info, tables, drawings)

                                [page break]


                                [Chapter beginning

                                In Medias Res ...                      (normal style)

                                (In the middle of things…)

                                Wednesday, April 18, 1860, 6:30pm


                                The TOC entries all point to chapter intros. The id1234 entries point to the chapter. The html looks like this:


                                <h2><a name=cCh00InMediasRes></a><b><i><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>In Medias Res ...</span></font></i></b></h2>


                                <p align=center style='text-align:center;text-indent:0in'><i><font size=3 face="Times New Roman"><span style='font-size:12.0pt;font-style:italic'>Dramatis Personae</span></font></i></p>


                                <p><font size=3 face="Times New Roman"><span style='font-size: 12.0pt'>Fokie Tom - renegade English pirate of the China seas</span></font></p>


                                *   (other info, tables, drawings)


                                <font size=3 face="Times New Roman"><span style='font-size:12.0pt;font-family: "Times New Roman","serif"'><br clear=all style='page-break-before:always'> </span></font>


                                <p><font size=3 face="Times New Roman"> </font></p>


                                <p align=center style='text-align:center'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>In Medias Res ...</span></font></p>


                                <p align=center style='text-align:center'><i><font size=1 face="Times New Roman"><span style='font-size:9.0pt;font-style:italic'>(In the middle of things…)</span></font></i></p>


                                The chapter name itself is in normal style, without any heading format that would trigger capture in a TOC. The mobi is created with Kinglegen. Calibre then converts the mobi to ePub, specifying Nook output, and "Do not add deteched chaptera to Table of Contents" is checked. The TOC is manually examined after ePub creation - that TOC is fine.


                                What is happening, and where does it happen? Seemingly, something in the HTML created by Word 2007 is finding its way into the mobi but is detected only the NookPress Preview. I don't know enough about ePub or Nook to guess how an "id1145" would be created, or why, but apparently it represents some TOC element recognized only by the Nook previewer.


                                Any help out there?

                                • 13. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                                  I used Calibre v0.8.26 to format my html-formatted text into MOBI and EPUB formats. The table of contents shows up fine in the MOBI book, but not in any of my EPUB readers (Nook, Sony).  Is there any special coding that needs to be added to the source material for the TOC to be generated?


                                  Click on the "Table Of Contents" tab within Calibre. Look for the line that says "Level 1 TOC (XPath expression)", and type in a statement in XPath syntax that tells where your new chapter starts in the HTML doc.


                                  For instance, if this is a typical line in the HTML,

                                  (h1)Chapter 5(br)The Plot Thickens(/h1)


                                  then the XPath code that you would enter for "Level 1 TOC" would be



                                  If this is a typical line of your HTML,

                                  (p class="Futura24Bold")Chapter 4(br)A New Hope(/p)


                                  then the XPath code that you would enter for "Level 1 TOC" would be

                                  //h: p[@class="Futura24Bold"]

                                  (Note: there should be no space between the ':' and the 'p')

                                  • 14. Re: How to create a well-formatted NookBook: cover, table of contents, NCX, plus HTML template

                                    We have found that Nook upload creates TOC entries for every page break (even when the Calibre Chapter Mark option is changed from pagebreak to none). In a test upload of our ePub, we removed all page breaks except those preceding an actual chapter heading, and this removed some 50 or so of the id---- TOC entries in the Nook TOC. The actual chapter headings are correct.

                                    We still have 5 of the id---- TOC entries, but there are no page breaks where they occur. These entries point to the middle of text and paragraphs for no apparent reason that can be seen in the source document or the HTML. As before, these extraneous id---- TOC entries in the Nook TOC do not appear in the TOC of any other reader. Even when the Nook ePub is downloaded to Calibre, the id---- TOC entries still do not show.

                                    We probably will just use this flawed ePub for our Nook, as no one seems to be able to say how id---- TOC entries are created by Nook, and we have already spent far too much time trying to correct the Nook TOC.