Author Topic: Using Calibre to edit your Table of Contents  (Read 5249 times)

Jeff Tanyard

Using Calibre to edit your Table of Contents
« on: October 26, 2018, 11:29:54 AM »
Some people use Calibre to convert their files to epub.  Then they use Sigil to edit the table of contents.  I know because I used to be one of those people.  That was before I discovered the "Edit ToC" tool in Calibre.  Now I just use that, bypassing Sigil altogether.  Nothing against Sigil; it's a fine program, and everyone should have it.  But I've streamlined my process this way, so I'm sharing it with y'all.

Unfortunately, it's not self-evident how to edit your ToC in Calibre.  The necessary button isn't activated by default.  You have to add it to your toolbar.  I'll show you how.

Important note: this tool is only for editing the ToC of an epub.  I don't think it works for other file formats.  So make sure you've used Calibre's conversion tool to make an epub version of your book before proceeding with the ToC editing.

First, open Calibre and click on the "Preferences" button.





Then click on the "Toolbars & menus" button.





You will then be asked to choose which toolbar or menu you wish to customize.  Choose "The Main Toolbar."  You'll then get a screen like this:





In the "Available actions" box, scroll down until you see this:





Click it so that it's highlighted.  Then use this arrow button:





...to move the Edit ToC button from the "Available actions" box to the "Current actions" box.  Then go to the bottom and click "Apply."  You should now have the Edit ToC button on your main toolbar.





Now you're ready to edit your Table of Contents.   :icon_mrgreen:  Click on your book so that it's highlighted and appears in the right-side pane.





See the "formats" thing?  Give it a glance to make sure you've got an epub format to work with.  This is an easy thing to forget about.   :icon_redface:

Now click the Edit ToC button.  You should see a screen like this:





As you can see, there are a variety of import options to help you set up your ToC.  Give each one a try to see how they work.  You can also make new entries from scratch.  You can easily delete the extras, so don't worry about cluttering up the Table of Contents box.  If you want to delete an entry, simply highlight it and then click the recycle button.

You can edit each individual entry in the ToC by clicking on it so that it's highlighted.  Then you'll see a bunch of options appear in the right-side pane:





As you can see, there are many ways to go about editing your ToC.  Calibre is a powerful program, and it's just a matter of playing around with it and seeing what it can do.

Good luck!    :cheers
v  v  v  v  v    Short Stories    v  v  v  v  v    vv FREE! vv
     
Genres: Science Fiction, Fantasy (some day) | Author Website
 
The following users thanked this post: Demon_Lord, Lysmata Debelius, djmills, alhawke

Simon Haynes

Re: Using Calibre to edit your Table of Contents
« Reply #1 on: October 26, 2018, 01:30:48 PM »
You can also do this from the commandline with calibre.

All my books are compiled from dos batch files. Set them up once, use them over and over again.


 

Lysmata Debelius

Re: Using Calibre to edit your Table of Contents
« Reply #2 on: October 26, 2018, 01:37:53 PM »
Thanks! Nice to know about this. Sigil has a really good "create toc" tool too, easy to use. But it's good to know about all the other options available.
 

Simon Haynes

Re: Using Calibre to edit your Table of Contents
« Reply #3 on: February 11, 2020, 07:46:10 PM »
yWriter uses Calibre's 'ebook-convert.exe' to make epub and mobi files from projects. It's a hidden part of the Calibre software, and really useful.
 
The following users thanked this post: Jeff Tanyard

alhawke

Re: Using Calibre to edit your Table of Contents
« Reply #4 on: February 12, 2020, 06:48:33 AM »
Thanks for this Jeff. I may reference it in the future.

I use Sigil. I go into the HTML, copy code from prior, and paste it for my new entry--because I have absolutely no idea what I'm doing. I thought people would be amused to know that's how I do it. And it works! As long as I paste the exact code.

I regret not publishing my first title with Vellum. Vellum is the easiest tool out there for those who have a Mac.
 

Lynn

Re: Using Calibre to edit your Table of Contents
« Reply #5 on: February 12, 2020, 07:51:38 AM »
You can do so much more with a basic understanding of HTML and CSS and specifically code for ebooks. For instance, I set images to always display the same regardless of screen resolution.

I sometimes open books that have images that won't shrink, won't scroll, won't do anything but sit there with one tiny corner displayed on my phone because they're too big and the code wasn't written to be responsive to small screens.  :evil2:
Don't rush me.
 

Jeff Tanyard

Re: Using Calibre to edit your Table of Contents
« Reply #6 on: February 12, 2020, 03:51:32 PM »
Thanks for this Jeff. I may reference it in the future.


Glad you found it useful.  :)


Quote
I use Sigil. I go into the HTML, copy code from prior, and paste it for my new entry--because I have absolutely no idea what I'm doing. I thought people would be amused to know that's how I do it. And it works! As long as I paste the exact code.


If you've found a way that works for you, then as far as I'm concerned, that one is the correct one for you.  The end result is all that matters.
v  v  v  v  v    Short Stories    v  v  v  v  v    vv FREE! vv
     
Genres: Science Fiction, Fantasy (some day) | Author Website
 

RPatton

Re: Using Calibre to edit your Table of Contents
« Reply #7 on: February 12, 2020, 06:06:21 PM »
Thanks for this Jeff. I may reference it in the future.


