About Arbortext Styler > Adding Generated Text > Adding User Formatting Elements to Generated Text
Adding User Formatting Elements to Generated Text
You can add User Formatting Elements to generated text by choosing Insert > User Formatting Element in the Generated Text Editor. A User Formatting Element (UFE) can be used in generated text to apply specialized formatting for generated text, other than that defined in Arbortext Styler. For example, you may want to add a UFE to the generated text of the title in chapter context to make a line appear directly over the contents of the title.
To Add a User Formatting Element to Generated Text
1. In Arbortext Styler, select an element context, and go to the Generated text category.
2. Choose the Edit button for the Before-text or After-text field.
3. In the Generated Text Editor, choose Insert > User Formatting Element. If you have not already defined a User Formatting Element, choose (new).
4. Arbortext Styler will automatically insert the UFE you choose. If you have created a new UFE, select the newly created UFE in the Elements list and use the property categories to apply style properties. If you do not see the new UFE in the Elements list, choose the View > User Formatting Elements menu option to enable their display.
Use a UFE to Concatenate Multiple Gentext Options Based on Attributes
It is possible that you will have an extremely complex generated text requirement for a single element: for example, an element myelement could have three attributes, each one with four possible values. If you need to apply different generated text for each possible value, you would need to maintain 12 conditions of the myelement element - if this is a commonly used element in your stylesheet it is likely that it will already have many conditions and contexts applied to it. If you wish to simplify the generated text setting, you could create a UFE for each of the three attributes of myelement and attach the conditions to those, thus not adding to the existing set of the conditions for myelement.
1. In Arbortext Styler, select the everywhere context for myelement, navigate to the Generated text category, and elect to add generated text before the element content.
2. In the Generated Text Editor window, insert a UFE via the Insert > User Formatting Element > (new). Give the UFE the same name as the attribute to which you wish to apply formatting options.
3. Repeat step 2 to create a UFE for each of the other two attributes of myelement. Place them in the same order in which generated values should appear and add whatever space, punctuation, or fixed text is necessary.
4. Click File > Apply and Close to save the changes and exit the Generated Text Editor.
5. For each UFE, create one condition for each of the possible values of the corresponding attribute via the Insert > Condition menu option. Each condition should include an attribute test, which specifies myelement as the required ancestor, and tests for a particular value of the attribute to which the UFE relates.
6. For each condition of each UFE, use the Generated text category to define the generated text that should be inserted when the specific value of the specific attribute for the myelement element is encountered.