Advanced authoring in Microsoft Word – Part 27: Miscellaneous Word tips
In this post, I give small miscellaneous tips about using Microsoft Word. This list is by no means complete. In particular, I do not repeat things I have covered in my previous posts.
Very basic editing
Of course, the reader is very familiar with the (extended) keyboard shortcuts used to navigate text on the Microsoft Windows platform. But still, here is a summary: The arrow keys move the caret one character or line at a time. Using the Ctrl modifier key, you move a word (horizontally) or a paragraph (vertically) at a time instead. The Shift modifier key extends the selection. (And, of course, Ctrl and Shift can be combined.) Home and End move to the beginning and end of the line, respectively. With Ctrl, they go to the beginning and the end of the document, respectively. Shift extends the selection. PgUp and PgDn move a screen up or down, and with Ctrl they by default move a page up or down. Backspace and Delete remove the preceding and next character, respectively. With the Ctrl modifier, the entire preceding or next word is removed.
-
You probably also know these very basic keyboard shortcuts:
Command Shortcut (English) Shortcut (Swedish) Undo Ctrl+Z Ctrl+Z Redo (or Repeat) Ctrl+Y Ctrl+Y Cut Ctrl+X Ctrl+X Copy Ctrl+C Ctrl+C Paste Ctrl+V Ctrl+V Bold Ctrl+B Ctrl+F Italic Ctrl+I Ctrl+K Underline Ctrl+U Ctrl+U Left (align) Ctrl+L Ctrl+L Centre (align) Ctrl+E Ctrl+E Right (align) Ctrl+R Ctrl+R Justify (align) Ctrl+J Ctrl+J Find Ctrl+F Ctrl+B Replace Ctrl+H Ctrl+H Goto Ctrl+G Ctrl+G Hyperlink Ctrl+K Ctrl+I Check spelling F7 F7 Save Ctrl+S Ctrl+S Close Ctrl+W Ctrl+W Open Ctrl+O Ctrl+O New Ctrl+N Ctrl+N (Shift+)Tab can be used to navigate tables and to change levels in lists.
Shift+Alt+Up and Shift+Alt+Down move the current paragraph up and down, respectively. (That is, the first one swaps the current paragraph and the one above it, while the second one swaps the current paragraph and the one below it.)
You can move a selection using the mouse and drag and drop. Ctrl copies and Shift+Ctrl inserts a link (so the ‘copy’ will be updated automatically if the source is changed). If you use the right mouse button (and no modifiers), you get a popup menu of options at the target.
Additional shortcuts
Ctrl+F1 collapses and expands the ribbon.
To insert a Unicode character with a known hexadecimal codepoint, type the codepoint in the document text, and press Alt+X. For example, typing 222b, Alt+X inserts the integral sign.
F6 navigates the GUI.
F2 is a convenient way to move text using the keyboard without using the clipboard. Shift+F2 copies.
Another way of moving without using the clipboard is to select the text in question and then Ctrl-right-click where you want to move it. This moves the text; Shift+Ctrl copies.
If you select some text (or graphics) and press Ctrl+F3, the selection is moved not to the clipboard, but to the ‘spike’. You can move several items to the ‘spike’, and insert them all – in their own paragraphs – using Shift+Ctrl+F3. Inserting the ‘spike’ clears it.
You can press F8 to turn on the ‘Extend Selection’ mode which will extend the selection instead of moving the caret. By pressing the key repeatedly in a row, you select the current work, the current sentence, the current paragraph, the current section, and the entire document. You exit the ‘Extended Selection’ mode by Esc. The mode is also exited on copy to clipboard (which I find particularly convenient).
Shift+F5 moves the caret to the place of the last edit. This is very convenient!
Alt+Ctrl+Z moves the caret between the last four places in the document where you have made edits.
Alt+Ctrl+PgUp and Alt+Ctrl+PgDn move the caret to the top and the bottom of the current visible screen, without doing any scrolling.
You know you can create block selections by Alt-dragging the mouse. But you can also create block selections using the keyboard: Shift+Ctrl+F8.
Editing
By default, Word automatically replaces single and double quotation marks with typographic quotation marks, according to the language of the text. For example, in English you get “this”, medan du på svenska får ”detta” und auf Deutsch erhält man „dieses“.
Warning! As indicated in the last point, it is very important that you write your text with the language set correctly. Otherwise, you might get the wrong type of quotation marks.
In some cases, you do want the standard quotation marks (", U+0022: QUOTATION MARK and ', U+0027: APOSTROPHE). For example, this is the case if you enter a snippet of computer code in a document. The simplest way get one of these is to press Ctrl+Z immediately after Word has replaced the character. This will undo Word’s automatic replacement.
By default, Word automatically capitalises the first letter in things that Word considers to be sentences. This will cause problems if you use a display formula inside a sentence that continues on the next paragraph in the technical sense. Best is to disable this feature if you work with formulae.
There are three ways to automatically insert sample text in a Microsoft Word document. My favourite is to type =lorem(m, n), where m and n are positive integers, followed by Return; this will insert m paragraphs of lorem ipsum with n sentences each.
Tables
For a long time, Microsoft Word has featured a very impressive table editor. In Microsoft Word 2007+ it is extremely easy to create good-looking tables with just a click or two in the ribbon.
-
Tables can be both in-line and free-moving with text floating around. Most often, I want them to be in-line in my long math texts. But then there is a small problem: it is not possible to set the spacing above and below an in-line table (in CSS terms: the margin above and below). There is no such margin (spacing). Since the style of the body text usually has spacing after but not above the paragraph, this will create a good-looking spacing before a table, but there will be no spacing after it, as illustrated in the following picture:
Perhaps the least ugly solution is to add an empty paragraph (with small text and suitable paragraph spacing) immediately after the table.
This is yet another problem that simply does not exist in HTML + CSS, where you can set padding, border, and margin the same way on any element, including tables.
If you have a table that does fit on a single page, you might want to make sure that no page break occurs inside it. To do this, select the entire table except the last row of it and apply the ‘Keep with next’ paragraph setting. (You might also want to apply the ‘Keep lines together’ option on the entire table.)
If the table fits precisely on a page (that is, if it fits on a page but occupies all of it), you might want to enable the ‘Page break before’ option on the first row of the table. (An inferior solution in the latter case is to insert a manual page break (Ctrl+Return) before the table, and remove superfluous paragraph breaks next to it.)
Fields and bookmarks
-
We have seen a number of fields in previous articles, such as
SEQ
,REF
, andPageRef
. In a footer you might usePAGE
andNumPages
to display the current page and the total number of pages. Also, things like TOCs are implemented as fields, as are hyperlinks, as displayed below. In addition to the field shortcuts we have discussed already, you can use Shift+F9 to toggle the display of field codes (instead of field results) in the selected fields (or the field that the caret is inside). Alt+F9 is a corresponding document-wide setting.
F11 selects the next field of the document, while Shift+F11 selects the previous field.
Shift+Ctrl+F9 replaces a field with its result as normal text (so the field is removed and the result becomes static). You can lock a field with Ctrl+F11; this way its result cannot be updated (e.g., by F9). To unlock, add the Shift modifier. Finally, Alt+Shift+F9 triggers the action associated with a few field types.
The
StyleRef
field can be useful. The field code StyleRef "Heading 2", for instance, gives the contents of the last paragraph styled with the ‘Heading 2’ style. This field can be placed in the header, to give the name of the current chapter or section. This practice is often employed in textbooks and manuals.The reader probably already knows of the document-property fields such as
Title
,Author
,CreateDate
, andFileName
, as well as theDate
andTime
fields.One of my initial reactions to bookmarks was that they are not visible in the text, like fields and formatting characters (which can be shown). That made me worried about their usefulness. But then I realised that you can make them visible. Simply open the Word Options dialog box, select Advanced, ‘Show document content’, and ‘Show bookmarks’.
Sections, headers, footers, footnotes, and endnotes
It is possible to divide a document into sections. A section is one of the parts in a logical division of the document into parts (which is independent of things like heading styles). To mark the end of one section and the beginning of a new one, you use section breaks, which you can insert using Page Layout/Breaks.
There are different types of section breaks. A section break can be continuous, meaning that the new section is started immediately after the break. But a new section can also begin on a new page (a ‘Next Page’ section break). This leaves the rest of the current page empty. Finally, there are section breaks that start the new section on the next even or odd page. In practice, such a break will introduce an empty page in the document, if necessary. Of course, section breaks are handled automatically.
If you want, you can have different headers and footers in different sections.
In each section (or in the entire document), you can choose to have different headers and footers for odd and even pages. You can also choose to have a different header or a different footer on the first page. (If you don’t use sections, these settings are still useful. The first page of the document is the cover page.)
You can have different page formats (page size, margins, vertical alignment) in different sections. Personally, I often let the cover page of a book be a section of its own, which is centred vertically. The cover page consists of a single paragraph (the title of the book), which is then automatically centred on the page.
You can choose to restart footnote and endnote numbering in each new section. (Footnote numbering can even restart at each new page.) You can also choose if you want endnotes to appear at the end of the section or at the end of the document.
It is possible to change the style of footnote and endnote references; they are normal styles. By default, they are superscripted, but you may format them any way you like.
It is even possible to change the separator above a footnote or endnote region. By default, this is a black line. To change this separator, go to Draft mode, open the footnote window and select the separator in the combo box. You might change the colour or size of the line, or remove it and set a paragraph border. In the latter case, you might also change the right indent of the paragraph.
It is possible to insert graphics in headers and footers. In particular, it is possible to insert floating (free-moving) shapes, and these can be positioned anywhere on the page (that is, they do not need to be confined to the header or footer area). This is a useful way to add the same graphics to every page in (a section of) a document. For example, you could have the page number in a decorated text box in the middle of the page at the outer margin.
Mathematics
-
I want my set-builder notation to look like this:
Notice the space after the colon. How to achieve this in Word? Probably the best way is to use wide space characters. For instance, one can try the EN space (U+2002) or the EM space (U+2003). One simple way to insert is to use the tokens \ensp and \emsp, respectively. I use the EN space, and have associated the keyboard shortcut Ctrl+Space to it.
-
Sometimes the automatic spacing in formulae can be improved by manual tweaking using ‘phantoms’ and ‘smashes’. In a blog post of Microsoft employee Murray Sargent, two examples are given.
First up is
By writing \hsmash\pi instead of merely \pi, the π will be rendered but its width will be ignored. So you get
The other example given is
Notice that the second square root is bigger than the first one. This is fixed by replacing y by \dsmash(y) which ignores the descender of y:
Apparently, Murray Sargent learned this trick from Donald Knuth.
Finally, in the comments to the blog post, commenter Nali noticed that
doesn’t look good because of the excessive height of the radical. This can also be fixed by smashing the descender:
There seems to be a bug in Microsoft Word 2010 (at least) related to smashing, however.
In general, Murray Sargent’s blog is great. He has also authored a complete specification for the formula editor’s ‘linear format’ which you use to enter formulae. Implicitly, it also reveals all the features supported by the formula component.
I always end my proofs with a “∎” (U+220E: END OF PROOF) at the right margin of the last line. To simplify this, I have added a Math AutoCorrect token \qed for the symbol. Then, when I am done with a proof, I set a right-aligned tab stop at the right margin of the last paragraph, insert a tab character, and type \qed.
-
I just considered the possibility of simplifying this further, and wrote the following VBA macro:
Sub InsertQED()
Selection.ParagraphFormat.TabStops.ClearAll
Selection.ParagraphFormat.TabStops.Add _
Position:=Selection.PageSetup.PageWidth _
- Selection.PageSetup.RightMargin _
- Selection.PageSetup.LeftMargin, _
Alignment:=wdAlignTabRight
Selection.InsertAfter (vbTab & ChrW(8718))
Selection.InsertParagraphAfter
Selection.Collapse Direction:=wdCollapseEnd
Selection.ParagraphFormat.Style = wdStyleNormal
End SubI then assigned the keyboard shortcut Alt+Shift+Ctrl+Q to it. Extremely convenient!