Chapter 3 Using Styles and Properties
This section describes the advantages of using documentation styles and properties over ad hoc document formatting.
Microsoft Office was not intended as a software development tool yet analysts spend more time working with text in a word processing application than possibly any other tool. Why! Because it is the lowest common denominator application that everyone who needs access to the requirements, is familiar with. This means that analysts often find that their development tools are specified by the business. Can you imagine your programmers being told that the only tool they are going to be given to write code with is Notepad?
I like to think of requirements as a form of software, but at a higher level of abstraction than source code or design. Ideally they are expressed in a formal language, but previous attempts to specify requirements in anything other than a natural language have mostly failed. Why is this?
Formal languages are difficult to understand and even more difficult to write (look at requirements specified in Z, VDM and OCL for example). Personally, I find it easier to read and write code than to write formal language specifications. Reviewers of requirements want to read them in a natural language that they can understand. Using a formal language will generally mean that the requirement have to be specified twice.
So let’s forget formal languages and ‘real’ requirements management tools and assume that our requirements are going to be written using natural language with a word processor.
We can at least go some way towards formalizing requirements written in English. As mentioned earlier, we already removed many English words from our requirements specifications; adjectives and adverbs for example. Other improvements are to introduce a glossary into the project. We want to restrict the use of English to a minimum subset of the language. If two words can convey the same meaning choose one, and use it consistently (we are not writing a romance novel; requirements are boring on purpose).
Other ways to make our requirements documents consistent is to make use of MS Word properties and styles. This chapter describes some best practices for using properties and styles with MS word.
- baldrick's blog
- Login or register to post comments
- 897 reads


