Document 375

How to move typeset page numbers

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

If your document style places the page number in a less than ideal spot, you can move it with the fancyhdr package. The package defines the content of the right, center, and left sections of the header and footer. You can place the page number in one of these areas.

Because your document shell may already define the content of some header and footer areas, you may need to redefine them before your changes will work correctly.

These instructions illustrate how to move a page number from the center bottom of the page to the top right. Use them as a guideline for moving page numbers to any part of the header or footer.

Example: Moving the page number from the bottom center to the top right of the page

  1. Add the fancyhdr package to your document.
  2. Move the page number:
    1. In the body of the document, enter an encapsulated TeX field.
    2. In the entry area, type \pagestyle{fancy} to establish a new page style.
    3. On the next line, add the command \fancyhf{} to clear the header and footer.
    4. On the next line, add the command \rhead{\thepage} to force the page number to the top right of the page.
    5. If you want to remove the rule under the header, which is automatically created by the package, add the command \renewcommand{\headrulewidth}{0pt}on the next line.
    6. If you want to remove the automatically created rule above the footer, add the command \renewcommand{\footrulewidth}{0pt} on the next line.
    7. Choose OK.

    or

    1. From the Typeset menu, choose Preamble.
    2. Click the mouse in the entry area.
    3. Start a new line at the end of the preamble entries and type the commands specified in steps b–f, above.
    4. Choose OK.

See also

Last revised 06/29/06

This document was created with Scientific WorkPlace.