Working with paragraph styles

From Apache OpenOffice Wiki
Jump to: navigation, search

Paragraph styles: advanced techniques

Chapter 6 (Introduction to Styles) covers the basics of using paragraph styles. This chapter looks at some advanced properties of paragraph styles and ways that you can use other features in OOo in conjunction with paragraph styles to do specific tasks like:

Controlling page breaks

Writer automatically flows text from one page to the next. If you do not like the default settings, you can change them on the Text Flow page of the Paragraph Style dialog box.

Automatic page or column breaks

The Options section of the Text Flow page of the Paragraph Style dialog box provides settings to control what happens when a paragraph does not fit on the bottom of a page.

Controlling page breaks
Options for controlling automatic page or column breaks.

Do not split paragraph means that the paragraph is never split across two pages. If it does not fit on the bottom of one page, the entire paragraph moves to the top of the next.

Keep with next paragraph is appropriate for headings or the lead-in sentence to a list, to ensure that it is not the last paragraph on a page.

Orphan control and Widow control. Widows and orphans are typographic terms. An orphan is the first line of a paragraph printed alone at the bottom of a page or column. A widow is the last line of a paragraph which appears alone at the top of the next page or column. Use these options to allow paragraphs to split across pages or columns but require at least 2 or more lines to remain together at the bottom or top of a page or column. You can specify how many lines must remain together.

Required page or column breaks

You can require a paragraph to start on a new page or column and specify the style of the new page. A typical use is for chapter titles that you always want to start on a new page. This topic is covered in more detail in Chapter 4 (Formatting Pages).

On the Text Flow page of the Paragraph Style dialog box:

  1. In the Breaks section, select Insert. Make sure that Type is set to Page and Position to Before.
  2. Select With Page Style and choose the page style from the list.
  3. To continue page numbering from the previous chapter, leave Page number set at 0. To start each chapter's page numbering at 1, set Page number to 1.
  4. Click OK.
Paragraph start on new page
Setting a paragraph style to always start on a new page.

Controlling tab stops

Using tabs to space out material on a page is not recommended (depending on what you are trying to accomplish, a borderless table is usually a better choice), but if you do use tabs, do not use the default tabs set in Tools > Options > Writer > General (shown below); instead, define your own tab settings, as described in this section.

Selecting a default tab stop interval
Selecting a default tab stop interval.

If you use the default tab interval and then send the document to someone else who has chosen a different default tab interval, tabbed material will change to use the other person's tab settings. This may cause a major formatting problem, as shown below.

Different default tabs
Default tab settings might be different.

To avoid this problem, specify all the tab settings for the paragraph, using the Tabs page of the Paragraph Style dialog box.

Here you can choose the type of tab: left, right, centered, or decimal; the character to be used as a decimal point; and the fill character—the characters that appear between the end of the text before the tab and the beginning of the text after the tab. A common use of a fill character is the dots between a heading and a page number in a table of contents.

Specifying tab stops
Specifying tab stops for a paragraph style.

Specifying a relative font size

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

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

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

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

Relative font size
Selecting a type size based on a percentage.

It is also possible to use a Percentage Font size for character styles. See the note in Selecting a language for a paragraph style.

Selecting a language for a paragraph style

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

Within the document, you can apply a separate language to any paragraph style. This setting has priority over the language of the whole document. On the Font tab of the Paragraph Style dialog box, languages with installed dictionaries are marked in the Language list by a small ABC icon. When you check spelling, OOo will use the correct dictionary for paragraphs with this style.

Language selection
Selecting a language for a paragraph style.

Note: You can assign a language to selected pieces of text in a paragraph using character styles, also on the Font page. This assignment has priority over the paragraph style and document language.

Rotating the text in a paragraph style

Two common uses for rotated paragraphs are to put portrait headers and footers on a landscape page and to fit headings above narrow table columns.

Rotated text
A table with rotated headings.

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

As an example, we will apply rotated table headings to a preexisting table.

  1. Create a new paragraph style. Name it Table Heading Rotated.
  2. On the Position page of the Paragraph Style dialog box, in the Rotation / scaling section, select 90 degrees. Click OK to save the new style.
  3. Rotating 90 degrees
    Rotating a paragraph 90 degrees.

  4. Select the heading row of the table and apply the new style. Any text in the cells of the heading row is now rotated.
  5. If the headings are aligned to the top of the cells, you may want to change the alignment to the bottom of the cells. To do this, click the Bottom button on the Table toolbar.
  6. Aligning text
    Aligning text to the bottom of cells.

Kerning text

Kerning means increasing or decreasing the amount of space between pairs of letters to improve the overall appearance of the text. Kerning automatically adjusts the character spacing for specific letter combinations. It is only available for certain font types and, for printed documents, only works if your printer supports it.

Kerning example
Kerning disabled (left) and enabled (right).

To turn kerning on, go to the Position page of the Paragraph Style dialog box. In the Spacing section, select the Pair kerning checkbox.

Turning on kerning
Turning on kerning of letters in a font.

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