About Arbortext Styler > Publishing XML Documents as RTF Files > Publishing Table and Figure Captions in RTF Files > Using Generated Text for Labeling a SEQ Field for Numbering
  
Using Generated Text for Labeling a SEQ Field for Numbering
This approach uses the SEQ field to perform the autonumbering of captions in Word, but otherwise relies on Arbortext Styler to define the generated text for the pretext label and the formatting surrounding the autonumbering.
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, 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 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 generated text before the table, using the steps below. Generated text provides the means to insert a user-defined SEQ field to perform autonumbering. In this manner, the table numbering will be dynamic for the Word author.
a. In the Elements list, create the context title in table if it doesn't already exist.
b. Select the default title in table context for table.
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:
"Table " + <ufe:tabletitlenumber> + ":"
d. 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
"Table: " (Styler gentext)
SEQ field (RTF gentext)
": " (Styler gentext)
My user-defined Table Title (PCDATA)
[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 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:tabletitle. The Arbortext Styler generated text for the default context of title in table is responsible for defining the destination RTF style TableTitle and publishing all title-related data to RTF.
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. 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.
c. In the Generated text category, click Edit to add generated text after 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 the table element.
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
"Table: " (Styler gentext)
SEQ field (RTF gentext)
": " (Styler gentext)
My user-defined Table Title (PCDATA)