Writer:推荐创建主控文档的方法

出自OOo 中文指南手册翻译

跳转到: 导航, 搜索

目录

Image:documentation_note.png下面是Writer指南的某些作者推荐的方法。
 This method is recommended by some of the authors of the Writer Guide.


请按给定的次序来完成这些步骤。每一步都会在下面的各小节里解释。 Follow these steps, in the order given. Each step is explained in detail in the following subsections.

步骤1 规划项目 Step 1. Plan the project

步骤2 创建包含所需样式、字段和其他元素的模板 Step 2. Create a template containing the required styles, fields, and other elements

步骤3 从同一个模板创建主控文档和子文档 Step 3. Create the master document and subdocuments from the same template

步骤4 在主控文档里直接插入一些信息 Step 4. Insert some information directly into the master document

步骤5 在主控文档中插入子文档 Step 5. Insert the subdocuments into the master document

步骤6 添加目录、文献参考或索引 Step 6. Add a table of contents, bibliography, or index

[编辑] 步骤1 规划项目 Step 1. Plan the project

虽然可能在该过程的大部分步骤中进行修改,但是开始前规划得越多,后面不得不纠正的问题就越少。这里有些需要规划的东西:span class='en_grey'> Although you can make changes at most steps in this process, the more you can plan before you start, the less work you will have to do to correct any problems later. Here are some things you need to plan: </span>

所需的书的各部分或报告。哪些页面将出现在主控文档里,而哪些则出现在子文档中?(目录和索引必须放在主控文档中。) Parts of book or report required. What pages will be in the master document and what will be in the subdocuments? (The ToC and index must be in the master document.)

假设一本书拥有下表中的部分。 Consider as an example a book with the parts given in the table below.

部分 位置
  标题(封面)页       在主控文档中    
  版权页   在主控文档中
  目录   在主控文档中
  序言(前言)   在子文档中
  1~18章   在子文档中
  附录A, B   在子文档中
  索引   在主控文档中

页、段、字符、文本框、编号样式。如何创建或修改样式及在书本设计中使用样式的例子,请见第6章(Writer样式介绍)和第7章(Writer样式应用)。 Page, paragraph, character, frame, and numbering styles. See Chapter 6 (Introduction to Styles) and Chapter 7 (Working with Styles) for instructions on how to create or modify styles and examples of the use of styles in book design.

必需的字段及自动文本条目。见本书中的其他章,可以为你提供思路。 Fields and AutoText entries, as required. See other chapters in this book for ideas.

[编辑] 步骤2 创建包含所需样式、字段和其他元素的模板 Step 2. Create a template containing the required styles, fields, and other elements

可以从已有的文档或者包含所需样式的模板创建自己的模板,也可以从空文档创建模板。更多有关模板的信息见第10章(Writer模板)。 You can create your template from an existing document or template that contains some or all of the styles you want for this document, or you can create the template from a blank document. For more about templates, see Chapter 10 (Working with Templates).

如果使用已有的文档或模板,删除里面的所有文本,除过页眉和页脚里的字段,然后保存为这个项目的模板。该模板仍然保留了所有定义的样式,即使没有文本。随着项目的开发可以修改模板里的样式。 If you use an existing document or template, delete all the text from it except for fields in headers and footers before saving it as the template for this project. It will still have all the styles you defined, even if the text is not there. You can change the styles in the template as your project develops.

创建模板后记得用文件>模板>保存 Be sure to use File > Templates > Save when creating the template.

[编辑] 步骤3 从同一个模板创建主控文档和子文档 Step 3. Create the master document and subdocuments from the same template

如果是刚开始的新项目,最好从同一模板创建主控文档和所有子文档。如果不用相同的模板,那么创建的样式将不一致,这需要时间和精力去调整。比如,两个子文档有同名样式,但是各自的格式却不一样,主控文档将用首先被添加的子文档里的格式。这可能导致文档的样子并不如你所愿。对所有子文档使用相同的模板将节省时间,少走弯路。 If you are starting a new project, create the master document and all the subdocuments from the same template. Not using the same template could create style inconsistencies that require time and effort to correct. For example, if two subdocuments have a style with the same name that is formatted differently in each document, the master document will use the formatting from the first subdocument that was added. This could cause your document not to look like you expect. Using the same template for all subdocuments saves time and frustration.

这样在项目中就不用管创建主控文档和子文档的先后次序,也没必要同时创建所有的子文档。可以在需要的任何时候添加新的子文档—只要是从同一模板创建的就行。 It does not matter in what order you create the master and subdocuments, and you do not have to create all the subdocuments at the same time, when you are starting the project. You can add new subdocuments at any time, as you need them—as long as you always create them from the same template.

