Writer Guide

Chapter 6
Introduction to Styles

Paragraph, Page, Character, and List 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.
Hal Parker

Feedback

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

Acknowledgments

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

Agnes Belzunce Gary Schnabl
Daniel Carrera Janet Swisher
Peter Hillier-Brook Jean Hollis Weber
Peter Kupfer 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

What are styles? 5

Why use styles? 5

Style categories 5

The Styles and Formatting window 6

Style selection basics 6

Using Fill Format mode 6

New Style from Selection, Update Style, and Load Styles functions 7

Using New Style from Selection 7

Update Style (from a selection) 8

Load Styles (from a template or document) 8

Using the visible styles filters 9

Drag-and-drop a selection to create a style 9

Applying styles 9

Applying paragraph styles 10

Example: Applying a paragraph style 10

Applying character styles 11

Unset/undo character styles 12

Applying frame styles 12

Applying page styles 13

Example: Chapters 13

Example: Page with special formatting 14

Applying list styles 15

Restarting the numbering 15

Modifying styles 15

Changing a style using the Style dialog box 16

Examples: Modifying paragraph styles 17

Center Heading 1 17

Indent Heading 3 18

Using AutoUpdate 19

Creating custom paragraph styles: examples 19

Creating the Poem paragraph style 20

Creating the PoemHeading style 21

Sample poem 21

Changing the formatting of your styles 21

Indent Poem 22

Final result 22

Copying and moving styles 22

Deleting styles 24

Assigning styles to shortcut keys 24

Defining a hierarchy of headings 24

Choosing paragraph styles for outline levels 25

Assigning outline levels to other styles 26

Setting up heading numbering 26

Setting up the indentation of headings 28

Positioning in new LibreOffice documents 29

Positioning in older documents opened in LibreOffice3.x 30



What are styles?

Most people are used to writing documents according to physical attributes. For example, you might specify the font family, font size, and weight (for example: Helvetica 12pt, bold).

Styles are logical attributes. We use styles every day. For example, there are two styles of personal computer: desktop and laptop. Each has its own distinctive set of properties. You never say “my computer is a low-weight, one-piece unit with an LCD screen attached to a rectangular casing containing the computing components and the keyboard”. Instead, you could say that you have a laptop.

LibreOffice (LibreOffice) styles are a way to do the same thing for your document. Using styles means that you could stop saying “font size 14pt, Times New Roman, bold, centered” and start saying “title” for describing that particular font usage. In other words, styles mean that you shift the emphasis from what the text looks like to what the text is.

Why use styles?

Styles help improve consistency in a document. They also make major formatting changes easy. For example, you might decide to change the indentation of all paragraphs or change the font of all titles. For a long document, this simple task could be prohibitive. Styles make the task easy.

Frame1

Style categories

LibreOffice Writer has five style categories:

In the same way that characters are the building blocks for creating words, paragraphs are the building blocks of every document. Headings (subheads) are paragraphs; headers, footers, and numbered lists are also paragraphs. Paragraph styles are, therefore, the most frequently used styles and are the ones treated in more detail in this and the next chapter.

The Styles and Formatting window

Styles are available through a floating or dockable window called Styles and Formatting, shown in Figure 1. This window is at the center of styles management. Do not worry if, at first, some contents of this section seem obscure while progressing through this or the next chapter. This guide describes how to use all these functions.

Frame9

To open the Styles and Formatting window, do any one of the following:

Tip

You can move the Styles and Formatting window to a convenient position on the screen or dock it to an edge.

Style selection basics

The first five icons at the top of the Styles and Formatting window select the category of styles to work on. Click on one of these icons to display a list of styles in that category, such as paragraph or character styles, in the main window.

To apply a character style to existing text, select the text and then double-click on the name of the style in the Character Styles list. To apply any other style, put the cursor in the paragraph, frame, or page you want to modify and double-click on the name of the style in the corresponding section. You can select more than one paragraph or frame and apply the same style to all of them at the same time.

Using Fill Format mode

