Understanding Styles |
Much of the functionality in Microsoft Word and Help Producer is based on styles. The proper use of styles is the key to a professionally looking document, and it also impacts the quality of the generated help documents.
Simply put, a style is a set of formatting characteristics that you can apply to a range of text or paragraphs in your document. Using styles, you can control:
Generally speaking, the use of styles is the preferred method of formatting a document, because it helps you maintain a consistent and professional look of your document. While you can still format your document without styles, it is discouraged if you have a complex document.
Microsoft Word distinguishes between Paragraph Styles, Character Styles, and Table Styles. Paragraph styles control all aspects of a paragraph's appearance, such as text alignment, tab stops, line spacing, and borders. Character styles affect text within a paragraph, such as the font and size of text, and bold and italic formats. Table styles affect the appearance of a table, such as borders, shading, and padding.
For more information on styles, consult your Microsoft Word help files (see Styles and Reusing Formatting).
Suppose you write a product manual. Throughout the document, you have reoccurring sections where you need to warn your customer about potential safety hazards. To draw the reader’s attention, you decide to format the word ‘Warning’ with an enlarged font, boldface type, and red color. A warning section might look like this:
Warning
Do not try this at home!
To format the word ‘Warning’, a writer might select the word, change its font-size, typeface, and color, and repeat these steps the next time he or she writes a ‘Warning’ section. You might ask now: “What’s wrong with that?” Well, there are several problems. Firstly, you might have hundreds of these sections throughout your document - it might be a considerable effort to apply these three formatting characteristics to all occurrences of the word ‘Warning’. Secondly, given the amount of formatting properties you need to apply, chances are that you accidentally select the wrong font size, color, or forget to apply the bold typeface. Thirdly, according to Murphy’s Law, your boss will walk into your cubicle tomorrow and inform you that corporate policy now requires you to use yellow color, italic instead of bold typeface, etc., and you spend the rest of your Friday afternoon reformatting your document.
The solution that solves the problems demonstrated in the example above is to use styles. Instead of manually formatting all warning sections, do the following:
With these three simple steps, you have achieved the following: The newly created style ‘Warning’ describes the looks of a warning paragraph. By applying this style to a paragraph, the paragraph inherits all the formatting from the style. You do not need to individually apply each and every property to the paragraph that requires the formatting – you apply the style instead. If the formatting properties change, you only need to change the style’s formatting. All paragraphs that are linked to this style will automatically update and inherit the new formatting.
A rule of thumb: If there are reoccurring parts in your document that should look the same, such as paragraphs, headings, or warning sections, you should use styles.
As shown above, styles are a great way to format a complex document and to keep its look consistent. However, they serve another purpose, when you convert your document to HTML using Help Producer: For each style in your Word document, you can create a Style Mapping, which can trigger a certain action in Help Producer, or control a formatting option.
For instance, there are paragraph style mappings for the styles Heading 1 through Heading 9, which instruct Help Producer to split the document and create a new topic page, whenever a new heading paragraph is found. Similar to Microsoft Word, Help Producer uses the heading styles to create a table of contents automatically.
Another important feature in Help Producer is that you can individually control formatting using style mappings. For instance, you can instruct Help Producer to create HTML attributes that format text in the help file with different formatting properties than the one in the Word document. Or you can instruct Help Producer to create a HTML class attribute for a certain document style, which references a class in a cascaded style sheet (CSS). This gives you fine grained control over every formatting aspect in your help file.
For more information on mapping styles, see the topic Style Mappings.