Join Anne-Marie Concepción for an in-depth discussion in this video Creating chapter breaks via a custom TOC style, part of InDesign CS5 to EPUB, Kindle, and iPad.
So the issue is how do we set up our InDesign document so that when we export it to the EPUB format, it opens up in the ereader with the navigational table of contents here on the left that all ereaders will automatically look for. You can click on any one of these headings on the left and it jumps to that section of the ebook or to that chapter. It's not how you InDesign automatically exports EPUBs. I showed one way in a different video of how you can do this by creating a series of separate InDesign files and compiling them together in the Book panel.
But there's an easier way to do this, especially if you're starting with a single document, that's only available in InDesign CS5. Let's take a look. I am in InDesign CS5 and I have a very simple document open with the content of this book. And as you can see that it's one long threaded story. I am going to select one of these frames. Kind of hard to see, but there's little triangles here, or if I turn on the View menu, go to Show Text Threads, you can see that this is just one long story and you can see the connectors.
Now if I export this to EPUB as is, we're not going to get that navigational table of contents. And let's see that for ourselves. So I'll just press the keyboard shortcut that I previously assigned to Export to EPUB format. Let's save this out on the Desktop. Click Save. And then in our Digital Editions Export Options, I want to make sure and turn on View eBook after Exporting so it'll automatically open in Adobe Digital Editions. And under Contents, I want to make sure that table of contents is not selected.
I click Export and so there is the problem, that we're not seeing these chapters, and it's one long document. OK, so let's go back. Instead of splitting this up into separate documents, what we can do is use the power of InDesign's built- in Table of Contents feature. If you've never built a table of contents before, don't worry about it. It's very simple. In fact, we're not going to go all the way through it. You don't even need to include the actual table of contents in this document. You actually just need to set up a table of contents style. Kind of like setting up a paragraph style, but not really applying it to a paragraph, because there is a place in that Export to EPUB dialog box that lets you choose the table of contents style that it should use to split this document up into separate chapters.
So the first thing to do is to decide where you want the chapters to start. In this document we want them to start with each of these yellow subheads. The second thing is to look to see to make sure that each one of these chapter starts is distinguished by a specific paragraph style. And it's called Subhead. So this is the same thing that you would do if you're creating a table of contents. If you want all these to appear in the table of contents, you have to make sure that they're all styled with the same style name. So if they're not styled, then you need to apply the style. Then we go to the Layout menu and we want to create a table of contents style.
Now you can do so directly by going to Table of Contents, where there is a Save Style button. I am going click Cancel. Or you can just go to Table of Contents Styles and create it from scratch here. Let's just do it this way. Table of Contents Styles and click New and we have the same dialog box, except that it knows already that we want to create a style. We'll call this epub. You don't need to worry about anything except for which style should be the chapter breaks. We select the style here under Other Styles, and we're going to click Add, and move it into Include Paragraph Styles.
So we're looking for Subhead, select it, click Add, and that's it. Click OK. And you see that it is saved in our list of table of contents styles. Click OK. And now we'll Export to EPUB again. I'll use my keyboard shortcuts, we'll click Save, we're going to replace the existing document. And then the critical thing to do here after you've created your table of contents style is to tell InDesign to use it. Go to the Contents panel, turn on Include InDesign TOC Entries, and you have to remember to choose the correct TOC Style.
Turn on the other two options as well and then click Export. And now you can see that each one of these subheads is a chapter start and we've link to them. Pretty cool, huh? So let's take a look at a document that's slightly more complicated to see some other things we can do these TOC styles. It's the same document, except that we also have this section at the end. It's another page with a Colophon and it's just a standalone frame. Now if we export this to EPUB using the same TOC style, let's see what happens.
First, because this is a new document we have to create a new TOC style. So I'll click New, I'll call this again pub, and we want to include the Subhead. Okay, and then we'll Export to EPUB, to the Desktop, and make sure that under Contents that we have chosen epub, and click Export. And what happens is that in the last chapter, these all worked fine, but as you scroll down there is the Colophon. It just ran right into that last chapter, because remember, separate text frames and frame breaks, all that stuff is ignored when you export to EPUB.
You have to tell InDesign that you want this to start in its own chapter. You want this to be a link here. And in order to do that you need to get this style into your TOC Style. So go back to InDesign. It can't be in a TOC style unless it's already a paragraph style. So of course, we want to check to see the name of the paragraph style. So I'll click inside the word, look inside the Paragraph Styles panel, and oh! It doesn't really have the style. it's locally formatted. You definitely want to make it its own style. So I'll go to the Paragraph Styles panel menu and choose New Paragraph Style.
We'll just call this colophon and Apply Style to Selection. So there it is. And you would do this then for every other kind of section in your document, whether it's on its own page or existing in the middle of the text, that you want InDesign to automatically start a new chapter from. Let's go to Table of Contents Styles and we'll edit our style to include the new style. So I select it and click Add. Now notice that InDesign automatically indented this and that's the default behavior, is that as you add multiple paragraph styles to your TOC, InDesign assumes that they should be sort of like subheadings.
And you can see that down here under the Style details that it's set to be at Level 2. If you're not seeing in the section by the way, you might be looking at it like this, with More Options as a button. So click More Options so that you see this expanded down here. For now what we want to do is we want to make colophon the same level as Subhead. We don't want it indented. So with that entry selected, I choose Level 1 and that skooches it over. Perfect! Click OK. Okay, and now let's try exporting this once again to EPUB.
I'll replace the existing EPUB and then in Contents make sure this is selected. Click Export. There we go. Now at the bottom of The gold rush we don't see it, until we actually click on Colophon, then we see it, all right? Which is exactly what want to happen. One last thing that I want to talk about is that sometimes you do want to have multiple levels in your navigational TOC. For example, up here on page 1, we have some sub-subheads, for lack of a better term, that we would like these to also be links in the navigational table of contents.
But we like them to appear underneath this subhead. So these sub-subheadings are all styled with the same style, which is, remember, one of the requirements it's Subhead2. And there's nothing else in this document, other than these guys that are styled with Subhead2. So we don't have to worry about creating a whole bunch of chapters that we don't want. Let's edit our table of contents style to include this. Or we could always create a new table of contents so we have two different one to choose from. But for now I am just going to choose that one and edit it. So I want Subhead2 to be underneath the Subhead.
So I select Subhead, go down to Subhead2. Choose Add, and it paid no attention to what I had selected. So instead I am just going to drag it up, there we go. And I am going to leave it at level 2. So that's still epub, TOC style. Let's export this to EPUB, replacing our existing one, everything else is still the same. And there we go. So we still have the subheads are still the main chapter breaks. There's our Colophon, but notice there's a little plus symbol here indicating that if you click it it's going to expand into the sub-subheads.
And if you click these, it doesn't start them at the very top. It just gets to that section of the page which is exactly what we want in this case. If you wanted them to start at the very top, then you would need to turn them in to level 1 subheads. So I think you can see that by using, creatively using, InDesign's TOC styles you can easily take a single InDesign document and split it up into multiple chapters in your EPUBs.
- Understanding ebooks and ebook publishing
- Examining the EPUB format
- Creating linked navigational TOCs
- Formatting with paragraph, character, and object styles
- Optimizing graphics for the EPUB and Kindle formats
- Streamlining production with free InDesign scripts and plug-ins
- Creating drop caps, pull quotes, and text wraps in the EPUB
- Reviewing best practices for book cover images
- Using cross-platform EPUB editors and utilities
- Validating EPUBs
- Proofing ebooks in iBooks, the Kindle, and the B&N Nook
- Acquiring an ISBN for ebooks
- Distributing ebooks with resellers and aggregators
Skill Level Intermediate
Q: There is a problem with preptext.jsx mentioned in this course in the Chapter 4 movie named "Applying paragraph and character styles". Is there a fix or does Anne-Marie address this somewhere?
A: Please refer to the post on Anne-Marie's web site regarding this issue, which can be found at <a target="_blank" href="http://indesignsecrets.com/perfectpreptext-a-smart-way-to-style-local-formatting.php%20">http://indesignsecrets.com/perfectpreptext-a-smart-way-to-style-local-formatting.php</a>.