Glad you found it useful.  :)


Quote
I use Sigil. I go into the HTML, copy code from prior, and paste it for my new entry--because I have absolutely no idea what I'm doing. I thought people would be amused to know that's how I do it. And it works! As long as I paste the exact code.


If you've found a way that works for you, then as far as I'm concerned, that one is the correct one for you.  The end result is all that matters.

Sigil won't change up the CSS styles. Calibre will sometimes consolidate styles. Which can cause problems in the long run. I have fixed more than my fair share of ebooks that got compiled or changed in Calibre. It's a good software, but easy to cause more problems if you aren't completely certain of what you're doing.
 

Jeff Tanyard

Re: Using Calibre to edit your Table of Contents
« Reply #8 on: February 12, 2020, 07:13:16 PM »
Sigil won't change up the CSS styles. Calibre will sometimes consolidate styles. Which can cause problems in the long run. I have fixed more than my fair share of ebooks that got compiled or changed in Calibre. It's a good software, but easy to cause more problems if you aren't completely certain of what you're doing.


What kind of problems?  Genuinely curious.
v  v  v  v  v    Short Stories    v  v  v  v  v    vv FREE! vv
     
Genres: Science Fiction, Fantasy (some day) | Author Website
 

RPatton

Re: Using Calibre to edit your Table of Contents
« Reply #9 on: February 13, 2020, 09:15:26 AM »
Sigil won't change up the CSS styles. Calibre will sometimes consolidate styles. Which can cause problems in the long run. I have fixed more than my fair share of ebooks that got compiled or changed in Calibre. It's a good software, but easy to cause more problems if you aren't completely certain of what you're doing.


What kind of problems?  Genuinely curious.

Sometimes a CSS will have the different names for a style that shares the same traits. There usually a reason for using different names, especially if you use a base style sheet and want to do some customization or branding. Calibree strips out the style names, gives it a new style. So now the copyright page uses the same style name as the acknowledgements page.

Sometimes Calibre will randomly assign multiple CC to the same formatting and toss in some errant nonsense. I'm sure it's due to a slight difference in the docx coding, which is why it works best when the docx  has minimal formatting. Save the paperback styles and such for the paperback.

Has absolutely nothing to do with paperback styles and everything to do with how Calibre treats styles. Calibre seems to ignore the style names and instead focus on the definitions. You might have a good reason for giving the same style two different names depending on how it's used, but Calibre doesn't care. It's fine for that first version, but going back in and updating that epub will take twice as long (if you're lucky) than if it had been checked in Sigil.

The point is, Calibre is a reader tool and what it does to the epubs is geared to the reader. Sigil is intended for epubs, creating and formatting them. It would be like using a ball-peen hammer instead of a claw hammer. Both will get the nail in the wood, but one is better suited for the job. Sometimes Calibre works great, but the one time you need it to work great, you're staring at a style sheet you didn't correct and no easy way to rename the styles in the HTML.
 

RPatton

Re: Using Calibre to edit your Table of Contents
« Reply #10 on: February 13, 2020, 10:55:22 AM »
Sigil won't change up the CSS styles. Calibre will sometimes consolidate styles. Which can cause problems in the long run. I have fixed more than my fair share of ebooks that got compiled or changed in Calibre. It's a good software, but easy to cause more problems if you aren't completely certain of what you're doing.


What kind of problems?  Genuinely curious.

Sometimes a CSS will have the different names for a style that shares the same traits. There usually a reason for using different names, especially if you use a base style sheet and want to do some customization or branding. Calibree strips out the style names, gives it a new style. So now the copyright page uses the same style name as the acknowledgements page.

Sometimes Calibre will randomly assign multiple CC to the same formatting and toss in some errant nonsense. I'm sure it's due to a slight difference in the docx coding, which is why it works best when the docx  has minimal formatting. Save the paperback styles and such for the paperback.

Has absolutely nothing to do with paperback styles and everything to do with how Calibre treats styles. Calibre seems to ignore the style names and instead focus on the definitions. You might have a good reason for giving the same style two different names depending on how it's used, but Calibre doesn't care. It's fine for that first version, but going back in and updating that epub will take twice as long (if you're lucky) than if it had been checked in Sigil.

The point is, Calibre is a reader tool and what it does to the epubs is geared to the reader. Sigil is intended for epubs, creating and formatting them. It would be like using a ball-peen hammer instead of a claw hammer. Both will get the nail in the wood, but one is better suited for the job. Sometimes Calibre works great, but the one time you need it to work great, you're staring at a style sheet you didn't correct and no easy way to rename the styles in the HTML.

You sound just like NotJohn referencing his outdated experience with Calibre. Calibre is absolutely an ebook creation tool and focuses on ePub for editing.  Calibre will retain any formatting from the docx. It's not perfect, but close enough to only require minor tweaking as long as there isn't excessive formatting in the docx. The entire process from import to verified epub is less than an hour.

I'm not referencing outdated experience, but thanks for that little insult.

And I'm tapping out. I know about CSS and epubs and print formatting and I've shared a lot of what I know with this forum. As I said, Calibre is a good tool, but there are better tools available for free. Same as Vellum. It's a good tool, but has its weaknesses. Blindly ignoring those weaknesses is just begging for a disaster at the worst possible moment. Good luck to you when that happens.