Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2012 by Barry MacDonnell. All Rights Reserved.

Page updated May 15, 2012

WordPerfect Tips
Main tips page | Browse tips


The Table of Contents and List features


To create an Index see here.
To create a Table of Authorities see Corel's support database article #3524 here and also this post at WordPerfect Universe (which references CiteLink and FullAuthority). [Update: See Corel's Perfect Authority for sale at http://www.corel.com. There is a tutorial on using Perfect Authority here.]
You can automatically include items in a Table of Contents or a List in two ways...

How to create a
Table of Contents or List

in three easy steps
(plus some tips)

Before you can have WordPerfect automatically create a Table of Contents (TOC), the words or phrases you want included in the TOC must be marked with special format codes. Then WordPerfect can find them and arrange them in a TOC.

This can be done in the three easy steps outlined below, but please read on for some other things to consider since they could save you time in the long run.

WordPerfect's five standard paragraph Heading styles (Heading 1 - Heading 5, accessed via a drop list on the Text property bar or via the Format, Styles menu) are already marked (internally) for inclusion in any TOC. They were created for you by Corel programmers and they already have the necessary codes in them.

So, for example, using the Heading 2 style on a (selected) word or short phrase will cause it to be automatically included in the TOC as a "level 2" entry when the TOC is defined and generated. This is very handy and a major reason to use these "shipping" styles (or custom versions of them) when you need to introduce sections of a document (e.g., Chapters, Sections, Appendices, etc.) with text headings.

Notes about Heading styles

If you use only these five standard paragraph Heading styles, and you do not need other document items in the Table of Contents, you can skip past Step 1 below. But you still need to perform Step 2 and Step 3.

[Tip: These Heading styles can be edited very easily to change their formatting. You can simply apply new formatting directly to the Heading's text. If that doesn't work the way you want, double-click the [Style] code in Reveal Codes; the Styles Editor that appears has a menu and toolbar which you can use to add format codes to the Contents pane in the Styles Editor. The changes made this way will be stored in the current document. For more on this topic, see the Tips section on the Styles page.]

For other items -- those not formatted with a WordPerfect standard Heading style -- that you want included in a TOC you can

(a) go through the document and mark each item manually as explained in Step 1 below ("Mark the entries")
...or...

(b) you can optionally create (or edit) your own custom style (see the column on the right ) and simply apply the special style to any text you want included in a TOC
...or...

(c) you can do both. Then simply follow Step 2 and Step 3 below.

How to do it

  • Step 1: Mark the entries in your document that you want included in the TOC.

Note: As explained above, skip this step if you are using only the standard Heading styles that are included with WordPerfect (and/or you use only special custom styles as explained in the next column ), since they are already marked internally. However, if you are not using one or more of these special styles, or if you are using them and you also have some other text you wish to include in a TOC, continue with this step.

    • To mark the entries manually:
    • Turn on Reveal Codes (View, Reveal Codes) so you can see what you are doing.
    • Select the text you want included as an item in the TOC (but not any format codes, unless you also want them in the TOC!).
      • Remember: The Heading 1 through Heading 5 styles are already marked for inclusion in the TOC, so don't mark them again since the internal marking will take precedence anyway. (This caveat also applies to custom styles you created and marked using the methods in the next column.)
    • Click Tools, Reference, Table of Contents, then click on the [Mark 1] button for a top-level entry, the [Mark 2] button for a second-level entry, etc.
    • Repeat the select-and-mark procedure as needed.
    • Tip: You can use small macros to automate this procedure. See Footnote 1 below.
  • Step 2: Define the TOC.
    • Place your cursor where you want the TOC to appear.
      • Tips:
      • Typical layout: You could create a blank page at the top (Ctrl+Enter will insert a hard page break), with a title (e.g., "Table of Contents"); then insert a couple of hard returns (with the Enter key) to provide a separation between the title and the TOC.
      • Custom layout: You create a multi-column table and place your cursor inside a cell; this will give you other formatting options later (cell borders and fills, additional text, etc.). [See also some related post-TOC-generation tips below.]
    • Choose Tools, Reference, Table of Contents (tab), and click the [Define] button. (If you cannot see a [Define] button in the Reference Tools dialog that should now be on screen, see Footnote 2 below.)
    • The Define Table of Contents dialog appears. Type the number of levels (or use the spinner arrows) you want in the TOC.
      • Optional:
      • You can set the Position of the page numbering (i.e., the numbering format on the TOC page) relative to the text entries for each level using the fields adjacent to each Level's style. [The default is to use dot leaders with flush-right page numbers, but you can use other numbering positions -- or no numbering at all, in which case the TOC's text entries will be hyperlinked to the relevant pages.]
      • The [Styles] button lets you change the TOC's text format for each level in the TOC area (not in the body text area) to some other pre-existing custom paragraph style (see the Advanced Topic #1 tip in the next column).
      • Use the custom [Page Numbering] button to change the numbering format for any of the levels.
    • Click OK, and WordPerfect will insert a [Def Mark] code at the cursor location -- that is, where the TOC will be generated -- and a temporary text marker ("<<Table of Contents will generate here>>") bracketed by a pair of [Gen Txt] codes..
      • Tip: You can double-click the [Def Mark] code to bring up the Define Table of Contents dialog if you need to change things.
  • Step 3: Generate the TOC with the Generate button. In the next dialog, you are given two choices: Save Subdocuments and Build hyperlinks. The first is only useful if you are working in a Master document which has one or more subdocuments (for more on this topic see here), and the second is only useful if you have hypertext links in the document. Most often, you can just click OK.

