About Arbortext Styler > Publishing XML Documents as RTF Files > Publishing Table and Figure Captions in RTF Files > Mapping a Context to a Single Paragraph Style
  
Mapping a Context to a Single Paragraph Style
With this approach, the context title in table publishes to a unique RTF paragraph style designed exclusively for the presentation of a table title. This style must be created or modified using Word to attach autonumbering stylesheet properties to it.
Publishing the Title Before the Table
The element to be published is marked up as shown below:
<table><title>My user-defined Table Title</title>...</table>
Use the following steps to publish the title before the table itself:
1. In Arbortext Styler, create the context title in table.
2. Highlight the title in table context in the Elements list.
3. To avoid affecting non-RTF outputs, select RTF from the Outputs to edit drop down list. This will ensure that any generated text and numbering used for titles will not appear in other outputs.
4. Assign a user-defined RTF paragraph style, such as TableTitle, to the title in table context, using the following steps:
a. In the RTF category, select the User-defined option in the RTF style name generation field. You may need to deselect the Default (None) option to be able to make this selection.
b. In the RTF style type field, check the Paragraph option.
c. Enter the name, for example TableTitle, of your user defined paragraph style in the RTF style name field.
d. Click elsewhere in the Arbortext Styler window to update your setting. You will see the style name you entered in the RTF Style/Field column in the Elements list.
Note that this column may not be visible in your window - use the View > Configure Columns menu option to activate it in your display.
The following RTF content will be published:
Paragraph Style: TableTitle
"Table n: " (RTF gentext, where n is autonumbering)
My user-defined Table Title (PCDATA)
[the Word table]
The title will use the paragraph style TableTitle. Table is a generated text label and n is autonumbering. Both are assumed to be part of the RTF style definition, not Arbortext Styler generated text.
Publishing the Title After the Table
The element to be published is marked up as shown below:
<table><title>My user-defined Table Title</title>...</table>
Use the following steps to publish the title after the table:
1. Create a User Formatting Element (UFE) with a name of your choice, for example _ufe:tabletitle, to represent the context title in table. Doing so will let you map this context to an RTF style and permit you to use generated text to move the resulting RTF style to an arbitrary location which does not depend on document order.
a. In Arbortext Styler, create the UFE _ufe:tabletitle. Check the View > User Formatting Elements menu option to ensure your new UFE is shown in the Elements list.
b. Select the context _ufe:tabletitle everywhere.
c. Assign the user defined RTF paragraph style TableTitle to the UFE context by using the following steps:
a. In the RTF category, select the User-defined option in the RTF style name generation field. You may need to deselect the Default (None) option to be able to make this selection.
b. In the RTF style type field, check the Paragraph option
c. Enter the name, for example TableTitle, of your user defined paragraph style in the RTF style name field.
d. Click elsewhere in the Arbortext Styler window to update your setting. You will see the style name you entered in the RTF Style/Field column in the Elements list.
Note that this column may not be visible in your window - use the View > Configure Columns menu option to activate it in your display.
d. To avoid affecting non-RTF outputs, select RTF from the Outputs to edit drop down list. This will ensure that any generated text and numbering used for titles will not appear in other outputs.
e. In the Generated text category, click Edit to add generated text after element content. The Generated Text Editor opens. Follow the steps listed below to insert the element content of the first title of table:
a. In the Generated Text Editor, choose the Insert > Element Content menu option. The Insert Element Content dialog box opens.
b. In the Of: field, select title from the drop down menu. Ensure that Element content is selected in the Insert field.
c. In the Element selection field, check the Specific occurrence option.
d. In the Occurrence: field, select 1st from the drop down list.
e. In the Within: field, select table from the drop down list.
This is an image of the Insert Element Content dialog box, with the Element content option set in the Insert field, the Of field set to title, and the Element selection field set to 1st occurrence within table
f. Click OK to exit the Insert Element Content dialog box, then File > Apply and Close to apply the change and exit the Generated Text Editor.
2. Create generated text to publish _ufe:tabletitle after the table, using the steps below. Generated text provides the means to place the table title text outside the table construct.
a. In the Elements list, select the default context for table.
b. In the Generated text category, click Edit to add generated text after element content. The Generated Text Editor opens. Follow the steps listed below to insert the UFE _ufe:tabletitle:
a. In the Generated Text Editor, choose the Insert > User Formatting Element menu option, then select _ufe:tabletitle from the pullright menu.
b. Click File > Apply and Close to apply the change and exit the Generated Text Editor.
3. Make this context hidden in RTF-specific output, by using the following steps. RTF output requires the flexibility to place a table title or a figure title after the respective table or graphic image. Making it hidden for RTF output prevents RTF-driven side-effects on other outputs and prevents default Arbortext Styler handling of the title.
a. In the Elements list, select the title in table context.
b. Select RTF in the Outputs to Edit list.
c. In the Text category, set Hidden to Yes.
The following RTF content will be published:
[the Word table]
Paragraph Style: TableTitle
"Table n: " (RTF gentext, where n is autonumbering)
My user-defined Table Title (PCDATA)
The title will use the paragraph style TableTitle and will be the element content of the first title in table. Table is a generated text label and n represents autonumbering. Both are assumed to be part of the RTF style definition, not Arbortext Styler generated text.