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:
- You don’t have to remember and repeat the same formatting commands every time you need a new box; instead, you simply tell Word what type of box you want.
- All boxes of the same kind are guaranteed to have the exact same formatting.
- It becomes easy to change the formatting of every box of the same kind at once.
- You can use software to enumerate or extract boxes of some kind.
For example, suppose you want to create boxes like the following:
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.
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.
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’.