[编辑] 创建主控文档 Create the master document

按照下面的步骤创建主控文档。也可以用其他方法,但是每个方法(包括该方法)都有自己的缺点。 Follow this process to create the master document. You can use other methods, but each method (including this one) has its drawbacks.

  1. 从步骤2中创建的模板打开新文档,点新建>模板和文档,然后选择已创建的模板。确认新文档第一页的页面样式就是最终文档首页的样式;如果不是,那就改一下。本例中,首页样式是标题页 Open a new document from the template you created in Step 2, by clicking New > Templates and Documents, then selecting the template you created. Be sure the first page of this new document is set to the page style you want for the first page of the final document; if it is not, change it. In our example, the style for the first page is Title page.
  2. 文档从模板中获取了文本或分页的话,删除这些文本。(可以保留页眉和页脚里的字段。) If any text or page breaks came into this document from the template, delete the text. (Fields in headers and footers can stay.)
  3. 文件>发送>生成主控文档。保存主控文档在项目文件夹里,而不是模板文件夹。我们稍后会用到主控文档,现在关闭与否悉听尊便。 Click File > Send > Create Master Document. Save the master document in the folder for this project, not in the templates folder. We will return to this master document later. For now, you can either leave it open or close it, as you prefer.

[编辑] 创建子文档 Create subdocuments

子文档与其他文本文档没什么区别。仅当文档被连接进主控文档并从主控文档打开时才成为子文档。某些主控文档中的设置将覆盖子文档中的设置,但只有当从主控文档中查看、操作或打印这些文档时才会发生。 A subdocument is no different from any other text document. It becomes a subdocument only when it is linked into a master document and opened from within the master document. Some settings in the master document will override the settings in a subdocument, but only when the document is being viewed, manipulated, or printed through the master document.

创建子文档和创建普通文档一样: Create a subdocument in the same way as you create any ordinary document:

  1. 打开基于项目模板(这点很重要)的空文档,点新建>模板和文档,然后选择该模板。 Open a blank document based on the project template (very important) by clicking New > Templates and Documents, then selecting the template.
  2. 删除不需要的文本,设置首页样式为自定义的章首页的页面样式 Delete any unwanted text, and set the first page to the page style you specified for the first page of a chapter.
  3. 文件>另存为。为文档取个合适的名字并保存在项目文件夹里。 Click File > Save As. Give the document a suitable name and save it in the folder for this project.

如有已经有写好的章节,而这些文件可能并不基于项目模板。那就需要改变这些文件所属的模板。可以手工修改,或者使用OOo修改模板的扩展;这两种方法都在第10章(Writer模板)中有描述。 If you already have some of the chapters written, the files are probably not based on the template you just created for this project. You will need to change the template attached to the existing files. You can do this manually, or by using the Template Changer extension to OOo; both methods are described in Chapter 10 (Working with Templates).

[编辑] 步骤4 在主控文档里直接插入一些信息 Step 4. Insert some information directly into the master document

步骤4和5中的说明遵守步骤1中规划的页码安排。如果文档有不同的要求,随机应变。例子见问题与解决办法 The instructions in steps 4 and 5 use the page numbering requirements given in Step 1. If your book has different requirements, change these instructions to suit. See Problem solving for one example.

