magic with TOC: edit or create a TOC for your documents or ebooks

Hope you enjoyed polishing and shining your e-books. Now let’s look at more heavy duty stuff. The last post already detailed how you can get the “Edit TOC” button on the main toolbar. It is the rightmost button on the main toolbar in the figure below.

Create TOC:
If you have an e-book without a  Table of Contents (TOC),  but it is well structured with headings calibre allows you to create a TOC in a few simple steps.Consider the following “Example Ebook”:

As you can see the e-book has no TOC, although it has headings and sub headings. Select the e-book in the main calibre window and click the “Edit TOC” button. A new window opens with the following options in the right side menu.

Click on “Generate TOC from all headings. The following TOC shows up in the editor window:

It has a well constructed TOC. Sometimes the headings in the ebook file are not well marked and some may be missing. In that case you can edit the generated TOC as explained in the next section.

Here is what the above generated TOC looks like in the calibre viewer:

Edit TOC:
So here I will start with a book that has an unsatisfactory TOC and play around with some of the available tools to make it better. This is just an example to show you some of the things you can do.

The above figure is a snapshot of the calibre viewer with the TOC of the e-book displayed. This TOC is messy as some chapters are subsets of others and although the chapters have names in the book, the TOC only lists chapter numbers. So lets see what we can do to spruce it up.

Select the e-book in the main calibre window and click the “Edit TOC” button. Then the above window opens up. Now as you can see Chapter II to Chapter XI are a part of Chapter I. Now say you want to make them independent chapters not belonging to Chapter I then select Chapter I and click the “Flatten this entry” button on the right hand side menu. Once you do this you will see:

If you now click “OK” and view the ebook the TOC looks like

As you can see in the two above figures Chapter II to Chapter XI are in the same level as Chapter I and not a part of it. But now say you want to make Chapter I to Chapter XI all members of Part I of the book. That too can be done.

In the “Edit TOC” window shown two figures above select “Preface”. Then on the menu on the right, click “New entry below this entry”. This takes you to the following window:

Move the mouse and position it just above Chapter one and left click. On the right hand side replace “(Untitled)” with “Part I” and click “OK”. Now this is what you see.

To make Chapter I to Chapter XI  members of Part one just drag and drop them in to part one in the correct order. Then this is what you see.

Now if you click “OK” and open the book in the viewer you will see:

You can also edit the text for any of the entries in the TOC by double clicking the entry in the TOC editor window. As you can see below I have edited “Chapter I” to the name of the chapter in the book.

The following figure shows the TOC in the viewer with all the chapters in Part I with their proper names.

This articles outlines some of the things you can do with “Edit TOC”. There are a few other options too. This should help you get started. Then enjoy tweaking and playing around with all the options. Feel free to leave comments about other interesting things you tried.

Leave a Reply

%d bloggers like this: