Writer Guide

6

ChapterIntroduction to Styles
Paragraph, Page, Character, and List Styles
This PDF is designed to be read onscreen, two pages at atime. If you want to print a copy, your PDF viewer shouldhave an option for printing two pages on one sheet ofpaper, but you may need to start with page 2 to get it toprint facing pages correctly. (Print this cover page
separately.)CopyrightThis document is Copyright © 2005–2010 by its contributors as listed
in the section titled Authors. You may distribute it and/or modify it
under the terms of either the GNU General Public License, version 3 orlater, or the Creative Commons Attribution License, version 3.0 or
later.
All trademarks within this guide belong to their legitimate owners.

Authors
Agnes Belzunce

Gary Schnabl

Daniel Carrera

Janet SwisherPeter Hillier-Brook

Jean Hollis Weber

Peter Kupfer

Michele Zarri

Feedback
Please direct any comments or suggestions about this document to:authors@documentation.openoffice.org

Publication date and software version
Published 14 March 2010. Based on OpenOffice.org 3.2.

You can download
an editable version of this document fromhttp://oooauthors.org/english/userguide3/published/

Contents
Copyright............................................................................................... 2
What are styles?..................................................................................... 5
Why use styles?................................................................................... 5
Style categories..................................................................................6
The Styles and Formatting window........................................................6
Style selection basics.......................................................................... 7
Using Fill Format mode......................................................................7
New Style from Selection, Update Style, and Load Styles functions. .8
Using New Style from Selection......................................................8
Update Style (from a selection).......................................................9
Load Styles (from a template or document)...................................10
Using the visible styles filters...........................................................10
Drag-and-drop a selection to create a style......................................11
Applying styles..................................................................................... 11
Applying paragraph styles................................................................11
Example: Applying a paragraph style............................................12
Applying character styles.................................................................. 14
Unset/undo character styles..........................................................15
Applying frame styles........................................................................ 15
Applying page styles.........................................................................16
Example: Chapters......................................................................... 16
Example: Page with special formatting..........................................18
Applying list styles............................................................................ 18
Restarting the numbering..............................................................19
Modifying styles................................................................................... 19
Changing a style using the Style dialog box.....................................20
Examples: Modifying paragraph styles.............................................21
Center Heading 1..........................................................................22
Indent Heading 3...........................................................................23
Using AutoUpdate............................................................................. 23
Creating custom paragraph styles: examples......................................24
Introduction to Styles

3Creating the Poem paragraph style..................................................24
Creating the PoemHeading style......................................................26
Sample poem....................................................................................26
Changing the formatting of your styles.............................................26
Indent Poem................................................................................... 27
Final result........................................................................................ 27
Copying and moving styles................................................................... 28
Deleting styles...................................................................................... 30
Assigning styles to shortcut keys.........................................................31
Defining a hierarchy of headings.........................................................31
Choosing paragraph styles for outline levels....................................31
Assigning outline levels to other styles.............................................32
Setting up heading numbering.........................................................33
Setting up the indentation of headings.............................................35
Positioning in new OOo3.x documents...........................................35
Positioning in older documents opened in OOo3.x.........................37

4

Introduction to Styles

What are styles?
Most people are used to writing documents according to physicalattributes. 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. Eachhas its own distinctive set of properties. You never say “my computer isa low-weight, one-piece unit with an LCD screen attached to arectangular casing containing the computing components and the
keyboard”. Instead, you could say that you have a laptop.
OpenOffice.org (OOo) styles are a way to do the same thing for yourdocument. Using styles means that you could stop saying “font size
14pt, Times New Roman, bold, centered” and start saying “title” fordescribing that particular font usage. In other words, styles mean thatyou 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 theindentation of all paragraphs or change the font of all titles. For a long
document, this simple task could be prohibitive. Styles make the taskeasy.
The time is 9:50 AM, and Jane is finishing the 30-page paper forschool that is due at 10:00 AM. She looks over the assignment one
more time, and suddenly she realizes that:• The text must use Arial font instead of Times New Roman.
• The headings must be dark blue and indented.
• The title must appear at the top-right of every page except thefirst.
• Even-numbered pages must have a wider right margin, andodd-numbered pages must have a wider left margin.
Thankfully, Jane used OOo Writer and styles. She makes all thechanges in only two minutes and hands in the paper on time.