See the Tips section below for more on editing and formatting the TOC, etc.

Lists

  • The above three-step method is essentially the same for creating a List of items with Tools, Reference, List. Such Lists are similar to a Table of Contents since their items are also associated with page numbers in the document. [To create ordinary (but automatically numbered) lists -- e.g., 1. First item... 2. Second item... etc. -- see how to use QuickBullets here.]
    • Mark the List's entries (Step 1 above): You can select some text first, then click Tools, Reference, List and give the list a name in the Reference Tools dialog's List field (if the List has not yet been created or named), then -- with the dialog still on screen -- click on [Mark]. This puts a paired code around the selected text. Select other text as required, clicking [Mark] for each selection. (It the list already has been created, you can choose its name from the List field, then select the text and click [Mark].)
    • When you are done marking items, you need to Define the List (and Insert it where appropriate) and then Generate it, in much the same way you Define and Generate a Table of Contents (Steps 2 and 3 above).
    • Notes
      • You can create several differently named lists in the List field, choosing different ones for different groups of document items to Mark for inclusion in those Lists.
      • The last several versions of WordPerfect will not let you mark items inside "substructures" such as headers, footers, footnotes, image captions, etc. However, you can work around this with a custom style that contains the required "mark for list" codes inside the style: See "Lists" under Step 4 in the next column for an explanation of this method and how to use it with Lists. When you apply the style to some text in one of those substructures (or in the body text area), it will automatically include that text (and page number) as an entry in the List when you generate the List. [Also see Footnote 5 for a method to create and save these custom styles so that you can use them to mark items quickly and easily -- and in any document where you need a List. (The method should also work in early versions of WordPerfect.)]

Tips

  • Editing the Table of Contents (or List): Once you create a TOC (or List) -- i.e., "generate" it -- it can be edited and formatted just like any other block of text. (Be sure to back up your document before making such changes.) The TOC (or List) is ordinary (paragraph style) formatted text between the special [Def Mark][Gen Txt] ... [Gen Txt] codes. For example, you can select the entire TOC and set new paragraph spacing with Format, Paragraph, Format, Spacing between paragraphs. You can also remove any unwanted format attributes, line breaks, etc.
    • Note: Each time you regenerate a Table of Contents (and/or List), WordPerfect replaces the existing TOC (and/or List) -- i.e., everything between the paired [Gen Txt] codes. Therefore, it might be best to refrain from adding or changing formatting to text inside (i.e., between) these paired TOC (or List) codes until the final draft of the document.
    • However, see Footnote 3 for more information and an example of how to format a TOC into two columns that survives multiple regenerations of the TOC during editing.
    • Keeping in mind the Note above regarding automatic replacement of the TOC if you regenerate the document... You could also select the generated TOC and click Table, Create (and use Paragraphs as the Text Delimiter). WordPerfect will create a table using each TOC entry as a separate row. You can then insert other coulms or rows (right-click in the table and choose Insert) for other purposes, remove borders, etc.
  • Unexpected formatting in the Table of Contents is typically caused by extraneous formatting codes that were included in the body text you selected and marked for the TOC. Use Reveal Codes to make precise selections (see Step 1 above), or apply standard or custom styles to body text that already have internal TOC markings (see the column on the right).
  • If you have lots of "non-style" (i.e., plain text) items to mark, you can record your TOC-marking steps to create a macro to mark them more quickly (once they have been selected) for a particular TOC level. Select an item, then use Tools, Macro, Record and click Tools, Reference, Table of Contents, then click [Mark 1] for a top-level entry, [Mark 2] for a second-level entry, etc. Stop recording with the stop button (  ) on the macro toolbar.
  • Hypertext: When WordPerfect generates a TOC, it creates hyperlinks around the page numbers in the TOC. (Hyperlinks become "active" if you enable Tools, Settings, Environment, Activate Hyperlinks.)
    • Tip: To make just the TOC headings -- the text entries in the TOC -- into hyperlinks: When you define the TOC (Tools, Reference, Table of Contents, Define) choose "No Numbering" for the Numbering Format for each level of the TOC. All TOC entries will become hyperlinked.

