Showing Page Numbers
Page numbers can easily be added to a document and then formatted by performing the applicable steps in the graphical user interface. These steps are described in the Microsoft help topics Add Page Numbers for Word 2013, Add Page Numbers to Your Word 2010 Document for Word 2010, and Add and Format Page Numbers for Word 2007.
The page numbers that you see in your headers or footers are generated by fields. For the page numbering formats described in the help topics just cited, you do not need to know anything about the fields that underlie them. However, if you want to customize your page numbering, the first thing that you need to do is to learn something about these fields and how to insert, display, and modify field codes. The fields described in the following table are related to page numbers and other information that you may want to insert along with a page number.
Field name | Description |
---|---|
PAGE | Gives the current page number. |
NUMPAGES | Gives the total number of pages in the document. |
PAGEREF | Gives the number of the page that contains a specified bookmark. The \h switch can be added to it to create a hyperlink to the bookmark, and the \p switch can be added to display the relative position of the bookmark (above or below) instead of the page number. |
SECTIONPAGES | Gives the total number of pages within the current section. |
SECTION | Gives the number of the current section. |
All of these fields can be can be inserted anywhere in your document, not just in headers and footers, by the standard methods for inserting fields, which are described in the Microsoft help topics Insert and Format Field Codes in Word 2010 and Insert and Format Field Codes in Word 2007. In all versions of Word, the PAGE field can also be inserted anywhere in a document by pressing Alt+Shift+P. Note that when you insert a PAGE field into a footer or header, the page numbering format that you set in the Page Number Format dialog box overrides the format specified by any switches added to the PAGE field.
Fields can also be inserted from the keyboard by typing the applicable field code, selecting it, and pressing Ctrl+F9. Pressing this key combination adds the special curly brackets ({}) that mark your selection as a field code. Field codes cannot be created by inserting ordinary curly brackets.
The short tutorials on this page illustrate many of the techniques for creating customized page numbering in a few specific cases. By performing these tutorials, you will become familiar with these techniques and be able to create your own variations. For some additional good tips about page numbering, see How to Control the Page Numbering in a Word Document by Bill Coan, and for more examples of customized page numbering, see Page Numbering by Greg Maxey.
Displaying Page Numbers after an Introductory Section
Users often want to have their page numbering start with page 1 after a table of contents and other front matter. Some users want the introductory section to be numbered with lowercase Roman numerals. The following steps describe how to do this and display the page numbers after the introductory section together with the total number of pages in the document after the introductory section.
To display page numbers after an introductory section
- If you have not done so already, insert a section break that starts a new odd page to separate your introductory section from the rest of your document. If you have any other type of section break, delete it first.
To do this, with your cursor at the location where you want Section 2 to begin, on the Page Layout tab, in the Page Setup group, click Breaks, and then click Odd Page.
- Add a page number and format it for lowercase Roman numerals with the desired alignment in the header (or footer) for Section 1 (optional).
To do this, with your cursor in Section 1, on the Insert tab, in the Header & Footer group, click Page Numbers, point to the desired location, and click a page number design. Next, on the Design tab under Header & Footer Tools, in the Header & Footer group, click Page Number, and then click Format Page Numbers. In the Page Number Format dialog box, in the Number format drop-down list, select i, ii, ii, ..., click OK, and then close the header (or footer).
- Open the header (or footer) in Section 2 and configure it to be different from the header (or footer) for Section 1. The Same as Previous label should vanish.
To do this, with your cursor in Section 2, double-click the header (or footer), and then on the Design tab under Header & Footer Tools, in the Navigation group, click Link to Previous.
- If you added a page number in the footer in Section 1 and you want the page number to appear in the header in Section 2 or vice versa, delete the unwanted page number in the footer (or header) for Section 2.
- Insert the following fields and text in the header (or footer) for Section 2.
Page { PAGE } of { SECTIONPAGES } pages
A SECTIONPAGES field is used here rather than a NUMPAGES field because the NUMPAGES field would give the total number of pages in the document, including the introductory section.
To do this, insert a PAGE field (if one is not already present) and a SECTIONPAGES field in the desired locations by the standard method, select the fields, press Shift+F9 to display the field codes, and insert the additional text.
- Configure the page numbering for Section 2 to start at 1.
To do this, on the Design tab under Header & Footer Tools, in the Header & Footer group, click Page Number, and then click Format Page Numbers. In the Page Number Format dialog box, select the Start at button, and in the nearby box, enter 1.
- Select the entire header (or footer), press F9 to update the fields and display the corresponding numbers.
If you do not want the page number to appear on the first page of Section 2, configure Section 2 to have a different first page. Similarly, if you want the headers (or footers) on the even and odd pages to be different, configure Section 2 to have different odd and even pages headers and make the appropriate changes.
To change the types of different headers (or footers), on the Design tab under Header & Footer Tools, in the Options group, select (or clear) the Different First Page and Different Odd & Even check boxes. Then in the Navigation group, use the Next Section and Previous Section buttons to navigate between the different headers (or footers), verify that each header (or footer) is configured to be different from the header (or footer) for Section 1, add the applicable fields and text to the header (or footer) for even pages, and modify the header (or footer) for odd pages as needed in both sections.
Displaying Page Numbers within Sections along with the Running Number
When you insert a page number into a header or footer, Word creates a PAGE field. By default, a PAGE field displays the running page number relative to the first page of the document. When you divide your document into sections, you can configure the page numbering to restart at any number in each section. In this way the PAGE field can display the appropriate page number within the section on each page. If you have a set of attachments after the main body of your document, you may want to have both of these types of numbering simultaneously in the sections for these attachments. This can be done by using the PAGE field to display the running number from the beginning of the document and creating another field (formula) that calculates the page number within each section for the attachments.
To display page numbers within sections along with the running number
- In the first section, insert the running page number by the standard method.
- If you have not done so already, insert section breaks that start a new page for each section.
- Insert a bookmark at the very beginning of each section except the first section. These bookmarks can be named StartSec2, StartSec3, etc.
- Configure the header (or footer) for Section 2, which can be called Attachment 1, to be different from the header (or footer) for Section 1.
To do this, on the Design tab under Header & Footer Tools, in the Navigation group, click Link to Previous.
- Open the header (or footer) for Section 2 (Attachment 1) for editing by double-clicking it in Print Layout view.
- Create the following field codes and text in the header (or footer) for Section 2 (Attachment 1).
Attachment {={SECTION} - 1}-{={PAGE} - {PAGEREF StartSec2} + 1}, Page {PAGE}
To do this, insert the SECTION, PAGE, and PAGEREF fields by the standard method and add the remaining text, but do not type any of the other curly brackets ({}) that will be needed. Next, select ={SECTION} - 1 and press Ctrl+F9. Then, select ={PAGE} - {PAGEREF StartSec2} + 1 and press Ctrl+F9. Finally, select the entire header (or footer), press F9 to update the data in the fields, hide the field codes, and display the corresponding numbers.
- Move to the header (or footer) in each of the remaining sections and configure it to be different from the header (or footer) for the previous section. (If they were already different, you will need to copy and paste the header (or footer) from the previous section.) In each section, select the second field (the page number within the section), press Shift+F9 to reveal the field code, change the name of the bookmark to the name of the bookmark for the current section, press F9 to update the data in the fields, hide the field codes, and display the corresponding numbers.
The best way to learn to create customized page numbering is to perform these steps exactly as they are written even if you want to achieve something slightly different. After you see how this works, you can modify your headers or footers to create the specific numbering that you want.
Displaying the Same Page Number on Side-by-Side Pages
Publications that present the same text in two different languages often present it on side-by-side pages with the text in one language on the left-hand page and the text translated into the other language on the right-hand page. In such cases there are advantages to having the same page number on matching left-hand and right-hand pages. The following steps, which are based on the Microsoft Knowledge Base article Placing the Same Page Number on Left and Right Pages, describe how to create this type of page numbering.
To display the same page number on side-by-side pages
- On the Page Setup tab, click the arrow at the bottom of the Page Setup group. Then, in the Page Setup dialog box, click the Layout tab, and under Headers and Footers, click Different Odd and Even.
- Add the following field codes in the header (or footer) for even pages.
{ ={ PAGE }/2 }
To do this, insert the PAGE field by the standard method and add the remaining text without typing any additional curly brackets ({}). Select ={ PAGE }/2 and press Ctrl+F9. Then, press F9 to update the data in the fields, hide the field codes, and display the page number.
- Add the following field codes in the header (or footer) for odd pages.
{ =({ PAGE }+1)/2 }
To do this, insert the PAGE field by the standard method and add the remaining text without typing any additional curly brackets ({}). Select =({ PAGE }+1)/2 and press Ctrl+F9. Then, press F9 to update the the data in the fields, hide the field codes, and display the page number.