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.

使用三个自定义的样式后的效果

[编辑] 相关链接

本文原文

个人工具