The sixth icon at the top of the Styles and Formatting window activates the Fill Format mode. Use Fill Format to apply a style to many different areas quickly without having to go back to the Styles and Formatting window and double-click every time. This method is useful for formatting many scattered paragraphs, words, or other items with the same style, and it may be easier to use than making multiple selections first and then applying a style to all of them.

  1. Open the Styles and Formatting window (Figure 1) and select a style.

  2. Click the Fill Format Mode icon .

  3. To apply a paragraph, page, or frame style, hover the mouse over the paragraph, page, or frame and click. To apply a character style, hold down the mouse button while selecting the characters. Clicking on a word applies the character style for that word.

  4. Repeat step 3 until you have made all the changes for that style.

  5. To quit the Fill Format mode, click the icon again or press the Esc key.

Caution

When this mode is active, a right-click anywhere in the document undoes the last Fill Format action. Be careful not to accidentally right-click and mistakenly undo actions you want to keep.

New Style from Selection, Update Style, and Load Styles functions

The last button in the toolbar of the Styles and Formatting window is a multipurpose button that gives access to three different functions: New Style from Selection, Update Style, and Load Styles.

Using New Style from Selection

Use the first function of the multipurpose button to create a new style from the formatting of an object in the current document. For instance, you can change the formatting of a paragraph or frame until it appears as you like, and then you can turn that object’s formatting into a new style. This procedure can save time because you do not have remember all the formatting settings you want, as is necessary when creating a new style with the Style dialog box. Besides, unlike when setting the formatting parameters in dialog box pages as you will learn to do later, you can immediately see how the objects will look like when formatted with the style you are creating.

Follow these steps to create a new style from a selection:

  1. Change the formatting of the object (paragraph, frame, etc.) to your liking.

  2. From the icons at the top of the window, choose the type of style to create (paragraph, character, and so on).

  3. In the document, select the item to save as a style.

  4. Go back to the Styles and Formatting window and click the New Style from Selection icon.

In the Create Style dialog box, enter a name for the new style. The list shows the names of existing custom styles of the selected type, if any. Click OK to save the new style.

Frame8

Update Style (from a selection)

Let’s use paragraph styles as an example.

  1. Create a new paragraph (or modify an existing paragraph) and edit all the properties you want to go into the style (such as indentation, font properties, alignment, among others).

    Caution

    Make sure that there are unique properties in this paragraph. For example, if there are two different font sizes in the paragraph selected to update the style, that particular property will not be updated.

  2. Select the paragraph by clicking anywhere in the paragraph.

  3. In the Styles and Formatting window, select the style you want to update (single-click, not double-click) and then click on the New Style from Selection icon and select Update Style.

    Frame2

The procedure to update another type of style (character, page, or frame styles) is the same. Just select the item in question, select the style you want to update, and choose Update Style.

Load Styles (from a template or document)

The last option in the New Style from Selection icon is used to copy styles into the current document by loading them from a template or another document. This method copies all styles, or groups of styles, at one time.

  1. Open the document to copy styles into.

  2. In the Styles and Formatting window, click on the New Style from Selection icon and then on Load Styles (see Figure 2).

  3. In the Load Styles dialog box (Figure 4), find and select the template to copy styles from. Click on the From File button if the styles you want are contained in a text document rather than a template. In this case, a standard file selection dialog box opens up, allowing you to select the desired document.

  4. Select the check boxes for the types of styles to be copied. If you select Overwrite, the styles being copied will replace any styles of the same names in the target document.

  5. Click OK to copy the styles.

Frame6

Using the visible styles filters

At the bottom of the Styles and Formatting window, use the drop-down menu to select a filtering criterion for the contents of the main body of the window. Normally, you will find that only a handful of styles are needed in any given document, and it makes sense to have only these styles shown.

So, at the beginning of the writing process, you may want to have access to all the available styles (by selecting All Styles). However, as the document develops, it is useful to reduce the size of the list displayed to only the styles already in use (by selecting Applied Styles). If you work on a document where you want to apply special-purpose styles only (such as those styles used in writing this user guide), select instead Custom Styles. The Hierarchical Styles view is most useful when modifying styles as it reveals which styles are linked together. This topic is discussed in more detail in Chapter 7, Working with Styles.

If you select the Paragraph Styles view in the Styles and Formatting window, the drop-down menu contains many more filtering options so you can view, for example, only Text Styles, Special Styles, and so on.

Drag-and-drop a selection to create a style

