This is the fourth post in the Madrid Writers Club series Creating Smashwords Ebooks with LibreOffice. If you haven’t already, check out the previous three posts: 1) Setting up your template, 2) Adding your content and 3) Adding images.
Last post we learned about images and how to add them to our ebook.
Now we’re going to learn how to create a good Table of Contents and other internal links within the ebook.
A Tale of Two Tables of Contents
Nothing in the ebook creation world is ever quite what it seems.
You might remember that we created a page titled “Table of Contents” in post number 2 (shown in the picture below). You might think that this is the page readers will use to jump around the sections of your book. You might be right…. but only half right.
You see, your ebook’s Table of Contents is like Zaphod Beeblebrox – it has two faces and they don’t always agree with each other.
We’ll call these two faces the “Visible Table of Contents” and the “Invisible Table of Contents”.
The Visible Table of Contents
The first Table of Contents is easy to understand. It’s the page titled “Table of Contents”. Go to that page now and type in the names of your chapters underneath.
This might look familiar, because we did this earlier when we were creating the chapters themselves.
Now you want to format those words to whatever style you like. Remember how to do that?
No! Don’t change the font! What did I tell you before about using Styles?
I’ll leave you to format the text as you want it. Go back to the previous post if you need some help (or post a comment below). You might want to create your own Style if none of the existing ones suit your needs.
I’ve formatted this one using the CenteredText style and also added the names of the authors under each story:
Notice that it’s it’s important to make sure that there are no extra spaces (marked as dots by our invisible elves) otherwise things won’t line up properly when using centred text. The red ring shows three unnecessary spaces before the words “Author Bios”.
The Invisible Table of Contents
So, now we have the Table of Contents sorted, right?
The Table of Contents we’ve just created is what the reader will see when they get to that page in the book. However, if they click on the word the ereader won’t jump to the right chapter, it’ll just sit there doing nothing.
Also, when you click on the tab marked “Table of Contents” in your ereader (if it has one) it will be completely empty.
That’s because we haven’t filled up the Invisible Table of Contents… yet.
Now, go to the first section or chapter in your book and select the title. Then go to “Insert > Bookmark”.
A window will pop up. Here you have to enter a reference. It doesn’t have to be the same as the title itself as this word won’t be seen by the reader, just by the software.
Now you need to enter all of the other chapters of the ebook in the same way.
How to see the Invisible Table of Contents
You can see the bookmarks by going to “View > Navigator” or pressing F5.
Then double-click on “Bookmarks”. Don’t worry that they are listed in the wrong order.
When you double-click on the bookmark name LibreOffice will jump to that chapter.
Remember, it’s the name on the page which will appear in the Invisible Table of Contents, not the name of the bookmark.
So, for example, my Invisible Table of Contents will show “Story 1” and not “s1”.
Linking the two Tables of Contents
So, fine, we now have two separate Tables of Contents. But, that’s not very helpful if the reader still can’t click on the Visible Table of Contents and have it jump to the right chapter.
Now we’re going to link the two. First, go back to the “Table of Contents” page and select the name of the first chapter.
Then go to “Insert > Hyperlink” or press “Ctrl+K”.
Then go to the “Document” tab in the window that pops up and click on the circle inside the “Target in document” section.
Then, double click on “Bookmarks”, choose the name of the first bookmark, click “Ok” and then “Apply”.
Now when I ctrl-click on the word “Introduction” on the Table of Contents page it’ll jump to the correct page.
You’ll notice it’s also changed the colour to blue and given an underline so that the reader knows it’s a hyperlink.
The Power of Bookmarks
For many people, a table of contents is all they need. However, for our anthology we wanted a section of Author Biographies. At the end of each story we wanted the reader to be able to jump to the author’s “bio”.
For this type of link we need to use a new type of Bookmark, a “reference bookmark”. These have names beginning with “ref_”, which tells Smashwords not to include the bookmark in the (Invisible) Table of Contents.
You can also use this type of bookmark to jump around Choose Your Own Adventure books, such as was done in the successful choose-your-own-erotica book Follow Your Fantasy by one of our members, Nicola Jane.
Creating a reference bookmark
First, we go down to the Author Bio section and copy in the author’s biography.
As you can see, I’ve used the inbuilt Heading 2 style for the name of the author. Now, we want to add a reference bookmark to the author’s name. Select the words and, same as before, go to “Insert > Bookmark”.
Now, in the pop-up, enter the bookmark name but be sure to add the prefix “ref_” and click OK.
Linking to the bookmark
Finally, we’ll go to the end of the corresponding short story and type in the “link text”. Then select it.
With the text selected, now add a Hyperlink to the new reference bookmark as we did before.
Now when the reader clicks on the line of text they will be transported to the bio. You can add as many reference hyperlinks as you like and they won’t show up in either Table of Contents.
These type of links can also be used to make footnotes!
Until next time…
To recap, in this post we have:
- Learned about the two Tables of Contents in ebooks
- Created both the Visible and the Invisible Tables of Contents
- Linked the two so that the reader can use them effectively
- Learned how to create reference bookmarks for internal linking within the book.
Next time, in the final post, we’ll learn how to upload the book to Smashwords and debug it using free tools.