If you read e-books, you’ve seen it. The Table of Contents at the beginning of a book, listed in blue. Tap or double-click a chapter name and voilà, you’re there. Nifty, huh? If you use Word, you know how to create that ToC, or can readily find out how, because instructions abound on the web. Heck, even KDP explains it somewhere. But what if you use a Mac and LibreOffice? You’ll find nothing helpful on Amazon’s KDP site because a) they’re indifferent to Mac users, b) they’re indifferent to LibreOffice users, and c) they’re indifferent to Mac users who utilize LibreOffice. What to do?
You could save your ODT file as a DOC or DOCX, which kind of defeats the purpose of using Libre if you ask me. Not so very long ago, KDP used to tell Mac users to hand code all the HTML, good luck! Now their not-so-helpful help entry merely says to use hyperlinks and bookmarks. Which brings me to the crux of the matter.
I use Calibre to create an EPUB from an ODT file. I never created that active ToC because I didn’t know how, didn’t have time to learn, and didn’t have the inclination to wander the web trying to find out how. Yesterday, however, through some semi-useful information found on the internet and a lot of trial and error, I figured it out. There may be a better and faster way, but this seems to work and is fairly simple.
I’m using a copy of my current WIP for the example. Note, this is the print edition layout, not the e-book, but it will do for the screencaps. Let’s assume the book is complete, save for proofing and minor changes that won’t affect the chapter layouts.
You assigned your chapter heading style as usual, but you also need to create a bookmark. Position the cursor at the beginning of your chapter title, then select Insert > Bookmark or click the Bookmark icon in your toolbar.
A dialogue box will pop up. In the first field it will say Bookmark 1.
Replace the default with the chapter number or title and click Insert. When you create your next bookmark, the detail box will show the page numbers of previously entered chapters in your document, chapter name and text. Make sure the Name and Text are the same. Upon further testing, I discovered that it’s unnecessary to replace the default. Just click insert, Libre will fill in the chapter number or title. For instance, the information in the box will read: Page 14 — Bookmark 1 — Chapter 1. Your ToC will work out okay.
I recommend bookmarking and hyperlinking at the end of your project to avoid snafus, which I won’t detail here. Continue this process until a bookmark has been created for every chapter. Now it’s time to create the hyperlinks.
Make sure Unvisited Links and Visited Links is turned on. Go to LibreOffice > Preferences. In the left hand pane under LibreOffice, select Application Colors. If the boxes Unvisited and Visited links aren’t checked, check them. Click OK. If you don’t care for the default colors, you can change them by using the pull down menu.
Position your cursor on the page or space in your document where you want your ToC to appear. Choose Insert > Hyperlink, Cmd+K, or click the hyperlink icon. In the hyperlink dialog box that pops up, click on Document in the left pane.
Under the Target in Document field is a box that says Target. On the far right is a button that looks like a scope. Click it. Another box opens. Expand the Bookmarks option — hey, look, all your bookmarks are listed. Select Chapter 1, and click Apply. In the first box under Target in Document, Chapter 1 shows up in the Target field, with the URL #Chapter 1 below it. Now, under Further Settings, click in the Text box and type Chapter 1. Click OK.
There should be an underlined blue hyperlink where you want your ToC to be. Space once, then return to go to the next line. Repeat the process for all your chapters.
Click on all your hyperlinks to make sure they take you to the correct chapter. You should notice that the link changes color once it’s been clicked.
Fine tune your ToC. Change the font size if you so desire. Use the Paragraph formatting to give each hyperlink a little breathing space. To do that, highlight all the links. Select Format > Paragraph. Under Indents, enter a value in the box that says Before Text to move the text to the right (or you can center with Cmd+E). Under Spacing, enter a value in either the Above Paragraph or Below Paragraph box to make things look less cramped. Alternatively, you could add some leading in the line spacing box. When you’re happy with your choices, click OK.
Save your document. When you convert your ODT file in Calibre, your hyperlinks will show up in your e-book, and the Calibre generated Table of Contents will also work, provided you selected the headings prior to conversion. Verify with the Calibre viewer, iBooks, and Kindle Previewer.
It may seem complicated and time consuming, but it really isn’t. Once you get into the rhythm, you’ll be finished in no time.