Difference between revisions of "Documentation/OOoAuthors User Manual/Writer Guide/Introduction to Styles"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
{{WriterStylesIntroTOC|PrevNext=block
 +
|Prev=Documentation/OOoAuthors User Manual/Writer Guide/Digital signing of documents
 +
|Next=Documentation/OOoAuthors_User_Manual/Writer Guide/Using paragraph styles}}__notoc__
 +
 
This is Chapter '''6''' of the '''OpenOffice.org 2.x Writer Guide''' (Third edition), produced by the [http://oooauthors.org/ OOoAuthors group]. A PDF of this chapter is available from the [http://documentation.openoffice.org/manuals/oooauthors2/ OOoAuthors Guides page] at OpenOffice.org.
 
This is Chapter '''6''' of the '''OpenOffice.org 2.x Writer Guide''' (Third edition), produced by the [http://oooauthors.org/ OOoAuthors group]. A PDF of this chapter is available from the [http://documentation.openoffice.org/manuals/oooauthors2/ OOoAuthors Guides page] at OpenOffice.org.
 
[[User_Manuals| &lt;&lt; User Manuals page]]<br>
 
[[Writer Guide| &lt;&lt; Writer Guide Table of Contents]]<br>
 
[[Writer Guide/Printing, Faxing, Exporting, and Emailing| &lt;&lt; Chapter 5 Printing, Faxing, Exporting, and Emailing]] &nbsp;&nbsp;|
 
&nbsp;&nbsp;[[Writer Guide/Working with Styles| Chapter 7 Working with Styles &gt;&gt;]]
 
 
  
 
= Introduction =
 
= Introduction =
Line 43: Line 41:
  
 
'''Note:'''  Styles and Formatting is a floating window. You can drag it around the screen using the mouse, or you can dock it to the left or right side of the screen.
 
'''Note:'''  Styles and Formatting is a floating window. You can drag it around the screen using the mouse, or you can dock it to the left or right side of the screen.
 
= Using paragraph styles =
 
 
== First steps ==
 
OpenOffice.org uses a tool called Styles and Formatting to manage styles. The concept of styles and the Styles and Formatting window is best explained through an example.
 
 
# Create a new document (choose '''File > New > Text Document''' or press ''Control+N'').
 
# Type '''Heading 1''' in it. ''Make sure that the cursor remains in that same line''.
 
# Click the '''Styles and Formatting''' icon [[Image:StylesFormattingIcon.png]] located on the Formatting Bar or press the ''F11'' key. This opens the Styles and Formatting window.
 
# Make sure the window is showing the ''Paragraph Styles'' section (click on the top-left icon of the Styles and Formatting window [[Image:ParagraphStylesIcon.png]]).
 
 
[[Image:WG6-2.png|Opening Styles window]]<br>Click on the Styles and Formatting icon to bring up the window.
 
 
Double-click the '''Heading 1''' entry of Styles and Formatting. This will do two things:
 
 
* Give the line you typed the ''Heading 1'' style.
 
* Add '''Heading 1''' to the ''Apply Style'' menu.
 
 
The Apply Style menu is illustrated in the [[#Using the Apply Style menu|next section]]. It provides direct access to the styles that are currently in use in the document.
 
 
== Using the Apply Style menu ==
 
The Apply Style menu lists the paragraph styles that are currently in use in the document. You can select styles from this menu, just like with the Styles and Formatting window. As an exercise, press ''Enter'', type some text and select '''Heading 1''' in the ''Apply Styles'' list. The text acquires the properties of the ''Heading 1'' style.
 
 
[[Image:WG6-3.png|Applying paragraph styles]]<br>Applying paragraph styles.
 
 
== Modifying paragraph styles ==
 
The power of styles lies in the ability to modify them to suit your needs. For the next example, we will 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 in the framework for a document that will be "fleshed out" afterwards. Your document should resemble the illustration below.
 
 
[[Image:WG6-4.png|Default heading styles]]<br>Headings 1–3 with default styles.
 
 
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, using the proper paragraph style for each. The ''Heading 1'' style should be applied to the "paragraph" containing the word ''Title'', ''Heading 2'' to ''Subtitle 1'', and so on.
 
 
'''Note:'''  ''Heading 1'' uses a bold font typeface, ''Heading 2'' uses a 14pt bold italic typeface, and ''Heading 3'' uses a 14pt bold typeface.
 
 
Suppose you decide to make some changes to these styles:
 
 
* ''Heading 1'' should be centered.
 
* ''Heading 3'' should be indented.
 
 
=== 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'''.
 
 
[[Image:WG6-5.png|Modifying a style]]<br>Modifying a style.
 
 
When the Paragraph Style window opens, choose the '''Alignment''' tab, select '''Center''', and click '''OK'''.
 
 
[[Image:WG6-6.png|Center Heading 1]]<br>Center Heading 1.
 
 
Now, everything marked as ''Heading 1'' will be centered. If you make another ''Heading 1'' entry, it will be centered as well.
 
 
[[Image:WG6-7.png|Centered text]]<br>Text with the Heading 1 style centered.
 
 
=== Indent Heading 3 ===
 
On the Styles and Formatting window, right-click on the '''Heading 3''' paragraph style and choose '''Modify''' (as before). When the Paragraph Style window opens, follow the steps below:
 
 
# Click the '''Indents & Spacing''' tab.
 
# Under the ''Indent'' section, set the indentation before the text to '''1.50cm''' (0.6 in).
 
 
[[Image:WG6-8.png|Set indentation]]<br>Set indentation.
 
 
The result should resemble the illustration below.
 
 
[[Image:WG6-9.png|Indented heading]]<br>The text with Heading 3 style is indented..
 
 
== Linked styles ==
 
Some OpenOffice.org styles are ''linked'' together. This means that a change in one style affects every style linked to to it. For example, every ''Heading'' style (such as ''Heading 1'', ''Heading 2'') is linked with a style called ''Heading''. This relationship is illustrated below.
 
 
[[Image:WG6-10.png|Linked styles]]<br>Linked styles.
 
 
As an example, suppose 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 this ''linking''. Open the Styles and Formatting window (press ''F11'') and select '''Heading'''.
 
 
[[Image:WG6-11.png|Select Heading style]]<br>Select Heading style.
 
 
Open the Paragraph Style dialog box for the ''Heading'' style (right-click > '''Modify''') and select the ''Font'' tab. Select a font and click '''OK'''.
 
 
[[Image:WG6-12.png|Select Heading style font]]<br>Select font for Heading style.
 
 
Now, the fonts of all the heading styles have been changed in a single operation. Your document should now resemble the illustration below.
 
 
[[Image:WG6-13.png|Heading styles new font]]<br>All Heading styles now have the new font.
 
 
= Creating custom styles =
 
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 OpenOffice.org you can make your own styles to suit your needs.
 
 
In this section, we will create a ''Poem'' paragraph style, and a ''PoemHeading'' paragraph style, with the following properties:
 
 
* ''Poem'': Centered, with font-size 10.
 
* ''PoemHeading'': Centered, bold, with font-size 12.
 
In addition, a ''PoemHeading'' is to be followed by a ''Poem''. In other words, when you press ''Enter'', the style changes to ''Poem''.
 
 
'''Note'''  The keen reader may have noticed this behavior already. After you type a heading and press ''Enter'', the style switches back to ''Text body''.
 
 
== Creating the Poem paragraph style ==
 
Our first example is the ''Poem'' style. We use the ''Default'' style as a starting point.
 
 
# Click the '''Styles and Formatting''' icon  inline:Graphic16.png  or press ''F11''.
 
# Click the '''Paragraph Styles''' icon (first from the left).
 
# Right-click '''Default''' and choose '''New'''.
 
: [[Image:WG6-14.png|Create a new style]]<br>Create a new style.
 
 
This opens the Paragraph Style dialog box, with the ''Organizer'' tab selected. To create a custom style, you have to understand and configure the top three entries.
 
 
{|
 
||'''''Style&nbsp;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&nbsp;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&nbsp;with'''&nbsp;&nbsp;&nbsp;&nbsp;||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 '''-&nbsp;None&nbsp;-'''. This means that ''Poem'' is not linked with any other style.||
 
|-
 
|}
 
 
After making these changes, your screen should look like the illustration below.
 
 
[[Image:WG6-15.png|Edited entries]]<br>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 this style.
 
 
* On the ''Alignment'' page, select the '''Center''' option.
 
* On the ''Font'' page, select '''12pt''' font-size.
 
Click '''OK''' to save the new ''Poem'' style.
 
 
Congratulations! You just made your very own style.
 
 
== Creating the PoemHeading style ==
 
Create a new ''PoemHeading'' style. Use the same procedure as before, with these changes:
 
 
* ''Next style'': Select '''Poem''', not '''PoemHeading'''.
 
* ''Linked with'': '''Heading'''''.''
 
The window should look like the picture below.
 
 
[[Image:WG6-16.png|Settings for PoemHeading style]]<br>Settings for the PoemHeading style.
 
 
Now set the settings of the new style:
 
 
# On the ''Alignment'' page, select '''Center'''.
 
# 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. Your poem should look similar to the one below.
 
 
[[Image:WG6-17.png|Sample poem]]<br>Sample poem.
 
 
== 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 will make the following changes:
 
 
* The ''Poem'' style will be indented instead of centered.
 
* Add a ''PoemAuthor'' style based on ''Poem'', except it is bold and has more indentation.
 
 
=== Indent Poem and PoemHeading ===
 
First, set the ''Poem'' style to left alignment:
 
 
# In the Styles and Formatting window, select '''Poem''', right-click and select '''Modify'''.
 
# On the ''Alignment'' page, select '''Left'''.
 
 
Set the indentation:
 
 
# Click the '''Indents & Spacing''' tab.
 
# Under ''Indent'', set the indentation before the text to '''5cm''' (or about 2in).
 
Done! Click '''OK''', and you should see the text change. Do the same thing for ''PoemHeading''.
 
 
=== Create PoemAuthor style ===
 
The purpose of this style is to set apart the name of the author from the rest of the poem. You already know how to create a new style. Follow the same procedure as before (starting from the ''Poem'' style). Use the following configuration:
 
 
* ''Name'': '''PoemAuthor'''
 
* ''Next style'': '''Default'''
 
* ''Linked with'': '''Poem'''
 
 
Now, configure ''PoemAuthor'' just like you configured ''Poem'', with the following changes:
 
 
* ''Font'': '''Bold'''
 
* On the ''Indents & Spacing'' page:
 
** Under ''Indent,'' set the ''Before text'' field to '''8.00'cm''' (3.2 in).
 
** Under ''Spacing'', set the spacing above the paragraph to '''0.50cm''' (0.2 in). This creates an extra space between the poem and the name of the author.
 
 
The picture below shows how the ''Indents & Spacing'' page should look at this point. Click '''OK''' to save the style. Now set the author of the poem (in the example, '''Anon''') to the newly created ''PoemAuthor'' style, as described in [[#First steps|First steps]].
 
 
[[Image:WG6-18.png|PoemAuthor style]]<br>Indentation and spacing for the PoemAuthor style.
 
 
=== Final result ===
 
After all these changes, the poem should look similar to the one below.
 
 
[[Image:WG6-19.png|Final result]]<br>Final result, using three custom styles.
 
 
== Tips and tricks ==
 
You can make the Styles and Formatting window display only custom styles. Click on the menu at the bottom of the Styles and Formatting window and select '''Custom Styles'''. As shown below, Styles and Formatting only displays ''Poem'', ''PoemAuthor'', and ''PoemHeading''.
 
 
[[Image:WG6-20.png|Display only custom styles]]<br>Displaying only custom styles.
 
 
= Using page styles =
 
Page styles are to pages what paragraph styles are to paragraphs. Just as paragraph styles can define paragraph properties (font size, color, and others), page styles can define page properties (margins, page size, header and footers, and others). However, unlike paragraphs, which can have directly applied properties, pages only have a page style and no directly applied properties.
 
 
'''Real life situation:'''
 
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.
 
 
== What page style does a page have? ==
 
The page style for the current page is displayed on the status bar.
 
 
[[Image:WG6-21.png|Current page style]]<br>The current page style is displayed on the status bar.
 
 
== Modifying a page style ==
 
Open the Styles and Formatting window and click the '''Page Styles''' button  [[Image:PageStylesIcon.png]].
 
 
[[Image:WG6-22.png|Page styles]]<br>Selecting page styles.
 
 
Right-click the currently active page style and select '''Modify'''. The resulting window is shown below.
 
 
[[Image:Wg6-23.png|Page properties]]<br>Page properties.
 
 
== Mirrored margins for facing pages ==
 
You can set up “mirrored" margins for facing pages within one page style. More complex differences between right and left pages may require separate page styles; these are discussed in [[Writer Guide: Formatting Pages|Chapter 4]] (Formatting Pages).
 
 
To set up “mirrored" facing pages, go to the ''Page'' tab of the Page Style dialog box. Choose '''Mirrored''''' ''for ''Page layout'' in the ''Layout settings'' section and set the inner and outer margins in the ''Margins'' section.
 
 
[[Image:WG6-24.png|Mirrored pages]]<br>Setting up mirrored pages.
 
 
== The Next Style property ==
 
You have seen the ''Next Style'' property in the context of paragraph styles. This property is especially powerful in page styles.
 
 
=== 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:
 
 
* It should not have a header or page number.
 
* The left and right margins should be the same.
 
For the title page, we can use the ''First Page'' page style that comes with OOo, and for the rest of the document, we can use the ''Default'' page style.
 
 
The illustration below 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'''.
 
 
[[Image:WG6-25.png|Flow of page styles]]<br>Flow of page styles.
 
 
See [[#Inserting a header|Inserting a header]] for instructions on setting up the page header.
 
 
== Manual page breaks ==
 
The ''Next Style'' property is enough for projects with straightforward pagination requirements (for example, reports, letterheads, and small books). But more complex projects require more control over page styles. ''Manual page breaks'' provide this control.
 
 
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 scenarios where page breaks are useful.
 
 
=== Example: Chapters ===
 
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 the chapter, we return to ''New Chapter'' for the next chapter.
 
 
OOo doesn't have a ''New Chapter'' style, so you must create a custom style. Let's suppose that you already have the page styles with the following properties:
 
 
{|
 
||'''''Page style'''''||'''''Next Style'''''||
 
|-
 
||New Chapter&nbsp;&nbsp;&nbsp;||Default||
 
|-
 
||Default||Default||
 
|-
 
|}
 
 
This can be seen visually in the flowchart in [[#Setting up a title page|Setting up a title page]], but where the ''New Chapter'' style replaces the ''First Page'' style.
 
 
At some point, you will want to start a new chapter. Follow these steps:
 
 
# Put the cursor at the end of the chapter, on a blank line of its own.
 
# Choose '''Insert > Manual Break'''. The Insert Break dialog box appears.
 
# Under ''Type'', choose '''Page break''' and under ''Style'', select '''New Chapter'''.
 
 
[[Image:WG6-26.png|Insert break]]<br>Choose Page break and select the New Chapter page style.
 
 
The figure below illustrates the flow of page styles when using page breaks.
 
 
[[Image:WG6-27.png|Page style flow]]<br>Page style flow using page breaks.
 
 
=== Example: Inserting a 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.
 
 
# Choose '''Insert > Manual Break'''.
 
# Select the page style (say, ''Special Page'') in the Insert Break dialog box.
 
# Fill in the contents for this page. Then insert another page break.
 
# 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 below.
 
 
[[Image:WG6-28.png|Inserting a page with special formatting]]<br>Inserting a page with special formatting.
 
 
= Page numbering =
 
Many people first encounter page styles when they want to number pages. OpenOffice.org has a powerful system for numbering pages.
 
 
== Preliminaries: fields ==
 
OpenOffice.org uses a feature called ''fields'' to manage page numbers. To insert a page number field, position the cursor where you want to insert the number and choose '''Insert > Fields > Page Number'''. The page number appears with a gray background. The gray background denotes a field.
 
 
'''Note:'''  The gray background is simply there to denote a field. This background is not printed. Choose '''View > Field Shadings''' (or press ''Ctrl+F8'') to turn this feature off.
 
 
If you have seen lists in OOo, you might have noticed this gray background. OOo lists use fields. The page number field always displays the page number for the current page. If you see the words “Page number" instead of a number, press ''Ctrl+F9''. This shortcut key toggles OOo between displaying the field's ''contents'' (what the field is for) and the field's ''results'' (what the field creates).
 
 
'''Note:'''  For a full introduction to fields, see [[Writer Guide/Working with Fields|Chapter 14]] (Working with Fields).
 
 
== Inserting a header ==
 
In OOo, headers are specified by page styles.
 
 
# Open the Page Style dialog box for the desired page style (right-click > '''Modify''').
 
# Select the '''Header''' tab.
 
# Under ''Header'', check '''Header on''' and click '''OK'''.
 
: [[Image:WG6-29.png|Turn on page header]]<br>Turn on page header.
 
 
At this point you should see the (empty) header on the current page. In the example below, the header area is identified, purely for illustrative purposes. It would normally be empty immediately after being turned on, until you insert your own header text and formatting.
 
 
[[Image:WG6-30.png|A page with a page header]]<br>A page with a page header.
 
 
''What's so special about headers?'' The same text in the header appears on ''all'' pages with that page style. (You can experience this yourself by entering some text into the header.) This property of headers (or footers), along with fields, forms the basis of OOo page numbering.
 
 
'''Tip:'''  You can also add a header through the Insert menu: '''Insert > Header > [page style]'''. Likewise, for footers: '''Insert > Footer > [page style]'''.
 
 
'''Caution:''' The Insert Menu can also be used for ''deleting'' a preexisting header or footer for a page style. If that page style has a check mark in front of it, pointing to it will open an OOo dialog box warning about this and asking whether you want to delete the header or footer for that particular page style.
 
 
== Simple page numbering ==
 
The simplest case is to have the page number at the top of every page and nothing more. To do this, put the cursor on the header and select '''Insert > Fields > Page Number'''.
 
 
[[Image:WG6-31.png|Page number in header]]<br>Page number inserted in the header.
 
 
Presto! Now, the correct page number appears on every page.
 
 
== More complex variations ==
 
There are a lot of interesting variations that you can apply without further knowledge of page styles. Here are some suggestions:
 
 
* Right-align the header to make the page number appear on the top-right:
 
* Place the cursor in the header.
 
* Click the '''Align Right''' icon (or right-click anywhere in the header and select '''Alignment > Right''').
 
* Add (type) the word '''page''' so the header reads '''page 1''', '''page 2''', and so on. This also requires using the ''Page Number'' field, [[#Page numbering|discussed earlier]].
 
* Add the document title so the header reads, for example: '''Joe's favourite poems''', left justified, and '''page x''' with right justification, where x is the value of the ''Page Number'' field. Consider using a tab to separate the title from the page number.
 
* OOo also has a ''Page Count'' field ('''Insert > Fields > Page Count'''). Using it, you could, for example, have a header that reads '''page 2 of 12'''.
 
 
These variations are all illustrated below.
 
 
[[Image:WG6-32.png|Header variations]]<br>Variations on the simple page numbering method.
 
 
Many more variations are possible. For example, you can use a footer instead of a header to make the page number appear at the bottom of the page. You can also include the chapter number with the page number: see "Numbering pages by chapter" in [[Writer Guide/Formatting Pages|Chapter 4]] (Formatting Pages).
 
 
=== Example: Restart page numbering: a preface ===
 
Some times you want to reset the page number back to 1. A typical example is the preface for a book. A standard preface has the following properties:
 
 
* Page numbers are displayed in Roman numerals (i, ii, iii, iv, …).
 
* After the preface, the document starts on a ''Default'' page.
 
* The page number resets to 1, and the number format becomes Arabic (1, 2, 3, 4, ...).
 
Resetting the page number requires page breaks.
 
 
First, let's get the preliminary work done for the ''Preface'' style:
 
 
# Create a new page style and name it '''Preface'''.
 
# Set its ''Next Style'' to '''Preface''' because a preface could span multiple pages.
 
# Add a header to ''Preface'' and insert the ''Page Number'' field. Make the page numbers display as Roman numerals (i, ii, iii, iv, …):
 
#* Open the page style window for ''Preface'' (if not already open) and click the '''Header''' tab. Check '''Header on''' under ''Header''.
 
#* Click the '''Page''' tab. Under ''Layout settings'', in the ''Format'' drop-down list, set the format to '''i, ii, iii, ...'''. (See the bottom right of the figure below.) Click '''OK''' to close the dialog box.
 
: [[Image:WG6-33.png|Roman page numbers]]<br>Set page number format to Roman numerals.
 
 
After the preface is written, we are ready to restart the page numbering in the main body of the document to Arabic numerals. Follow these steps:
 
 
# Make an empty paragraph at the very end of the preface.
 
# Put the cursor on the blank line.
 
# Choose '''Insert > Manual Break'''.
 
# Select '''Page break''' and choose the ''Default'' style.
 
# Select the '''Change page number''' check box and set the new value to '''1'''. Click '''OK''' to close the dialog box.
 
 
These settings are shown below.
 
 
[[Image:WG6-34.png|Insert break]]<br>Set the new page number to 1 and the page style to Default.
 
 
'''Note:'''  You cannot assign an odd page number to a left page or an even page number to a right page. OOo strongly adheres to the convention that odd page numbers go on right-hand pages and even page numbers on left-hand pages.
 
 
This change is also reflected on the status bar. The ''Page'' section of the status bar now includes both the total page count and the entry of the page number field.
 
 
[[Image:WG6-35.png|Page number in the status bar]]<br>Page number in the status bar.
 
 
=== Example: Different headers on right and left pages ===
 
When you insert a header on a page style set up for mirrored pages or right-and-left pages, you can have the contents of the header be the same on all pages or be different on the right and left pages.
 
 
To allow different content in headers, clear the '''Same content left/right '''check box in the ''Header'' area on the ''Header'' page of the Page Style dialog box.
 
 
[[Image:WG6-36.png|Different header content]]<br>Different header content.
 
 
Now, you can put the page number on the left-hand edge of the left pages and on the right-hand edge of the right pages, put the document title on the right-hand page only, or make other changes. An example is shown below.
 
 
[[Image:WG6-37.png|Different content left and right]]<br>Different content on left and right pages.
 
 
= Using character styles =
 
Character styles are a complement to paragraph styles. Like paragraph styles, they define text properties (font, weight, size), but they are applied to blocks of text smaller than a paragraph. For example, you can use the ''Emphasis'' character style to emphasize a word. A couple of character styles used in this document include:
 
 
* Key strokes use the custom ''OOoKeyStroke'' style. For example, “to set OOo to full screen, press ''Control+Shift+J''".
 
* Menu paths use the custom ''OOoMenuPath'' style. For example, “to turn field shadings on or off, choose '''View > Field Shadings'''".
 
 
== Why use character styles? ==
 
Beginning OOo users often wonder, "''Why use character styles?''" or "''How is this different from pressing the bold icon to change the font typeface?''" The following real life event illustrates the difference.
 
 
'''Real-life situation'''
 
 
Jean is a technical writer from Australia. She learned the value of character styles after her publisher told her to unbold menu paths in her 200 page book. Jean had not used character styles. She had to edit all 200 pages by hand, with some help from Find & Replace.
 
 
This was the last time Jean failed to used character styles.
 
 
Character styles do not have as many options as paragraph styles or page styles. Their benefits are of a different nature:
 
 
* '''Formatting changes'''<br/> As Jean's story illustrates, the ability to make formatting changes throughout a document can be important. Character styles provide this.
 
* '''Consistency'''<br/> Character styles help ensure that typesetting guidelines are applied consistently.
 
* '''Focus on content'''<br/> “''Was I supposed to bold keystrokes? How about menus?''"<br/> A writer shouldn't 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 ''OOoKeyStroke'' or ''OOoMenuPath'') will remove this burden from you.
 
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.
 
 
== 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:
 
 
# Select the block of text where you wish to apply the style.
 
# Double-click the appropriate character style in the Styles and Formatting window.
 
 
Some examples include:
 
 
: This example uses the OOo-supplied '''''Strong Emphasis''''' character style.
 
 
: '''Definition''': A statement describing the meaning of a word or phrase.
 
 
'''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 two easy ways to remove character formatting:
 
 
* Select the block of text, right-click and choose '''Default Formatting'''.
 
* If you have the Styles and Formatting window open, select the block of text and double-click the ''Default'' character style.
 
 
'''Note:'''  The first method also works for removing manual formatting.
 
 
== 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:
 
 
* ''Never'' mix character styles and manual formatting. Manual formatting supersedes character styles. If you combine them, you may end up wasting hours in frustration trying to figure out why your character styles don't work.
 
* Right-clicking and choosing '''Default Formatting''' removes any text formatting (both manual and character styles).
 
* Realize that clicking the '''Bold''' icon in the toolbar ''is not easier'' than double-clicking on a character style that is preset for bolding the font typeface.
 
* Leave the Styles and Formatting window open to make character styles easy to access.
 
  
  
 
{{CCBY}}
 
{{CCBY}}
 
[[Category: Documentation]]
 
[[Category: Documentation]]

Revision as of 20:24, 21 August 2007



This is Chapter 6 of the OpenOffice.org 2.x Writer Guide (Third edition), produced by the OOoAuthors group. A PDF of this chapter is available from the OOoAuthors Guides page at OpenOffice.org.

Introduction

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 (say, Helvetica 12pt, bold).

Styles are logical attributes. We use styles every day. For example, there are two styles of computers: 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 say “I have a laptop".

OpenOffice.org styles are a way to do the same thing for your document. Using styles means that you stop saying “font size 14pt, Times New Roman, bold, centered", and you start saying “title". In other words, styles means that you shift the emphasis from what the text looks like, to what the text is.

Why use styles?

OpenOffice.org (OOo) brings a powerful notion of styles. Styles help improve consistency in a document. They also make major formatting changes easy. For example, you may decide to change the indentation of all paragraphs or change the font of all titles. For a long document, this simple task can be prohibitive. Styles make the task easy.

Example: The time is 9:50 A.M. and Jane is finishing the 30-page paper for school that is due at 10:00 A.M. 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 the first.
  • Even numbered pages must have a wider right margin, and odd numbered pages must have a wider left margin.

Thankfully, Jane used OpenOffice.org and styles. She makes all the changes in two minutes and hands in the paper on time.

Types of styles

OpenOffice.org Writer has five types of styles:

  • Paragraph styles affect an entire paragraph.
  • Character styles affect a block of text inside a paragraph.
  • Page styles affect page formatting (page size, margin, and the like).
  • Frame styles affect frames and graphics.
  • List styles affect numbered lists and bulleted lists.

The first three styles are the most used. Those are the styles covered in this chapter. Frame styles and list styles are discussed in Chapter 7 (Working with Styles).

These styles are available through a floating window called Styles and Formatting. (Press F11 to see it.) The Styles and Formatting window is discussed in the next section.

Styles and Formatting window
Styles and Formatting window and types of styles.

Note: Styles and Formatting is a floating window. You can drag it around the screen using the mouse, or you can dock it to the left or right side of the screen.


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools