Building a Table Of Contents In Mac Pages

Learn how to use the Table Of Contents function in Mac Pages. This can automatically grab the headings from your Word Processing document body text and place them in a formatted table of contents with page numbers. The table of contents will update as you edit your document, and will be clickable in PDF exports.
You can also watch this video at YouTube.
Watch more videos about related subjects: Pages (222 videos).

Video Transcript

Hi, this is Gary with MacMost.com. Let me show you how to use the Table of Contents feature in Mac Pages. 
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you could read more about the Patreon Campaign. Join us and get exclusive content and course discounts.
So if you're creating a long document, like a report or a book, in Pages you have the ability to automatically generate a Table of Contents using a special feature. As an example here I've created a word processing document. I'm using the Automatic Body Text. The text that flows automatically from page to page in the document. I'm only using that and at the top here I have a title and notice I have set the Style to Title. I also have at the beginning of each chapter a Heading and I've set the Style to Heading. The rest is set to Body Text or some of the other styles used here. If I scroll long enough I'll get to chapter two and I'll see that that also is using the Style Heading here for the name of the chapter. Since I've set it up this way I can now automatically generate a table of contents very easily. 
So at the beginning here I'm going to place the text cursor just before the start of the first chapter. I'm not going to worry about inserting a page break or anything like that because that will happen automatically. Now I'm going to go to Insert and then Table of Contents. I have three choices. A Table of Contents for an entire Document, a Table of Contents for this section only, or a Table of Contents that will cover everything until the next Table of Contents. In most cases you're going to want to create one for the entire document. So let's do that. It's going to say Generating a Table of Contents here and you'll see this appear here and you'll see this one has got five chapters. The name of each one of these is taken from the Heading for the chapters. So if I look here at the first chapter there's the Heading and you could see it's shown here along with a page number. It knows there are five chapters simply because it's looking for every paragraph that styled using Heading. 
Now why did it choose Heading for the Style? Why didn't it use Title or other types of styles? So if I select the Table of Contents like this and you can see it all highlights under the Format sidebar I've got Text and Table of Contents. If I switch to Table of Contents you could see here I could change the type of Table of Contents. So those three choices before they weren't permanent. I could now switch this to be only the Section's Table of Contents if I want. Also I have Customize Styles. So let's click that and now it's going to show us a List of all the Styles and whether or not the style is used to generate the Table of Contents. You could see here it's only using the Heading style. 
Now let's work a little bit on this Table of Contents. First, let's add a page break right after here, after the byline. I'm going to Insert a page break. So now the Table of Contents appears on its own page. I've got this title page and may want to add other things to it like copyright information there. Now I've got this extra page here that just has a Table of Contents. So I could put something right above it. I could just type Table of Contents there. I could Style it like I want. But what makes sense is maybe to make that a Heading. But if I make that a Heading it's going to include that in the Table of Contents. Now maybe I want that or maybe I don't. An easy way to get around that is to use a different Heading here. Now you may want it to look just like the regular heading but not be in the Table of Contents. So simply create a new style, I'm going to use the Plus button there. I'll call it Heading and then in parentheses put (Not TOC) and now this is styled the same way the other Headings here at the beginning of each chapter but it is not included in the Table of Contents because the Table of Contents does not include this. If I were to check it here it would include it which isn't what I want. 
 Now let's say I want to change the style of the Table of Contents. I could select it here and go to Text instead of Table of Contents in the sidebar and I could change it to whatever I want. So I can change the size, the font, the style. All of that. I'm going to make it Bold right here and this doesn't effect the actual headings. This is just inside the Table of Contents. I could do things like change the line spacing here. I can change the Indents. I can change the spacing for the numbers here on the right. You could see it is treated like Tab stops. So I could go in here and see it's at 6.5 inches. I could change that. Let's say to 6.25 if I don't want it to be all the way over to the right. I could even add a Leader here so you have dots go all the way across like that. I can even exclude page numbers here so it's just the chapters. No page numbers are included. If you are exporting this as a PDF and distributing it that way then it may not matter as much to you what the page numbers are. We'll look at using Table of Contents in PDF in a bit. 