Another little known property of the Styles and Formatting window is the capability of creating a new style with a simple drag-and-drop of a text selection into the Styles and Formatting window.

  1. Open the Styles and Formatting window.

  2. Select the style category you are going to create (for example a character style) using one of the five icons in the top left part of the window.

  3. Select the object you want to base the style on and drag it to the Styles and Formatting window. The cursor changes its shape indicating whether the operation is possible or not.

  4. In the Create Style dialog box (Figure 2), enter a name for the new style. The list shows the names of existing custom styles of the selected type, if any. Click OK to save the new style.

Note

You cannot use the drag-and-drop method to create a custom page style.

Applying styles

Styles can easily be applied by means of the Styles and Formatting window. However, alternative ways exist to apply certain styles, as explained in this section.

Applying paragraph styles

The most used style when drafting a document is the paragraph style. LibreOffice offers two quick alternatives to the Styles and Formatting window to apply this category of style: the Apply Style list and the Format Paintbrush icon.


Figure 5: Apply Style list

When a paragraph style is in use in a document, the style name appears on the Apply Style menu near the left end of the formatting bar, to the right of the Styles and Formatting icon. You can select styles from this menu, just as you can from the Styles and Formatting window.

To apply a style from this menu, click on the desired style or use the up or down arrow keys to move through the list, then press Enter to apply the highlighted style.

Tip

Select More... at the bottom of the list to open the Styles and Formatting window.

The format paintbrush can be used to apply a certain paragraph style to another paragraph (or group of paragraphs). Start by placing the cursor inside the paragraph you want to copy, then press the Format Paintbrush icon in the standard toolbar. The cursor changes into an ink bottle. Select now the paragraphs to which you want to apply the copied style. Note that it is not required to select the whole paragraph.

Example: Applying a paragraph style

Let's see the three methods described above in action with an example.

  1. Create a new document (choose File  New  Text Document or press Control+N).

  2. Type the words Heading 1 in the new document, but do not press Enter so that the cursor remains in that same line where you typed.

  3. Click the Styles and Formatting icon located on the Formatting Bar or press the F11 key. This opens the Styles and Formatting window (Figure 6).

  4. Make sure the window is showing the Paragraph Styles section: click on the top-left icon of the Styles and Formatting window.

Frame3

Double-click the Heading 1 entry of Styles and Formatting (Figure 7). This does two things:

Frame5

To use the Apply Styles list (Figure 5):

  1. Move the cursor to a new line or create a new line by pressing the Enter key at the end of the previous line and type some text.

  2. Keeping the cursor on the same paragraph, select Heading 1 in the Apply Styles list.

The text acquires the properties of the Heading 1 style. If the paragraph style you want is not in the Apply Style list, select More to bring up the Styles and Formatting window. If the Styles and Formatting window is still open, you may notice that the Heading 1 style is also highlighted in the main window, as shown in Figure 7.

Finally, try the Format Paintbrush:

  1. Move the cursor to a new line or create a new line by pressing the Enter key at the end of the previous line and type some text.

  2. Move the cursor to one of the two paragraphs with style Heading 1 and select the Format Paintbrush icon to activate it (the cursor changes shape).

  3. Move the cursor on the paragraph you have created and click the left mouse button.

The cursor shape changes back to the normal one, and the text acquires the properties of the Heading 1 style.

If the Styles and Formatting window is open, you may notice that the Heading 1 style is also highlighted in the main window.

Applying character styles

Open the Styles and Formatting window (press F11) and click the second button in the top bar. The list of available character styles is displayed. To apply a character style, follow these steps:

  1. Select the block of text where you wish to apply the style.

  2. Double-click the appropriate character style in the Styles and Formatting window.

Some examples include:

Frame421

Note

One difference between character styles and paragraph styles is the need for selecting text (highlighting). Character styles require you to select the text you want to apply them to; paragraph styles do not.

Unset/undo character styles

Sometimes, you will want to remove the formatting from a block of text. You must resist the temptation to do this manually. This will only cause trouble down the road. There are three easy ways to remove character formatting:

Note

The first two methods also work for removing manual formatting.

Applying frame styles

Whenever you insert an object into a document, it will automatically have a frame around it. Some designers like to add frame styles to introduce variety. For example, you could have two different frame styles for graphics: one that is centered for small graphics and another that is left-aligned for graphics that take up the entire width of the main frame. In such a case, you need to add at least one frame style.

To apply a style to a frame:

  1. Select the frame.

  2. Bring up the Styles and Formatting window (for example, by pressing F11).

  3. Click the Frame Styles icon (the third one from the left).

  4. Double-click the frame style you want.

Tip