这些说明相当冗长乏味,不过一旦建立了主控文档,就不需要修改了,即使小小的设置也是很快的。 These instructions are fairly tedious, but once you have the master document set up, you should not have to change it, and with a bit of practice setting it up goes quickly.

  1. 打开主控文档,按下面做。 Open the master document and do the following.
    • 确保段落标记显示(在工具>选项>OpenOffice.org Writer>格式化辅助进行设置,或点控制符号图标Image:ParagraphIcon.png)。 Make sure paragraph marks are showing (you can set them in Tools > Options > OpenOffice.org Writer > Formatting Aids, or click the Nonprinting characters icon Image:ParagraphIcon.png).
    • 显示正文边界,表格边框,区域边框(工具>选项>OpenOffice.org>外观 Show text boundaries, table boundaries, and section boundaries (Tools > Options > OpenOffice.org > Appearance).
  2. 输入标题页的内容(或者留下通配符以待稍后填充)。在页面最后的空段落处,点插入>手动分隔符。在插入分隔符对话框里选换页,并选择第二页的页面样式(就是例子中的版权页),不要选修改页码复选框。点确定 Type the contents of the title page (or leave placeholders and fill in later). With the insertion point in the last blank paragraph on the page, click Insert > Manual Break. On the Insert Break dialog box, select Page break and the page style for the second page (Copyright page in our example), and leave the Change page number checkbox deselected. Click OK.
  3. 在标题页和版权页间插入分页 Inserting a page break between the title page and the copyright page.
  4. 输入版权页的内容(或者留下通配符)。插入另一个手动分页,这次设置页面样式为OOoFrontMatter。勾选修改页码复选框并在下面的框里选择1,如下所示。这个数字1在文档里显示为i,因为页面样式定义的是罗马数字。 Type the contents of the copyright page (or leave placeholders). Insert another manual page break, this time setting the page style to Front matter first page. Select the Change page number checkbox and choose 1 in the box below that, as shown below. This number 1 will show in your document as i, because the page style is defined to use Roman numerals.
  5. 在前页的第一页前插入分页 Inserting a page break before the first page of the front matter.
  6. 假设第三页也是内容目录。在该页留一两个空白段落然后插入另一个分页,将下一页样式设置为OOoFrontMatter作为序言的第一页。因为这里序言的页码延续内容目录的页码,不要修改页码复选框。注意导航工具显示一个项目—文字 Let’s assume the third page is for the Table of Contents. Leave a blank paragraph or two on this page and insert another page break, with the next page again set to the Front matter first page style, which we want to use for the first page of the Preface. Because we want the page numbering for the Preface to continue from the page numbers of the Table of Contents, do not select the Change page number checkbox this time. Notice that the Navigator shows one item, labeled Text.

[编辑] 步骤5 在主控文档中插入子文档 Step 5. Insert the subdocuments into the master document

最后就是添加子文档。 At last we are ready to add the subdocuments.

Image:Tip.png插入的子文档会出现在主控文档里被高亮选择的项目之前。先插入最后的子文档,再插入其他子文档在其前面,这样就无需在列表里上下移动它们了,最后得到的就是正确的次序。
  Subdocuments are inserted into a master document before whatever item is highlighted in the Navigator. If you insert the last subdocument first, and then insert the other subdocuments before the last one, they will end up in the correct sequence without the necessity of moving them up or down in the list.


  1. 显示导航工具(点编辑>导航,或按F5,或点导航图标Image:NavigatorIcon.png)。Display the Navigator (click Edit > Navigator, or press F5, or click the Navigator icon Image:NavigatorIcon.png).
  2. 在导航工具里,选文字,然后点住插入图标并选文件。On the Navigator, select Text, then long-click on the Insert icon and click File.
  3. 用导航工具在主控文档中插入子文档 Inserting a subdocument into a master document using the Navigator.

    会出现一个标准打开文件对话框。选所需的文件(步骤3里创建的)并点确定。本例用到了六个章节和一个前言;如上面的提示,先添加第6章。A standard File Open dialog box appears. Select the required file (which you created in Step 3) and click OK. This example uses six chapters and a preface; we will load Chapter 6 first, as suggested in the Tip above.

    在导航工具里插入的文件在文字项目,如下所示。The inserted file is listed in the Navigator before the Text item, as shown below.

    插入子文档后的导航工具 Navigator after inserting one subdocument.
  4. 因为文字部分包含了标题页和已插入的其他材料,高亮它并点上移图标将其移动到列表的顶部。 Because the Text section contains the title page and other material you have already inserted, highlight it and click the Move Up icon to move it to the top of the list.
  5. 高亮刚插入的子文档(第6章),点住插入图标,选文件插入第一个子文档;本例中,就是前言。第6章仍然是高亮的。重复插入第1章、第2章等等直至所有子文档被加入列表。导航工具现在看起来就像下图。 Highlight the subdocument you just inserted (Chapter 6), then long-click on the Insert icon and click File to insert the first subdocument; in this example, Preface. Chapter 6 remains highlighted. Repeat with Chapter 1, Chapter 2, and so on until all the subdocuments have been added to the list. The Navigator will now look something like the figure below.
  6. 导航工具显示了主控文档中的一系列文件 The Navigator showing a series of files in a master document.
  7. 再次保存主控文档。依次高亮每一章然后在各章前插入一个文字。导航工具看起来就像下图。 Save the master document again. Now highlight each chapter in turn and insert a Text section before it. When you are done, the Navigator should look like Figure 8.
  8. 导航工具显示了一系列文件和文字 The Navigator showing a series of files and text sections.
    Image:Tip.png 可以定义以标题1段落样式开始新页,这样可以避免在章与章之间插入手动分页,但是如果你想在第一章重新开始编号的话这样做又引起了页码问题。

    为了重新开始页面编号,必须插入手动分页;但是因为第一章首页的标题1样式强制分页,这样在第一章首页后就会出现一两个无用的空白页。本章中讲述了避免这个问题的方法。

      You can define your Heading 1 paragraph style to start on a new page, and thus avoid inserting manual page breaks between chapters, but this causes a page numbering problem if you want to restart page numbering at the beginning of Chapter 1.

    To restart page numbering, you must insert a manual page break; but because the Heading 1 style on the first page of Chapter 1 forces yet another page break, you end up with one or more unwanted blank pages before the first page of Chapter 1. The technique described in this chapter avoids this problem.


  9. 检查主控文档首页的页面样式是否正确。如果不是,就修改为正确的样式(如本例中的标题页)。 Check whether the first page of the master document has the correct page style. If not, change it to the correct style (Title page in this example).
  10. 滚动到第一个子文档开始处。检查它的页面样式是否正确,如有需要请修改(如本例中的OOoFrontMatter Scroll to the place where the first subdocument begins. Check whether its page style is correct, and change it if necessary (Front matter first page in this example).

    第一个子文档页面的顶部有个空白段落;这是手动分页插入的。设置该段落为步骤2里创建的分页样式。 The first subdocument has a blank paragraph at the top of the page; this was inserted as part of the manual page break. Set this paragraph to the PageBreak style you created in Step 2.

    子文档前的分页,处于受保护部分。 Page break before subdocument, which is in a protected section.
  11. 注意文档处于受保护部分。这意味着在主控文档里不能对该子文档的内容做出任何修改。(如果删除该部分,内容就成为主控文档的内容;而不再是子文档的了。如果在主控文档或子文档里都有修改,那这些修改不会对其他文档有效。更多关于受保护部分的内容参见在线帮助或第4章(格式化Writer页面)。) Notice that the document is in a protected section. That means you cannot change any of the contents of this subdocument from within the master document. (If you remove the section, the contents become part of the master document itself; they are no longer in a subdocument. If you make changes in either the master document or the subdocument, those changes are not made in the other document. For more about sections, refer to the online help or to Chapter 4, Formatting Pages.)
  12. 向下滚动到第1章的起始部分。你会发现和前言的末尾在同一页,两部分(前言和第1章)间有个空白段,如下所示。 Scroll down until you find the beginning of Chapter 1. You will find that it is on the same page as the end of the Preface, and there is a blank paragraph in the text area between the two sections (the Preface and Chapter 1), as shown below.

    点空白段插入分页,指定首页样式,并设页码为1。点确定 Click on this blank paragraph and insert a page break, specifying the First Page style and the page number to start at 1. Click OK.

    主控文档两部分间的文本区域 A text area between two sections of a master document.
  13. 滚动到第二章的首页。该页也和第1章的末尾在同一页,两章之间同样有空白段。 Scroll to the first page of Chapter 2. You’ll find that it is on the same page as the end of Chapter 1, and there is a blank paragraph in the text area between the two chapters.
  14. 点空白段插入分页,指定首页样式,但不要勾选修改页码复选框。 Click on this blank paragraph and insert a page break, specifying the First Page style, but do not select the Change page number checkbox.

    为所有章节重复上面的步骤,这样每章都以新页开始。 Repeat for all of the chapters, so that each chapter starts on a new first page.

  15. 再次保存主控文档。 Save the master document again.

[编辑] 步骤6 添加内容目录、文献目录或索引 Step 6. Add a table of contents, bibliography, or index

可以用主控文档来生成书的内容目录、文献目录或索引。必须将这些项目插入主控文档的文本部分。有关这些文档元素见第12章(生成目录、索引和书目)。 You can generate a table of contents, bibliography, or index for the book, using the master document. You must insert these items into a text section in the master document. For more about these document elements, see Chapter 12 (Creating Tables of Contents, Indexes, and Bibliographies).

放置光标在主控文档最靠前的文本部分,那里是放置目录的地方,接着创建目录。 Put the insertion point on the page in the first text section where the table of contents is to go and create the table of contents.

如果在主控文档的末尾没有文本部分,那么在最后一个子文档前插入一个,然后将其下移至最后一个文档之后。该文本位置是用来放置文献目录的,现在就可以把子文档里的参考文献条目组织起来创建文献目录了。 If you do not have a Text section at the end of the master document, insert one before the last subdocument, then move it down so it is after the last subdocument. Now, if you have included bibliographic entries in your subdocuments, you can put the insertion point on the page in this last text section where the bibliography is to go and create the bibliography.

如果子文档中有要索引的条目,同样将插入点放在最后的文本部分创建索引。 If you have included index entries in your subdocuments, put the insertion point on the page in the last text section where the index is to go and create the index.

[编辑] 进度表

Writer:推荐创建主控文档的方法 中文化进度 翻译 0 校对 0 插图 / 上次编辑 20100504151938 编者 Yookee

[编辑] 相关链接

本文原文

个人工具