Difference between revisions of "Documentation/UserGuide/Writer/Text"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Numbered and bulleted lists)
Line 451: Line 451:
 
|   
 
|   
 
|}
 
|}
 +
 +
= Autoformatting text =
 +
 +
Writer will automatically format parts of your document, according to the options selected in the AutoCorrect dialog box ({{Menu|Tools|AutoCorrect Options}}).
 +
 +
[[Image:Writer-Autocorrect-options-dialog-box.jpg|500px|500px]]
 +
 +
Inside the AutoCorrect Options dialog box, the Help button will open and describe the selected choice and how to activate the autoformats. 
 +
 +
To automatically format your document with the selected options, select or deselect from the submenu in {{Menu|Format|AutoCorrect}}.
 +
 +
 +
'''While Typing'''
 +
 +
The default option, automatically formats the document while you type.
 +
 +
 +
'''Apply'''
 +
 +
After choosing this option, Writer will automatically format the document.
 +
 +
 +
'''Apply and Edit Changes'''
 +
 +
After choosing this option, Writer will automatically format the document and then open a dialog box where you can accept or reject changes.
 +
 +
 +
'''AutoCorrect Options'''
 +
 +
Open the AutoCorrect dialog box.
  
 
[[Category:Documentation]] [[Category:Documentation/Writer]]
 
[[Category:Documentation]] [[Category:Documentation/Writer]]

Revision as of 16:42, 4 September 2013

Template:Documentation/DraftPage


In Writer, you can use the toolbars, the sidebar and menus (normal and contextual) to modify text. For example, modify the selected paragraph through Format → Paragraph (choose Character to format text). Alternatively, right click the selection and choose Paragraph or Character.

Formatting tools are available through the Format menu or a right click on the page. But it is important to note that these options only modify the corresponding page style. In Writer there is no direct formatting for pages, page formatting can only be done through styles. For this reason, we will leave the details on how to format pages to the corresponding section for page styles.

Selecting Text

In Writer, in order to work with text, you need to select it. Selecting a piece of text, or consecutive pieces of text, is relatively simple.


Using the cursor, left click the text, and drag until the desired text is selected. You can also use selection shortcuts by left clicking the text. Single words can be selected with a double left click, a sentence selected with a triple left click, and a paragraph selected with a quadruple left click.


With the keyboard, use the navigation arrows to choose the text, hold down the  ⇧ Shift  key and select text area with the arrow keys.


Writer-consecutive-selection-text-border.png


To quickly select content on the entire page, press  Control  +  A , or go to Edit → Select All.

Selecting items that are not consecutive

  1. Using the cursor, select the first piece of text.
  2. Hold down the  Control  key (continue holding until all selections are complete), and use the cursor to select the next piece of text.
  3. Repeat until all selections are made.


Writer-unconsecutive-selection-text-border.png


Selecting a vertical block of text

Text may be separated by spaces or tabs in a vertical block. To select text in this form, change the selection mode to block by choosing Edit → Selection Mode → Block Area or left click on STD in the status bar until it changes to BLK.


Writer-status-bar-block-mode-border.png


Now you can make your selection as you would with consecutive text selection.


Writer-block-selection-text-border.png

Cutting, copying and pasting text

Text can be moved within a document, or between documents by cutting or copying and subsequently pasting the text.

Cutting text entails removing it entirely and relocating it within the document. Copying text creates a duplicate to be placed within the document.


To cut or copy (with text selected) you can use:

  • Keyboard shortcuts:  Control  +  X  (cut) or  Control  +  C  (copy)
  • Menu selections: Edit → Cut or Edit → Copy
  • Contextual menus: Right click text selection and choose Cut or Copy
  • Icon sources: Writer-cut-icon.png Cut or Writer-copy-icon.png Copy


Pasting text places the cut or copied text in the document. When pasting text, the formatting result depends on the source and how you paste it.

To paste and retain original formatting use:

  • Keyboard shortcut:  Control  +  V 
  • Menu selection: Edit → Paste
  • Contextual menu: Right click and choose Paste
  • Icon source: Writer-paste-icon.png Paste


To paste and take on formatting of the surrounding text:

  • Choose the arrow to the right of the paste icon, and choose Unformatted text