When a frame is selected, the Frame toolbar replaces the Formatting toolbar. Then, the Apply Style list at the left of the Frame toolbar displays frame styles. You can use this to change the style of a frame.

Most of a frame’s design can be set in a style. However, the following options must be set manually:

The right-click menu also has items for anchoring and arrangement, as well as for wrap and alignment.

Applying page styles

To apply a page style, place the cursor anywhere on the page to which the style should be applied. You can easily check which page style is applied because it is shown on the status bar.

Frame21

If you want to apply a different style, you can either right-click on the style in the status bar and select a new style from the pop-up menu, or you can open the Styles and Formatting window, select the page style icon at the top of the window (fourth icon), and then double click on the desired style.

Caution

Changing a page style may cause the style of subsequent pages to change as well. The results may not be what you want. To change the style of only one page, you may need to insert a manual page break, as described below.

As discussed in Chapter 7, Working with Styles, a correctly set up page style will, in most cases, contain information on what the page style of the next page should be. For example, when you apply a Left page style to a page, you can indicate in the style settings that the next page has to apply a Right page style, a First page style could be followed by either a Left page style or a Default page style, and so on.

Another very useful mechanism to change the page style is to insert a manual page break and specify the style of the subsequent page. The idea is simple: you break a sequence of page styles and start a new sequence. To insert a page break, choose Insert Manual Break and choose Page break. This section illustrates two common scenarios where page breaks are useful.

Example: Chapters

A possible scenario: You are writing a book that is divided into chapters. Each chapter starts with a page style called New Chapter. The following pages use the Default page style. At the end of each (except the last) chapter, we return to the New Chapter page style for the first page of the next chapter.

Figure 9 illustrates the flow of page styles when using page breaks.

Frame37

LibreOffice doesn’t have a predefined New Chapter style, so you must create a custom style (see Chapter 7). Let’s suppose that you already have the page styles with the following properties:

Page style

Next Style

New Chapter

Default

Default

Default

At some point, you will want to start a new chapter. Follow these steps:

  1. Put the cursor at the end of the chapter, on a blank line (empty paragraph) of its own.

  2. Choose Insert Manual Break. The Insert Break dialog box (Figure 10) appears.

  3. Under Type, choose Page break and under Style, select New Chapter.

Frame14

Example: Page with special formatting

Sometimes you may need to insert a page with special formatting, for example a landscape page or a page with more columns. This can also be done with page breaks. Suppose that the current page has the Default page style.

  1. Choose Insert Manual Break.

  2. Select the desired page style (say, Special Page) in the Insert Break dialog box.

  3. Fill in the contents for this page. Then insert another page break.

  4. Then select Default again. The pagination continues on as normal, except that one page has been replaced by a different page style.

This concept is illustrated in Figure 11.

Frame15

Applying list styles

List styles define properties such as indentation, numbering style (for example, 1,2,3; a,b,c; or bullets), and punctuation after the number, but they do not by themselves define properties such as font, borders, text flow, and so on. The latter are properties of paragraph styles.

If you need your list to have specific paragraph-style properties, you should embed the list style into paragraph styles, as explained in Chapter 7. You can then create a numbered list by applying paragraph styles alone.

Each of the list styles predefined in Writer has four associated paragraph styles. For example, the Numbering 1 list style is associated with four paragraph styles:

Numbering 1 is a default paragraph style to which you can attach a list style. If you want to make exclusive use of paragraph styles and never use the Formatting toolbar when creating a numbered list, you could use the other three styles. All you need to do is to create a suitable list style and set up the Next Style property in the Organizer page of the Paragraph Style dialog box so that the Numbering 1 Start paragraph is followed by the Numbering 1 Cont. style, while the Numbering 1 End paragraph style is followed by a default style paragraph.

If you only want to apply a list style (that is, the numbering or bullet symbol and the indentation) then, when the cursor is on the paragraph to be numbered, double-click on the desired list style.

When creating a list style, you can define up to ten levels of depth for nested lists. Switch from one level to the other with either the Promote or the Demote buttons on the Bullets and Numbering toolbar or by pressing the Tab key (one level down) or Shift+Tab key combination (one level up) or by right clicking on the list element and select Up One Level or Down One Level from the pop up menu.

Restarting the numbering

