Glossary Item Box

TechWriter 2009 for Databases Send comments on this topic.

Creating a Custom Output Style Sheet

The Style Sheet File option under the Output Tab can be used to override the font styles used to output headings and text in order to produce highly customized output.  This tutorial provides step-by-step instructions for creating your own custom output style sheet — an advanced feature that is targeted towards technically-savvy users.

Generating Annotated Output

Sample output style sheets that you can use to create your own custom file can be found in Samples\Output Style Sheets folder of your TechWriter installation (typically C:\Program Files\Adivo TechWriter 2009\Samples\Output Style Sheets).  The samples will include the following style sheet files:

DefaultOutputStyles.xsl

RedOutputStyles.xsl

BlueOutputStyles.xsl

GreenOutputStyles.xsl

Starting with a Sample File

Each output style sheet must contain a complete set of all styles and properties in order to be considered valid.  For this reason it is recommended that you start with one of the sample files and adjust the style settings as needed. 

Output style sheet files are XSLT style sheets that can be edited using a plain text editor such as Notepad.  The style sheet contains an XSL attribute-set to represent each of the following supported styles:

Style Description
Heading1 Used for level 1 headings.
Heading2 Used for level 2 headings.
Heading3 Used for level 3 headings.
Heading4 Used for level 4 headings.
CodeListing Used for code listings.
Normal Used for normal paragraphs and text blocks.
TocTitle Used for the Table of Contents title.
Toc1 Used for the level 1 Table of Contents entries.
Toc2 Used for the level 2 Table of Contents entries.
Toc3 Used for the level 3 Table of Contents entries.
Toc4 Used for the level 4 Table of Contents entries.
Title Used for the document title.
Subheading Used for subheadings within a topic.
TableHeading Used for column headings of a table.
IndexHeading Used for index group heading.
IndexTerm Used for index term.
IndexPage Used for index page references.
Header Used for page headers.
Footer Used for page footers.


Each XSL attribute-set contains set of attributes to represent the following CSS font properties: 

CSS Property Description
font-family Specifies the font family to use for the style.  May include alternative font families by using a comma to separate the names.
font-style Specifies whether the font is italic or normal.  Must be set to either italic or normal.
font-weight Specifies whether the font is bold or normal.  Must be set to either bold or normal.
font-size Specifies the size of the font to use for the style.  Must be specified using points (pt) as the unit of measure. 
color Specifies the color to use for the style.  Must be set to a valid CSS color name or #RRGGBB value.

 

Note:  The font families that are supported vary by output format.   For example, PDF and XPS output formats are limited to the following font families:

In cases where none of the font families specified are supported by the output format, a default font family will be used.

Modifying a Style

Using the copy of the style sheet that you created, locate the attribute-set for the style you wish to change.  Below is an example attribute-set for the Normal style:

<xsl:attribute-set name="Normal">
    <xsl:attribute name="font-family">Arial, Helvetica, sans-serif</xsl:attribute>
    <xsl:attribute name="font-style">normal</xsl:attribute>
    <xsl:attribute name="font-weight">normal</xsl:attribute>
    <xsl:attribute name="font-size">10pt</xsl:attribute>
    <xsl:attribute name="color">Black</xsl:attribute>
</xsl:attribute-set>

 

 


© 2005-2009 Adivo Ltd. All rights reserved.