Writer-paste-icon-menu.png

  • Select Edit → Paste Special → Unformatted text


For other paste formatting options, choose from the drop down menu of the paste icon or the Paste Special dialog box.

Writer-Paste-Special-dialog-box.png

Numbered and bulleted lists

There are several ways to create numbered or bulleted lists:

  • Auto-formatting (covered later in this chapter)
  • List Styles (covered in the chapter on Styles)
  • The Numbering Writer-numbering-icon.jpg and Bullets Writer-bullets-icon.jpg icons on the paragraph formatting toolbar. The use of these icons will be described in the section below.


Documentation caution.png It is important to note that it is better to avoid the use of numbered list in numbered chapters. In another section of this guide we will see how to number chapters and give an outline to a document.

To produce a numbered or bulleted list, select the paragraphs in the list and choose the appropriate icon.

Writer-create-numbered-list.jpg

Using the Bullets and Numbering Toolbar

With a numbered or bulleted list active, a contextual toolbar will open.

AOO-BulletNumbering.png


The buttons, numbered on the screenshot, perform the following actions:

  1. Bullets ON/OFF
  2. Numbering ON/OFF
  3. Numbering OFF
  4. Promote one level
  5. Demote one level
  6. Promote one level with sub-points
  7. Demote one level with sub-points
  8. Insert an unnumbered entry
  9. Move line up
  10. Move line down
  11. Move line up with sub-points
  12. Move line down with sub-points
  13. Restart numbering
  14. Bullets and Numbering dialog box


The options in the Bullets and Numbering dialog box are the same as when editing a list style, so these properties will be covered in the chapter on List Styles.

Nested Lists

As mentioned earlier, list sub-points refer to the levels of a numbered list or bullet, see example below:

  1. First
    1. Sub First
  2. Second
    1. Sub Second
      1. Sub Sub Second


To change the level of one line in the list, either use the Promote/Demote Level Writer-promote-or-demote-icons.jpg icons in the Bullets and Numbering toolbar, or place the cursor at the beginning of the line and press  Tab ⇆  or  ⇧ Shift  +  Tab ⇆ .

Autotext

Use AutoText to insert text, tables, fields and other items for reuse, by assigning a key combination to the item for retrieval.

For example, by typing dt and  F3 , a long paragraph with a sample text will insert into the document (note: "dt" stands for "dummy text" and different acronyms may apply to non-English versions: use Edit → AutoText to see the one appropriate for your language). Typing fn and  F3  will produce a table with one row and two columns, with a Math object on the left cell and a variable on the other.

Both examples show what AutoText does and its use, to introduce a document snip previously defined in any place, using only an abbreviation and a keyboard shortcut.

Inserting an AutoText

Insert an AutoText by typing the abbreviation followed by  F3 .

To view the available abbreviations, you can choose Edit → AutoText ( Ctrl  +  F3 ), but there is an easier method: Activating the Insert toolbar. By choosing the AutoText icon, you can view the AutoText categories and their respective abbreviations.

AOO-InsertAutoText.png

Defining an AutoText

  1. Select the content you want to use for an AutoText. The content can be anything: text, tables, pictures, frames, sections, etc.
  2. With the content selected, go to Edit → AutoText.
  3. The AutoText dialog box will appear. Provide a name for your entry in the Name box. Writer will suggest a shortcut, which you can change.
  4. In the box to the left, choose a category for the entry, where the AutoText will be classified.
  5. Select the  AutoText  button to the right, and select either New (text only) (for the AutoText to take on formatting where it is inserted into the document) or New (for the AutoText to retain its formatting).
  6. Select  Close  to return to the document.
Documentation caution.png If the AutoText contains a table, it is necessary to select at least one line before and one line after the table, otherwise only the content and not the table itself will go into the AutoText.

AOO-AutoText.png

Inside the AutoText dialog box, note the following features:

  • With the option Display remainder of the name as suggestion while typing enabled, Writer will suggest an AutoText if you start to type the AutoText name. The suggestion will appear in a pop-up box, and pressing  ↵ Enter  will insert the AutoText.
  • The  Categories...  button allows you to create new categories to classify your AutoTexts.
  •  Path...  defines where to save the AutoTexts.

Editing an AutoText

In the AutoText dialog box (Edit → AutoText), you can edit your AutoText entries.

