Creating headers and footers

From Apache OpenOffice Wiki
Jump to: navigation, search

] Headers are portions of a document that always appear at the top of a page; footers appear at the bottom of a page. Typically, headers display the title or chapter name of a document.

In OOo, headers are specified by page styles; therefore, when inserted, all the pages with the same page style will display the same header. Chapter 7 describes how to format a header as part of the page style formatting. For the purpose of this example, we will insert a header in the Default pages using manual formatting.

Select from the main menu Insert > Header > [Page Style]. The submenu contains as many entries as page styles used in your document. In addition the submenu includes the entry All, which activates headers on all the pages of the document.

For our example, select the Default menu item to activate the headers only on the pages that use the Default page style. Similarly, to insert a footer, choose Insert > Footer.

Documentation caution.png

The Insert Menu can also be used for deleting a preexisting header or footer for a page style. If that page style has a check mark in front of it, clicking on it opens an OOo dialog box warning about this and asking whether you want to delete the header or footer for that particular page style.

Inserting headers and footers.

Depending on which option you choose, an area will appear at the top or bottom of the page. In this area you can enter text and graphics that will appear on every page.

A page with a page header.

Items such as document titles, chapter titles, and page numbers, which often go into headers and footers, are best added as fields. That way, if something changes, the headers and footers are all updated automatically.

Fields are covered in Chapter 14 (Working with Fields), but one example here may be useful. To insert the document title into the header:

  1. Select File > Properties > Description, enter a title for your document in the Title area, and click OK to close the dialog box.
  2. Add a header (Insert > Header > Default).
  3. Place the cursor in the header part of the page.
  4. Select Insert > Fields > Title. The title should appear on a gray background (which does not show when printed and can be turned off).
  5. To change the title for the whole document, choose File > Properties > Description.

Formatting headers and footers

In Writer headers and footers are considered paragraphs and therefore you can format the header or footer text using the same techniques you use for formatting text in the main body of the document.

Documentation note.png You can define styles for headers and footers so that you can quickly obtain a consistent formatting in case you use several page styles. Writer includes three predefined header styles and three footer styles: generic ones, for left pages, and for right pages. You can also add custom header and footer styles.

Portrait headers on landscape pages

When you define a header and footer on a landscape page, they will be aligned with the long side of the page. If your landscape pages are going to be inserted between portrait pages, you might want the headers and footers to be on the short sides of the landscape pages, so the final printed product looks like the contents of the landscape pages have been rotated 90 degrees on portrait pages.

You can set up portrait headers and footers on landscape pages by using a trick involving frames. These are a bit tedious to set up, but once you have done so, you can copy and paste them to other landscape pages. There does not appear to be a way to make this part of the landscape page style.

To set up portrait headers and footers on landscape pages:

  1. Calculate the required margins so the text area of the landscape page is the same size as the text area on the portrait pages, taking into account the space for headers and footers on the portrait pages. For example, this book uses the margins shown in the following table. The landscape right and left margins are 1 cm larger than the portrait top and bottom margins, respectively. This difference accounts for the extra space used by the portrait header and footer (0.5 cm for the height of the header or footer and a 0.5 cm gap between the header or footer and the main text).
  2. Portrait page (right page) Landscape page (right page)
    Top margin 1.5 cm Right margin 2.5 cm
    Bottom margin 1.5 cm Left margin 2.5 cm
    Left (inner) margin 2.8 cm Top margin 2.8 cm
    Right (outer) margin 1.8 cm Bottom margin 1.8 cm
  3. Create the landscape page style.
  4. Measure the distance from the upper and left edges of the page to the upper left-hand corner of the space where you want the footer to appear. Measure the width and length of the space the footer will occupy (to match footers on portrait pages).
  5. Measuring the location and size of the footer frame.
  6. In a blank paragraph in the text, type the footer text or insert fields such as the page number or the chapter number and name—to match the footer text and fields on the portrait pages. Assign the Footer style to this paragraph so the typeface, font size, and tab settings match those of the footers on the portrait pages.
  7. Select the text (including the fields) you just entered. Choose Format > Character. On the Character dialog box, choose the Position tab and set Rotation / Scaling to 270 degrees (counterclockwise). Click OK.
  8. Rotating the footer text 270 degrees.
  9. With the text still selected, choose Insert > Frame. In the Frame dialog box, choose the Type tab and enter the width, height, and horizontal and vertical position for the footer.
  10. Defining the size and position of the footer frame.
  11. If your footer has a line above the text, on the Borders page, select a right border and specify the line width and spacing to the frame's contents.
  12. Specifying the border position, line width, and spacing to contents.
  13. Click OK to save these settings. The footer should now appear in the required position and orientation.

Repeat these steps (using appropriate measurements) to set up a portrait header on the landscape page.

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools