About Arbortext Styler > Working with Elements in Your Stylesheet > Elements Overview > Styler Formatting Elements
  
Styler Formatting Elements
Styler Formatting Elements (SFE) are predefined elements in the stylesheet that are defined in their own namespace. Arbortext Styler uses SFEs to mark up certain constructs in generated text and control the formatting of the generated text they enclose, for example:
Cross references
Links
Headers and footers
Indices
Tables of contents: note that SFEs only apply to inline tables of contents (TOC) produced via generated text for an element, not those used to contribute to PDF bookmarks on online TOCs
Repeating titles
To display all the SFEs configured for your stylesheet in the Elements list, activate the View > Styler Formatting Elements menu option.
Since the SFEs available for a stylesheet are predefined for that stylesheet, you are not permitted to create new SFEs or rename existing SFEs in your stylesheet. You also may not change the style assigned to a SFE, since this is part of its definition in the stylesheet. You can, however, delete an SFE from the stylesheet or modify its formatting properties, as you would a normal element.
Note that, whilst the generated text constructs listed above generally have their own property categories, dialog boxes, or menu options in which you can set certain properties, the SFE allows you to apply a much more detailed control on the object's appearance in generated text. For example, the Table of Contents Format and Table of Contents Format Details dialog boxes contain options to configure the following properties for the table of contents format objects configured in your stylesheet:
Table of Contents Format dialog box: indent setting for levels, and display of age numbers, leaders and space
Table of Contents Format Details dialog box: settings for display of labels, numbering and spacing for individual entries
When you work with the Styler Formatting Elements _sfe:TocXXX, however, you have access to all the options available to regular elements for the setting of formatting properties. There is an SFE for each individual component of each table of contents format object, which allows you even greater control over its appearance when used in generated text. Each SFE displays the same formatting property categories as a regular element in the Elements list:
Text properties: see Text Category for information
Indent settings: see Indent Category for information
Spacing properties: see Spacing Category for information
Breaks: see Breaks Category for information
Generated text: see Generated Text Category for information
Property sets: see Property Sets Category for information
Footnotes: see Footnote Category for information
Side by side placement: see Side by Side Category for information
PDF tags: see PDF tags Category for information
HTML tags: see HTML tag Category for information
RTF properties: see RTF Category for information
Example: Using SFEs to Style a Table of Contents Format Object
This example demonstrates how to set formatting properties for the Book Table of Contents format object and an override for its second level entries.
Note that this process will only have an effect for inline tables of contents (TOC) produced via generated text for an element, not those used to contribute to PDF bookmarks on online TOCs (see Table of Contents Overview for further information).
1. In Arbortext Editor, open the file transport.xml located at Arbortext-path/samples/styler.
2. Note that the toc element generates a table of contents at the beginning of the document, before the first chapter.
3. Choose Styler > Edit Stylesheet to open the associated stylesheet for edit. This is a read only stylesheet so you will need to save a local copy if you want to make amendments.
4. In the Elements list, highlight the toc everywhere context. Navigate to the Generated text category for the context. You will see in the After-text field that the context is set to use the Book Table of Contents object to generate a table of contents.
5. Still in the Elements list, highlight the SFE _sfe:TocBook_Table_of_Contents. Refer to the Description tab and you will see that the purpose of this element is to wrap the Book Table of Contents table of contents format object.
6. In the Text category for the context, set the Font family field to Arial and the Text color field to Blue. Here you have selected a default font style and color for the whole table of contents.
7. Back in the Elements list, highlight the SFE _sfe:TocEntry2_Book_Table of Contents. Refer to the Description tab and you will see that the purpose of this element is to wrap all second level entries in a table of contents based on the Book_Table_of_Contents object.
8. In the Text category for the element, set the Text color field to Red. Here you have set a font color for the second level table of contents entries only, which will override the font color setting specified for all other text in the table of contents in the _sfe:TocEntry2_Book_Table of Contents element.
9. In the Spacing category for the element, set the value of the Preferred option in the Spacing before field to 40pt. Here you have specified that second level table of contents entries should be separated from the preceding first level element by 40pt.
10. Choose Print > Preview. In the Print Preview window, refer to the table of contents at the beginning of the document and note that most of the entries are colored blue, with the exception of the second level entries which are colored red. There is a large space between second level entries and their preceding first level entry.