140 likes | 305 Views
Create a TOC by using fields. Beyond the three basic methods of building a TOC (using heading styles, custom styles, and outline levels), there is an advanced way: TOC fields. In fact, behind the scenes in every automatic TOC in Word is a field.
E N D
Create a TOC by using fields Beyond the three basic methods of building a TOC (using heading styles, custom styles, and outline levels), there is an advanced way: TOC fields. In fact, behind the scenes in every automatic TOC in Word is a field. If you’re familiar with fields, you already know how powerful they can be. If fields are new to you, use this lesson to find out what they are, how to directly create a table of contents by using them, and why they’re essential if you want total control of your table of contents. Table of Contents III: Use fields to create a TOC and create multiple TOCs
What is a field? A field is a set of codes that instructs Word to insert information or perform an action in a document automatically. Fields have many varied uses in Word, and some things you can accomplish only by using fields, such as excluding page numbers from just a couple of levels of the TOC. Table of Contents III: Use fields to create a TOC and create multiple TOCs
What is a field? TOC fields are the building blocks of a table of contents. All automatic tables of contents, no matter how they were created, rely on TOC fields behind the scenes to collect the entries for the table of contents. When the TOC field result is displayed, you see the table of contents. You can see all the fields in a document by pressing ALT+F9. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Field switches Say you want to exclude page numbers for some levels in your TOC. One option would be to delete the page numbers manually and remember not to update the TOC. But that’s hardly a reliable solution. The better way is to use field switches. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Field switches Field switches are commands inside the field that determine what the code does—they are the real power behind fields. Switches are added to the end of a field code and within the curly brackets; they always start with a backslash (\). An automatic TOC puts the switches in for you, but you can add, remove, or change the switches later. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Field switches A TOC field can have more than one switch, as this illustration shows. This one includes the \o “1-3” switch, which builds the TOC based on text marked with heading styles Heading 1, Heading 2, and Heading 3. The \h switch turns the TOC entries into hyperlinks. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Field switches To add a switch, you type a backslash (\) and the switch letter inside the curly brackets. For example, to remove all page numbers in the TOC, use the \n switch, as follows: { TOC \o “1-3” \h \n } Table of Contents III: Use fields to create a TOC and create multiple TOCs
Field switches To add a switch, you type a backslash (\) and the switch letter inside the curly brackets. While you can also remove all the page numbers by using the Table of Contents dialog box, if you want to remove the page numbers from just levels 2 and 3, you’ll need to use the \n switch and type the levels, such as: { TOC \o “1-3” \h \n “2-3”} Table of Contents III: Use fields to create a TOC and create multiple TOCs
TC fields Besides the TOC field, there is another field that can be used in an automatic TOC: the TC field. The TC field is another way, along with heading styles, custom styles, or outline levels, that you can mark the text you want to include in the TOC. Table of Contents III: Use fields to create a TOC and create multiple TOCs
TC fields So when would you use a TC field? Use it when you don’t want to format the TOC entry by using a heading style, custom style, or outline level, but you still want to include the text in the TOC. Or use it when you want to include text from the middle of a sentence or paragraph, such as a long title or heading that would be awkward in the TOC. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Set up TC field entries for your TOC To use TC fields, you need to set up the TC entries and then add them to your TOC field so that it collects the TC entries. Before you start, determine the text and the level you want that text to appear in the TOC. Also, if you have multiple TOCs, you’ll need to choose the letter designation, or Table identifier, of the TOC. For now, we’ll use the default table, “C,” which places the entry in the main TOC. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Set up TC field entries for your TOC To set up a TC field, first select the document that you want to include in the TOC. Then press ALT+SHIFT+O to open the Mark Table of Contents Entry dialog box, as shown. Edit the text in the Entry text box if you need to. If there’s more than one TOC in a document, each has a different letter to identify it; click the Table identifier text box arrow and then the letter of the table where you want this entry to be displayed. Select the TOC level for this entry in the Level box. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Add the TC field entries to your TOC field To get the TC field entries to appear in the TOC you must add the \f field switch to your existing TOC. The \f switch tells the TOC to include the TC field entries. You could open the Table of ContentsOptions dialog box and select the Table entry fields when you create or replace your TOC; but it’s easier to create an automatic TOC and modify it. Simply press ALT+F9 after you create the TOC and type \f at the end of the field. Table of Contents III: Use fields to create a TOC and create multiple TOCs
Add the TC field entries to your TOC field To get the TC field entries to appear in the TOC you must add the \f field switch to your existing TOC. The \f switch tells the TOC to include the TC field entries. It will look as follows: { TOC \o “1-3” \h \f } Then update your TOC by placing your cursor in the TOC field and pressing F9. Press ALT+F9 to see the results. The TOC will now include all the TC field entries. Table of Contents III: Use fields to create a TOC and create multiple TOCs