You might also be interested in creating an index for your document. See here.

[Page top]

How to "mark" a custom style
for automatic inclusion in a
Table of Contents or List
(plus some tips)

The column on the left describes how to mark ordinary text so that the text will appear in a Table of Contents (TOC), and also notes that several standard heading styles (Heading 1 ... Heading 5) included with WordPerfect mark their text in such a way that the text will be automatically included in a TOC.

But what about custom styles? How can they be set up to automatically include their text in a Table of Contents?

[For Lists, another Reference tool, and Outlines, which basically are specially numbered styles, see the notes under Step 4 below.]

For those who use styles to format document section and page headings, this is a common question, since these headings probably should be included in a TOC, and most people would want them to be included automatically once the style is applied to a heading's text.

For example, one WordPerfect user who was hunting for an answer to this question double-clicked on various standard Heading [Style] codes in Reveal Codes and saw a unique code inside each one (which turns out to be a special code that is used to include, or "mark," these Heading styles for inclusion in a TOC). This prompted the following exchange:

Q: "I notice that inside the Heading 1 through Heading 5 styles the appropriate [Mrk Txt T.O.C.] code is included. How can I create a new style and include this code? The 'Help' suggests that it is possible but the 'How to' doesn't address it."

A: "It's a little tricky, but simple. Here's how:"

  • Step 1. Either create a new Paragraph heading style or new Character style with Format, Styles, Create, or edit an existing Paragraph or Character style with Format, Styles, <stylename>, Edit.
    • Note: WordPerfect contains five styles, TableofCont1 ... TableofCont5, that are used to format the generated TOC text area. These are different from the custom heading styles used in the body text area that are being described here. For more about these special styles and how they can be modified, see the tip below.
  • Step 2. At the bottom of the Styles Editor dialog window that opens, be sure to check (i.e., enable) the box, "Show off codes."
    • Note: If you are creating a new style, the Contents field will be empty. You should enter the format codes in the Contents field that will be applied to any text when you apply the style to it. For example, if you want to create a new Character style that will apply bold, small caps formatting to selected body text, and then mark that text for inclusion in your Table of Contents, click on the Styles Editor's Format, Font menu and check (enable) the "Bold" and "Small caps" options, then click OK to return to the Styles Editor and its Contents field. You should see the new codes for [Bold] and [Sm Cap]. [For more information on styles, see here.]
  • Step 3. Now, in the Contents window of the Styles Editor, select the code labeled [Codes to the left are ON, codes to the right are OFF]. An easy way to do this is to put the cursor just in front of this code, hold down the <Shift> key, and press the <Right Arrow> key.
    • Note: For most typical heading styles, don't select any formatting (or numbering) codes unless you also want their formatting to be applied to those heading items in the Table of Contents, too.
  • Step 4. While this long [Codes to the left...] code is selected (a [Select> code appears just to the left of it), click Tools, Reference, Table of Contents from the Styles Editor menu. The Reference Tools dialog (or, in earlier versions, a Table of Contents bar) should appear. Choose one of the TOC levels (e.g., [Mark 1]) and click its button. Click on [Close] to go back to the Styles Editor. You should now see a pair of [Mrk Txt T.O.C.] codes appear around the "[Codes to the left...]" code.
    • Lists: If you are creating a WordPerfect List instead of a Table of Contents, the above procedure is essentially the same, but instead of Tools, Reference, Table of Contents in Step 4 you would use Tools, Reference, List from the Styles Editor menu. Choose the name of the List (or type one in the field if the field has no name yet), then click the [Mark] button. Click on [Close] to go back to the Styles Editor. You should now see a pair of [Mrk Txt List] codes appear around the "[Codes to the left...]" code. All custom styles with the same List name will appear in that List when it is Defined and Generated (see the column on the left for how to Define and Generate a Table of Contents; the process is essentially the same for Lists).
      • Tip: This is the preferred way to mark items for a List in more recent versions of WordPerfect, since the marked items can be in the body text area, a header or footer, a footnote, an image caption, etc. For a method you can use to create (and save) custom styles to do all this quickly and easily, see Footnote 5.
    • Outlines: You can use the above method to mark an Outline's levels, too, since they also contain embedded Paragraph styles. (Outlines can be created with Insert, Outline... or even more quickly with the automatic numbering method described here.) In this case you probably want to include the outline item's number in the TOC, so be sure to include the [Para Num] code inside the paired TOC codes, using the <Shift+RightArrow> method above.
      • Tip: Shorter blocks of text used for an Outline level (e.g., a section heading) that are marked for inclusion in the TOC might be preferable to several long paragraphs, since all paragraphs will show up in the TOC as a TOC entry. (They are all marked for inclusion using the method above.) You can easily work around this by stopping the outline immediately after a short phrase or sentence (the section heading), then indenting the following paragraphs of normal text to match the Outline's indentation, then starting the Outline again for the next numbered item. [See the Outlines page for methods of quickly starting and stopping outlines as you type.] The short phrase or sentence will then show up by itself in the TOC, since the following paragraphs were essentially excluded from Outline's level style.
  • Step 5. Close the TOC bar if it is open, and click OK to dismiss the Styles Editor. When you are ready to create the TOC, see the column on the left.

Optional

  • Want to reuse the new style? While editing the same document that contains the new paragraph Heading style that is now marked for the TOC, save (i.e., copy) the style to your default template so that it can be used in any new (blank) document based on the default template: Click Format, Styles, <select the style from the list>, Options, Copy, Default template, OK.
  • Want to create a hyperlink back to the Table of Contents, so that users can click on the custom style's text to return to the TOC? Here's how to create such a "reverse link":
    • First, be sure to create a bookmark at the top of the Table of Contents area. This is where WordPerfect will return to when the user clicks the custom style. Click on Tools, Bookmark, Create, and give the bookmark a name such as TOC. Be sure the bookmark is created outside (i.e., above or to the left of) the [DefMark][GenTxt]...[GenTxt] codes, so that it will not be accidentally deleted if you decide to regenerate the Table of Contents.
    • Then follow the steps above -- but instead of using Tools, Reference, Table of Contents in Step 4, use Tools, Hyperlink, and then click in the Bookmark drop list to select the bookmark name (e.g., TOC).
    • Tip: You can remove underlines from hyperlinks in the current document from the main WordPerfect menu: Click Format, Styles, and select Hypertext in the 'Available styles' list. (Note: If no Hypertext style is present in the document, the style name will not appear.) Then click Edit and delete the [Und] code in the Contents pane; then click OK. Note that this changes all hyperlink styles in the current document, even those that are used in cross references, and including the page numbers in the Table of Contents. (It's an all-or-nothing situation.)

Tips

  • You do not need to create a style in order to mark some text for inclusion in a TOC. As noted in Step 1 in the left column on this page, just select the text and click Tools, Reference, Tables of Contents, and then click the [Mark] button of choice.
    • However, creating custom styles with the TOC-marking codes inside them (as described above) will let you apply other formatting to the text items at the same time you mark those items for inclusion in the TOC. You will also be able to quickly change the TOC level of particular custom styles by simply editing any instance of the style (see Steps above) to replace the TOC marks with new ones. You can also use a macro such as ReplStyl to replace one such style with another. For more on styles, see here.
  • Editing the Table of Contents: Once the TOC is generated (Step 3 in the left column), you can edit it -- it is ordinary text between the two special [Gen Txt] codes -- to remove any unwanted attributes, and remove any line breaks to "glue" the multiple-line entries into a single entry in the TOC. You can also format it differently by applying format codes to the entries. Be aware that these are superficial changes that will disappear if you re-generate the TOC: Everything between the paired [Gen Txt] codes will be deleted and replaced when you generate the TOC again. (For more permanent TOC formatting see the "Advanced topic" tip below.)
  • Multi-level TOC: You can create multi-level Table of Contents entries by choosing the appropriate TOC level (e.g., [Mark 2], [Mark 3], etc.) while using the method described above. You will need to create (or edit) several styles, one for each level.
  • Spacing: If you want to reduce the spacing between a Paragraph heading style (e.g., Heading 2 or MyHeadingStyle 5) and the following body text (i.e., the next paragraph), see here.
  • Speed up marking entries: If you have lots of "non-style" (i.e., plain text) items to mark for inclusion in the TOC, you can record your TOC-marking steps to create a macro to mark them more quickly (once they have been selected) for a particular TOC level. Select an item, then use Tools, Macro, Record and click Tools, Reference, Table of Contents, then click [Mark 1] for a top-level entry, [Mark 2] for a second-level entry, etc. Stop recording with the Stop button on the macro toolbar.
  • Advanced topic #1: In contrast to the formatting contained in standard or custom document Heading styles, the formatting of the generated TOC area itself is governed by up to five predefined TOC styles: TableofCont1 ... TableofCont5. These built-in styles apply to the TOC levels you have chosen to use in the Define Table of Contents dialog (Step 2, left column of this web page), and they apply only to the current document. However, they can be edited with Format, Styles to change their format codes for the current document's TOC. [For a macro technique to do this, see Footnote 4. You can also create new TOC paragraph styles (to format just the generated TOC area) with Format, Styles, and then "attach" them to each TOC level with Tools, Reference, Table of Contents, Define, Styles.] The changes become effective in the document immediately, so you can do this either before or after a TOC has been generated in that document. Re-generating the same document's TOC will not effect their new formatting since the formatting is now contained inside the TOC page's style code(s).
  • Advanced topic #2: As noted above, you do not need to create a style in order to mark some text for inclusion in a TOC. You can simply select the text and click Tools, Reference, Tables of Contents, and then click the [Mark] button of choice. This procedure can be automated with macros. See Footnote 1.

For some basic information about styles, and several links to related pages about styles on this site, see here.

[Page top]

To create an Index see here.
To create a Table of Authorities see Corel's support database, Answer ID 753748 and this post at WordPerfect Universe (which references CiteLink and FullAuthority). [Update: See Corel's Perfect Authority for sale at http://www.corel.com.]

 

- NOTES -


Footnote 1 [Intermediate to Advanced users]

[Tips: Macros such as those below can be copied into WordPerfect. See here for brief instructions.]

Example 1:

Here is a macro that can mark selected body text for inclusion in a Table of Contents. You might find it easier or quicker than using Tools, Reference, Table of Contents and then clicking the Mark button. Such macros can be assigned to keyboard shortcuts, toolbars, or menus for rapid access.

Note that this macro (or the manual marking method described at the top of the left-hand column above) doesn't accurately mark body text to which a Heading style was previously applied, or to which a previously created custom paragraph style with internal TOC marks was applied. Therefore it should not be used on those items. To mark such items for the TOC, see the method described at the top of the right-hand column above, "How to Mark a Custom Style...".

The sample macro below marks the selected body text as a Level 1 entry in the TOC. You will need to modify several copies of the macro (as explained below) for other TOC Levels. (Advanced users: You could combine all five TOCMark() commands in a "two-key" macro.)

// Macro code begins -
If(?BlockActive)
   TOCMark(1)
Else
   Messagebox(;;"Select some text first")
Endif
// Macro code ends

Note: Change the "1" in the TOCMark(1) command to 2, 3, 4,or 5, as needed for the particular TOC Level desired.

Tip: Items marked for inclusion in a TOC using the manual method (see How to do it) or using this macro can later be modified to change their TOC Level by re-selecting them in the document's text and applying a new level. A macro to go though the document and stop at each item to allow you to change the level can be found on WordPerfect Universe here.

Example 2:

If you created custom styles (discussed at the top of this web page, right-hand column, "How to Mark a Custom Style...") for the purpose of applying a style that was marked for inclusion in a TOC, here is an example of how to use a macro to quickly apply that custom style to selected text. Then, simple macros, each containing the special command StyleOn("nameofstyle"), can apply the custom style to selected text. (Note: Change "nameofstyle" to your style's name, but retain the double quote marks.)

// Macro code begins -
If(?BlockActive)
   StyleOn("nameofstyle")
Else
   Messagebox(;;"Select some text first")
Endif
// Macro code ends

Note: Change "nameofstyle" to your style's name, but retain the double quote marks.

Tip: Custom styles can be easily changed by editing them, or replaced with another style with a macro such as ReplStyl.

Tip: An alternative to using this macro is to use the Text Property Bar's "Select Style" drop list to choose the style and apply it to selected text. If the macro is assigned to a keyboard shortcut, it may be faster to apply the style than using the mouse.

[Page top]


Footnote 2 [Intermediate to Advanced users]

If you cannot see a Define button in the Reference Tools dialog it might be because Reference Tools dialog has been “truncated.” [Click here for a screen shot of what the Reference Tools dialog should look like with the Index tab selected. (Shown is the WPX4 version. Other versions might be different.)]

There's a setting in Windows that might be causing the problem. 

Windows XP: Right-click on the Windows XP desktop, then click Properties (or click the Start menu, Settings, Control Panel, Display). Click the "Settings" tab, then click the "Advanced" button in the lower right-hand corner of that tab. Under DPI setting, make sure the drop-down displays "Normal size (96 DPI)" rather than "Large size (120 DPI)". 

Windows Vista/7: Open "Screen Resolution" by clicking the Start button on your desktop, clicking Control Panel, and then, under Appearance and Personalization, clicking "Adjust screen resolution". You can set the sizes to Smaller, Medium, and Larger. If you want to fine tune the setting: Click on "Set custom text size (DPI)" in the left pane. Click the scale (ruler), drag the setting to whatever percentage size increase you want (100%-500%), and then click OK. (If you prefer, you can type a number between 100 and 500 in the box next to "Scale to this percentage of normal size," and then click OK.) On the Display screen, click Apply. The change will take effect the next time you log on.

Notes:

Some users have reported on the results of increasing the setting beyond 100% (96 DPI). For them, at 117% all buttons on the Reference Tools dialog's tabs are present; at 118% the bottom buttons are missing because the dialog is truncated.

Note also that in some situations increasing the DPI will make the numbers on your WP ruler invisible. This is a known issue.

If you still need to increase the size of dialog (and other Windows elements) text, here's a tip from Charles Rossiter (Corel C_Tech):

[In Windows XP:] "Instead of changing the dpi, you can edit the display settings through Windows Start, Settings, Appearance tab, Advanced button. Click on item, and you get a list of about 20 items. Go through that list and increase every font size by 2 points (as a starter example).

If you increase the size of the characters that way, without changing the dpi, you will not lose the ruler measurements, nor disrupt the reference tools dialog."

[In Windows 7:] Click on Start, then in the Search field, type "change windows colors and metrics." In that dialog (Window Color and Appearance) you can adjust these items.]

Temporary solution:

You can create a simple macro to display the Define Index dialog, the same as if you pressed the Define button in the Reference Tools dialog. Here's how:

Open a new blank document and use Tools, Macro, Macro Toolbar to display the Macro toolbar. Then type the single macro command, IndexDefineDlg, into the document. Press Save & Compile on the Macro toolbar to save it to your default macro folder (as shown in Tools, Settings, Files, Merge/Macro). Then go to the document to be indexed and play the macro at the current cursor location (usually, the end of the document) with Tools, Macro, Play. It will insert the Index codes and the text placeholder there. Then generate the document with Tools, Reference, Generate.

[Page top]


Footnote 3 [All users]

While you can format the TOC after it has been generated, you might want some formatting to "stick" if you have to regenerate it several times. Regenerating the TOC will delete the existing TOC -- including any changes in format that you might have made. The trick is to either place the formatting code before the TOC codes, or select the entire TOC and its defining codes (as explained below) and then apply your formatting.

Example: Format the TOC into two columns.

If you want to format the TOC into columns, here's a way to do it that lets you regenerate the TOC without upsetting the column formatting.

1. Back up your document. Generate the TOC (Tools, Reference, Generate).

2. In Reveal Codes, place your cursor immediately to the left of the initial |[Def Mark][Gen Txt] codes at the beginning (top) of your TOC. (The cursor in your Reveal Codes is shown here as a red "|".)

(N.B.: Also check that no other paragraph format codes, such as [Para Spacing], are present. Sometimes these can mysteriously affect the TOC when regenerating it. So you should apply such formatting after creating the two-column format.)

3. Hold the Shift key down while you move down with the arrow or Page Down keys until you have selected everything in the TOC including the last [Gen Txt]| code. (Again, the cursor is shown here in red "|".)

4. Click Format, Columns, Balanced newspaper (if that's what you want), OK.

The TOC should now be in two columns, with headings and page numbers in the same column(s).

5. Save the document under a different name to back it up again (as a separate document), just in case there are problems with the next step.

6. Test things by making a change to a heading (or other marked TOC item) in the body text area of the document (e.g., edit a heading's text, or add a new heading, or delete an old one, or edit the heading [Para Style] to change the marked TOC level for that heading [as explained above, under "How to mark a custom style for automatic inclusion in a Table of Contents"]).

7. Then regenerate the TOC with Tools, Reference, Generate.

The TOC should remain in two columns, but the changes you just made should be visible.

Tip: Wait until the final draft to make any further format changes to the TOC (back up the document first, of course).

[Page top]


Footnote 4 [Intermediate to Advanced users]

[Tip: Macros such as those below can be copied into WordPerfect. See here for brief instructions.]

Here is a sample of a macro that can automatically change a single Table of Contents style -- the style that governs the format of the Table of Contents page itself, normally assigned with the Styles button on the Define Table of Contents dialog or toolbar.

[For a macro that can change an Index style, see the next macro below.]

This particular sample macro changes the style for TOC Level 1, and uses several new format codes, shown in dark red. You must use the StyleEditBegin command to "point to" the appropriate style to revise, then change the various format commands to your preferences.

You can repeat this code segment four more times -- one segment for each subsequent TOC Level -- to produce a single macro that can modify all five levels of the TOC styles in one operation.

Note that this changes the TOC style for the current document only. At this time, the most recent version (WPX3/sp2) sometimes will not allow you to change the TOC styles in the default template. In any case, it seems to be a better idea to use a macro to quickly set up a TOC's format for a particular document, since the new TOC format will be document-specific. It should be easier than going back into the default template to change the TOC system styles back to their defaults if they are not the currently required format -- assuming you can remember the default formatting for these five styles.

// Macro code begins -

// Change the Style name in the next command for other TOC levels:
StyleEditBegin (Style:
ToC1Style!; Library: CurrentDoc!)
StyleCodes (State: WithoutOffCodes!; Library: CurrentDoc!)
// Delete everything in the Contents pane:
While(?RightCode>0 or ?RightChar<>"")
DeleteCharNext
Endwhile
// Enter new format code commands here:
HardReturn
Indent
BackTab
FontSize (FontSize: 14p)
Font (Name: "Arial Regular")
AttributeAppearanceOn (Attrib: Bold!)

// Exit from the Styles Editor:
SubstructureExit ()
StyleEditEnd (State: Save!)

// Macro code ends

If you are wondering whether it is possible to do the same thing with an Index, the answer is yes. Here's a macro that will change the style of Index level 1 (which appears as [Para Style: Index1] in Reveal Codes).

Using a macro might be better than saving the new, modified Index styles to the default template, since there might be new documents where you do not want the new Index styles. Moreover, you might want different styles for different Indexes.

In the same manner as explained for the previous macro, you would need to create a separate macro for Index level 2. And as with the previous macro, the changes are document-specific.

This particular sample macro changes the style for Index Level 1, and uses two new format codes, FontSize and Font, shown in red. You must use the StyleEditBegin command to "point to" the appropriate style to revise (Index1Style! or Index2Style!), then change the various format commands (in red) to your preferences.

// Macro code begins:

// Change the Style name in the next command for other Index levels:
StyleEditBegin (Style:
Index1Style!; Library: CurrentDoc!)
StyleCodes (State: WithoutOffCodes!; Library: CurrentDoc!)
// Delete everything in the Contents pane:
While(?RightCode>0 or ?RightChar<>"")
DeleteCharNext
Endwhile
// Enter new format code commands here:
// (The first 4 commands are the WP defaults for Index1 -- i.e., level 1)
Indent
Indent
BackTab
BackTab
FontSize (FontSize: 10p) // (new)
Font (Name: "Arial Regular") // (new)

// Exit from the Styles Editor:
SubstructureExit ()
StyleEditEnd (State: Save!)

//Macro code ends

[Page top]


Footnote 5 [Intermediate to Advanced users]

Marking and Generating Lists

[NOTE: You can download a small file (WPLists.zip) containing a WordPerfect document (.WPD) describing the following method. You can also easily "clip" the custom styles described below -- and found inside that document -- to your own document or template.]

The following should help you create two custom styles to -

  • quickly mark text in the document's body text areas and/or in footnotes, headers, footers, image captions, etc., so they will appear in a generated List; and
  • quickly set up the List area -- i.e., where the list will appear in the document. [Thanks to Noal Mellott on WordPerfect universe for this method.]

Notes

1. If you wish to use more than one List in a document, you will need to create more than one set of styles -- each named differently. [A "set" consists of two styles: one to mark items in various places in the document for inclusion in the List, and one to set up the List area itself (i.e., where the list will be generated).] The example set of two styles below have a "1" appended to their names, so you would create additional sets of styles with a "2," "3," and so forth. If you save these styles to your template (Step 6 below), this would only need to be done once.

2. If you wish to mark text for a List that is inside headers and/or footers -- which are structures that display the same information over many pages -- you should create a NEW header or footer (usually of the same type, A or B) on each page you wish to include in the List, and mark the text in those headers/footers only on those pages. [You would probably create your headers/footers this way anyway, since you would want the text to change, such as at the beginning of each new section or charpter.] This will ensure that page numbers in the generated List point to the proper page(s) where headers/footers contain appropriate referenced text. (For more on how to use headers and footers, see here.)

2. The following instructions assume you use a <WordPerfect> menu (see Tools, Settings, Customize, Menus (tab)).

Method

[Note that if you save the styles to your template (Step 6 below), most of the following would only need to be done once.]

Step 1. Open a document in which you want to create a List. (It is always a good idea to back up the document first.)

Step 2. Create a new WordPerfect List:

a) Click Tools, Reference, List. In the Reference Tools "List" field, enter a name for the List. Here, we will use "MyList1" (without quotes), but you can use any name.

b) Click the Mark button, then the Close button to return to the document. (You can verify the List name was stored in the current document by again using Tools, Reference, List and checking the drop list. Later we will save these items so that they can be used in other documents.)

Step 3. Create a Character style to quickly apply the List marks (i.e., a pair of codes surrounding selected text -- the text that will appear in the List once it it generated):

a) Click Format, Styles, Create.

b) In the Styles Editor that appears, give the style a Name (e.g., "MarkForList1") and a Description (e.g., "Mark the current item for List").

