Writer:創建自定義段落樣式

出自OOo 中文指南手册翻译

跳轉到: 導航, 搜尋

目錄

樣式和格式窗口裡有一些內置的樣式,如標題 1、正文等。但是您可能需要一種新的樣式,如詩歌樣式。您可以在Writer里定義符合您的要求的樣式。 You have seen that the Styles and Formatting window provides several predefined styles, such as Heading 1 and Text body. But what if you need something different, like a poem style, that is not in Styles and Formatting? With Writer you can make your own styles to suit your needs.

第七章(Writer樣式應用)里詳細介紹了段落樣式對話框的各個選項頁中的設置。在本節里先用一個例子說明怎樣創建一個新的段落樣式。 Chapter 7 (Working with Styles) describes in detail the options on the various pages of the Paragraph Style dialog box. This section provides an example of a typical use of custom paragraph styles.

我們將創建具有下面屬性的「詩歌」樣式和「詩歌題目」樣式: We create a Poem paragraph style and a Poem Header paragraph style, with the following properties:

  • 詩歌:居中對齊,字體大小為10pt。
  • 詩歌題目:居中對齊,粗體,字體大小為12pt。

此外,詩歌題目的下一個樣式是詩歌,即當按下回車鍵后,下一段落的格式變成詩歌 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.

Image:documentation_note.png 您可能已經注意到這種情況,當您在輸入完一個標題樣式的段落後,按回車鍵,新建段落的樣式變成正文了。
  You may have noticed this behavior already. After you enter a heading using a Heading paragraph style and press Enter, the next style switches to Text body.


[編輯] 創建詩歌段落樣式

我們將使用詩歌樣式。首先以默認樣式來創建詩歌樣式。 Our next example uses the Poem style. We will use the Default style as a starting point.

  1. 點擊樣式和格式圖標 Image:Styles3Icon.png或者按功能鍵F11
  2. 點擊第一個段落樣式圖標。
  3. 右擊默認,選擇新建
創建新樣式。

這打開段落樣式對話框,顯示管理選項卡。在創建新樣式前,您需要了解下面三個設置: This opens the Paragraph Style dialog box, with the Organizer page selected. To create a custom style, you have to understand and configure the top three entries.

樣式設置項目 說明
名稱 樣式的名稱,如「標題 1」或「正文」。請輸入名字「詩歌」。 This is the name of the style itself, like Heading 1 or Text body. Set (type in the text box) the name to Poem.
下一個樣式 這是詩歌段落後面的段落樣式,即當您在詩歌樣式的段落後按下回車鍵,新的段落使用的樣式。這裏設置為詩歌。即詩歌段落後面還是使用詩歌樣式。 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.
鏈接到 如果詩歌樣式鏈接到其它樣式,如默認樣式,則對默認樣式做的修改將會影響到詩歌樣式。這並不是我們需要的,因此這裏設置成- 無 -,即詩歌樣式不會鏈接到其它樣式上。 If the Poem style is linked with another, say Default, then any change in Default will affect Poem, just as you saw with Heading in the previous section. For our example, this is not the behavior we want. Set this entry to – None –. This means that Poem is not linked with any other style.

在修改完后,對話框如下圖所示: After making these changes, your dialog box should look like the figure below.

詩歌樣式中需要修改的三個選項。

下一步設置對齊和字元大小。 The next step is to configure the alignment and font properties of this style.

  • 對齊選項卡里選擇居中。On the Alignment page, select the Center option.
  • 字體選項卡里選擇12pt的字元大小。 On the Font page, select the 12pt font size.

點擊確定保存詩歌樣式。 Click OK to save the new Poem style.

[編輯] 創建詩歌題目樣式

根據上面的步驟使用下面的設置創建詩歌題目樣式: Create a new PoemHeading style. Use the same procedure as before, with these changes:

  • 下一個樣式:選擇詩歌代替詩歌題目
  • 鏈接到標題

對話框如下圖所示: The dialog box should look like the figure below.

詩歌題目的設置

現在設置樣式的新參數: Now set the settings of the new style:

  1. 對齊選項頁,選擇居中 On the Alignment page, select Center.
  2. 字體選項頁,選擇粗體14pt大小。 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 the figure below.

一首詩

[編輯] 修改樣式的格式

使用樣式的一個優點是在輸入文字后允許更改文檔的格式。例如,你有一個100頁的詩集,現在你或者你的出版商不喜歡現在的格式。 One of the main advantages of styles is that they allow the document formatting to be changed after the content has been written. For example, suppose you have written a 100-page book of poetry. Then you decide you don』t like the way the poems look after all. Or, perhaps, your publisher doesn』t like it.

我們以縮進代替詩歌樣式的居中來示範修改樣式格式。 To learn about reconfiguring styles, we add an indentation to the Poem style instead of centering it.

[編輯] 縮進詩歌

首先,設置詩歌樣式為左對齊: First, set the Poem style to left alignment:

  1. 樣式和格式窗口,選擇詩歌樣式,右擊,選擇修改 In the Styles and Formatting window, select Poem and right-click and select Modify.
  2. 對齊選項頁,選擇左對齊 On the Alignment page, select Left.

設置縮進: Set the indentation:

  1. 點擊縮進和空白選項頁。 Click the Indents & Spacing tab.
  2. 縮進下設置段前為5cm(或2英寸)。 Under Indent, set the indentation before the text to 5cm (or about 2in).

完成!點擊確定后,您將看到修改後的變化。 Done! Click OK, and you should see the text change.

[編輯] 最後的效果

當完成所有設置后,示例的詩的效果如下圖。注意作者使用了第三個自定義樣式。 After all these changes, the poem should look similar to the figure below. Note in the figure that a third style has been created for the author of the poem.

使用三個自定義的樣式后的效果

[編輯] 相關鏈接

本文原文