Select an existing AutoText, and choose the AutoText... button to modify or even eliminate the AutoText.

Selecting Edit, a document will open with the AutoText. Simply make the changes and save. The entry will now be available as edited.

Documentation caution.png The changes will apply only to AutoTexts inserted after the modification, AutoText already inserted will not be changed

Print a list of AutoText entries

  1. Choose Tools → Macros → Organize Macros → OpenOffice Basics.
  2. In the Macro from list, choose OpenOffice Macros → Gimmicks.
  3. Select AutoText and click  Run .
  4. A list of the AutoText entries will be generated in a new document. You can print this document.


Find and replace text

You can find text within a document with the Find toolbar, or the Find & Replace dialog box. In the Find & Replace dialog box, you also have the ability to:

  • Find and replace words or phrases
  • Find and replace specific formatting
  • Find and replace paragraph styles
  • Use regular expressions to find and replace text

The Find toolbar Writer-Find-Toolbar.png will only allow you to search for and identify specific text or phrases. You can find the toolbar docked in the standard toolbar, or by choosing View → Toolbars → Find.


Display the Find & Replace dialog box by pressing  Control  +  F  or choosing Edit → Find & Replace.

Writer-Find-and-Replace-box.png

  1. Type the text you want to search for in the Search for box.
  2. To replace the text, type the new text in the Replace with box.
  3. To find text, click Find. To replace, click Replace. Choosing Find All will select all instances of the text. Selecting Replace All will replace all matches.
  4. You can choose from several search options such as matching case, matching whole words, or searching for similar words.

Find and replace specific formatting

To quickly change the format of text from one style to another:

  1. Choose the More Options button to expand the dialog box and view the formatting options.
  2. To search for text with specific formatting, enter the text in the Search for box. To only search for formatting leave the Search for box empty.
  3. With the Search for box selected, choose Format.
  4. Select the formatting options to include and click OK.
  5. To replace with different text and/or formatting, perform the same actions for the Replace with box.
  6. Choose Find, Find All, Replace, or Replace All.

Find and replace paragraph styles

To quickly change paragraph styles from one style to another:

  1. Choose the More Options button to expand the dialog box.
  2. Select Search for Styles (if you have attributes specified this option is labeled as Including Styles).
  3. Select styles from the Search for and Replace with drop down menus.
  4. Choose Find, Find All, Replace, or Replace All.

Template:Documentation/Note

Using regular expressions (wildcards)

Regular expressions (also known as wildcards) are combinations of characters that instruct Writer how to search for something.

  1. Choose the More Options button to expand the dialog box.
  2. Select the Regular expressions option.
  3. Type the search text with the regular expression and the replacement text if any.
  4. Choose Find, Find All, Replace, or Replace All.


Examples of common regular expressions:

To Find Use Examples
Any single character . b.d finds bad, bud, bid, bed
One of the specified characters [xyz] b[iu]n finds bin and bun
Any single character in this range [x-y] [r-t]eed finds reed, seed, and teed (range must be in alphabetically ascending order)
Any single character except the characters inside the bracket [^x] p[^a]t finds post and pest but not past
The beginning of a word \<start \<log finds logbook and logistics but not catalog
The end of a word end\> log\> finds catalog but not logistics
A paragraph marker $ Does not work as a replacement character, use \n instead
A line break \n Finds a line break that was inserted with  ⇧ Shift  +  ↵ Enter , as a replacement character it inserts a paragraph marker

To view a full list of regular expressions, select Help → OpenOffice Help and search for regular expressions, choose list of to display the list.


Inserting special characters

A special character is one that is not found on the standard keyboard. For example, ₵ ə Σ ẽ ψ are all special characters.

To insert a special character:

  1. Place the cursor in the document where you want the character to appear.
  2. Select Insert → Special Character for the Special Character dialog box.
  3. Inside the dialog box, choose the character from the available fonts and click OK.

Template:Documentation/Note

Non-breaking spaces and hyphens

A non-breaking space (NBSP) or non-breaking hyphen tells Writer to never break lines at that spot. A non-breaking space or hyphen can never end or begin an automatically wrapped line. Use non-breaking spaces to prevent periods at the end of lines that do not terminate sentences, or numbers or bullet-like symbols at the beginning of lines that do not initiate list items. Use a non-breaking hyphen to prevent the hyphen from appearing at the end of a line, such as in a phone number.