Now what happens if we wanted to have more than just the Heading here. What if each chapter was broken up into smaller parts. So here under the first chapter I'm going to add something right here. I'm going to add a subheading or second heading here. Put some fake text in there. I'm going to set this to be Heading 2, like that. Let's say I want several of those to be in the first paragraph and through other paragraphs as well. So I'm going to add a bunch. So I've now added a whole bunch of these secondary headings to every single chapter. So let's go back to the Table of Contents and you could see none of them are shown there. You just have the chapter headings. But if I select the Table of Contents and now I look here under Heading 2 we can see that's active now. I can check it. If I check it all of those secondary headings are now included in the Table of Contents. I can select any Style in the Table of Contents. I can select the Secondary Headings, Heading 2, or the Heading like that. So I could style them differently. So I go here to text and you could see that these are Bold 14 pt, these are regular 14 pt, let's bring it down to 12 pt here so I can have different styling for the different levels. I could also go in and change things like the numbers here. Like, maybe, not include the numbers for the subheadings. Maybe I could change it so that they are indented differently like that. Maybe I could change it so the entire thing is indented differently. So all of the level twos here are indented like that. I could include the Leaders for each one of those. I could, maybe, let's include the leaders for these like that. That makes a nice little effect there. You can continue to go and add  different things here. So you could do three levels of headings, for instance. 
You could even include other things. Like let's include an image and instead of an image here I will just add a shape like that. Let's say I wanted to include this in the Table of Contents. Sometimes you may want to include illustrations in the Table of Contents. Well, you can't have items that aren't part of the Body Text in the Table of Contents. It all comes from the Body Text. So let's take this here and change Format, Arrange to Inline with Text. So now it's actually part of the text. I'm going to move it. I'm going to Cut it with Command X and give it its own line right there. Then after it I'm going to give another line here and I'm going to put a Caption. I'll just type the word Caption. I could click on this object here and then I could go to Style and Turn On Caption and have Caption underneath that. But since that is not part of the Body Text it won't be included. But this is part of the Body Text. I can set this to Caption or create my own style called Caption if I want. So that is something I can now include in the Table of Contents. Let's go back up to the top here. I'll say Yes, Include Captions and you could see the caption is now there. I can select that and style it. Let's definitely make it a lot smaller. Let's indent it some. Like that and I can have a page number to that or maybe not include page number so that it is underneath this heading right here. Then I could include, you know, all my Illustrations in someway in the Table of Contents. This also works great for including things like tables, and charts, and info graphics and all of that. You can have all those included.
You could also have those included in a separate Table of Contents because there is nothing to stop you from creating more than one. So let's say you don't want to include the captions for illustrations here. But instead right after this Table of Contents I'm going to insert another Table of Contents. It's going to generate it based on the Headings as before but I'm going to customize styles and say Don't Include Headings. Don't include this other heading here that I created. Include Captions though. So now we have these captions here, and there's only that one, and I could put something above it. I can call this Illustrations. Let's use that same Not Table of Contents Heading there. Now I can have this list of illustrations. This could appear on a separate page here. I can insert a Page Break and have another Table of Contents that includes that. I could have this at the end of a document. There's no reason I need to have it at the beginning. So you can have these additional tables of contents that point to all sorts of things. 
Now a few other things I want to point out about the Table of Contents. First of all they automatically update. So, for instance, notice that this one right here, this chapter, if I go to the first chapter and I change it to something like Chapter 1 and I go back to the Table of Contents. Notice how it automatically updates with that. So it's going to look at the Headings constantly and make sure that it's reflecting what's in the document. Note also you can use the Table of Contents to jump to parts of your book while you're writing. So if you look at your Table of Contents and say I want to work on this section right here you can click here on the number on the right, see how the pointer changes to a hand there, click on that and it will jump to it. So I could use that to navigate around in my book as I'm writing it. 
You also have something completely separate from this called the Table of Contents View here on the left which you can see and you can Edit what styles are used here. You can do Heading and Heading 2 and you can include Captions as well. I can even Indent Caption here, more like that. This is not something that's in the final version. This isn't for exporting and used by the reader. This is for you for use while you're writing. You can jump around in your document to edit different portions and continue with your work. 
Now obviously if your goal is to print out this document and having the Table of Contents printed with the page numbers is useful for the readers. They can flip through the book to get to that page. But if you export as a PDF you could also use this Table of Contents. So you export to PDF here and we'll just export here to the Desktop. Then when we open this up in a PDF reader, like Preview, then we have a Table of Contents here that can be clicked on. Notice how you get the hand pointer here. So I can click on something and jump right to that chapter. Note that this is different than a functionality like this where you can do Table of Contents on the side here. Notice you get this here which you can expand and look at and jump around to things in the PDF viewer. This is a function of the PDF viewer itself. So depending on what viewer you're using this is going to work differently and may pull on different elements from the PDF document. But, of course, Pages works really well with Preview so it's going to actually look at the things in your Table of Contents here and you'll be able to move around in the document using this handy sidebar.
So going even further with your Table of Contents is just a matter of working really with the Styles that are included in the Table of Contents and the styles that you have. If you want something to be a Heading and not be in the Table of Contents simply don't  use one of the checked styles here in the Table of Contents. If you want something to be included here you can use one of the existing styles that has a check mark next to it or create a new style and include it. Include it in the main table of contents, add additional Table of Contents for different things and have different things checked there. So by creating different paragraph styles and deciding which of those styles will be used in any particular Table of Contents you have a ton of control over how this works. Hope you found this useful Thanks for watching. 

