Customizing Portable HTML Standard Edition Styles with User Macros

prevnext

Modifying TOC styles


The TOC styles (TOC1-TOC5) process the FrameMaker table of contents entries and strip page numbers from those entries. The TOC1-5 styles are hierarchical; that is, you map your highest-level table of contents style to TOC1, your second-level table of contents style to TOC2, and so on. Table19 shows how you might map styles.

Table 19: Mapping TOC styles
FrameMaker style
WebWorks Publisher style
TitleTOC
TOC1
Heading1TOC
TOC2
Heading2TOC
TOC3
Heading3TOC
TOC4
Heading4TOC
TOC5

Note: Every FrameMaker template is different, so it's impossible to predict exactly how your styles need to be mapped.

There is one macro that you may need to modify in rare cases. It is the UMTOCFilter user macro. Here's the definition of UMTOCFilter:

 $GET_GLOBAL(tocpara)["[ ][A-Z\-0-9xviXVI]+$",""];

This macro is what strips the page number from your TOC entries. However, if your FrameMaker table of contents includes entries without page numbers, the last word in the paragraph is stripped (because there's no page number to be stripped). If this happens, you'll need to modify UMTOCFilter to work with the TOC entries that don't include page numbers. For example, you can modify UMTOCFilter so that it treats your chapter titles differently, which is accomplished by checking the current FrameMaker style before proceeding.

To adjust TOC formats' output, follow these steps:

  1. Click the FrameMaker and Generated Files folder. (If you want to set a custom mapping for a single file, click that file instead.)
  2. Select Project » Properties, or right-click and select Properties from the pop-up menu.
  3. Click the Macros tab.
  4. In the Macro Name drop-down list, select UMTOCFilter. The default for the UMFontHeadingColor user macro-$GET_GLOBAL(tocpara)["[ ][A-Z\-0-9xviXVI]+$",""];-is displayed as grayed-out text.
  5. Click the Let me override the value for this macro when converting this file check box. The default becomes black to indicate you can change it.
  6. In the Macro Value field, adjust the default code. For an example of how to adjust the code, see "Example."
  7. Click OK to save your changes.
  8. Regenerate your project (or the file that you changed) to see the new heading color.

Example

Assume that you have a TOC that contains:

ChapterTOC
heading1TOC
heading2TOC
heading3TOC

ChapterTOC does not have a page number, but all the rest do.

The default UMTOCFilter macro works fine for all but the FrameMaker ChapterTOC paragraph style. You can modify the macro to check for ChapterTOC and treat it differently:

 $IF_EQUAL($FRAMESTYLENAME;, ChapterTOC,	$GET_GLOBAL(tocpara);,
$GET_GLOBAL(tocpara)["[ ][A-Z\-0-9xviXVI]+$",""];\
);

Basically, this says:

IF the current FrameMaker paragraph tag is ChapterTOC
THEN use $GET_GLOBAL(tocpara);
ELSE use $GET_GLOBAL(tocpara)["[ ][A-Z\-0-9xviXVI]+$",""];

prevnext



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com