Insert a non-breaking space

Place the cursor between the two words, and press  Control  +  Space .


Insert a non-breaking hyphen

Place the cursor where the hyphen will appear, and press  ⇧ Shift  +  Control  +  - .


En and em dashes

To use en and em dashes, the Replace dashes option must be checked under Tools → AutoCorrect Options. With this option enabled, Writer will replace two hyphens, under certain conditions, with the corresponding dash.


In the following table, the A and B represent text consisting of letters A to Z or digits 0 to 9. The table describes the different en and em dash options.


Text that you type: Result
A - B (A, space, minus, space, B) A – B (A, space, en-dash, space, B)
A -- B (A, space, minus, minus, space, B) A – B (A, space, en-dash, space, B)
A--B (A, minus, minus, B) A—B (A, em-dash, B)
A-B (A, minus, B) A-B (unchanged)
A -B (A, space, minus, B) A -B (unchanged)
A --B (A, space, minus, minus, B) A –B (A, space, en-dash, B)


En or em dashes can also be inserted manually through Insert → Special Characters, use characters U+2013 or U-2014.


There are also shortcuts available to insert en or em dashes, that vary per operating system.

Operating System En dash shortcut Em dash shortcut
Windows  Alt  + 0150  Alt  + 0151
Linux Compose + two hyphens + a period Compose + three hyphens + a period
Mac  ⌥ Opt  + hyphen  ⇧ Shift  +  ⌥ Opt  + hyphen


Formatting Paragraphs

Formatting paragraphs in Writer can be achieved through alignment, justified text, line spacing, numbering or bullets, and indenting. These actions can be performed using the buttons on the Formatting toolbar. The below image shows the Formatting toolbar with the paragraph specific icons displayed.

Template:Documentation/Note

Writer-formatting-paragraph-icons.jpg

1 Open the Styles and 5 Align Right 10 Numbering On/Off
Formatting Window 6 Justified 11 Bullets On/Off
2 Apply Style 7 Line Spacing: 1 12 Decrease Indent
3 Align Left 8 Line Spacing: 1.5 13 Increase Indent
4 Centered 9 Line Spacing: 2 14 Paragraph

Aligned and justified text

Text can be aligned to the left, center, or right of the document. The below image shows how text appears with the different alignment options.

Writer-aligned-text-example.jpg

When using justified text, the last line by default is aligned to the left. You can also align the last line to the center, or justify the last line. These options are controlled in the Alignment tab from Format → Paragraph.

Writer-justified-text-example.jpg

Tab stops and indents

The ruler displays the default and defined tab stops. The tab settings affect the indentation of paragraphs. You can manually change the indentation of paragraphs with the Increase Indent or Decrease Indent icons, or by using the  Tab ⇆  key.

Tab and indent settings are discussed in the Ruler section of Writer's User Interface.


Formatting characters

Formatting characters in Writer can be achieved through adjustments to the font family, font weight, font size, or font coloring. These actions can be performed using the buttons on the Formatting toolbar. The below image shows the Formatting toolbar with the character specific icons displayed.

Template:Documentation/Note

Writer-formatting-characters.jpg

1 Open the Styles and 6 Italic 12 Font Color
Formatting Window 7 Underline 13 Highlighting
2 Apply Style 8 Superscript 14 Background color
3 Font Name 9 Subscript 15 Open Character Format
4 Font Size 10 Increase Font dialog box
5 Bold 11 Reduce Font

Autoformatting text

Writer will automatically format parts of your document, according to the options selected in the AutoCorrect dialog box (Tools → AutoCorrect Options).

Writer-Autocorrect-options-dialog-box.jpg

Inside the AutoCorrect Options dialog box, the Help button will open and describe the selected choice and how to activate the autoformats.

To automatically format your document with the selected options, select or deselect from the submenu in Format → AutoCorrect.


While Typing

The default option, automatically formats the document while you type.


Apply

After choosing this option, Writer will automatically format the document.


Apply and Edit Changes

After choosing this option, Writer will automatically format the document and then open a dialog box where you can accept or reject changes.


AutoCorrect Options

Open the AutoCorrect dialog box.

Personal tools