When you create a Table of Contents in a Word document, Word does some pretty hacky stuff using its Bookmarks feature. Even if you delete the Table of Contents you created in Word (which you should do, as Leanpub generates a Table of Contents for you automatically based on lines styled as
Heading 1 in your Word document), that will not get rid of the problem in your Leanpub-generated files.
This is because the invisible stuff Word did in the background when you created your Table of Contents is not cleared properly from the Word document when you delete the Table of Contents. You can't see the nonsense left behind, but it is there.
Below are the steps to manually delete what Word does and fix up the ebook files created by Leanpub's book generators from your Word document. Following these steps may take a few minutes and involve a bit of mouse-clicking, but you only need to do it once.
(Please note these are instructions for Word version 15.32 for Mac, so things might work a bit differently for you if are using a PC or a different version of Word.)
- Open your Word document
- In the menu, select
Hidden bookmarks(If it is already selected, then you may have to un-select it and select it again, to get it to work)
- Select a bookmark and click
- Repeat Step 4 until you have deleted all the bookmarks.
There is a way to get rid of all the bookmarks all at once. If you'd like to try it, follow the steps in this article.
If you are looking for more information and guidelines for writing a Leanpub book in Word, please read this blog post.
If you would like to start over with a new Word document, please download this Word document, which sets out all the Leanpub formatting options. We recommend you read the document (it's just a couple of pages) and delete all the body text and image etc. when you're done, and then, start writing!
If you're interested in what is going on here, and why at Leanpub we have fundamental technical (and indeed cultural) beliefs about why using "binary" word processing software like Word is sub-optimal, not only for writing books but also for scholarship, and, well, humanity, please read this post by Leanpub Co-Founder and CEO Peter Armstrong.