When creating more than one numbered list of the same type within the same chapter, Writer applies progressive numbering to all the lists. Sometimes this is exactly what you want, while at other times you want to restart the numbering. To do so, either click on the Restart numbering icon on the Bullets and Numbering toolbar or right-click on the first element of the list and select Restart numbering.

Modifying styles

Writer provides several predefined styles, but you may find that they do not fit your preferences. You can build your own library of custom styles to use in place of the predefined ones, or you can modify the existing styles. LibreOffice offers four mechanisms to modify both both predefined and custom (user-created) styles:

The first two methods are discussed in “Update Style (from a selection)” on page 8 and “Load Styles (from a template or document)” on page 8, while Chapter 7, Working with Styles, discusses at length the process of creating a new style.

This section shows how you can quickly make simple modifications to existing paragraph styles using the same tools you would use for applying formatting manually.

Tip

Any changes made to a style are effective only in the current document. If you want to reuse modified or new styles in other documents, you need to either save the styles in a template (see Chapter 10, Working with Templates) or copy the styles into the other documents, as described in “Copying and moving styles” on page 23.

Changing a style using the Style dialog box

To change an existing style using the Style dialog box, right-click on the style in the Styles and Formatting window and select Modify from the pop-up menu.

The dialog box displayed depends on the type of style selected. Figure 12 shows an example of the dialog box for a paragraph style. Each style’s dialog box has several tabs. The various properties on these dialog boxes are described in the next chapter.

Frame22

Move to the page where the setting you want to modify is specified and input the new value. You can click the Help button at any time to bring up the online guide where all the options of the current page are briefly described. When you are done, click OK to close the dialog box. As discussed above, the great advantage of styles is that all the instances of such style in your document are now modified to your liking.

Examples: Modifying paragraph styles

For this example, we need three lines of text with three LibreOffice-supplied paragraph styles: Heading 1, Heading 2, and Heading 3. These paragraph styles could be used in formatting headings (subheads) in the framework for a document that will be “fleshed out” afterwards.

Open a new text document for this exercise and type Title on the first line, click the Paragraph Styles icon on the Styles and Formatting window, and double-click Heading 1 in the drop-down list. Repeat this procedure for the other entries of Figure 13, using the proper paragraph style for each: the Heading 1 style for the paragraph containing the word Title, Heading 2 for Subtitle 1, and so on.

Your document should resemble Figure 13.

Frame1x

Suppose you decide to make some changes to these styles, namely:

Center Heading 1

On the Styles and Formatting window, select the Paragraph Styles icon (if it isn’t already chosen), right-click on Heading 1, and choose Modify.

Frame3x

After the Paragraph Style window opens, choose the Alignment tab, select Center (as shown in Figure 15), and click OK.

Now, every paragraph marked as Heading 1 will be centered (as shown in Figure 16). If you make another Heading 1 entry, it will be centered as well.

Frame4

Frame20

Indent Heading 3

On the Styles and Formatting window, right-click on the Heading 3 paragraph style and choose Modify (as before). After the Paragraph Style dialog box opens, follow the steps below:

  1. Click the Indents & Spacing tab.

  2. Under the Indent section, set the indentation before the text to 0.60", as shown in Figure 17. Your display might be different, depending upon what measurement unit was set in the options (Tools  LibreOffice Writer  General  Settings).

Frame44

The result should resemble Figure 18.

Frame11

Using AutoUpdate

On the Organizer page of the Paragraph Style dialog box is a check box named AutoUpdate (Figure 19). It is present only for paragraph and frame styles. If this check box is selected, then LibreOffice will apply to the style itself any modification made manually to a paragraph formatted with that style.

Caution

If you are in the habit of manually overriding styles in your document, be sure that AutoUpdate is not enabled, or you will suddenly find whole sections of your document reformatting unexpectedly.

Frame17

Creating custom paragraph styles: examples

You have seen that the Styles and Formatting window provides several predefined styles, such as Heading 1 and Text body. But what if you need something different, like a poem style, that is not in Styles and Formatting? With Writer you can make your own styles to suit your needs.

Chapter 7, Working with Styles, describes in detail the options on the various pages of the Paragraph Style dialog box. This section provides an example of a typical use of custom paragraph styles.

We create a Poem paragraph style and a Poem Header paragraph style, with the following properties:

In addition, a PoemHeading style is to be followed by a Poem style. In other words, when you press Enter, the next paragraph style in the document changes to Poem.

Note

