Headers and Footers in Books

Headers and footers are essential for longer documents and books. At the very least they hold page numbers . But the more reader-friendly approach is to also include such information as the name of the publication and the current main heading in the document (a running head), as shown in Figure 9-7. In fact, the headers of this book show those very things.

Figure 9-7. Header and footer on a right page

graphics/09fig07.gif

For more information on headers and footers and the types of information you can insert in them, see Using Headers and Footers in Basic Documents on page 228.

Figure 7-38 on page 229 and Figure 7-39 on page 229 show how to set up headers and footers for the page styles you'll use in your books and longer documents. Those settings merely ensure that the header and/or footer text boxes will be displayed on your pages. This section shows you how to put the stuff you want in those headers and footers.

To get the most flexibility with headers and footers, use alternating left/right page styles (see Applying and Switching Page Styles on page 259 and the Next style field in Figure 7-60 on page 258). That way you can have separate headers and footers that contain different information. For example, you could display the page number and name of the book on all left pages, and show the page number and the name of the current main heading (a running head) on all right pages. Another possibility is putting the name of the publication on the left and right footers, and putting the running head and page number in the left and right headers.

Using Running Headers or Footers

Running heads show the current text of a certain paragraph, like a heading. For example, you can have the contents of the current Heading 1 display on each page. Each new instance of a Heading 1 changes the running head text starting at that point until another Heading 1 appears in the document. This very book uses running heads in the header: chapters on the left pages, and Heading 1 titles on the right pages.

  1. Set up outline numbering so that the paragraph style you want to use for the running head is selected as Level 1 in the Outline Numbering window.

    See Outline Numbering, for Chapter, Figure, and Cross-Reference Numbering on page 314.

  2. Click in the header or footer where you want to insert the numbering.

  3. Press Ctrl+F2 to bring up the Fields window.

  4. On the Document tab, in the Type list, select Chapter.

  5. In the Format list, select Chapter name.

  6. Click Insert.

  7. If you're using more than one set of headers and footers in the document, copy and paste the running head to all pertinent headers or footers.

Creating Variables for General Use in Headers and Footers

If you want to create a standard simple variable, whether a heading that you want to insert in a header or cross reference, or something else, you'd think you could do it with the User Field option in the Insert Fields window. It even works the first time you do it. However, those fields are just for triggers for conditional statements.

If you want to have random variables like chapter titles or product names for use in documents, create a plain ol' text document or spreadsheet, create a data source to connect to it, and insert the fields from that data source in your document when you want those variables. Create multiple rows if you need multiple values for different purposes.

Example: Figure 9-8 shows the text file, and Figure 9-9 shows using it in a file.

Figure 9-8. A text file containing variables for use in a document

graphics/09fig08.jpg

Figure 9-9. Using the variables in a document

graphics/09fig09.jpg

See Creating a Data Source Based on Text Files on page 882 or Creating a Data Source Based on Text Files on page 882 for more information. (If you want to be able to change the values from the Data Source Viewer in OpenOffice.org, save the file as a .dBase file before you create the data source.)

Then see Dragging Data Source Fields Into a Document on page 379 to bring the fields into the document where you want to use them.



OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net