Join Anne-Marie Concepción for an in-depth discussion in this video Adding a custom TOC as the first page of an EPUB file, part of InDesign CS5: EPUB Kindle and iPad.
When I'm reading an EPUB one of the things I really appreciate is if the producer has taken the time and trouble to create an internal linked table of contents. I mean whenever you're using an ereader like we are using right now, Adobe Digital Editions, they usually have a special section that is an automatic table of contents and we've talked about that in a number of videos, of how to populate this section over here in the left with those links. It is something that can be hidden or shown from somewhere within the ereader. Like in ADE I can just choose Hide navigational pane.
So you see that this is how I prefer to read this EPUB. If I want to quickly jump from section to section, it would be nice if there is a way to do that and actually in this EPUB there is, because the person who created it made a linked table of contents within here. So I can just click on the Foreword section to jump to Foreword for example or let me move back up California's Name and Early History to go there and it is also good because a lot of ereaders, I don't know how many you've tried, like the Nook and all those other ones, sometimes they have little tiny icons in the corner and you can never remember which one is the table of contents.
The navigational table of contents, the navigation pane. But it is usually pretty easy to get to the beginning of the book and if at the beginning of the book you have a linked table of contents, that makes it a lot easier on your readers. plus of course, the other advantage is that if you are actually adding this to the content of the InDesign file, this page with its links, then you have complete freedom about what you want to put in here. It could be a list of illustrations. It could be a list of recipes. It could be links to pictures. It doesn't have to just be the same thing as the chapters over here on the left.
So how do we create this? Well, let me show you. We will go back to InDesign where I have a version of the book that we've been working with, Stories of California, that has a number of chapters. California's Name And Early History and so on, and there already is a spread with the contents page here. Now this is actually not quite usable. What I did was I placed an actual table of contents. Let me show you what I mean. If I delete this frame and I go to the Layout menu and I choose Table of Contents, then I can just click OK and then it will load a table of contents for me using these settings.
Now I have already created the table of contents style and I know what I want to include there, because I have been using this to chunk up my long InDesign file into multiple chapters so that that automatic navigation panel appears correctly, and you might be tempted to say, "Hey! I already did this work. why not use this as my internal table of contents?" So I am going to click OK and place it. There it is and let's see happens when I export this EPUB to the Desktop. Let me call it something else. I'll call it cali-1 and you want to, based on page layout, View eBook after Exporting.
Under Contents we are going to go ahead and chunk it up into the Basic TOC and then generate the CSS. That's all good. Click Export. So that all came out, but where is the thing that says Content? Well maybe I didn't-- I forgot to include that header. Let's just scroll. Well, where is the foreword? It is not there and we are on page 3 already. You know, what happens and it is so evil I think is that when you place an automatic table of contents, the Export to EPUB command ignores it and if you're wondering, you know there is no dingleberry or anything hanging off the frame edge as to say this is an automatically generated TOC.
What you need to do is select the frame and go to the Edit menu, go to Edit in Story Editor, and if you see these little icon surrounding everything, then you know this was an automatically generated table of contents. So the first order of business is getting these contents in here a normal text frame and that's something that was automatically generated, so that it will be retained in the Export to EPUB process. What you could do would be to actually manually delete each of these from this text frame or you could just copy and paste these words on to a new text frame.
Or another way is to take this existing TOC and export it to a Rich Text Format and when you do that, that retains the styling information, but loses the "TOC-ness" of it and then you can replace that. An in fact that's what I did in this little frame to the right edge here. So let's replace this. I am just going to delete this. This is a normal text frame using the same content. So that's the first order of business is getting content ready for you to start linking and I am just going to double-check, by pressing Command+Y or Ctrl+Y, that there's no little links around here.
So it is a normal text frame, right? And in fact I can just quickly export it just to make sure that it is going to be included. Contents. There it, all right, but nothing is linked. All right, so let's get started linking. There is two ways to make links in InDesign CS5. One is by making a hyperlink. The other one is by making a cross reference. It is really up to you which one you want to do. The first order of business though is opening up the panel, so that's under Interactive and you can choose Hyperlinks and Cross-References is at the bottom here.
If you want to learn more about Hyperlinks and Cross-References, definitely watch videos on those in any of the other InDesign titles at lynda.com. We are not going to be able to talk about this in detail. But first let's talk about creating an internal hyperlink. Say that we want Foreword to link to the Foreword section. You can't really create an internal hyperlink without first creating the destination. So what you will do is you go to where it says Foreword, select it, and then in the Hyperlinks panel menu choose New Hyperlink Destination.
It's going to be a text anchor and it automatically selects what you had highlighted gives it that name, which is nice. All right so now you have that anchor. Now we can select the word Foreword and in the Hyperlinks panel click New Hyperlink. You don't want to link to an external URL, you want to link to a text anchor, and the anchors that you have created so far in this document appear in a list. All right, that's pretty straightforward. Now if you are working in a book, in a collection of multiple InDesign files, then you would need to still make the anchor in those other files.
If you are doing hyperlinks across documents you'd still need to do that. Then you just need to remember to open up the correct document file here. Otherwise it is not going to show you the text anchor there. Anyway, we will just go ahead and do that as one example. And we didn't apply any formatting. We could have if we wanted to, but we are just going to leave it alone for now, and most ereaders will apply their own default formatting by the way. Now, let's do a Cross-Reference. So I am going to select this and instead of making a hyperlink-- what's nice about Cross-References is that you do not need to create a text anchor first and also the Cross-Reference is made up of the text of the destination paragraph, so if later you edit this chapter name, this will automatically update to match.
So the Cross-Reference is this little cross-arrow here. We want to create a Cross-Reference to that chapter called California's Name and so we need to know the paragraph style. I know it is chapter title and there is California's Name. We want the full paragraph. We don't need the page number. So we are using the Cross- Reference format full paragraph. We don't want to apply any kind of special linking formatting to this, so we will just say OK. Now it automatically used quote marks around here, which is part of that default format, but you can always create your own custom formats.
All right, so let's export this to EPUB and see how it works. Just use the same settings as before. Use Contents. There is the links and click and it doesn't work. Click. It doesn't work! This is a known bug in InDesign CS5. Maybe by the time you are watching this they would come up with an update that fixes this bug. There is a script and here is the URL. If you go to this person's site, he has got a script called "Corrections of links in epubs made with InDesign CS5." It's a free script, like all the scripts that I have shown you so far.
It will request a donation if you really like it. It has got information here about what the script does, but I've already installed it in InDesign. I want to show you how it works. Like a couple of the others scripts I have talked about, it adds a menu command. Under the File menu > Export for, look at this, EPUB with corrected links. All right, so choose that instead of the EPUB and it is almost exactly the same as exporting to EPUB. We get the same dialog box. I will replace that. All this is the same.
Click Export. You get one more alert that asked you to enter the publication year and this is just an extra thing that Taos added because you are supposed to be able to include a publication year as metadata inside of an EPUB file and InDesign doesn't let you do that. So he just threw this in to make a little easier down the road. So go ahead and enter something. All right, so here we are. Let's go to Contents, there are the links. Ah@ Now they work, right? If you go to Taos's website and read those instructions, they will tell you when it works and when it doesn't. It's not perfect, but at least in this example it makes your links work correctly.
Now if you are not able to use the script or you run into one of the issues with links that Taos talks about that his script doesn't fix, you can always fix it later in the EPUB file. You can always fix it in post as they say. And we are going to have a whole video about working with links and fixing them in the EPUB files themselves later on.
- 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 http://indesignsecrets.com/perfectpreptext-a-smart-way-to-style-local-formatting.php.