About Arbortext Styler > Publishing XML Documents as RTF Files > Publishing RTF With and Without Using Word Style Names
  
Publishing RTF With and Without Using Word Style Names
When publishing documents to RTF, you can choose to publish them either with or without Word style names applied to paragraphs and inline characters.
You may wish to exclude style names for purposes of expedience and cost-effectiveness. When you choose not to assign style names, it is assumed that your primary concern is simply that the output RTF is well-formatted and appears similar to other outputs. You are not concerned with the structure of the RTF file (in terms of style names) and as such you wish to limit the time spent developing Export stylesheets.
However, there are several circumstances in which you will need to use style names:
You want to leverage existing Word templates
You will need to re-import published documents at a later date
You want an identifiable structure in your exported documents (paragraphs in documents published without style names are all assigned the Normal style).
When creating stylesheets that export XML to Word or RTF, you have the following choices regarding style names:
Publish using all of the style stylesheet properties defined in a stylesheet without regard to Word style names
Publish using Word style names automatically generated by Arbortext Styler using the XPath version of the context selector string as the style name
Publish using Word style names as defined in a user-specified Word template
Publish using Word style names as defined in the stylesheet
Publish list items using Word's built-in list paragraph styles (in conjunction with any of the previous options)
These options are described individually in the sections below.
Publish Using the Style Properties Defined in a Stylesheet Without Regard to Word Style Names
When publishing documents without style names, the formatting in the published file will reflect most values defined in Arbortext Styler and all paragraphs (except possibly listitem paragraphs, see below) will be assigned the Normal style. Some Arbortext Styler stylesheet properties such as keeps, odd-even page sets, and hyphenation may not be fully supported by Word or by Arbortext Import/Export. Refer to Limitations when Publishing to RTF for further details.
Any context whose element is designated as a list item in Arbortext Styler may use the Word built-in styles for list-related paragraph styles, depending on the setting of the Use Built-in List Paragraph Styles option. This is the only exception to output without style names. To set the required option:
1. With Arbortext Styler and your stylesheet open, choose the File > Stylesheet Properties menu option. The Stylesheet Properties dialog box is displayed.
2. Navigate to the RTF tab.
3. Ensure that the Generate RTF-style names automatically option is not checked and choose OK.
Publish Using Word Style Names Automatically Generated by Arbortext Styler Based on the Context Selector String
When publishing documents using automatically generated style names, the formatting in the published file will reflect any values defined in Arbortext Styler. Style names will be generated as follows:
Any context whose structure type is Block will generate a Word paragraph style with the same name as the element context name, as defined by the XPath syntax (displayed when the Arbortext Styler menu option Options > Show Contexts as XSL is checked). A Word style definition will be created as a new style definition in the published RTF file, if it does not already exist, which reflects the formatting stylesheet properties of the context.
Any context whose Structure Type is Inline will generate a Word character style with the same name as the context name. A Word style definition will be created as a new style definition in the exported RTF file, if it does not already exist, which reflects the formatting stylesheet properties of the context.
Any context whose element is designated as a list item in Arbortext Styler may use the Word built-in styles for list-related paragraph styles depending on the setting of the Use built-in list paragraph styles option.
Word-builtin-styles.rtf can be used to support those publishing processes that do not need final output to include custom styles, or Word styles. A process using this template will use the word built-in styles defined in normal.dot. For more specificity in output styles, specific style name definitions must be included in the template associated with the publishing process in the RTF tab of the Stylesheet Properties dialog box.
If Arbortext Styler is set to autogenerate style names in your publishing process it will provide most of the work towards creating a Word template that is “Word smart”. You should note, however, that Arbortext Styler does not provide support for all Word constructs. For example, Word's document map depends on what Word calls Headings. In an out of the box, English Word installation, these Headings are called Heading 1, Heading 2, Heading 3, etc. Arbortext Styler does not set this RTF-specific property, but allows the stylesheet developer to take advantage of Word's unique formatting capabilities by allowing one to use a style name to reference and link to a style which has been named and fully formatted in Word (sometimes in very Word-centric ways that Arbortext Styler does not support).
Documents that contain divisions do not lend themselves easily to a publishing process that works on autogenerated style names. While you can define divisions with associated levels in Arbortext Styler, they cannot be matched in Word because Word does not use division elements, only titles with an associated division level. Arbortext Styler does not attempt to derive the division level of titles, because the style names used may be user-defined, automatically defined, or not defined at all. It is intended that anything Arbortext Styler does not support can be defined in a Word template to accompany the publishing process, then this Word-specific information will be passed through verbatim to the resultant RTF file.
To include style names that match Arbortext Styler contexts, e.g. chapter/title, section/title, etc. the user-defined RTF template that is associated with the publishing process in the RTF tab of the Stylesheet Properties dialog box must contain Word's definition of those style names, which in turn must include level settings. The easiest way to do this is to define the properties of these new styles in Word, as based on Heading 1, Heading 2, etc. as appropriate. The based on setting is a Word one, and as such further information can be found by examining the style formatting dialog boxes in Word, and investigating Word's online help.
Use the following steps to specify that Word style names be automatically generated by Arbortext Styler based on the context selector string:
1. With Arbortext Styler and your stylesheet open, choose File > Stylesheet Properties. The Stylesheet Properties dialog box is displayed.
2. Navigate to the RTF tab.
3. Ensure that the Generate RTF style names automatically option is checked then choose OK.
You should note that setting Arbortext Styler to autogenerate style names may cause your publishing process to run about 10 times slower than usual.
Publish Using Word Style Names as Defined in Your Stylesheet
When defining style names in your stylesheet, Word style definitions will be created and stored in the published Word document as named paragraphs or character styles. The style definitions will reside in the \stylesheet section of the RTF file. Optionally, you can open the published document in Word and copy any of these Arbortext Styler-created Word style definitions to existing Word templates.
Use the following procedure to designate style names for any stylesheet context:
1. For each context you wish to style, choose User-defined in the RTF style name generation field on the RTF category. You may need to deselect the Default (None) option before you can select the User-defined option.
2. In the RTF style name field, enter the name of the style to be assigned to the content of the published context. The style name will be displayed in the RTF Style/Field column in the Elements list.
* 
If you intend to publish your document with user defined style names, it is important that you disable the Keep track of formatting option in Word when observing or defining the target style names for the final Word document. When the option is enabled, the actual style name might not be displayed as planned in Word's Style UI. Instead Word may display a dynamically-created “phantom” style name which is a concatenation of local formatting overrides to established styles, such as “Normal” + bold, when in reality no such explicit style name exists. This may cause confusion (or obscure the real task) in formatting when the Word styles are being applied in Arbortext Styler.
To disable the option, uncheck the Keep track of formatting option in Word's Editing Options (see Word online help).
Publish Using Word Built-In Styles for List Items
1. Consider the following items when publishing list items using Word's built-in list paragraph styles.
If you want list items to be auto-numbered in Word, ensure the Use built-in list paragraph styles option is checked in the RTF tab of the Stylesheet Properties dialog box, accessed by choosing the File > Stylesheet Properties menu option. In this case, list items will be published using the built-in Word style names that exist in Normal.dot, Word's template style template.
The advantage of this option depends on the intended recipient of the document. If the RTF document is to be modified by the Word user, the built-in list paragraph styles will ensure flexibility and dynamic auto-numbering or auto-bulleting when list items are added to or deleted from existing lists.
Bulleted list items, as defined by the Arbortext Styler style List - Bulleted, will be published using the following Word style names:
List Bullet - Represents a first-level bulleted list.
List Bulletn - A nested list, where n is a digit from 2 to 5 representing the nesting level.
Numbered list items as defined by the Arbortext Styler style List - Numbered, will be published using the following Word style names:
List Number - Represents a first-level numbered, or ordered, list.
List Numbern - A nested numbered list, where n is a digit from 2 to 5 representing the nesting level.
If you do not want list items to be auto-numbered in Word, ensure Use built-in list paragraph styles is not checked in the RTF tab of the Stylesheet Properties dialog box. In this case list items will be published using bullet characters, numerals, and punctuation as defined by Arbortext Styler.
This is the least flexible way to publish, from the perspective of a Word author. The number and bullet characters, as well as punctuation and white space, will be hard-coded as normal text. Auto-numbering will not take place. Use this feature if you are delivering RTF documents for preview only and you do not expect to re-import them. The advantage is that the formatting of the numbers and bullet will match the Arbortext Styler-defined stylesheet properties used for other outputs.
If a given list item context, as defined by Arbortext Styler's List Item style, is explicitly assigned a user-defined RTF style name, the Use built-in list paragraph styles option is ignored.