Writer Guide 7.3
Chapter 5,
Formatting Pages: Basics
Page styles and related features
This document is Copyright © 2022 by the LibreOffice Documentation Team. Contributors are listed below. You may distribute it and/or modify it under the terms of either the GNU General Public License (https://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
All trademarks within this guide belong to their legitimate owners.
Jean Hollis Weber |
|
|
Jean Hollis Weber |
Kees Kriek |
Gillian Polack |
Bruce Byfield |
John A Smith |
Ron Faile Jr. |
Randolph Gamo |
Kees Kriek |
Jenna Sargent |
Jamie Eby |
|
|
Please direct any comments or suggestions about this document to the Documentation Team’s mailing list: documentation@global.libreoffice.org
Note
Everything you send to a mailing list, including your email address and any other personal information that is written in the message, is publicly archived and cannot be deleted.
Published March 2022. Based on LibreOffice 7.3.
Some keystrokes and menu items are different on macOS from those used in Windows and Linux. The table below gives some common substitutions for the instructions in this document. For a detailed list, see the application Help.
Windows or Linux |
macOS equivalent |
Effect |
Tools > Options |
LibreOffice > Preferences |
Access setup options |
Right-click |
Control+click or right-click depending on computer setup |
Open a context menu |
Ctrl (Control) |
⌘ (Command) |
Used with other keys |
Alt |
⌥ (Option) or Alt, depending on keyboard |
Used with other keys |
F11 |
⌘+T |
Open Styles deck in Sidebar |
Writer provides several ways for you to control page layouts. This chapter describes the use of page styles and some associated functions:
Margins
Page breaks
Headers and footers
Page numbering
Title pages
Footnotes and endnotes
Chapter 6, Formatting Pages: Advanced covers the use of columns, frames, tables, and sections; changing page orientation within a document; and the use of borders and backgrounds. Some other uses of page styles are discussed in Chapter 8, Introduction to Styles. The Page Style dialog is covered in detail in Chapter 9, Working with Styles.
Note
All pages in a Writer document are based on page styles. The other layout methods (described in Chapter 6) build upon the underlying page style.
Tip
Page layout is usually easier if you select the options to show text, object, table, and section boundaries in Tools > Options > LibreOffice > Application Colors and the options for paragraph ends, tabs, breaks, and other items in Tools > Options > LibreOffice Writer > Formatting Aids.
In Writer, page styles define the basic layout of all pages, including page size, margins, the placement of headers and footers, borders and backgrounds, number of columns, page numbers, and so on.
Writer comes with several page styles, which you can build on or modify, and you can define new (custom) page styles. You can have one or many page styles in a single document. If you do not specify a page style, Writer uses the Default Page Style.
To change the layout of individual pages, either define a new page style or use one of the techniques (sections, frames, or tables) described in Chapter 6, Formatting Pages: Advanced.
Note
For some documents, all layout changes (such as the position of page numbers and other elements in a header or footer on facing pages) can be defined in a single page style.
Tip
Any modifications of page styles, including the Default Page Style, apply only to the document you are working on. If you want the changes to be the default for all documents, you need to put the changes into a template and make that template the default template. See Chapter 10, Working with Templates, for details.
You can change page margins in these ways:
Using the page rulers—quick and easy, but does not have fine control.
Using the Page Style dialog—can specify margins to two decimal places.
Using the Page deck in the Sidebar—changes all margins to the same value.
Note
If you change the margins using any of these methods, the new margins are recorded in the page style and affect all pages that use that style. The new margins will be shown in the Page Style dialog the next time you open it.
If you want to change the margins on some pages, but not others, you must use different page styles and switch between them; see “Inserting page breaks” below.
To change margins using the rulers:
1) The shaded sections of the rulers are the margins (Figure 1). Put the mouse cursor over the line between the gray and white sections. The pointer turns into a double-headed arrow and displays the current setting in a tooltip.
2) Hold down the left mouse button and drag the mouse to move the margin.
Figure 1: Moving the margins
Caution
The small arrows on the ruler are used for indenting paragraphs. They are often in the same place as the page margins, so you need to be careful to move the margin marker, not the arrows. The double-headed arrows shown in Figure 1 are the mouse cursors placed in the correct position.
Tip
After making a change, passing the mouse cursor over the new margin will show its new measurement.
To change margins using the Page Style dialog:
1) Right-click anywhere on the page and select Page Style in the context menu.
2) On the Page tab of the dialog (Figure 2), type the required distances in the Margins boxes. The Gutter margin is the extra space to leave between the left (or inner) edge of the page and the left (or inner) margin. Alternatively, you can leave the Gutter set to zero and add the gutter margin amount to the left or inner margin value.
3) Click OK to save.
Figure 2: Page tab of Page Style dialog
To change margins using the Page deck in the Sidebar, choose one of the preset margins in the drop-down list (Figure 3). You can also access the Page Style dialog from the symbol at the top right of the Format section’s title bar.
Figure 3: Changing margins using the Sidebar
Note
Changing the margin on the Sidebar changes all four margins to the same dimension. Use another method if you want margins of different sizes.
In many documents (for example, a multi-page report), you want the text to flow from one page to the next as you add or delete information. Writer does this automatically, unless you override the text flow using one of the techniques described in this section.
You can control some of the automatic text flow in several ways, including:
Use the Keep with next paragraph option, for example to prevent the lead-in sentence to a list from being separated from the list. This option is found on the Text Flow tab of the Paragraph dialog (right-click and choose Paragraph > Paragraph in the context menu to open the dialog).
Figure 4: Keep with next paragraph and Do not split paragraph options on Paragraph dialog
Use the Do not split paragraph option on the Text Flow tab of the Paragraph dialog (for individual paragraphs) or the Paragraph Style dialog (for all paragraphs with that style).
Use a paragraph style to require a paragraph to start on a new page. A typical use is for chapter titles to always start on a new right-hand (odd-numbered) page; use the Paragraph Style dialog to define this (see “Text flow options for paragraph styles” in Chapter 9, Working with Styles, for more information).
If you want a page break in a particular place—for example, to put a heading at the top of a new page—you can position the cursor at the point where you want to start the new page and select Insert > Page Break on the Menu bar.
If you want the new page to have a different page style—for example, to change from a First Page style to a Left Page style—use either of these methods.
Caution
Do not try to change a page style for a single page without inserting a page break. If you do, the page style of some or all of the other pages may also change.
Method 1
1) Position the cursor at the point you want to start the next page. Select Insert > More Breaks > Manual Break.
2) In the Type section of the Insert Break dialog (Figure 5), Page break is preselected, and Style is set at [None]. In the Style drop-down list, select the page style for the next page. Do not select the Change page number option. Click OK.
Figure 5: Inserting a manual page break and changing the page style
Method 2
1) Position the cursor in the paragraph you want to be at the start of the next page. Right-click and choose Paragraph > Paragraph in the context menu.
2) On the Text Flow page of the Paragraph dialog (Figure 6), in the Breaks section, select Insert and With page style. In the Style drop-down list, select the page style for the next page. Do not select the Page number option. Click OK to insert the page break.
Figure 6: Inserting a manual page break using the Paragraph dialog
Tip
See “Numbering the first page something other than 1“ below for information on the use of the page number field in these dialogs.
Headers are portions of a document that appear at the top of every page; footers appear at the bottom of a page. They typically include a page number and sometimes document information such as the title. In Writer, headers and footers are specified in page styles; therefore, all the pages with the same page style will display the same header and footer, although the contents of the header/footer may vary. For example, the header/footer on the first page of a section, chapter, or document may contain different information than the rest of the headers and footers in the document, even though the page style is the same. See “Using one page style” below.
Chapter 9 describes how to format a header as part of the page style formatting. The example below shows how to insert a header in the Default pages using manual formatting.
Terminology
A heading is a paragraph that introduces a chapter or section of a document; for example, “Creating headers and footers” above. A header (also known as a running header) appears on each page and typically displays information about the document.
There are two ways to insert a header. The simplest method is to click above the top of the text area, then when the Header marker appears, click the +. (To insert a footer, click below the bottom of the text area to display the Footer marker, and then click the +.)
Figure 7: Header marker at top of text area
You can also select Insert > Header and Footer > Header > [Page Style] on the Menu bar. The submenu lists the page styles used in your document. In addition, the submenu includes the entry All, which activates headers on all the pages of the document regardless of their page style. Similarly, to insert a footer, choose Insert > Header and Footer > Footer > [Page Style].
For our example, select Default Style to activate the headers or footers only on the pages that use the Default Page Style. An area will appear at the top or bottom of the page (Figure 8).
Figure 8: A page with a page header
In Writer, headers and footers are paragraphs; 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. See Chapter 4, Formatting Text.
You can also add images to headers and footers using any of the techniques described in Chapter 11, Images and Graphics, and you can line up information using tables as described in Chapter 6, Formatting Pages: Advanced.
Tip
Writer provides paragraph styles for headers and footers, which you can modify and use in the same way as other paragraph styles. See Chapter 8, Introduction to Styles, and Chapter 9, Working with Styles.
To format the layout of headers and footers manually:
1) Use any of these methods to open the relevant page style dialog:
Click anywhere on the page and choose Format > Page Style on the Menu bar.
Right-click anywhere on the page and choose Page Style in the context menu.
If the page has a header, click in the header area. When the Header marker appears, click the down arrow and select Format Header.
If the page has a footer, click in the footer area. When the Footer marker appears, click the down arrow and select Format Footer.
2) On the Header or Footer tab of the Page Style dialog (Figure 9), you can change the margins, spacing, and height.
3) Click More to open the Border/Background dialog (Figure 10), where you can add borders, background colors, and background images to the header or footer.
Figure 9: Footer tab of Page Style dialog
Figure 10: Border / Background page for header or footer
You can type information into headers and footers, but some items such as document titles and chapter titles are best added as fields. That way, if something changes, the headers and footers are all updated automatically.
Fields are covered in Chapter 17, Fields, but one example here may be useful. To insert the document title into the header on a Default page style:
1) Select File > Properties > Description on the Menu bar, enter a title for the document in the Title area, and click OK to close the dialog.
2) Add a header (Insert > Header and Footer > Header > [Page Style]).
3) Place the cursor in the header part of the page.
4) Select Insert > Field > Title on the Menu bar. The title should appear on a gray background (which does not show when printed and can be turned off).
5) To change the title of the document, select File > Properties > Description again and edit.
Note
You must use a field for the page number so it changes from one page to the next. See “Numbering pages” below.
When you place a page number field in a header or footer, the number appears on every page and changes automatically from one page to the next. The page number appears with a gray background. This gray background denotes a field; although it is visible on screen, it is not printed.
Tip
If you wish to turn off the gray background, choose View > Field Shadings (or press Ctrl+F8). If you see the words “Page number” instead of a number, press Ctrl+F9. This toggles Writer between displaying the field name and the contents of the field.
This section describes some techniques to insert page numbers and related information in headers or footers of a document:
The simplest case is to have the page number at the top or bottom of every page and nothing more (Figure 11). To do this, put the cursor on the header or footer and choose Insert > Page Number or Insert > Field > Page Number on the Menu bar.
Figure 11: Page number inserted in the header
You can align the page number to the left, right, or center. Click in the footer paragraph and then use one of these methods:
Click on one of the alignment icons on the Formatting toolbar.
Open the Properties deck in the Sidebar. In the Paragraph section, click on one of the alignment icons (Figure 12).
Figure 12: Alignment icons in Properties deck of Sidebar
Right-click and choose Paragraph > Paragraph in the context menu. On the Paragraph dialog, go to the Alignment tab and choose an alignment option, then click OK.
Figure 13: Alignment tab of the Paragraph dialog
Many more variations are possible. For example, you can set the page number to display in Roman numerals. One way to do that is to double-click the page number and select the desired format; a better choice is to specify the format of numbers in the page style as explained here.
Right-click in the text area of the page and select Page Style in the context menu.
On the Page tab of the Page Style dialog, in the Layout Settings section on the right, select i, ii, iii, …. in the Page numbers: drop-down list to use lowercase Roman numerals (Figure 14).
Figure 14: Changing format of page numbers
Caution
Any change in the number format affects the page numbers on all pages using that page style, regardless of the method used to change the format. To change the format of page numbers on some pages but not all, you need to use different page styles; see “Restarting page numbering and changing numbering format” below.
You may want to restart the page numbering at 1, for example, on the page following a title page or a table of contents. In addition, many documents have the front matter (such as the table of contents) numbered with Roman numerals and the main body of the document numbered in Arabic numerals, restarting at 1.
First, you need to define the numbering format for two page styles: Front Matter and Default. See “Using different page styles” below and “Defining the number format’ above.
Next, in the front matter, insert a page number (see “Simple page numbering” above).
Then, you can restart page numbering as follows:
1) Place the cursor in the first paragraph of the page to have the Default page style. (A heading is a paragraph.)
2) Choose Format > Paragraph on the Menu bar, or right-click and choose Paragraph > Paragraph, to display the Paragraph dialog.
3) On the Text Flow page of the Paragraph dialog, in the Breaks area (Figure 15):
a) Select Insert.
b) In the Type drop-down list, select Page.
c) In the Position drop-down list, select Before.
d) Select With page style and choose from the drop-down list the page style for the next page.
e) Select Page number to make the field active. Type 1. Click OK.
Figure 15: The Breaks section of the Text Flow page of the Paragraph Style dialog
Sometimes you may want to start a document with a page number greater than 1. The instructions are similar to Step 3 in the previous section.
1) Insert a page number in the header or footer (Insert > Page Number).
2) Click in the first paragraph in the text area. Choose Format > Paragraph (or right-click and choose Paragraph > Paragraph in the context menu).
3) In the Text Flow page of the Paragraph dialog, in the Breaks section (Figure 15), select Insert and select Page in the Type drop-down list. Select With page style and the page style you are using for the first page of the document.
4) Select Page number to make the field active. Type the page number you want to start with. Click OK.
Note
If you set a starting page number that is an even number, you will end up with a blank page before the first page. LibreOffice adheres to the convention that odd page numbers go on right-hand pages and even page numbers on left-hand pages. However, you can suppress this blank page when you print the file or export it as a PDF. See Chapter 7, Printing, Exporting, Emailing, Signing for more information.
You can apply a lot of interesting variations without further knowledge of page styles. Here are some suggestions:
Right-align the header to make the page number appear on the top-right.
Type the word Page (and a space) before the page number field so the header reads Page 1, Page 2, and so on.
Add the document title so the header includes, for example: Peter’s Favourite Poems (left aligned) and Page x (right aligned), where x is the value of the Page Number field. Use a right-aligned tab to separate the title from the page number.
Writer also has a Page Count field (Insert > Field > Page Count). Using it and the page number field, you could, for example, have a header that reads Page 2 of 12.
These variations are all illustrated in Figure 16.
Figure 16: Variations on the simple page numbering method
Technical documents often include the chapter number with the page number in the header or footer. For example, 1-1, 1-2, 1-3, ...; 2-1, 2-2, 2-3, ... To set up this type of page numbering in Writer, you need to do three things:
1) Ensure that your chapter titles are all identified by the same paragraph style, for example, the Heading 1 style.
2) Use Tools > Chapter Numbering to tell Writer what paragraph style you are using for Level 1, and specify “1,2,3” in the Number box.
Figure 17: Specifying paragraph style and numbering for chapter titles
3) Insert the chapter number in the document:
a) Place the cursor in the header or footer just before the page number you inserted earlier, and choose Insert > Field > More Fields on the Menu bar.
b) On the Fields dialog (Figure 18), go to the Document tab. Select Chapter in the Type list, Chapter number in the Format list, and 1 in the Level box. Click Insert.
c) Type a hyphen or other punctuation between the chapter number and the page number.
Figure 18: Inserting a chapter number field
Many documents, such as letters and memos, have a first page that is different from the other pages in the document. For example, the first page of a letterhead typically has a different header, as shown in Figure 19, or the first page of a report might have no header or footer, while the other pages do.
Figure 19: Letterhead with different headers for first and following pages
You can do this in several ways:
Use the Default (or any other) page style for your document. Deselect the Same content on first page option on the header/footer tabs in the Page Style dialog, and then add different headers/footers to the first page and to the other pages of the document. See “Using one page style” below.
Use different page styles for the first page and for the following pages. Set the Next Page attribute for the first page so the next page automatically becomes the style for following pages. See “Using different page styles” below.
Add a title page at the beginning of the document. See “Adding title pages” below.
This example uses the Default page style.
1) Right-click anywhere on the page and choose Page Style in the context menu. On the relevant tab (Header or Footer) of the Page Style dialog, select Header/Footer on and deselect Same content on first page (Figure 20). Optionally select Same content on left and right pages.
Figure 20: Setting up footers to have different content on different pages
2) Insert a header or footer on any page using the Default page style. See “Creating headers and footers” above.
3) Add different header and footer content to the first page and to the other pages of the document. For example, leave the header/footer blank on the first page.
As an example, we can use the First Page and Default Style page styles that come with LibreOffice. Figure 21 shows what we want to happen: the first page is to be followed by the default page, and all the following pages are to be in the default page style.
To do this, open the Page Style dialog for the First Page style, go to the Organizer tab, and choose Default Style in the Next Style list (Figure 22).
Figure 21: Flow of page styles
Figure 22: Setting the next style for a page style
Writer provides a fast and convenient way to add one or more title pages to a document and optionally to restart the page number at 1 for the body of the document.
To begin, choose Format > Title Page on the Menu bar to display the Title Page dialog (Figure 23).
Figure 23: Adding title pages to a document
On the Title Page dialog, you can make the following choices:
Convert existing pages to title pages, or insert new title pages.
How many pages to convert or insert.
Where those pages are located.
If and where to restart page numbering, and what number to start with.
What page style to use for the title page.
Using this technique, you can insert several “title pages” at different points in your document, for example to add decorative pages between chapters as well as title, copyright, and other pages at the beginning of a book.
Footnotes appear at the bottom of the page on which they are referenced. Endnotes are collected at the end of a document.
To work effectively with footnotes and endnotes, you need to:
Insert footnotes and define their format, if the default does not meet your needs (see Chapter 3, Working with Text: Advanced).
Define the location of footnotes on the page, and the color and line styles for separator lines, if the defaults do not meet your needs.
The location of footnotes on the page, and the color and style of the line that separates the footnotes from the text, are defined in the page style. If you are using several page styles, and may have footnotes on any of them, you need to define the footnote location and separator line on each of the page styles.
Choose Format > Page on the Menu bar or right-click a page and choose Page in the context menu, to display the Page Style dialog. Go to the Footnote tab (Figure 24) and make your selections, then click OK to save the changes.
Figure 24: Defining footnote location and separator line
Keeping the default setting Not larger than page area, the footnotes area is calculated automatically on the basis of the number of footnotes. If you prefer to control manually the maximum space that footnotes can take, select the Maximum footnote height option and enter the value in the preferred unit of measurement. A footnote higher than the maximum height will spill over on to the next page. Use the second section of the page to customize the separator between the footnotes and the main text area.