What are styles?

5Style categories
OOo Writer has five style categories:• Paragraph styles affect entire paragraphs represented with thosestyles.
• Character styles affect a block of text inside a paragraph.
• Page styles affect page formatting (page size, margin, and thelike).
• Frame styles affect frames and graphics.
• List styles affect outlines, numbered lists, and bulleted lists.
In the same way that characters are the building blocks for creatingwords, paragraphs are the building blocks of every document.
Headings (subheads) are paragraphs; headers, footers, and numberedlists are also paragraphs. Paragraph styles are, therefore, the mostfrequently used styles and are the ones treated in more detail in thisand 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 centerof styles management. Do not worry if, at first, some contents of thissection seem obscure while progressing through this or the next
chapter. This guide describes how to use all these functions.

Figure 1: Styles and Formatting window buttons

6

Introduction to Styles

To open the Styles and Formatting window, do any one of thefollowing:• Click on theicon located at the left-hand end of theFormatting toolbar.
• Select Format > Styles and Formatting.
• Press F11.
Tip

You can move the Styles and Formatting window to aconvenient 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 todisplay a list of styles in that category, such as paragraph or characterstyles, in the main window.
To apply a character style to existing text, select the text and thendouble-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 thecorresponding section. You can select more than one paragraph orframe 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 forformatting many scattered paragraphs, words, or other items with thesame 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 astyle.
2) Click the Fill Format Mode icon.
3) To apply a paragraph, page, or frame style, hover the mouse overthe paragraph, page, or frame and click. To apply a characterstyle, 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.
The Styles and Formatting window

75) To quit the Fill Format mode, click the icon again or press the Esc
key.
CautionWhen this mode is active, a right-click anywhere in the
document undoes the last Fill Format action. Be careful notto 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 amultipurpose 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 newstyle. 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 theformatting 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.) toyour 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 listshows the names of existing custom styles of the selected type, if any.
Click OK to save the new style.

8

Introduction to Styles

Figure 2: Dialog to name a new style from selection

Update Style (from a selection)
Let’s use paragraph styles as an example.
1) Create a new paragraph (or modify an existing paragraph) andedit all the properties you want to go into the style (such as
indentation, font properties, alignment, among others).
CautionMake sure that there are unique properties in thisparagraph. For example, if there are two different fontsizes in the paragraph selected to update the style, thatparticular 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.

Figure 3: Updating a style from a selection
The procedure to update another type of style (character, page, orframe styles) is the same. Just select the item in question, select thestyle you want to update, and choose Update Style.

The Styles and Formatting window

9

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 oranother 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 thestyles you want are contained in a text document rather than atemplate. 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 stylesof the same names in the target document.
5) Click OK to copy the styles.

Figure 4: Loading styles from a template

Using the visible styles filters
At the bottom of the Styles and Formatting window, use the drop-downmenu 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 areneeded in any given document, and it makes sense to have only thesestyles shown.
So, at the beginning of the writing process, you may want to haveaccess 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 special10

Introduction to Styles

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 arelinked 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 soon.

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 atext 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 acharacter 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 shapeindicating 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 ofthe selected type, if any. Click OK to save the new style.
CautionYou 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.
OOo offers two quick alternatives to the Styles and Formatting window
to apply this category of style: the Apply Style menu and the Format
Paintbrush icon.
Applying styles

11When a paragraph style is in use in adocument, the style name appears on the
Apply Style menu (Figure 5) near the left endof the formatting bar, to the right of the Styles
and Formatting icon. You can select styles
from this menu, just as you can from theStyles and Formatting window.

Figure 5: Apply Style
menu
Tip

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

Select More... at the bottom of the list to open the Styles andFormatting 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 iconin 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 wholeparagraph.

Example: Applying a paragraph styleLet'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 theFormatting Bar or press the F11 key. This opens the Styles andFormatting 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.

12

Introduction to Styles

Figure 6: Click on the Styles and Formatting icon tobring up the window
Double-click the Heading 1 entry of Styles and Formatting (Figure 7).
This does two things:• Gives the line (actually, its entire paragraph) you typed the
Heading 1 style.
• Adds Heading 1 to the Apply Style menu.

