Flag of the United Kingdom
Andreas Rejbrands webbplats

Advanced authoring in Microsoft Word – Part 7: Boxes

In many types of text, you want to create boxes with borders and/or different background colour. For example, a mathematics textbook might contain examples in coloured boxes, and theorems and proofs in boxes with solid black borders. In Microsoft Word, it is easy to create simple boxes.

As always one could use direct formatting to create boxes, but it is much better to use styles, for the usual reasons:

For example, suppose you want to create boxes like the following:

A bordered and coloured exmple box with heading in Microsoft Word.

To do this, create a new paragraph style named ‘Example Box’. Make sure the ‘Space After’ and ‘Space Before’ values are suitable. If you use vertical space to separate paragraphs of body text, you should probably use the very same values for ‘Example Box’. Also add the border and the shading.

The Modify Style dialog box used to edit the Example Box paragraph style.

The Borders and Shading dialog box used to edit the presentational attributes of the Example Box paragraph style.

Now we create a new style named ‘Example Box Heading’. Set the ‘Style based on’ value to ‘Example box’; this will make ‘Example Box Heading’ inherit the properties of ‘Example Box’ like the background and border. Also make sure that ‘Style for following paragraph’ is ‘Example Box’, since we want an example box heading to be followed by an example box paragraph. To format the heading, it is a good idea to use boldface; if you like, you can also increase the font size. Finally, since this is a heading of the box, you should set the ‘Keep with next’ (and ‘Keep lines together’) paragraph option.

The Modify Style dialog box used to edit the Example Box Heading paragraph style.

Now we are all set up.

In order to create an example box in your document, simply activate the ‘Example Box Header’ style, for instance by pressing Shift+Ctrl+S, typing the name of the style, and pressing Enter. You then type the heading of the box, and when you press Return, the style is automatically changed to ‘Example Box’. You may create any number of paragraphs in the box, and when you want to ‘close’ the box and create a ‘normal’ paragraph, simply press Shift+Ctrl+N to set the style to ‘Normal’ (if that is the style you use for body text).

It is very convenient. If you create a lot of boxes of the same kind, you can even associate a shortcut to enable the box heading style. For example, you could assign Alt+Shift+Ctrl+E to ‘Example Box Heading’.

The 'Shortcut key' menu item in the Format popup menu in the Modify Style dialog box in Microsoft Word 2010.


Visa alla tidigare notiser.

Visa enbart de senaste notiserna.