About Arbortext Styler > Publishing XML Documents as RTF Files > Publishing Table and Figure Captions in RTF Files > Mixing Paragraph and Character Styles with a SEQ Field
  
Mixing Paragraph and Character Styles with a SEQ Field
This approach publishes the caption with a paragraph style that includes a character style for the generated text and a SEQ field for autonumbering. This approach is appropriate when re-importing the document is a priority. This approach is more difficult to set up, but it makes the import mapping simpler and more efficient because the import mapping process does not have to parse the details of generated text and numbering for the table title.
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 table title before the table, mixing paragraph and character styles with a SEQ field:
1. Create the User Formatting Element _ufe:tabletitlenumber, using the steps described below. Doing so lets you map the default context of this UFE to a Word field, define structure at a level of granularity lower than the paragraph text, and autonumber all tables that are given the common numbering reference Table.
a. In Arbortext Styler, create the UFE _ufe:tabletitlenumber. Check the View > User Formatting Elements menu option to ensure your new UFE is shown in the Elements list.
b. Assign the Inline style to _ufe:tabletitlenumber, via the Edit > Style menu option.
c. Assign the RTF field SEQ to _ufe:tabletitlenumber by following the steps described below:
a. Select the default context of _ufe:tabletitlenumber in the Elements list.
b. In the RTF category, click the Edit button in the RTF Field field. The Field dialog box opens.
c. In the Field name field, select SEQ from the drop down list.
d. Set the field values for SEQ as follows: .
Set the field instruction VARIABLE NAME to Table. Ensure the Use box is checked.
(Optional) Set the \* switch to Arabic. Ensure the Use box is checked.
This is an image of the Field dialog box, with the Field name field set to SEQ, and the instruction VARIABLENAME highlighted in the list. The instruction has the Use option checked and the value “Table” set in the Value column. The instruction \* has the Use option checked and the value “Arabic” set in the Value column.
2. Create the UFE ufe:tabletitlelabel. Creating a unique UFE for the generated text associated with this title lets you provide a character style which wraps the generated text within the table title. This character style wrapper can then be ignored easily if you later import the document. Without it, Arbortext Import must parse the entire table title to remove the non-PCDATA. For example, in the title Table 1: My user-defined Table Title, the only data to be imported to XML is the actual title My user-defined Table Title.
a. In Arbortext Styler, create the UFE _ufe:tabletitlelabel. Check the View > User Formatting Elements menu option to ensure your new UFE is shown in the Elements list.
b. Assign the Inline style to _ufe:tabletitlelabel, via the Edit > Style menu option.
c. Assign the RTF Character style TableTitleLabel to _ufe:tabletitlelabel 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 Character option.
c. Enter the name, for example TableTitleLabel, of your user defined character 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. In the Generated text category, click Edit to add generated text before element content. The Generated Text Editor opens. Enter the following in text format:
"Table "+ <ufe:tabletitlenumber> + ":"
Click File > Apply and Close to apply the change and exit the Generated Text Editor.
3. Assign the paragraph style TableTitle to the title in table context and create Add Before generated text. By inserting _ufe:tabletitlelabel in Add Before generated text, this context will publish the TableTile paragraph start. Then, it will publish the character style TableTitleLabel which will encapsulate the pretext and generated text autonumbering. Finally, this context will publish the title PCDATA (by default), which will reside in the parent paragraph style TableTitle.
a. Select the default context of title in table in the Elements list.
b. Assign the user defined RTF paragraph style TableTitle to the element context by using the following steps:
a. In the RTF category, select the User-defined option in the RTF 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.
c. In the Generated text category, click Edit to add generated text before element content. The Generated Text Editor opens. Enter the following in text format:
<ufe:tabletitlelabel>
Click File > Apply and Close to apply the change and exit the Generated Text Editor.
The following RTF content will be published:
Paragraph Style: TableTitle
Character Style:
"Table: " (Styler gentext) (ufe:tabletitlelable: PCDATA in the Character Style)
SEQ field (RTF gentext) (SEQ in the Character Style)
": " (Styler gentext) (ufe:tablelable: PCDATA in the Character Style)
My user-defined Table Title (PCDATA in the Paragraph style)
[the Word table]
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 table title after the table, using generated text for labeling and a SEQ field for numbering:
1. Create the User Formatting Element _ufe:tabletitlenumber, using the steps described below. Doing so lets you map the default context of this UFE to a Word field, define structure at a level of granularity lower than the paragraph text, and autonumber all tables that are given a common numbering referenceTable.
a. In Arbortext Styler, create the UFE _ufe:tabletitlenumber. Check the View > User Formatting Elements menu option to ensure your new UFE is shown in the Elements list.
b. Assign the Inline style to _ufe:tabletitlenumber, via the Edit > Style menu option.
c. Assign the RTF field SEQ to _ufe:tabletitlenumber by following the steps described below:
a. Select the default context of _ufe:tabletitlenumber in the Elements list.
b. In the RTF category, click the Edit button in the RTF field field. The Field dialog box opens.
c. In the Field name field, select SEQ from the drop down list.
d. Set the field values for SEQ as follows: .
Set the field instruction VARIABLE NAME to Table. Ensure the Use box is checked.
(Optional) Set the \* switch to Arabic. Ensure the Use box is checked.
This is an image of the Field dialog box, with the Field name field set to SEQ, and the instruction VARIABLENAME highlighted in the list. The instruction has the Use option checked and the value “Table” set in the Value column. The instruction \* has the Use option checked and the value “Arabic” set in the Value column.
2. Create the UFE ufe:tabletitlelabel. Creating a unique UFE element for the generated text associated with this title lets you provide a character style which wraps the generated text within the table title. This character style wrapper can then be ignored easily if you later import the document. Without it, Arbortext Import must parse the entire table title to remove the non-PCDATA. For example, in the title Table 1: My user-defined Table Title, the only data to be imported to XML is the actual title My user-defined Table Title.
a. In Arbortext Styler, create the UFE _ufe:tabletitlelabel. Check the View > User Formatting Elements menu option to ensure your new UFE is shown in the Elements list.
b. Assign the Inline style to _ufe:tabletitlelabel, via the Edit > Style menu option.
c. Assign the RTF Character style TableTitleLabel to ufe:tabletitlelabel by using the following steps:
a. In the RTF category, select the User-defined option in the RTF 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 Character option.
c. Enter the name, for example TableTitleLabel, of your user defined character 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. In the Generated text category, click Edit to add generated text before element content. The Generated Text Editor opens. Enter the following in text format:
"Table "+ <ufe:tabletitlenumber> + ":"
Click File > Apply and Close to apply the change and exit the Generated Text Editor.
3. 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.
c. In the Generated Text Editor, choose the Insert > User Formatting Element menu option, then select _ufe:tabletitle from the pullright menu.
d. Click File > Apply and Close to apply the change and exit the Generated Text Editor.
4. 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 view, 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
Character Style:
"Table: " (Styler gentext) (ufe:tabletitlelable: PCDATA in Character Style)
SEQ field (RTF gentext) (SEQ in Character Style)
": " (Styler gentext) (ufe:tablelable: PCDATA in Character Style)
My user-defined Table Title (PCDATA in the Paragraph style)