Figure 7: Applying paragraph styles
To use the Apply Styles drop-down menu (Figure 5):1) Move the cursor to a new line or create a new line by pressing theEnter key at the end of the previous line and type some text.

Applying styles

13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 theparagraph style you want is not in the Apply Style list, select More to
bring up the Styles and Formatting window. If the Styles andFormatting window is still open, you may notice that the Heading 1style 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 theEnter 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
toactivate it (the cursor changes shape).
3) Move the cursor on the paragraph you have created and click theleft 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 thesecond button in the top bar. The list of available character styles isdisplayed. 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 andFormatting window.
Some examples include:
This example uses the OOo-supplied Strong
Emphasis character style.
Definition: A statement describing the meaningof a word or phrase.

Note

14

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.

Introduction to Styles

Unset/undo character styles
Sometimes, you will want to remove the formatting from a block oftext. 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:• Select the block of text and right-click and choose Default
Formatting.
• If you have the Styles and Formatting window open, select theblock of text and double-click the Default character style.
• Select the block of text, then press Ctrl+Shift+Spacebar.
Note

The first method also works for removing manual formatting.

Applying frame styles
Whenever you insert an object into a document, it will automaticallyhave a frame around it. Some designers like to add frame styles tointroduce variety. For example, you could have two different framestyles for graphics: one that is centered for small graphics and anotherthat is left-aligned for graphics that take up the entire width of themain 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, bypressing 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 theFormatting toolbar. Then, the Apply Style list at the left of the
Frame toolbar displays frame styles. You can use this tochange 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:• Anchoring: how the frame is positioned in relation to the rest of
the page’s contents (Format > Anchor).
• Arrangement: the frame’s position in a stack of objects (Format> Arrange).
• Adding a hyperlink: so that a click on the frame opens a Web pageor another document in an HTML file (Insert > Hyperlink).
Applying styles

15

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 isapplied because it is shown on the status bar.

Figure 8: The current page style is displayed on the status bar
If you want to apply a different style, you can either right-click on thestyle in the status bar and select a new stype from the pop-up menu, or
you can open the Styles and Formatting window, select the page styleicon at the top of the window (fourth icon), and then double click on
the desired style.
CautionChanging a page style may cause the style of subsequentpages to change as well. The results may not be what you
want. To change the style of only one page, you may need toinsert a manual page break, as described on the next page.

As discussed in Chapter 7 (Working with Styles), a correctly set up
page style will, in most cases, contain information on what the pagestyle of the next page should be. For example, when you apply a Leftpage 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 amanual 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 andchoose 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

16

Introduction to Styles

(except the last) chapter, we return to the New Chapter page style forthe first page of the next chapter.
OOo doesn’t have a predefined New Chapter style, so you must createa custom style (see Chapter 7). Let’s suppose that you already have thepage 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 9) appears.

Figure 9: Choose Page break and selectthe New Chapter page style3) Under Type, choose Page break and under Style, select New
Chapter.
Figure 10 illustrates the flow of page styles when using page breaks.

Figure 10: Page style flow using a page break

Applying styles

17

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 theDefault 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.

Figure 11: Inserting a page with special formatting