3.2 Styles
Prior to using MS Word I was introduced to a document publishing system named Interleaf. Interleaf was designed specifically for writing technical documents, and introduced me to the idea of classes and objects in document processing. Each paragraph in an Interleaf document is an ‘object’. Each object is an instance of a class. Classes are assigned attributes. The attributes define the format of the paragraph; i.e., its size, font, color and other formatting attributes. Objects may be moved within the document and they retain their attribute values wherever they are located. Changing the attributes of a class updates the formatting of every object of that type of class within the document. Consistency is prevalent throughout the document.
Interleaf no longer exists, but how many technical writers do you know of that are making use of similar features that are built into MS Word?
MS Word assigns every character in a document to a ‘style’. A style is similar to the class concept of Interleaf. A style is a predefined format that may be applied to document characters, words or paragraphs. By default Word will assign text that is typed into a document to a style named 'Normal'. To change the format from Normal, you assign the text to its appropriate style.
Prior to using office 2000, I was not even aware that this feature was available to MS Word. Word 2003 improved the styles feature and it became quite usable.[2]
The following diagram shows the list of styles that I am using to write this document.
Figure 4: Styles Window
Every paragraph in this document is assigned to one of these styles. [3]
I try to give my styles names that reflect the purpose for creating the style. Examples in this document are:
Alternate Flow – This style automatically numbers alternate flow headings in a use case.
Appendix – Automatically numbers appendix headings.
Bullet List – Used to create an unordered list.
Emphasis Bold – Used to highlight text.
Emphasis Italic – Used to italicize text.
Extension Point – Used to automatically number use case extension headings.
Figure Label Text - Used to give document figures a consistent caption.
Front Page – Used to format text on the cover of a document.
Heading – Four heading levels; these are the standard Word headings.
List Number – Used to create an ordered list of items.
Normal – The default Word style.
Subtitle – Used to create an unnumbered subheading.
Supplementary Requirement – Used to identify that this paragraph is a supplementary requirement.
Template Text – Is assigned to instructional text in a document template.
Template Text Emphasized – Allows Template Text to be emphasized.
Use Case – Used to identify the body text of a use case.
Use Case Step -This style automatically numbers the steps of a use case.
The following sections describe some ways in which you may use styles to make your documentation effort more efficient.
3.2.1 Defining Styles
Start by creating a new template from Word’s ‘Normal.dot’ template. Display the styles window pane and modify and add styles as appropriate. These are the styles that are embedded into my normal.dot template that comes with Word 2007, when I select the Show ‘Recommended’ styles option.
Figure 5: Normal Styles
Clicking on the ‘Manage Styles’ button allows you to display more styles or hide styles that you are not interested in. [4]
Rename styles that you wish to keep with a name that represents when the style is to be used. Using the drop-down menu on the right-hand side of the style, select ‘Modify’ and change the name of the style, as appropriate.
Figure 6: Modify command
For example, if you think that the ‘Book Title’ style is appropriate for text on the front cover of your document, rename it to ‘Front Cover’. In this manner users of your template do not have to guess where to use the style. Similarly, because it is named ‘Front Cover’, it should be apparent to your template users that this style should not be used in the body of the document.
In addition to the style name, the ‘Modify’ window allows all formatting associated with the style to be altered.
As a minimum you should define a style for each type of requirement that can be entered into the document. (Even if the formatting is identical, each requirement type needs its own style name.)
[Note that ‘Clear All’ is not actually a style in itself. Clicking on ‘Clear All’ sets the text style to ‘Normal’. Unfortunately, changing text from one style to another can confuse the heck out of Word. The ‘Clear All’ command allows you to clear all formatting prior to selecting the correct style for the text, by assigning the text to the style ‘Normal’. For this reason I do not suggest changing the ‘Normal’ style in any way.]
Figure 7: The Modify Style Window
Clicking on the ‘Format’ button pops up the following formatting options.
Figure 8: Formatting Options
In addition to the formatting options, there are 3 style settings in the Modify window:
3.2.1.1 Style Type
There are 5 style types that may be selected from the dropdown list. Only 1 is of interest; the others are subsets of the ‘Linked’ style type. I set every style to type ‘Linked’ whenever possible (some preset styles do not allow their type to be changed).
The other style types are:
· Paragraph – will set the complete paragraph to the selected style.
· Character – will set only the selected text to the style when selected.
· Table and list – I am not sure of the purpose of these types and have never found reason to use them.
When using a linked style, if a selection of text is highlighted when the style is invoked, only the selected text is assigned to that style. If no text is selected when the style is selected, the whole paragraph is assigned to that style. This is the same functionality as the ‘Paragraph’ and ‘Character’ style types combined. (The same functionality applies if the text is in a table or if it is in a list, so I do not know why I would need the other 2 types of style.)
3.2.1.2 Style Based On
All styles by default are based upon the ‘Normal’ style. That is to say that if you create a new style and do not change its formatting in any way it will appear exactly the same as the ‘Normal’ style when applied to text. By basing a style upon an existing style, of the same style type (you will have to change the style type to ‘Linked’ in order to see both ‘Paragraph’ and ‘Character’ styles in the dropdown list), the style automatically adopts the formatting of that style. Now you may adjust the formatting as appropriate. (A good example of where I use this feature is to create the style ‘Template Text Emphasized’. This style is based on the ‘Template Text’ style, but with ‘Bolding’ added.)
3.2.1.3 Style for Following Paragraph
This is a useful feature that saves the effort of selecting a style for a paragraph, by having Word automatically assign the correct style to the next paragraph after this style has been assigned to the current paragraph. (Note that this feature only applies to a new paragraph that is inserted after the current paragraph. It does apply to an existing paragraph, nor does it apply to selected characters that are assigned to a style.) When a paragraph of text is assigned to this style and a new paragraph is inserted after this paragraph, the new paragraph will be assigned the style selected in this dropdown field. For example, the ‘Alternate Flow’ and ‘Extension Point’ headings are always followed by at least one use case step. Similarly a use case step is normally (but not always), followed by another use case step. These 3 styles types have the ‘Style for following paragraph’ set to ‘Use Case Step’. By default the following paragraph is assigned to the this style being edited.
3.2.2 Tips for Working With Styles
If you do not wish to modify any of the existing Word styles to match your needs, you may create a new style. Simply enter the ‘New Style’ command and the ‘Modify Style’ window pops up (but with a heading of ‘Create Style’).
Once you have defined enough styles to start working with your template, create a document from the template and start filling it out. (You are going to discover that more styles are needed as you complete the document, so keep the template handy.) As you discover that you need to add a style or modify an existing style, create or modify the style in the document template and import the template styles into your document. Do not change style properties directly in the document (see my comments on duplication of work).
3.2.2.1 Template Text
Templates generally contain instructional text about what goes into each section and how to organize the contents of the section. I assign all of this text to a style named ‘Template Text’ (or ‘Template Text Bold’).
(At a previous institution where I worked, the templates were accompanied by a document named ‘Template Instructions for <document type>. The reason for this was because the analysts felt it was a lot of effort to remove thousands of template text instructional words from the document. The result of course is that two documents are maintained in tandem (duplication again) and because the instructions are in a separate document, you need both documents open in order to complete a document that is derived from the template.)
Leaving the template text in the document, I complete the sections of the document, causing the template text and my document text to become intertwined. This is fine, because when I am ready to remove the template text, I simply select ‘All Instances of’ template text and hit ‘Delete’. (Actually I have to do this twice, once for template text and again for template text emphasized.)
Figure 9: Selecting All Instances
In fact this is such a simple procedure that it is possible to retain the template text in the working version of your document and only remove the template text when the document is to be published.
3.2.2.2 Formatting Text
If you have set all of your styles to the ‘Linked’ type, then in order to format a complete paragraph simply place your cursor in the paragraph and select the style from the styles window; or to assign characters in a paragraph to a style, highlight those characters and select the style.
Selected or highlighted text may encompass several paragraphs, allowing many paragraphs to be assigned to a style in a single action.[5]
(This might be an appropriate place to make a recommendation, which is: Since we are working on paragraphs with our styles, it might be easier if we can see where one paragraph begins and ends. To do this, select the ‘Show Paragraph Marks’ option in Word’s ‘Options’ window.)
3.2.2.3 Example Situations For Using Styles
Take the situation where text has been assigned a certain style, but at some time later a decision is made to change the formatting of that style. We simply open up the template for the document. Change the style as appropriate and then import the style into our document. All text of that style is automatically updated to reflect the change in formatting.
How about the situation whereby you open up a document to discover that the wrong style has been applied throughout? Suppose that you wish to change all text of style ‘List Number’ to be style ‘List Bullet’. Simply select all text assigned to style ‘List Number’, see Figure 8, and select the correct style; in this case ‘List Number’.
You need to produce a report of all the supplementary requirements in your use case documents. This report is a document that lists just supplementary requirements each on a separate line. Simple; you create your ‘Supplementary Requirements Report’ document (from a template that contains the ‘Supplementary Requirement’ style, of course). Open up each requirements document in turn; select all text of style ‘Supplementary Requirement’, and copy; then paste into your supplementary requirements report.
One final example (and I’ll stop here because I may be stretching the situation a bit far); suppose that you are given a request, by the business, to highlight every instance of where money is referenced in the use cases (I’m thinking SOX applicable requirements). We simply find every instance of the ‘$*’ in the use case steps, assign them a temporary ‘Paragraph’ type style (let’s call the style SOX for this example). Every step in the use cases that contains a reference to ‘$’s can now be selected by selecting all styles of type ‘SOX’.[6]
See for an example of using styles with the ‘Replace’ function in Word.
Figure 10: Using Styles to Select Replaced Text
3.2.2.4 The Style Area Pane
There is an option in MS Word to set a value for the ‘Style Area Pane’, in inches. Setting this to 1” should be sufficient for you to ne able to recognize the style names in your document. After you have set the style pane value switch to ‘Outline View’ and all of the paragraph styles in use in your document are displayed in this pane. You may select the paragraph by clicking on the style.
A PowerPoint presentation that includes a lesson on using styles is located here.
[1] Why the field is not automatically updated in the document when it is changed, is beyond any explanation that can think of. If the property is used in a header or footer, it must also be updated there in addition to the body of the document. Again, the reason I changed the property value is because I want the value I changed it to, to be displayed in my document. I can think of no reason why I would want to continue displaying the previous value.
[2] Word 2007 changed the way that styles operate meaning that all of my predefined styles had to be redefined when I moved my templates to Word 2007. This change was quite unnecessary in my opinion. Why do Microsoft do this to their customers?
[3] A nice feature that Word 2007 did introduce is the ability to restrict formatting of documents such only the formatting allowed is to styles that have been predefined in the document template.
[4] I am showing the styles pane that comes with Word 2007. Earlier versions of Word (have the equivalent functionality, but in many cases it will function differently. This work is not intended to teach readers how to use their versions of the MS tools.
[5] At this point I have just discovered that in Word 2007, if text is selected across paragraphs and its style is changed all paragraph text is changed, not just the selected text. So, if you wish to change a selection of text across paragraphs to a certain style, but not the whole paragraph, you will need to assign text to a style for each paragraph. Alternatively combine all text into a single paragraph, assign to the correct style and then insert paragraph marks. That works too.
[6] At places where I have worked that were SOX compliant we have had to cut out just the applicable SOX requirements from documents and send them to the financial business group. They did not want to receive anything that was of no interest to them.