c) In the "Enter key inserts style" field, choose "<None>".

d) For the Type, choose "Character."

e) Enable (tick) the checkbox at the bottom of the dialog, "Show 'off' codes".

f) In the Contents pane, carefully select the long [Codes to the left...] code; this is more easily done with Shift+Arrow.

g) At the top of this dialog (i.e., NOT the main program menu), click Tools, Reference, List (be sure the proper list is selected), Mark, Close.

h) The Contents pane in the dialog should now look something like this:

[Mrk Txt List][Codes to the left...][Mrk Txt List]

i) Click OK on the Styles Editor dialog to return to the Styles dialog. Note the new name is listed in the Available styles list.

j) Click Close on the Styles dialog to return to the document. (You can verify the new style exists in the "Select Style" drop list on the Text property bar.)

Step 4. Create a new, Open style to use to quickly define and position the List itself (typically on page 1, but it can be elsewhere in the document, such as at the end):

a) Position the cursor in the document (typically on page 1).

b) Click Tools, Reference, List (be sure the proper list is selected), Define. A Define List dialog appears with the List name(s), the style of the list(s), and the Numbering format. [You can click Edit to change the Position of the numbering or its format for a selected List, such as numbers that follow dot leaders (the default). If you are listing boxes by their captions and want them included in the List, use the "List box captions automatically" to specify the type of box the List is intended to use -- Figure, Table, Text, or User.]