Applying list styles
List styles define properties such as indentation, numbering style (forexample, 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 paragraphstyles alone.
Each of the list styles predefined in Writer has four associatedparagraph styles. For example, the Numbering 1 list style is associatedwith four paragraph styles:• Numbering 1• Numbering 1 Cont.
• Numbering 1 End• Numbering 1 Start
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
18

Introduction to Styles

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 theParagraph Style dialog box so that the Numbering 1 Start paragraph isfollowed 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 paragraphto be numbered, double-click on the desired list style.
When creating a list style, you can define up to ten levels of depth fornested lists. Switch from one level to the other with either the
Promoteor the Demotebuttons 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 andselect 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 iconon the Bullets and Numbering toolbar or rightclick 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 in one way or another your preferences. You can build yourown library of custom styles to use in place of the predefined ones, or
you can modify the existing styles. OOo offers four mechanisms tomodify both both predefined and custom (user-created) styles:• Update a style from a selection.
• Load or copy styles from another document or template.
• Change a style using the Style dialog box.
• Use AutoUpdate (paragraph and frame styles only).
The first two methods are discussed in “Update Style (from aselection)” on page 9 and “Load Styles (from a template or document)”
on page 10, while Chapter 7 (Working with Styles) discusses at length
the process of creating a new style.

Modifying styles

19This section shows how you can quickly make simple modifications toexisting 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 otherdocuments, 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 andmoving styles” on page 28.

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 fromthe 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. Eachstyle’s dialog box has several tabs. The various properties on these
dialog boxes are described in the next chapter.

Figure 12: Example of the Paragraph Style dialog box

20

Introduction to Styles

Move to the page where the setting you want to modify is specified andinput the new value. You can click the Help button at any time to bringup the online guide where all the options of the current page arebriefly 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 yourliking.

Examples: Modifying paragraph styles
For this example, we need three lines of text with three OOo-supplied
paragraph styles: Heading 1, Heading 2, and Heading 3. These
paragraph styles could be used in formating 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 firstline, click the Paragraph Styles icon on the Styles and Formatting
window, and double-click Heading 1 in the drop-down list. Repeat thisprocedure for the other entries of Figure 13, using the properparagraph style for each: the Heading 1 style for the paragraphcontaining the word Title, Heading 2 for Subtitle 1, and so on.
Your document should resemble Figure 13.

Figure 13: Headings 1–3 with default styles
Suppose you decide to make some changes to these styles, namely:• Heading 1 should be centered.
• Heading 3 should be indented.

Modifying styles

21

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.

Figure 14: Modifying a style
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 shownin Figure 16). If you make another Heading 1 entry, it will be centeredas well.

Figure 15: Center Heading 1

Figure 16: The text Title, which is formatted as acentered Heading 1 style

22

Introduction to Styles

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 to0.60", as shown in Figure 17. Your display might be different,
depending upon what measurement unit was set in the options(Tools > OOo Writer > General > Settings).

Figure 17: Set indentation
The result should resemble Figure 18.

Figure 18: The text formatted as Heading 3 style is now indented

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 andframe styles. If this check box is selected, then OOo will apply to thestyle itself any modification made manually to a paragraph formatted
with that style.
Caution

Modifying styles

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

Figure 19: The Organizer page of the Paragraph Style dialog box

Creating custom paragraph styles:
examplesYou 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 andFormatting? With Writer you can make your own styles to suit yourneeds.
Chapter 7 (Working with Styles) describes in detail the options on thevarious 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:• Poem: Centered, with a font size of 10pt.
• PoemHeading: Centered, bold, with a 12pt font size.
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 aheading using a Heading paragraph style and press Enter, thenext style switches to Text body.

Creating the Poem paragraph style
Our next example uses the Poem style. We will use the Default style asa 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.

24

Introduction to Styles

This opens the Paragraph Style dialog box, with the Organizer page
selected. To create a custom style, you have to understand andconfigure 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 Poemstyle, 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, thenany 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.

Figure 20: Initial configuration for the Poem style. Set
the first three entries as shown.
The next step is to configure the alignment and font properties of thisstyle.
• On the Alignment page, select the Center option.
• On the Font page, select the 12pt font size.
Click OK to save the new Poem style.

Creating custom paragraph styles: examples

25

Creating the PoemHeading styleCreate a new PoemHeading style. Use the same procedure as before,
with these changes:• Next Style: Select Poem, not PoemHeading.
• Linked with: Heading.
The dialog box should look like Figure 21.

Figure 21: Settings for the PoemHeading style
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.

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. Thenyou 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 Poemstyle instead of centering it.

26

Introduction to Styles

Figure 22: Sample poem

Indent PoemFirst, 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.

Creating custom paragraph styles: examples

27

Figure 23: Final result, using three custom styles

Copying and moving styles
Styles are part of the document properties, therefore changes made toa 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, youneed 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 anotherin two ways:• Using the Template Management dialog box.
• Loading styles from a template or document (see page 10).
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.

28

Introduction to Styles

Figure 24: Choosing to copy styles from a document,
not a template3) To load styles from a file, click the File button. When you returnto this window, both lists show the selected file, as well as all thecurrently open documents.

Figure 25: Copying a style from one document to another4) Double-click on the name of the template or document and thendouble-click the Styles icon to show the list of individual styles.
5) To copy a style, hold down the Control key and drag the name ofthe style from one list to the other.
6) Repeat for each style you want to copy or move. When you arefinished, click Close.

