Writer Guide

Chapter 7
Working with Styles







Copyright

This document is Copyright © 2010 by its contributors as listed below. You may distribute it and/or modify it under the terms of either the GNU General Public License (http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.

All trademarks within this guide belong to their legitimate owners.

Contributors

Ron Faile Jr.

Feedback

Please direct any comments or suggestions about this document to: documentation@libreoffice.org

Acknowledgments

This chapter is based on Chapter 7 of the Writer Guide for OpenOffice.org. The contributors to that chapter are:

Agnes Belzunce Bruce Byfield
Daniel Carrera Peter Hillier-Brook
Peter Kupfer Ian Laurenson
Iain Roberts Gary Schnabl
Barbara M. Tobias Jean Hollis Weber
Sharon Whiston Michele Zarri

Publication date and software version

Published 31 January 2011. Based on LibreOffice 3.3.

Note for Mac users

Some keystrokes and menu items are different on a Mac from those used in Windows and Linux. The table below gives some common substitutions for the instructions in this chapter. For a more detailed list, see the application Help.

Windows/Linux

Mac equivalent

Effect

Tools Options menu selection

LibreOffice Preferences

Access setup options

Right-click

Control+click

Open context menu

Ctrl (Control)

z (Command)

Used with other keys

F5

Shift+z+F5

Open the Navigator

F11

z+T

Open Styles & Formatting window



Contents

Copyright 2

Note for Mac users 2

Introduction 5

Creating custom (new) styles 5

The Style dialog box 5

The Organizer page 5

Understanding linked styles 7

Creating a linked style 7

Example: Changing a property of a parent style 7

Working with paragraph styles 8

Settings on the Indents & Spacing page 8

Settings on the Alignment page 10

Text flow options for paragraph styles 10

Font options for the paragraph style 12

Specifying a relative font size 12

Selecting a language for a paragraph style 13

Options for positioning text 13

Example: Rotating the text in a paragraph style 14

Spacing options 15

Controlling tab stops 15

Using the Outline & Numbering page 16

Setting up a drop cap 16

Setting up paragraph background and borders 17

Working with conditional paragraph styles 17

Working with character styles 19

Why use character styles? 19

Creating a new character style 20

Migrating to character styles 20

Working with frame styles 21

How frame styles work 21

Planning the styles 21

Creating new frame styles 21

Working with page styles 23

Creating a new page style 23

The next style property 23

Setting up a title page 23

General settings for the page style 24

Background and Border pages 25

Header and Footer pages 25

Columns page 26

Footnote page 26

Example: A book chapter sequence of pages 26

Working with list styles 30

Defining the appearance of a nested list 31

Creating a new list style 31

Bullets, Numbering Styles, and Graphics pages 31

Outline page 31

Position page 31

Options page 34

Combining list and paragraph styles 35

Example: Creating a simple list style 35

Creating the CDTracks numbered list 36

Applying the list style 36



Introduction

Chapter 6, Introduction to Styles, described the basics of how to use, apply, and manage styles. This chapter gives a more detailed description of how to create or modify a style, using the many options available on the various pages of the Style dialog box. You will learn how these options affect the appearance of the style and how to use them efficiently. Examples and hints are also provided.

The Style dialog boxes share many of the same pages as the manual formatting dialog boxes, so you can also use this chapter to help you apply manual formatting (though you do not need that if you use styles).

Creating custom (new) styles

In addition to using the predefined styles provided by LibreOffice, you can add new custom (user-defined) styles. In Chapter 6, two methods were given for creating a new style: the drag-and-drop approach and the New Style from Selection icon in the Styles and Formatting window.

These methods are very convenient because it is possible to immediately check the visual effects that the style produces before creating it. However, they may require you to access several different menus, and you have a somewhat reduced amount of control on style (particularly when it comes to organizing them). The method described in this chapter, therefore, concerns only the use of the Style dialog box.

The Style dialog box

Open the Styles and Formatting window. Select first the category of style you want to create by clicking on the appropriate icon in the top part of the Styles and Formatting window. For example, select the third icon from the left if you want to create a new frame style.

Right-click on the main window and select New from the pop-up menu. If you right-click on an existing style, the new style will be linked to the style you clicked on. If you right-click on an empty area, then the initial settings of the style are copied from the Default style of the corresponding category.

The dialog box that is displayed depends on the type of style you selected. Many of the pages are the same as those that are displayed when manual formatting is applied. Therefore, if you are familiar with manual formatting, you will find that you already know how to use most of the options. The dialog box used to create a new style and to modify an existing one is exactly the same.

Tip

An exception to the above rule is conditional styles, which have a different dialog box. See “Working with conditional paragraph styles” on page 17.

The Organizer page

When creating a new style, the first page you need to set up is the Organizer, which is shown in Figure 1. This page is common to all style categories. Therefore, it is described only once.

Frame11

Depending on the style you are creating, you will find the following information on this page:

Understanding linked styles

Figure 2: Hierarchical view of linked styles.

When creating a new paragraph or a new character style, you may use an existing style as a starting point for its settings. In this sense, LibreOffice links the styles together.

When styles are linked, a change in the parent style affects every style linked to it. You can easily visualize the connections between styles by switching to the Hierarchical view in the Styles and Formatting window filter.

For example, every Heading style (such as Heading 1, Heading 2) is linked with a style called Heading. This relationship is illustrated in Figure 2.

Linking styles is a very powerful method to create “families” of styles and allows you to change their properties simultaneously. For example, if you decide that all the headings should be blue (such as in this guide), you only need to change the font color of the parent style to achieve the desired result. Note however, that changes made to a parameter of the parent style do not override changes previously made to the same parameter in the child styles. For example, if you changed the Heading 2 font color to green, a change of the font color of the Heading style (the parent style) to red will not affect the Heading 2 font color.

You can easily check which properties are specific to a style by looking at the Contains section of the Organizer page. In case you want to reset the properties of a child style to that of the parent style, click the Standard button located at the bottom of each Paragraph and Character style dialog page.

Note

You cannot define a hierarchical style structure for Page, Frame and List styles.

Creating a linked style

To create a linked style, you can either specify the parent style (the “linked with” style) in the Organizer page of the Style dialog box, or you can start creating a new style by right-clicking in the Styles and Formatting window on the style to be linked with and selecting New from the drop-down menu.

Figure 3: Select Heading style.

Example: Changing a property of a parent style

Suppose that you want to change the font of not only Heading 1 or Heading 2, but all headings. The easiest way to do that is to take advantage of linking.

Open the Styles and Formatting window (press F11) and select Heading.

Open the Paragraph Style dialog box for the Heading style (right-click Modify) and select the Font tab. Select a font and click OK (Figure 4).

Frame4

Now, the fonts of all the heading styles (Heading 1 through Heading 10) are changed in a single operation. Figure 5 shows on the left a document using the headings 1, 2 and 3 and on the right the same document after changes have been made to the Heading style.

Frame6

Working with paragraph styles

Although this section describes most of the parameters scattered over the twelve tabbed pages shown in Figure 4, you do not need to configure them all. In fact, in the vast majority of cases it is sufficient to modify only a few attributes, particularly if you make use of the linking properties of styles or when basing the new style on one which is already similar.

Settings on the Indents & Spacing page

On the Indents & Spacing page, you can set up the parameters that affect the position of the paragraph on the page and the spacing between lines and between this paragraph and the paragraphs nearby. The right hand side of the page shows a preview of the applied settings.

Frame7

Use the Indent section of the page to set up the indentation, using these parameters:

Use the Spacing section of the page to determine the amount of vertical space above and below the paragraph. It is customary to include some “space above” in heading styles so that they are separated from the text body of the previous section without the need to insert empty paragraphs. Spacing between paragraphs is also normal in certain types of documents. The body text style of this guide is configured to leave some space between consecutive paragraphs.

The spacing between paragraphs does not affect the spacing between lines, which is instead controlled using the drop-down box in the Line spacing section. You can select one of the following values:

Tip

When using different font sizes in the same paragraph, the line spacing will be uneven, as Writer automatically calculates the optimal value. To obtain evenly spaced lines, select Fixed or At least in the drop-down list and a value that is large enough to create a spacing between the lines sufficient to account for the largest font size used.

The last parameter that can be set in this page is Register-true. If you have activated the Register-true for the page style in use (refer to General settings for the page style on page 24) then the Reference style and all the styles hierarchically dependent on it will have the Register-True box selected, you may want however to activate the vertical grid also for other styles (or not apply it to styles dependent on the reference style) and this is where this can be done.

Settings on the Alignment page

Use the Alignment page to modify the horizontal alignment of the text, choosing between Left, Right, Center, and Justified. The results of the selection are shown in a preview window on the right-hand side of the page.

When selecting the Justified alignment, you can also decide how Writer should treat the last line of the paragraph. By default, Writer aligns the last line to the left, but you can choose to align it to the center or to justify it also (meaning that the words on the last line will be spaced in order to occupy it fully). If you select the Expand single word option, then whenever the last line of a justified paragraph consists of a single word, this word is stretched by inserting spaces between characters so that it occupies the full length of the line.

The alignment page is also used to control the Text to Text vertical alignmentuseful when you have mixed font sizes on the same row. Choose the element of the fonts on the line that will be aligned between Automatic, Baseline, Top, Middle, Bottom. Refer to Figure 7 for a graphical representation of these reference points.

Frame8

Text flow options for paragraph styles

The page of the dialog box controlling the text flow options is shown in Figure 8. This page is divided into three parts: Hyphenation, Breaks, and Options.

In the Hyphenation section, you can change three parameters:

If you prefer Writer to automatically control the hyphenation, select the Automatically option.

Frame12

In the Breaks section, you can require a paragraph to start on a new page or column, as well as specify the position of the break, the style of the new page, and the new page number. A typical use for this option is to ensure that the first page of a new chapter always starts on a new (usually right-hand) page.

To always start a style on a new page, choose the following settings on the Text Flow page of the Paragraph Style dialog box:

  1. In the Breaks section, select Insert. Make sure that Type is set to Page and Position is set to Before.

  2. Select With Page Style and choose the page style from the list.

  3. To continue page numbering from the previous chapter, leave Page number set at 0. To restart each chapter’s page numbering at 1, set Page number to 1. Click OK.

Note

If you want the first page of a new chapter to always start on a right (recto) page, make sure that the page style for the first chapter page is set for the right page only by making this selection in the Layout settings field on the Page tab of the Page Style dialog box.

The Options section of the Text Flow page provides settings to control what happens when a paragraph does not fit on the bottom of a page:

Font options for the paragraph style

Three pages of the Paragraph Style dialog box are dedicated to settings controlling the appearance of the font, namely, the Font, Font Effects, and Position pages. The use of the first two pages is straightforward. Many of the options used when creating a character style are discussed in “Creating a new character style” on page 20. Options that can be used when creating a paragraph style are described here.

Specifying a relative font size

If you are creating a style based on another style (linked style), you can specify a font size relative to that other style—either as a percentage or as a plus or minus point value (–2pt or +5pt). Relative font sizes are commonly used for Web pages.

For example, the paragraph style Heading 1 is based on the paragraph style Heading. The font size of the paragraph style Heading is 14pt, and the font size of paragraph style Heading 1 is specified as 115%. Thus, the resultant font size of text in a paragraph formatted with the Heading 1 paragraph style is 14pt times 115% = 16.1pt.

To specify a percentage font size: in the Paragraph Style dialog box, select the Font tab. In the Size box, enter the percentage amount followed by the symbol % (see Figure 9). Similarly, you can enter a plus or minus sign followed by the number of points to be added or subtracted from the base font size.

To change from a relative font size back to an absolute font size, enter the desired font size in points followed by the letters pt.

It is also possible to use a Percentage Font size for character styles.

Frame10

Selecting a language for a paragraph style

The language you select for a document (on Tools Options Language Settings Languages) determines the dictionary used for spell checking, thesaurus, hyphenation, the decimal and thousands delimiter used, and the default currency format.

Within the document, you can apply a separate language to any paragraph style. This setting has priority over the language of the whole document. On the Font page of the Paragraph Style dialog box, languages with installed dictionaries are marked in the Language list by a small ABC icon (Figure 10). When checking spelling, Writer will use the correct dictionary for paragraphs with this style. If you write documents in multiple languages, you can use the linked styles to create two paragraph styles that differ only in the language option. If you then want to change some of the other properties of the paragraph style, all you need do is to change the parent style.

To insert occasional words in a different language and avoid their being picked by mistake with the check-spelling function, it is more convenient to use a character style, as discussed in “Creating a new character style” on page 20.

Frame13

Options for positioning text

The Position page of the Paragraph Style dialog box collects all the options that affect the position of the text on the screen or printed page. This page is divided into three sections, plus a preview area. They are: Position, Rotation, and Scaling.

Frame5

Use the Position section to control the appearance of superscripts and subscripts. However, you will normally apply superscript and subscripts to groups of characters rather than to entire paragraphs. Therefore, it is strongly recommended to change these parameters only when defining a character style and, instead, leave the default settings for the paragraph styles.

The second section of the Position page controls the rotation of the paragraph area. Two common uses for rotated paragraphs are:

Frame15

The Scale width box controls the percentage of the font width by which to compress or stretch the rotated text horizontally.

Chapter 4, Formatting Pages, describes how to create portrait headers and footers on landscape pages by rotating characters. You can achieve the same effect by defining a separate header or footer paragraph style specifically for landscape pages.

Example: Rotating the text in a paragraph style

As an example, we will apply rotated table headings to a pre-existing table.

  1. Create a new paragraph style. Name it Table Heading Rotated.

  2. On the Position page of the Paragraph Style dialog box, in the Rotation / scaling section, select 90 degrees. Click OK to save the new style.

Frame16

  1. Select the heading row of the table and apply the new style. Any text in the cells of the heading row is now rotated.

  2. If the headings are aligned to the top of the cells, you may want to change the alignment to the bottom of the cells, as shown in Figure 12. To do this, click the Bottom button on the Table toolbar or select Format Alignment Bottom from the main menu.

Spacing options

Use the Spacing section of the Position page to control the spacing between individual characters in the paragraph. When selecting an option other than default in the drop-down menu, use the edit box to enter the value in points by which you want to expand or condense the text.

Figure 14: Kerning disabled (left) and enabled (right).

The Pair Kerning option (selected by default) increases or decreases the amount of space between certain pairs of letters to improve the overall appearance of the text. Kerning automatically adjusts the character spacing for specific letter combinations. Kerning is only available for certain font types and, for printed documents, only works if your printer supports it.

Controlling tab stops

Although borderless tables are generally considered a much better solution to space out material across a page, in many situations tabs are sufficient to do what you need, with the added advantages of being simpler to manage and quicker to apply.

Tip

If you need to use tabs, and you will be sending a document to other people, do not use the default tab stops. If the recipients of the document have defined default tab stops that are different from the ones you are using, the paragraph may look very different on their machines. Instead, define the tab stops explicitly in the paragraph or the paragraph style; then you can be sure that everyone will see the same layout.

To define tab stops in your paragraph style, use the page shown in Figure 15. Here you can choose the type of tab: left, right, centered, or decimal; the character to be used as a decimal point; and the fill character—the characters that appear between the end of the text before the tab and the beginning of the text after the tab. You can also create a custom fill character by entering it in the corresponding box. Common use of a fill character is adding dots between a heading and a page number in a table of contents or underscore character when creating a form to fill in.

Frame18

Creating a new tab stop, therefore, is just a matter of deciding its position relative to the left margin, the type, the fill character and clicking the New button. The tab stop will be entered in the Position list on the left hand side. Unfortunately, the only way to modify the position of a tab stop is to create a new one in the desired position and delete the old one using the buttons on the right-hand side of the page.

Note that it is not possible to define tabs that exceed the page margin. In the rare cases where that may be needed, use a borderless table instead.

Using the Outline & Numbering page

Use the Outline & Numbering page if you want to number the paragraph, for example if this style is to be used for a heading or list item.

You can assign an outline level to any paragraph style. This feature enables you to create a table of contents that includes those headings along with the headings using styles listed in Tools Outline Numbering. For example, you might use a different sequence of styles for annexes (appendixes), but you want the annex headings and subheadings to appear in the TOC at the same levels as the chapter headings and subheadings.

To assign an outline level to a paragraph style, go to the Outline & Numbering page for the style, and select the required outline level. Click OK to save this change.

This page should be used in combination with list styles when you need to associate a certain paragraph style with a list style. Refer to “Combining list and paragraph styles” on page 35 for additional information on how to use this page, as well as an example.

Frame1

Setting up a drop cap

If you want your paragraph to use drop caps (usually this is suitable for a first paragraph style), then you can predefine the properties in the Drop Caps page of the paragraph style dialog box. Selecting the option to display drop caps enables the subsequent options where you can fine tune the appearance: the number of lines occupied, the number of characters to enlarge (if you want the whole first word, check the corresponding box), and the space between the drop caps and the text.

Drop caps use the same font and have the same properties as the rest of the paragraph; however, you can easily modify their appearance by creating a specific character style and using it. For example, you may want the drop caps to be of a different color or apply an outline effect. Select the character style you want to use in the corresponding drop-down menu.

Frame19

Setting up paragraph background and borders

Adding a background color and a border to a paragraph is a good way to make it stand out without having to insert a frame. You can customize the background and border of the paragraph areas using the corresponding pages of the paragraph style dialog box. In addition to highlighting, borders are also often used to separate header and footer areas from the main text area (such as in this guide) as well as to provide decorative elements in some heading styles.

The two pages are fairly intuitive. You may want to pay attention to the following points when working with the Background page:

On the Borders page, the following points are worth considering:

Working with conditional paragraph styles

A conditional paragraph style is another way of formatting text differently in different parts of a document. In some cases, you may find it saves time to use conditional styles rather than switching between styles as you type.

Making a paragraph style conditional means it changes its formatting depending on where it is used. For example, you may want the style MyTextBody to be black by default but turn white when inside a frame with a blue background.

Probably the most common use for conditional formatting is with single-style outlining. Single-style outlining is a type of outline numbering designed with a Numbering style, rather than with Tools Outline Numbering. Instead of using different styles, it changes the number formatting whenever you press the Tab key to create a subordinate heading.

The only trouble with single-style outlining is that all levels look the same. This is where a conditional paragraph style comes in handy. Assign the paragraph style to an outline numbering style in the Outline & Numbering page and then open the Condition page. There, you can assign the levels of the outline numbering style to other paragraph styles. Then, when you press the Tab key while using the paragraph style, each level of the outline takes on different formatting, making single-style outlining even more convenient than it is on its own.

Note

Predefined styles (other than Text body) such as Default, Heading 1, and Heading 2 cannot be set to be conditional.

Caution

If you want to make a style conditional, you have to do it while the style window is still open for the first time. After the window closes, the Condition tab no longer appears in the window.

Frame20

When you create a conditional style, you are saying “in this condition make this style look like that other style”. For example, “When typing into a footer, make this style look like the my_footer paragraph style; when typing into a table, make this style look like the table_text paragraph style”.

In addition to setting the normal (unconditional) properties of the style, you need to define which other style it will look like in different situations. You do this on the Condition tab.

To set up a conditional paragraph style:

  1. Define a new paragraph style.

  2. Select all the paragraph properties for the style. Do not click OK!

  3. Click the Condition tab.

  4. Select the Conditional Style option.

  5. Select the first condition in the Context list (left side of the dialog box) and select the style you want for this condition in the Paragraph Styles list on the right-hand side.

  6. Click Apply. The name of the paragraph style appears in the middle list.

  7. Repeat steps 5 and 6 for each condition you want to have linked to a different style.

  8. Click OK.

When the style is selected, you will see that the formatting of your text depends on the context.

Working with character styles

Character styles complement paragraph styles and are applied to groups of characters, rather than whole paragraphs. They are mainly used when you want to change the appearance or attributes of parts of a paragraph without affecting other parts. Examples of effects that can be obtained by means of character styles are bold or italic typeface or colored words.

Two of the character styles used in this document are:

to set Writer to full screen, press Control+Shift+J.

to turn field shadings on or off, choose View Field Shadings.

Other ways of using character styles are described elsewhere in the Writer Guide. These uses include making chapter numbers, page numbers, or list numbers larger than the surrounding text and formatting hyperlinks. When inserting words in different language or words you do not want the spell checker to detect as mistakes (for example procedure names in some programming language), character styles are quite useful because you can define the language to be applied in the character-style properties.

Why use character styles?

Beginning Writer users often wonder, “Why use character styles?” or “How is this different from clicking the bold icon to change the font typeface?” The following real-life event illustrates the difference.

Frame231

Character styles do not have as many options as paragraph styles or page styles. Their benefits are of a different nature:

As Jean’s story illustrates, the ability to make formatting changes throughout a document can be important. Character styles provide this.

Character styles help ensure that typesetting guidelines are applied consistently.

Was I supposed to bold keystrokes? How about menus?
A writer should not have to remember the answers to these questions. Typesetting details distract you from the real content of your work. A properly named custom character style (such as LibreOfficeKeyStroke or LibreOfficeMenuPath) will remove this burden from you.

Creating a new character style

This section illustrates the use of the style dialog box for creating a new character style.

The pages used to configure the character style have already been seen in the previous section on paragraph styles. Therefore, once you are familiar with creating paragraph styles, it will only take a few minutes to create a character style.

Migrating to character styles

For people accustomed to formatting text manually, character styles can take some getting used to. Here are some suggestions for making the transition easier:

Working with frame styles

Frames are often used as containers for text or graphics. To provide consistency in the appearance of frames used for similar purposes, it is a good idea to define styles for frames. For example, you might want photographs to be enclosed in a frame with a drop-shadowed border, line drawings in a frame with a plain border, marginal notes in a frame without a border but with a shaded background, and so on.

Writer provides several predefined frame styles, which you can modify as needed, and you can define new frame styles. The technique for defining and applying frame styles is similar to that for other styles.

Tip

There is considerable overlap between the uses of frames and of sections for some page layout purposes. You may find it useful to take a look at Chapter 4, Formatting Pages, for information about the use of frames and sections.

How frame styles work

When an object is added to Writer, it is automatically enclosed in a frame of a predetermined type. The frame sets how the object is placed on the page, as well as how it interacts with other elements in the document. You can edit the frame by modifying the frame style it uses or by using a manual override when a frame is added to the document.

Because frames and objects are used together, it sometimes is easy to forget they are separate elements. In some cases, such as charts, you can edit the frame and object separately, so the distinction is worth remembering.

Unlike other elements that use styles, frames can be defined only partly by their style because their use can vary so much. Several elements of frames, such as the anchor and protected elements, need to be defined manually for individual frames.

You can format a frame manually when you select Insert Frame. The dialog box that opens contains all the settings available when frame styles are set up, as well as some only available when the frame is inserted. As with other styles, the most efficient way to format frames is in the Styles and Formatting window.

Planning the styles

If you are using a mix of graphics, you may want to define two related styles, one with a border line for graphics with white backgrounds and one without a border for all other backgrounds. You also may want to design one or more frames for text only.

Otherwise, the default frame styles (listed in Table 1) cover most users’ needs. The only significant addition that many users might need is one or more styles for text frames.

Creating new frame styles

You can access frame settings by selecting New or Modify in the Styles and Formatting window for a frame style.Creating new frame styles

You can access frame settings by selecting New or Modify in the Styles and Formatting window for a frame style.

Table 1. Various frame styles and their uses

Style

Comments and Use

Formula

The frame style used for formulas. The default includes AutoSize, which adjusts the size of the frame to the formula.

Frame

The default frame style.

Graphics

The default style for graphics. The defaults include autosizing to fit the graphic, no text wrap, and a thin border around the frame. These are reasonable defaults, except for the border. Unless the background of the graphic is white and the document’s background also is white, the border usually is unnecessary.

Labels

The default style for use with File New Labels. It seems to be used by LibreOffice automatically and is not intended for users at all.

Marginalia

A style for placing a frame beside the left margin. As the name suggests, the Marginalia style is intended for comments added in the margin of text. The style also is useful for creating sideheads—headings against the left margin, which often are used in technical documentation. To set up sideheads, create body-text paragraph styles with two inches or more indentation from the left. Then, place the cursor at the start of a body-text paragraph, add the frame, and apply the Marginalia style.

OLE

The default style for OLE objects and floating frames. The default places the frame at the top and center of a body of text.

Watermark

The default style for a watermark, a graphic placed as the background to a body of text. The default is a Through wrap, with text passing over the frame and anything in it. The graphic should be faint enough that text still is readable over top of it.

Frame settings are available from the following tabbed pages:

Working with page styles

Page styles control page properties (margins, page size, header and footers, among others). However, unlike paragraphs, which can have directly applied properties, pages only have a page style and no directly applied properties.

Christian is a lawyer from California, USA. For his letters, the first page has his letterhead, and subsequent pages only identify the recipient, the date, and the page number. Christian does this using page styles. He also uses page styles to comply with the spacing requirements (such as margins) for legal briefs in California State courts.

This section describes how to create a new page style, explains the meaning of some of the options in the Page style dialog box, and illustrates their usage.

Creating a new page style

Unlike other styles, page styles can be created or modified only by using the Styles and Formatting window. Open the Styles and Formatting window and click the Page Styles icon . Right-click anywhere in the main window and select New.

The Page Style dialog box consists of the eight pages.

Frame21

The next style property

As for the other styles, use the Next style property (described in “The Organizer page” on page 5) to specify the style for the subsequent element of the category of style you are working on. This property is particularly important for a page style, as the following example demonstrates.

Setting up a title page

Consider a common scenario: you want the document to have a title page that is different from the rest of the document:

For the title page, we can use the predefined First Page page style that comes with LibreOffice, and for the rest of the document, we can use the Default page style.

Figure 20 shows the required flow of page styles. On the Organizer page of the Default page style, leave the Next Style property set to Default. On the Organizer page of the First Page style, make sure that the Next Style property is set to Default.

Frame22

General settings for the page style

The Page page of the Page Style dialog box is where you can control the general settings of the page. The page consists of three sections, plus a preview area in the top right corner.

Frame23

In the Paper format section, you can specify the size of the paper choosing from one of the many predefined formats. Selecting “user”, you can use the Width and Height fields to define your own paper size. If using a predefined format, select the orientation of the paper between portrait and landscape. If your printer has more than one tray, you can specify the tray from which to print pages in the new page style.

In the Margins section, specify the size of the margins in your preferred unit of measurement. If you select Mirrored margins in the Page layout settings, the left margin becomes the Inner margin, while the right margin becomes the Outer margin.

In the Layout settings section, choose the desired Page layout from the four available options. Decide whether the page style being defined applies to both left and right pages (default) or if instead it should be applied only to one or the other types. Some considerations:

If you check the Register-true box, Writer will create a vertical grid on the page with a spacing between grid points that depends on the selected Reference Style. The vertical grid makes sure that text printed on adjacent columns, opposite pages, or even both sides of the same sheet of paper, is alignedmaking it easier to read as well as being more pleasant to see.

Background and Border pages

Use the Background page to apply a background or the Border page to draw a border around text area of the page. You can choose between a solid color or a graphic image for the background and several styles of line for the borders. Note that the page area affected by these changes does not include the area outside the margins. If you plan to print on colored paper and want to have a feel of the final result you will obtain or want to use a light color for the font, rather than changing the background,then go to Tools Options LibreOffice and in the Appearance section, change the Document background color.

Header and Footer pages

You can associate a different header or footer to each page style. This property makes it very easy to have different headers on left and right pages, to avoid headers on pages at the start of a new chapter, and so on.

Setting up the header and footer pages is straightforward. The instructions here refer to the header, but the footer page has the same options. Activate the input boxes by selecting Header on, then specify the left margin, right margin, and spacing to the main text area. For the height of the header area, you can either select the AutoFit height box, which will make Writer adapt the size to the contents, or specify the height manually. Clicking More opens a new dialog box, where you can set the borders and background of the header area.

If you deselect the Same content left/right box, you can specify a different header for left or right pages, even if you use a single style for both as shown here.

Frame24

Columns page

Use this page to create the desired column layout for the page style. The page is subdivided into three sections: Settings, Width and Spacing and Separator Line. The Settings section contains thumbnails of predefined columns settings you can select, as well as a text box where you can enter the desired number of columns if you need to create a customized one.

After you select more than one column, the Width and Spacing section becomes active. If you are not satisfied with the predefined settings (equally spaced columns), deselect the AutoWidth option and enter the parameters manually. When you work with multiple columns per page, you can also fine tune the position and size of a separator line between the columns.

Footnote page

Use this page to adjust the appearance of the footnotes. 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. Use the second section of the page to customize the separator between the footnotes and the main area.

Example: A book chapter sequence of pages

Book chapters typically start on a right-hand page, with the first page of the chapter having a different layout from the rest of the pages. The other pages in the chapter are “mirrored” for double-sided printing. For example, page numbers in the header or footer may be positioned on the outside edge of pages and a wider margin (allowing for binding) may be placed on the inside edge.

Table 2 shows the properties of two page styles (Right Page and Default) set up for a typical book chapter’s sequence of pages.

Table 2. Properties of customized page styles for book chapter

Page Style

Desired effect

Property: setting

Right Page

First page always on the right (an odd-numbered page)

Page Page layout Only right

No header or footer

Header Header Header on: Not selected

Top margin of page larger than on other pages

Page Margins Top: 6.00cm

Default

Mirrored margins

Page Page layout: Mirrored

Header with page number on the top outside of the page and chapter title in the top middle center of the page

Header Header on: Selected

Header Header Same content left/right: Not selected

Figure 23 illustrates the transitions from the Right Page to Default page styles, with the change of header between left and right pages shown by the # symbol.

Frame30

Step 1. Set up the Right Page style.

  1. On the Styles and Formatting window, click the Page Styles icon to display a list of page styles.

  2. Right-click on Right Page and select Modify from the pop-up menu.

  3. On the Organizer page of the Page Style: Right Page dialog box, change Next Style to Default.

Frame31

  1. On the Page tab, specify a larger left margin for binding, and a larger top margin to move the chapter title down the page.

Frame32

  1. On the Header and Footer pages, be sure the Header on and Footer on options are not selected. Click OK to save your changes.

  2. On the Styles and Formatting window, in the list of page styles, right-click on Default and select Modify from the pop-up menu.

  3. On the Organizer page of the Page Style: Default dialog box, be sure Next Style is set to Default.

Step 2. Set up the Default page style.

  1. On the Page page of the Page Style: Default dialog box, select Mirrored for Page layout and set the Inner and Outer margins to the same width as the Left and Right margins, respectively, on the Right Page style.

Frame34

  1. On the Header page of the Page Style: Default dialog box, select the Header on option and deselect the Same content left/right option. Click OK to save your changes.

Frame38

Step 3. Set up the Heading 1 paragraph style to start on a new right-hand page.

  1. In the Styles and Formatting window, on the Paragraph Styles page, right-click on Heading 1 and select Modify.

  2. On the Text Flow page of the Paragraph Style dialog box, in the Breaks section, select Insert, With Page Style, and Right Page. Click OK to save your changes.

Frame36

Step 4. Start a new chapter.

Apply the Heading 1 paragraph style to the first paragraph, which is the title of the chapter.

Note

By default, the Heading 1 paragraph style is assigned to Outline Level 1. The assignment of paragraph styles to outline levels is done through Tools Outline Numbering.

Step 5. Set up the page headers.

  1. On a left page, put the cursor in the header and insert a page number field on the left (Insert Fields Page Number).

  2. Press Tab to put the cursor in the middle and insert a Chapter reference:

    Press Control+F2 (or choose Insert Fields Other from the menu bar) to display the Fields dialog box (Figure 29).

    On the Document page, for Type, select Chapter and for Format, select Chapter name. Make sure that Level is set to 1 and then click Insert.

  3. On a right page, put the cursor in the header, press the Tab key, insert a Chapter reference, press Tab again, and insert a page number field.

  4. If you need to adjust the tab stops for the header, modify the Header paragraph style. Do not manually adjust the tab stops.

Frame37

Working with list styles

List styles (also called numbering styles) work together with paragraph styles. They define indentation, alignment, and the numbering or bullet characters used for list items. You can define many list styles, from simple bulleted lists to complex multi-level (nested) lists.

As with other styles, the main reasons for using list styles are consistency and speeding up your work. Although you can create simple lists quickly by clicking the Numbering On/Off or Bullets On/Off icons on the Formatting toolbar, and create quite complex nested lists using the icons on the Bullets and Numbering toolbar, the appearance of the resulting lists may not be what you want—and you might want to have more than one style of list. You can use the Bullets and Numbering choice on the Format menu to manually format the appearance of some or all of the lists, but if you later need to change their appearance, you will have a lot of manual work to do.

Note

LibreOffice uses the terms “numbering style” and “list style” inconsistently, but they are the same thing. For example, the tooltip in the Styles and Formatting window says “List Styles”, but its style dialog box says “Numbering Style”.

Defining the appearance of a nested list

A nested list is a numbered or bulleted list with subordinate (usually indented) numbered or bulleted lists. Rather than just a list of numbered items (1,2,3...), a nested list may have item 1, then indented items numbered a,b,c or i,ii,iii or some other numbering method before the main number 2. With numbering styles, you can achieve any combination of numbering formats you want. A nested list may even combine numbered items with bulleted items.

There is no difference between defining a nested list style or a simple list, although nested lists require more work. An example of a nested list is given in Chapter 3, Working with Text. In that case, the list was built using one of the predefined outline schemes as a starting point, while in this section we follow a more general approach so that the list can more fully suit your needs.

Creating a new list style

The dialog box to create a new list style consists of six pages, in addition to the usual Organizer page discussed in “The Organizer page” on page 5.

Bullets, Numbering Styles, and Graphics pages

The Bullets, Numbering Style, and Graphics pages contain predefined formatting for list item symbols (bullets or numbers). To use one of them for your style, click on the image. A thick border indicates the selection. The bullets on the Bullets tab are font characters; those on the Graphics tab are graphics.

If you choose a graphics bullet, you can select the Link Graphics option to create a link to the graphic object rather than embedding it in the document. If you decide to link the graphic, keep in mind that the bullet will not be displayed when the document is opened on a different computer (unless the same graphic file is located in the same location on both computers) or if the graphic file used is moved to a different location on the computer.

Outline page

Use the Outline page to select from eight predefined nested lists. You can also select one and use it as a starting point for your own style, customizing the list using the Position page and the Options page, as described below.

Position page

Use the Position page to fine tune the indentation and spacing of the the list item symbol and the text of the list item. This page is particularly effective when used in combination with the Options page.

Frame25

You can adjust the following settings for each individual level or all at once (to make them all the same). It is generally easier to adjust the settings in the order given below, instead of the order on the dialog box. That is, start from the overall indentation for the list elements, then fix the position of the symbols, and finally adjust the alignment of the symbols.

Note

When defining an indentation different from 0, the position of the tabulation is not considered.

Tip

In normal circumstances, setting the Numbering followed by distance to be equal to the Indent at distance works well. See Figure 31 for a graphic representation of the effects of the above parameters.

Frame29

Position page for older documents opened in LibreOffice

If your document was created with an earlier version of a similar program, or if the document was saved for compatibility reasons using the ODF file format version 1.1 or earlier, the position dialog will appear as in Figure 32.

Frame26

In this case you can adjust the following settings:

For any level other than Level 1, the Relative option causes the indentation to be measured from the start of the previous level rather than from the page margin.

Tip

To fully appreciate how the Numbering alignment works, try to create a numbered list with more than ten elements and make sure that enough room has been made for numbers with two or more digits. You may also wish to right-align numbers 10 or greater, as in Figure 31 on page 33.

Options page

Use the Options page to define the style of the outline levels. The options available on this page depend on the type of marker selected for the list. First, on the left side, select the level you want to modify. To modify all ten levels at once, select 1 – 10 as the level. If you started from a predefined outline, some of the levels will already have settings.

Frame27

Depending on the numbering style selected in the Numbering box (bullet, graphic, numbering), some of the following options become available on the page:

The right-hand side of the dialog box shows a preview of the modifications made.

To revert to the default values, click the Reset button in the bottom right corner. Finally, if you wish to use consecutive numbers regardless of the outline level, check the Consecutive numbering box at the bottom of the page.

Combining list and paragraph styles

When applying a list style, the underlying paragraph style remains unchanged. If your list must also have a certain font size, indentations, and so on, you might expect to first apply a paragraph style and then a list style (or vice versa). However, you can embed a list style in a paragraph style using the Numbering page of the Paragraph Style dialog box, and then apply only the paragraph style to the list.

This section gives an example of combining list and paragraph styles.

  1. Create a list style you want to use for the paragraph. For example: MyNumberedList.

  2. Create a new paragraph style.

  3. On the Organizer page of the Paragraph Style dialog box:

    1. Give the new paragraph style a name, say NumberedParagraph.

    2. For the Next Style, choose NumberedParagraph (this will make the following paragraph also be in this style, until you choose a different style).

    3. In Linked with, choose None.

    4. Leave Custom Styles, in the Category field.

  1. Set up this paragraph style to your liking. Because the indentation is controlled by the List style, to avoid undesired interactions do not change the indent settings on the Indents & Spacing page. (You might want to change the spacing above and below the paragraph.)

  2. On the Outline & Numbering page, choose the MyNumberedList style created in step 1.

  3. Click OK to save this style.

To have full control, it is common practice to define three base paragraph styles for lists: List Start for the first element of the list, List Continue for the subsequent elements of the list, and List End for the last element of the list. You should also define a paragraph style to be used for unnumbered list items (one for each nested level you intend to use) as well as an introductory style for the paragraph preceding the start of the list (to allow for keeping the introductory paragraph with the first list item, or for specifying spacing before the first list item that is different from the spacing between other paragraphs).

Example: Creating a simple list style

In this example, we will create a numbered list that is used to number the songs on a CD. The numbers are right aligned, and some space is left between the number and the title of the track.

As we want to reuse the same numbered list for other CDs, we will define a new list style and then apply it to the tracks list.

Creating the CDTracks numbered list

As for the previous example, start by clicking the List Styles icon (fifth from the left) in the Styles and Formatting window. Then right-click anywhere in the list box and choose New.

The Numbering style dialog box is displayed. For the CDTracks style, we need to customize fields in the Organizer, the Options, and the Position pages.

Style fields

Description

Name

Enter CDTrack

Category

Custom styles will be OK for us.

Modify the options of the Options page as follows:

  1. In the Level box, choose 1.

  2. In the Numbering list, choose 1, 2, 3, ....

  3. Leave the Before and After boxes empty.

  4. Leave the Character Style field as None.

  5. Show sublevels should be grayed out.

  6. Make sure Start at is set to 1.

  7. Do not select Consecutive numbering.

As discussed above, the numbering list will adopt settings of the underlying paragraph style. If you want to use a special font, size or color for the numbering, you can create a character style and apply it in the Options page.

If you want the word Track to appear before the number, just add it to the Before field in the Options dialog box. Do not forget to add a space character to separate the word from the number.

Set up the final parameters of the CDTracks list style in the Position page.

  1. In the Level box, choose 1.

  2. For Numbering followed by, choose tab stop and set it at 4.0cm.

  3. For Numbering alignment, choose Right.

  4. For Aligned at choose 1.5cm. (this refers to the alignment of the numbers)

  5. For Indent at choose 4.0cm. (This sets the indentation of the whole list.) Click OK to finish.

Applying the list style

Now that the list style is available, it can be quickly applied to any list in the document:

  1. If starting a new list, before pressing Enter to start a new line, double-click on the desired list style name in the Styles and Formatting window.

  2. If you already have a list, select it and then double-click on the desired list style name in the Styles and Formatting window.

Note

Remember that applying a list style does not affect the characteristics of the underlying paragraph; therefore you may want to check if you are satisfied with the paragraph style before applying the list style.

If you have more than one list in a document, the second and subsequent lists with the same style continue their numbering from the previous list. To restart at 1, place the cursor anywhere in the paragraph you want numbered 1, right-click, and choose Restart numbering.

To stop using numbering, press the Numbering On/Off icon on the Standard toolbar. The final result is illustrated in Figure 31.