c) Select (click on) the List name (if there is more than one). Click Insert. Then click Close to close the Reference Tools dialog and return to the document.

d) In Reveal Codes, carefully select just the [Def Mark] code and copy it to the Windows clipboard (Ctrl+C).

e) Click Format, Styles, Create. Enter a Style name (e.g., "GenList1"), a Description (e.g., "Generate the List here"), and set the Enter key to "<None>".

f) Choose the Type as "Document (open)".

g) Place the cursor in the Contents field and paste (Ctrl+V) the [Def Mark] code you just copied (above).

h) Click OK to return to the Styles dialog. Note the new style appears in the Available styles list.

i) Click Close to return to the document.

j) You can, and probably should, delete the [DefMark][GenTxt].."<<List will generate here>>..[GenTxt] line of codes and text. The next step will recreate them (but without the <<text placeholder>>.

Step 5. Test the new styles:

a) Select some text in the body text, in a header/footer, in a footnote, or graphic image caption. Apply the "MarkForList1" style to it from the Select Styles drop[ list on the property bar or from Format, Styles (in Reveal Codes this should place a pair of codes around that text). You probably want to mark just text characters and not format codes, or else the formatting will appear in the generated List.

Repeat on several items on different pages.

b) Place the cursor where you want the List to appear, and -- if there isn't already a pair of [Gen Txt] codes there for that list -- insert the generate-the-list style (e.g., "GenList1") from the Select Styles drop list on the property bar or from Format, Styles. This inserts a single code (e.g., [Open Style: GenList1]) at that location, which will do the job of generating the actual List.