Copying and moving styles

29

Caution

If you do not hold down the Control key when dragging, thestyle 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 OOo’s predefined styles from a document or
template, even if they are not in use. However, custom styles can bedeleted.
To delete an unwanted style, right-click on it in the Styles andFormatting window and choose Delete. If the style is in use, themessage shown in Figure 26 appears.

Figure 26: Deleting an applied style
CautionTip

Make sure the style is not in use before deletion. Otherwise,
all objects with that style will return to the Default style andretain their formatting as manual formatting. This can bevery problematic in a long document.
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 in Figure 27 appears.

Figure 27: Deleting a style that is not in use

30

Introduction to Styles

Assigning styles to shortcut keys
You can configure shortcut keys to quickly assign styles in yourdocument. 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 17 (Customizing
Writer) for details.

Defining a hierarchy of headings
Tools > Outline Numbering defines the hierarchy of headings in adocument. 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 eachchapter 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 OOo’s outline numbering feature. The
default paragraph styles assigned to outline levels are the headingstyles supplied with OOo: 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 andfooters of pages (see Chapter 14, Working with Fields), and Writer cansend the outline to Impress to use as the basis for a presentation (seethe Impress Guide for details).

Choosing paragraph styles for outline levels
If you are using the default heading styles for the headings in youroutline, and you do not want to use heading numbering, you do notneed 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 headingstyles:1) Choose Tools > Outline Numbering to open the Outline
Numbering dialog box (Figure 28).
Defining a hierarchy of headings

31

Figure 28: Choosing paragraph styles for outline levels
2) Click the number in the Level box corresponding to the heading
for which you want to change the paragraph style.
3) In the Numbering: Paragraph Style section, choose from the dropdown list the paragraph style you want to assign to that headinglevel. For example, when setting up a chapter in the Writer Guide,
you would click Level 1 and choose OOoHeading1 (a custom
style defined for the OOoAuthors project) to replace Heading 1
and for Level 2, OOoHeading2 to replace Heading 2.
4) Repeat for each outline level that you want to change. Click OK
when done.

Assigning outline levels to other styles
Beginning with OpenOffice.org 3.1, you can assign an outline level toany paragraph style. This feature enables you to create a table ofcontents 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.

32

Introduction to Styles

Figure 29: Specifying an outline level on the Outline &Numbering page for a paragraph style

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 thatlook like those in Figure 30.

Figure 30: The numbering scheme to be set up.
Use the Numbering page of the Outline Numbering dialog box todefine the numbering scheme and its appearance. Figure 31 shows thedefault settings.
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.

Defining a hierarchy of headings

33

Figure 31: Default settings on the Outline Numbering dialog box.

Figure 32: Specifying numbering of Level 1 headings.

Figure 33: Specifying numbering of Level 2 headings.

34

Introduction to Styles

Figure 34: Specifying numbering of Level 3 headings.
These choices produce the layout shown in Figure 35.

Figure 35: Results of numbering choices for headings

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 numberedheadings, you may also want the second line of long headings to line
up with the first word of the heading, not the number. For thesechanges, use the Position page of the Outline Numbering dialog box.

Note

The Position page for documents created in OOo3 is slightly
different from the Position page for documents created inearlier versions of OOo that are opened in OOo3. Thisdifference is provided for backwards compatibility.

Positioning in new OOo3.x documents
Figure 36 shows the Position page as it appears for documents createdin OOo3.x.

Defining a hierarchy of headings

35

Figure 36: Setting up the position of level 1 headings
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).

Figure 37: Indenting Level 2 headings

Figure 38: Result of changes to indentation of Level 2 headings
2) 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.

36

Introduction to Styles

Figure 39: Wrapping long headings

Figure 40: Result of changing Indent at value
3) 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.

Figure 41: Indenting level 3 headings

Positioning in older documents opened in OOo3.x
Figures 42, 43, 44, and 45 show the Position page as it appears for
documents created in earlier versions of OOo and opened in OOo3.x.

Defining a hierarchy of headings

37

Figure 42: Setting up level 1 headings

Figure 43: Indenting Level 2 headings

Figure 44: Changing the Width of numbering value to wrap
long headings

38

Introduction to Styles

Figure 45: Indenting Level 3 headings

Defining a hierarchy of headings

39