You may have noticed this behavior already. After you enter a heading using a Heading paragraph style and press Enter, the next style switches to Text body.

Creating the Poem paragraph style

Our next example uses the Poem style. We will use the Default style as a starting point.

  1. Click the Styles and Formatting icon or press F11.

  2. Click the Paragraph Styles icon (first from the left).

  3. Right-click Default and choose New.

This opens the Paragraph Style dialog box, with the Organizer page selected. To create a custom style, you have to understand and configure the top three entries.

Style fields

Description

Name

This is the name of the style itself, like Heading 1 or Text body.

Set (type in the text box) the name to Poem.

Next Style

This is the default style that follows the Poem style. When you press Enter while typing text in the Poem style, this style is used.

Set this value to Poem. When you press Enter, the text will remain in the Poem style.

Linked with

If the Poem style is linked with another, say Default, then any change in Default will affect Poem, just as you saw with Heading in the previous section.

For our example, this is not the behavior we want. Set this entry to – None –. This means that Poem is not linked with any other style.

After making these changes, your dialog box should look like Figure 20.

Frame201

The next step is to configure the alignment and font properties of this style.

Click OK to save the new Poem style.

Creating the PoemHeading style

Create a new PoemHeading style. Use the same procedure as before, with these changes:

The dialog box should look like Figure 21.

Frame241

Now set the settings of the new style:

  1. On the Alignment page, select Center.

  2. On the Font page, choose Bold and size 14pt.

Click OK to save the new PoemHeading style.

Sample poem

It is a good idea to test out your new styles and see if you are happy with them. Typing a poem using the styles we have just defined should produce the results in Figure 22.

Frame361

Changing the formatting of your styles

One of the main advantages of styles is that they allow the document formatting to be changed after the content has been written. For example, suppose you have written a 100-page book of poetry. Then you decide you don’t like the way the poems look after all. Or, perhaps, your publisher doesn’t like it.

To learn about reconfiguring styles, we add an indentation to the Poem style instead of centering it.

Indent Poem

First, set the Poem style to left alignment:

  1. In the Styles and Formatting window, select Poem and right-click and select Modify.

  2. On the Alignment page, select Left.

Set the indentation:

  1. Click the Indents & Spacing tab.

  2. Under Indent, set the indentation before the text to 5cm (or about 2in).

Done! Click OK, and you should see the text change.

Final result

After all these changes, the poem should look similar to Figure 23. Note in the figure that a third style has been created for the author of the poem.

Frame381

Copying and moving styles

Styles are part of the document properties, therefore changes made to a style or new styles you create are only available within the document they belong to. Styles always stay with a document. So, for example, if you e-mail a document to another person, the styles go with it.

If you want to reuse modified or new styles in other documents, you need to either save the styles in a template (see Chapter 10) or copy the styles into the document where you want to use them.

You can copy or move styles from one template or document to another in two ways:

To copy or move styles using the Template Management dialog box:

  1. Click File Templates Organize.

  2. At the bottom of the Template Management dialog box, choose either Templates or Documents, as needed. For example, if you are copying styles between two documents, both entries should say Documents.

Frame38

  1. To load styles from a file, click the File button. When you return to this window, both lists show the selected file, as well as all the currently open documents.

  2. Double-click on the name of the template or document and then double-click the Styles icon to show the list of individual styles.

  3. To copy a style, hold down the Control key and drag the name of the style from one list to the other.

  4. Repeat for each style you want to copy or move. When you are finished, click Close.

Frame39

Caution

If you do not hold down the Control key when dragging, the style will be moved from one list to the other. The style will be deleted from the list you are dragging it from.

Deleting styles

It is not possible to delete LibreOffice’s predefined styles from a document or template, even if they are not in use. However, custom styles can be deleted.

To delete an unwanted style, right-click on it in the Styles and Formatting window and choose Delete. If the style is in use, the following message appears.

Frame12

Caution

Make sure the style is not in use before deletion. Otherwise, all objects with that style will return to the Default style and retain their formatting as manual formatting.

Tip

If an unwanted style is in use, use Find & Replace to replace it with a substitute style before deleting it.

If the style is not in use, the message shown below appears.

Frame10

Assigning styles to shortcut keys

You can configure shortcut keys to quickly assign styles in your document. Some shortcuts are predefined, such as Ctrl+1 for the Heading 1 paragraph style and Ctrl+2 for Heading 2. You can modify these shortcuts and create your own. See Chapter 16, Customizing Writer, for details.