Tip: You can insert this style in multiple locations in a document and it will produce multiple copies of the same List whenever the List is generated. (See also the next tip under Step 5c.)

c) Generate the document with Tools, Reference, Generate. (Windows keyboard shortcut: Ctrl+F9. DOS61(Classic) keyboard shortcut: Alt+Shift+F5.) If you want to create hyperlinks to the pages, enable "Build hyperlinks" when the Generate dialog appears. [Note that Tools, Settings, Environment, "Activate Hyperlinks" must be enabled for the hyperlinks to work in the document.]

Tip: Since the generated List is just specially formatted text, you could format the entries differently (such as some entries being in a different color, italics, etc.) This is best done on the final draft, since generation removes all existing List entries -- including formatting you may have applied later -- and replaces them with new ones.

Step 6. [Optional]

To save these new custom styles to a template -- such as your default template -- so they can be used in other documents, see http://wptoolbox.com/tips/CustomStyles.html. That linked page also shows how to retrieve custom styles directly from other documents you may have received from other users into your current document. For example, you can do this by clipping the custom styles by block retrieving them from the source document.

You can also simply create the styles directly in the template (custom or default) that spawns your documents. (See here fore more: http://wptoolbox.com/tips/Templates.html)

Step 7. Regenerate as needed with Tools, Reference, Generate. If you insert or delete material in the document after generating the List(s), you should generate them again to refresh page numbering.

[Page top]