About Arbortext Styler > Adding Generated Text > Advanced Formatting of Titles and Numbering > Example: Create a Numbered Caption or Title for a Figure, Output After the Figure
Example: Create a Numbered Caption or Title for a Figure, Output After the Figure
This example describes how to create a numbered title for a figure element that contains a graphic.
These steps will place the title after the graphic in the final output even though it occurs before the graphic in the authored document.
1. In Arbortext Styler, set the title in figure context to be hidden in output, by setting the Hidden field in the Text category to Yes.
Set Hidden explicitly, not by referencing a property set.  This is necessary for some outputs, including Editor view, to correctly resolve cross references when titles are hidden and output after the figure.
You must make this setting for all outputs, with the Outputs to edit field set to Base (all outputs). If you do not hide the context for all outputs, any cross references to the parent formal block (the figure element) will use the numbering properties of the hidden title rather than the alternative, generated title being created in this procedure. Although you are hiding the element's content from output in its document location, you will be reinserting it as the content of a User Formatting Element (UFE) in the same table in a later stage in the procedure. As such it will be included as a valid title for the table if you do not hide it completely.
2. Select the figure element in the Elements list, and navigate to its Generated text category. Elect to create generated text to appear after the element's content by clicking the Edit button next to the After-text field. The Generated Text Editor opens.
3. Insert a UFE into the generated text by selecting the Insert > User Formatting Element > (new) menu option, and creating a user-defined UFE, for example _ufe:figure-title. Note that the UFE is displayed in pink tags, as it is currently unstyled. See Highlight Unstyled Elements in a Document for further information.
4. Inside the UFE, elect to insert the content of the title in figure context by selecting the Insert > Element Content menu option and configuring the following settings in the Insert Element Content dialog box:
Element selection: By name and occurrence-within-ancestor
Name: title
Occurrence: 1st
Within: figure
Insert: Only content
5. Save the changes and exit the Generated Text Editor
6. Style the UFE as a title by selecting the Edit > Style > Title menu option in the Elements list.
7. Create a context for the UFE in a figure ancestor, i.e. _ufe:figure-title anywhere in figure.
8. Set the context to be numbered in the Generated text category, by selecting the Number option in the Numbers and bullets field.
9. When previewing or publishing you will now see that all figure titles are numbered, and for each figure the title appears after the graphic, even if the title was entered before the figure in the source document.
If you want to include figure titles configured in this way in a table of contents, or a list of graphics, for example, ensure that you select the _ufe:figure-title anywhere in figure title context in the Customize Table of Contents dialog box, rather than title in figure. For more information on creating a custom table of contents, please refer to Customizing the Content of a TOC.