Defining a hierarchy of headings

Tools Outline Numbering defines the hierarchy of headings in a document. Headings can be numbered or not; typically the first-level headings in a book-length document are the next level of headings after the chapter titles, which may be numbered, but lower-level headings are not numbered. Some chapter title and heading styles (such as those commonly used in engineering documents) number each chapter and heading level, for example 1, 1.1, 1.2, 2, 2.1, and so on. When chapters or sections are added or deleted, the numbering is automatically changed.

Paragraph styles are the key to LibreOffice’s outline numbering feature. The default paragraph styles assigned to outline levels are the heading styles supplied with LibreOffice: Heading 1, Heading 2, and so on. However, you can substitute any styles you wish, including custom (user-defined) styles.

The headings defined using the outline numbering feature can be used for more than the table of contents (described in Chapter 12). For example, fields are commonly used to display headings in headers and footers of pages (see Chapter 14, Working with Fields), and Writer can send the outline to Impress to use as the basis for a presentation (see the Impress Guide for details).

Choosing paragraph styles for outline levels

If you are using the default heading styles for the headings in your outline, and you do not want to use heading numbering, you do not need to do anything on the Outline Numbering dialog box. The default outline numbering scheme uses the default heading styles (Heading 1, Heading 2, and so on).

To use custom styles in place of one or more of the default heading styles:

  1. Choose Tools Outline Numbering to open the Outline Numbering dialog box (Figure 28).

  2. Click the number in the Level box corresponding to the heading for which you want to change the paragraph style.

Frame36

  1. In the Numbering: Paragraph Style section, choose from the drop-down list the paragraph style you want to assign to that heading level. In this example, you might choose My Heading 1 to replace Heading 1 and for Level 2, My Heading 2 to replace Heading 2.

  2. Repeat for each outline level that you want to change. Click OK when done.

Assigning outline levels to other styles

In LibreOffice, 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 the Outline Numbering dialog box. 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.

Frame23

Setting up heading numbering

If you want one or more heading levels to be numbered, many choices are available; this example defines a scheme to create headings that look like those in Figure 30.

Frame41

Use the Numbering page of the Outline Numbering dialog box to define the numbering scheme and its appearance. Figure 31 shows the default settings.

Frame42

  1. In the Level list, choose 1. In the Number list, choose 1, 2, 3, .... The result is shown in the preview box on the right in Figure 32.

  2. In the Level list, choose 2. In the Number list, choose 1, 2, 3, .... The Show sublevels list is now active; it should show 2 (if not, choose 2). The result is shown in Figure 33.

  3. In the Level list, choose 3. In the Number list, choose 1, 2, 3, .... The Show sublevels list should show 3 (if not, choose 3). The result is shown in Figure 34.

Frame43

Frame45

Frame46

These choices produce the layout shown in Figure 35.

Frame47

Setting up the indentation of headings

Whether or not the headings are numbered, you may want to change some of their formatting. For example, you may want the second-level and third-level headings to be indented from the margin. For numbered headings, you may also want the second line of long headings to line up with the first word of the heading, not the number. For these changes, use the Position page of the Outline Numbering dialog box.

Note

The Position page for documents created in LibreOffice is slightly different from the Position page for documents created in earlier versions of similar programs that are opened in LibreOffice. This difference is provided for backwards compatibility.

Positioning in new LibreOffice documents

Figure 36 shows the Position page as it appears for documents created in LibreOffice.

Frame7

  1. In the Level list on the left, choose 2. Change the values for Numbering followed by... at and Aligned at, as shown in Figure 37. You may want to use a different value. This indents the entire heading but does not affect the way long headings wrap around (see Figure 38).

Frame19

Frame50

  1. To change the wrapping behavior of long headings, change Indent at to a larger value, as shown in Figure 39. The result is shown in Figure 40.

Frame13

Frame52

  1. In the Level list, choose 3. Change the values for Numbering followed by... at, Aligned at, and Indent at, as shown in Figure 41. The final result is shown in Figure 30.

Frame18

Positioning in older documents opened in LibreOffice3.x

Figures 42, 43, 44, and 45 show the Position page as it appears for documents created in earlier versions of similar programs and opened in LibreOffice.

Frame48

Frame49

Frame51

Frame53