Comments: 13 Comments

    Karin
    3 years ago

    Would this apply also if you perhaps were referencing exhibits vs. headings ?

    3 years ago

    Not sure what you mean by "exhibits." But as long as it is a Paragraph style, you should be able to include it in the TOC.

    Jan
    3 years ago

    awesome helpful explanation

    Wendee Mason
    3 years ago

    Gary, I have been working on a Living Trust Document that is long. I was just thinking yesterday, "I wish I knew how to do a table of contents." Thank you for making my life easier. I will be using this for many of my real estate guest manuals for Airbnb as well. I really appreciate your clear explanation. You are a wonderful instructor.

    Jerry Rockwell
    3 years ago

    Thanks so much for this Gary!!! I have been spending SO MUCH time tediously creating TOC from scratch in Adobe Acrobat Pro DC. I knew there must be a work-a-round in some app, and this feature in Pages is AWESOME!!! Very clear explanation too!!!!

    Giuseppe Martini
    3 years ago

    Hi Gary, what about footnotes? Thinking of references to articles and web sites, thought would be nice to reference them in footnotes with specific assigned styles, then use the TOC functions to make dynamic lists of footnotes. I tried but it seems that styles in footnotes are not acceptable for the TOC. Hope you have some way around, in any case many many thanks for all your fantastic work!

    3 years ago

    Giuseppe: Here's a video on how to use the footnotes function: https://macmost.com/adding-footnotes-to-pages-documents.html

    cathy
    3 years ago

    Hi Gary, I studied this AND USED IT for a very long paper. That's the reason it's taken me 6 months to leave this comment/question. First of all -- thank you. What a great thing. I now have a TOC and list of illustrations for over 600 pages. When I converted it to PDF, the function didn't transfer. What have I done wrong? At any rate, you are just wonderful; I've been watching your videos for -- maybe -- over a decade now. Thank you!

    3 years ago

    cathy: Not sure what you mean by "the function didn't transfer." Is the TOC missing completely?

    cathy
    3 years ago

    (Answer to my own question might be) -- my problem may be that my pdf is 2 combined documents. The function does seem to transfer if I simply save 2 documents. Will work on some remedy -- sorry to waste your time -- you are brilliant. Thanks.

    Tom
    2 years ago

    Hi Gary – This was really informative and helpful, thanks! Is there a way to edit a TOC once it's fully populated? My TOC is displaying in a default way I don't like (with page number directly under each entry), and I'd also like to be able to edit the wording of the entries on the contents page. Is it possible to convert the TOC to a regular text format that can be edited as normal? Thanks!

    2 years ago

    Tom: The TOC always reflects the contents of the headings in your document. As for styles, you can change that as you need, so maybe decrease the font size or margins to fix your issue? You can't convert the TOC to text, and if you copy and paste it into the same document you get another TOC linked to headings. But if you copy and paste into another document, you get just the text of the TOC. So then you can copy that and paste it back into your original document and edit it as you wish.

    Tom
    2 years ago

    Thanks, Gary! Copying and pasting into another doc may be my solution then. The problem is that the full headings within my document (a book) are quite long, but the Pages TOC system seems to take in the whole line of text as the title – it won't let me format a highlighted snippet.

Comments are closed for this post.