Creating and applying a style

Create styles to apply a specific list of formatting attributes to multiple elements within a template. For example, create a text style to apply to all section headings or create a list style to apply a certain numbering scheme to all lists in your document. Define the values for these properties and others, such as text formatting, table borders, image placements, and more.

About this task

Styles are applied in the following order:
  1. Template styles or stylesheets, if any
  2. The formatting properties you define for the template elements, if any
If you find that a style is not being applied as expected, it might be for one of the following reasons:
  • The styles set in the formatting properties might be causing the styles that are applied earlier to be reset.
  • The name of the style might already exist in the Rational® Publishing Engine default stylesheet. For example, the Title style already exists. The Title style in the default stylesheet overrides a style you create and name Title.
Tip: Avoid using more than one of the three methods for applying styles in a template. You might get mixed results in the output and have difficulty troubleshooting. When you must apply additional styling to an element that uses a particular style, apply the customization to a child element.

For example, you might want to change the color of a single paragraph that uses a style. Apply the style to the paragraph element and change the color property for the text element that the paragraph contains.

Procedure

  1. Create a style:
    1. In Document Studio, click Style > New Style.
    2. In the New Style wizard, click Next.
    3. Enter a name for the style and click Next.
    4. Select the property, or group of properties, and click the Add icon Add icon to add the property to the style. Click Next.
    5. Expand the property names.
    6. Select a property name and enter a value for the selected property in the Property Value column. Repeat for each property name. Click Next.
    7. Review the summary and click Finish.
  2. Apply the style to an element:
    1. Add an element to the template.
    2. In the Outline view, expand Styles.
    3. Select a style and drag it into the element in the Template Content editor. The style icon displays in the element in the template.
    4. Repeat to add the style to other elements.

What to do next

To modify an existing style:
  1. In the Outline view, right-click a style.
  2. Select Edit Style.
  3. Complete the wizard. If you select the template element and modify its properties in the Properties view, your changes are applied to that element only and not to the style.

Feedback