Writer Guide

13

Chapter
Working with Master
Documents
This PDF is designed to be read onscreen, two pages at atime. If you want to print a copy, your PDF viewer shouldhave an option for printing two pages on one sheet ofpaper, but you may need to start with page 2 to get it toprint facing pages correctly. (Print this cover page
separately.)CopyrightThis document is Copyright © 2006–2010 by its contributors as listed
in the section titled Authors. You may distribute it and/or modify it
under the terms of either the GNU General Public License, version 3 orlater, or the Creative Commons Attribution License, version 3.0 or
later.
All trademarks within this guide belong to their legitimate owners.

Authors
Daniel Carrera
Ian Laurenson
Scott Rhoades
Janet M. Swisher
Jean Hollis Weber
Michele Zarri

Feedback
Please direct any comments or suggestions about this document to:authors@documentation.openoffice.org

Acknowledgments
Much of this chapter is based on material that was first published in
Taming OpenOffice.org Writer 1.1, by Jean Hollis Weber, © 2003.

Publication date and software version
Published 14 March 2010. Based on OpenOffice.org 3.2.

You can download
an editable version of this document fromhttp://oooauthors.org/english/userguide3/published/

Contents
Copyright............................................................................................... 2
Why use a master document?................................................................5
Styles and master documents................................................................5
Using the Navigator............................................................................... 6
Creating a master document..................................................................7
Splitting one document into a master document and subdocuments..7
Combining several documents into a master document.....................8
Starting with no existing documents..................................................8
Method 1. Quick and easy, but not recommended...........................8
Method 2. Not too complicated, but with restrictions.....................9
Method 3. Complete control............................................................9
Recommended method for creating master documents.........................9
Step 1. Plan the project....................................................................10
Step 2. Create a template containing the required styles, fields, andother elements.................................................................................. 10
Step 3. Create the master document and subdocuments from thesame template................................................................................... 11Create the master document.........................................................11
Create subdocuments....................................................................12
Step 4. Insert some information directly into the master document.12
Step 5. Insert the subdocuments into the master document.............14
Step 6. Add table of contents, bibliography, index............................18
Editing a master document..................................................................18
Changing the appearance of the document......................................18
Editing subdocuments......................................................................19
Cross-referencing between subdocuments..........................................19
Preparing items as targets for cross-referencing..............................19
Using bookmarks...........................................................................20
Setting references.........................................................................20
Inserting the cross-references..........................................................21
Creating one file from a master document and its subdocuments.......24
Working with Master Documents

3

Problem solving.................................................................................... 25
Including a chapter reference in the header of the first page..........25
Including landscape pages in a portrait-oriented master document.27
Anchoring pictures to a page............................................................28
Restarting list numbering when using custom styles........................29

4

Working with Master Documents

Why use a master document?
Master documents are typically used for producing long documents
such as a book, a thesis, or a long report. A master document is
especially useful when graphics, spreadsheets, or other materialcauses the file size to become quite large. Master documents are also
used when different people are writing different chapters or otherparts of the full document, so you don’t need to share files. A masterdocument joins separate text documents into one larger document, andunifies the formatting, table of contents (ToC), bibliography, index, andother tables or lists.
Yes, master documents do work in OOo Writer. However, their use isfull of traps for inexperienced users. Until you become familiar withthe traps, find out whether they affect what you are doing, and learn
how to avoid (or work around) them, you may think that masterdocuments are unreliable or difficult to use. In fact, avoiding or
working around most of the traps is quite easy to do.
You can use several methods to create master documents. Eachmethod has its advantages and disadvantages. Which method you
choose depends on what you are trying to accomplish. The different
methods are described in this chapter, along with suggestions on when
to use each one.

Styles and master documents
Styles that are used in subdocuments, such as paragraph styles, areautomatically imported into the master document after you save themaster document. When you modify the style in the master document,
the style in the subdocument remains unaffected. That is, the style inthe master document takes precedence over the style in the
subdocument.

Tip

Use the same document template for the master document andits subdocuments. When you modify or create a style, add it to
the document template, and then reload the styles from thetemplate into the master document and the subdocuments.
This way the subdocuments will look the same when they areloaded into the master document as they do when viewed as
individual files.

Styles and master documents

5

Using the Navigator
The Navigator is a very useful tool that helps you move quickly to
specific parts of your document. It also provides information about thecontent of the document and enables you to reorganize some of thecontent. For example, if each chapter in your final book is a separate
document, then in the master document they can be reordered, andthe references are renumbered automatically and the table of contents
and index can be updated.
In Writer, the Navigator has two distinct forms. One form is used inordinary text documents and the other in master documents.
In an ordinary text document, the Navigator displays lists of thegraphics, tables, index entries, hyperlinks, references, and other itemsin the document, as shown on the left hand side of Figure 1. Click theindicator (+ sign or triangle) by any list to display the contents of thelist. You can double-click an entry in the Navigator and jump
immediately to that place in the document.

Figure 1. The Navigator for a text document (left) and for a
Master document (right)

6

Working with Master Documents

In a master document, the Navigator lists the subdocuments and text
sections, as shown on the right hand side of Figure 1. The use of theNavigator in a master document is covered in more detail later in thischapter (see “Step 5. Insert the subdocuments into the masterdocument” on page 14 and “Cross-referencing between subdocuments”
on page 19).

Creating a master document
The three most common scenarios for creating a master document
depend on the current state of your document:• You have one existing document (a book) that you want to split
into several subdocuments (chapters) that will be controlled by
the master document.
• You have several existing documents (chapters) by one or moreauthors that you want to combine into one book, controlled by themaster document.
• You have no existing documents but intend to write a long bookcontaining several chapters, possibly by multiple authors.
We will look at each of these scenarios in turn.

Splitting one document into a master document andsubdocuments
When you have one existing document that you want to split into
several subdocuments that will be controlled by the master document,
you can split the document automatically.
Use this method if the original document uses only the Default pagestyle, is numbered sequentially from the first page, and uses the
Heading 1 style to identify the start of each chapter. In these
conditions, this method will work well.
Advantages: This method is quick and easy, and any existing crossreferences between chapters are preserved. Although cleanup work
may be necessary, once you have done the cleanup, the document will
behave itself.
Disadvantages: If the original document was complex, you may have
major cleanup work to do because some formatting will be lost—for
example, page styles, page breaks, restarted page numbering.

Creating a master document

7

How to do it: Open the document and click File > Send > Create
Master Document to split the document. You will find that each of the
subdocuments begins with a Heading 1 and the file names are all
maindocnameX.odt, where X is 1, 2, 3, and so on. If you have a Preface
or other “chapter” starting with a Heading 1 before Chapter 1, the filenames will not directly correspond to the chapter numbers.

Combining several documents into a masterdocument
This method works best when all of the documents were created fromthe same template, but you can also use it when the documents werecreated from different templates.
Use one of the techniques described in “Starting with no existing
documents” to create a blank master document and insert the otherdocuments as subdocuments of the master document.
This method is especially useful if the subdocuments are created or
maintained by multiple writers. All writers on the project can work on
their subdocuments without fear of version control issues that canoccur when multiple people work on the same document.

Starting with no existing documents
The ideal situation is to start with no existing documents, because you
can do everything the way you want from the beginning. Writer
provides three ways to create a master document:
Method 1. Quick and easy, but not recommended
Method 2. Not too complicated, but with restrictions
Method 3. Complete control
In each case, you need to have a disciplined approach to make sure themaster document works correctly and reliably. Each method below
describes the steps to take. Be sure to do the steps in the order given.

Method 1. Quick and easy, but not recommended
Writer provides a quick and easy way to create a master document, but
the master document is not associated with a template, so changes tostyles and formatting are more difficult to apply reliably.

8

Working with Master Documents

Note

If the subdocuments were all created with the same template
and the styles were not modified in the documents, then thestyles are imported into the master document with thesubdocuments, and styles and formatting should be correct inthe master document. This method works best when these
conditions are met.

How to do it:
1) Click File > New > Master Document.
2) Use the Navigator to insert new documents or existing files into
the master document, as described in “Step 5. Insert thesubdocuments into the master document” on page 14.

Method 2. Not too complicated, but with restrictions
This technique works well if you want to use sequential page
numbering throughout the final document (not restarting at 1 at any
point), and each chapter starts with a Heading 1 on a new page.
(Books distributed in PDF or other e-book formats are often numbered
this way.) If you want to restart page numbering anywhere in the
document, use Method 3.
How to do it: Follow the instructions in “Recommended method for
creating master documents” but do not put in the text sections
between the subdocuments or try to change the page numbering.

Method 3. Complete control
This method gives you complete control over complex documents withseveral page styles or restarted page numbering. It is a bit more work
to set up, but works reliably1. This method is explained in detail in thenext section.

Recommended method for creating masterdocuments
Follow these steps, in the order given. Each step is explained in detailin the following subsections.
Step 1. Plan the project
Step 2. Create a template containing the required styles, fields, andother elements
1 However, the method does not work in some situations. See “Problem solving” onpage 25 for details.

Recommended method for creating master documents

9Step 3. Create the master document and subdocuments from the same
template
Step 4. Insert some information directly into the master document
Step 5. Insert the subdocuments into the master document
Step 6. Add table of contents, bibliography, index

Step 1. Plan the project
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 tocorrect any problems later. Here are some things you need to plan:
Parts of book or report required. What pages will be in the masterdocument 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.
Part

Location

Title (cover) page

In master document

Copyright page

In master document

Table of contents (ToC)

In master document

Preface (Foreword)

Subdocument

Chapters 1 to 8

Subdocuments

Appendixes A, B

Subdocuments

Index

In master document

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 theuse of styles in book design.
Fields and AutoText entries, as required. See other chapters in thisbook for ideas.

Step 2. Create a template containing the required
styles, fields, and other elements
You can create your template from an existing document or templatethat 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).

10

Working with Master Documents

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 thetext is not there. You can change the styles in the template as yourproject develops.
Be sure to use File > Templates > Save when creating the template.

Step 3. Create the master document andsubdocuments 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 thesame name that is formatted differently in each document, the masterdocument will use the formatting from the first subdocument that wasadded. This could cause your document not to look like you expect.
Using the same template for all subdocuments saves time andfrustration.
It does not matter in what order you create the master andsubdocuments, and you do not have to create all the subdocuments atthe 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 othermethods, but each method (including this one) has its drawbacks.
1) 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 ofthe final document; if it is not, change it. In our example, the stylefor the first page is Title page.
2) If any text or page breaks came into this document from thetemplate, delete the text. (Fields in headers and footers can stay.)3) Click File > Send > Create Master Document. Save themaster document in the folder for this project, not in thetemplates folder. We will return to this master document later. For
now, you can either leave it open or close it, as you prefer.

Recommended method for creating master documents

11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 themaster document will override the settings in a subdocument, but only
when the document is being viewed, manipulated, or printed throughthe 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 (veryimportant) by clicking New > Templates and Documents, thenselecting 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 andsave it in the folder for this project.
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 willneed to change the template attached to the existing files. You can dothis manually, or by using the Template Changer extension to OOo;
both methods are described in Chapter 10 (Working with Templates).

Step 4. Insert some information directly into themaster document
The instructions in steps 4 and 5 are for a book that uses page
numbering requirements that are typical of printed books:• No page numbers on cover page or copyright page
• Lower-case roman numerals in the front matter, starting with 1• Arabic numerals in the body of the document, starting with 1

If your book has different requirements, change these instructions tosuit. See “Problem solving” on page 25 for one example.
These instructions are fairly tedious, but once you have the masterdocument set up, you should not have to change it, and with a bit ofpractice setting it up goes quickly.
1) Open the master document and do the following:•
Make sure paragraph marks are showing (you can set them inTools > Options > OpenOffice.org Writer > Formatting
Aids, or click the Nonprinting characters icon ).

12

Working with Master Documents•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 fillin later). With the insertion point in the last blank paragraph on
the page, click Insert > Manual Break. On the Insert Breakdialog 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.

Figure 2: Inserting a page break between
the title page and the copyright page3) 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 in Figure
3. This number 1 will show in your document as i, because thepage style is defined to use Roman numerals.
4) 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 pagestyle, 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.

Recommended method for creating master documents

13

Figure 3: Inserting a page break before
the first page of the front matter

Step 5. Insert the subdocuments into the masterdocument
At last we are ready to add the subdocuments.

Tip

Subdocuments are inserted into a master document before theitem 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) Display the Navigator (click View > Navigator, or press F5, or
click the Navigator icon.
2) On the Navigator, select Text, then long-click on the Insert icon
and click File.

Figure 4: Inserting a subdocument into amaster document using the Navigator
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.
14

Working with Master Documents

The inserted file is listed in the Navigator before the Text item, as
shown in Figure 5.

Figure 5: Navigator after inserting
one subdocument
3) Because the Text section contains the title page and othermaterial you have already inserted, highlight it and click theMove Up icon to move it to the top of the list.
4) Highlight the subdocument you just inserted (Chapter 6), thenlong-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 Figure 6. Save the master document
again.

Figure 6. The Navigator showing a seriesof files in a master document
5) Do this step only if you want to restart page numbering forthe first chapter only. Now highlight each chapter in turn andinsert a Text section before it. When you are done, the Navigatorshould look like Figure 7.

Recommended method for creating master documents

15

Figure 7. The Navigator showing aseries of files and text sections

Tip

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 ofChapter 1.
To restart page numbering, you must insert a manual page
break; but because the Heading 1 style on the first page ofChapter 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.

6) Check whether the first page of the master document has thecorrect page style. If not, change it to the correct style (Title pagein this example).
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).
The first subdocument (Figure 8) 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.

16

Working with Master Documents

Paragraph marker

Section marker

Protected section
containing
subdocument

Figure 8: Page break before subdocument, which is in a
protected section7) Notice that the document is in a protected section. That means
you cannot change any of the contents of this subdocument fromwithin the master document. If you remove the section, thecontents become part of the master document itself; they are nolonger in a subdocument. If you make changes in either the
master document or the subdocument, those changes are notmade in the other document. For more about sections, refer to theonline help or to Chapter 4 (Formatting Pages).
Scroll down until you find the beginning of Chapter 1. You willfind that it is on the same page as the end of the Preface, andthere is a blank paragraph in the text area between the two
sections (the Preface and Chapter 1), as shown in Figure 9.
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.

Section marker at endof previous section
Text area in master document, between sections
Section marker atstart of next section

Figure 9: A text area between two sections of a masterdocument
8) Scroll to the first page of Chapter 2. You’ll find that it is on thesame page as the end of Chapter 1, and there is a blankparagraph in the text area between the two chapters.

Recommended method for creating master documents

17

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.
9) Save the master document again.

Step 6. Add table of contents, bibliography, index
You can generate a table of contents, bibliography, or index for thebook, using the master document. You must insert these items into atext section in the master document. For more about these document
elements, see Chapter 12 (Creating Tables of Contents, Indexes, andBibliographies).
Put the insertion point on the page in the first text section where thetable 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 inthis last text section where the bibliography is to go and create thebibliography.
If you have included index entries in your subdocuments, put theinsertion point on the page in the last text section where the index is togo and create the index.

Editing a master document
After creating a master document, you may want to change its
appearance or contents.

Changing the appearance of the document
You can change the styles in the template as your project develops. Do
not make changes to styles in the master document or in any of the
subdocuments—make those changes in the template.
To update the master document (and all of the subdocuments) withchanges to the template, just open the master document. You will get
two messages: first, to ask if you want to update all links; and second,
if you want to apply the changed styles. Answer Yes to both of thesemessages.
18

Working with Master Documents

Editing subdocuments
You cannot save edits made to a subdocument from within the masterdocument. Instead, you must open the subdocument, either by doubleclicking on it in the master document’s Navigator, or by opening itfrom outside the master document. Then you can edit it just as you
would edit any other document. Just one rule: if you make any changes
to the styles while editing a subdocument, you must copy thosechanged styles to the template so they are available to all of the
subdocuments and to the master document.
If you change the contents of any subdocument, you need to manually
update the table of contents, bibliography, and index from within themaster document.

Cross-referencing between subdocuments
The methods described earlier in this chapter are all most writers willneed when using master documents. However, you might want toinclude automatically updated cross-references between
subdocuments. This section describes how to do this.
The process to create cross-references between subdocuments istedious, but it works.

Preparing items as targets for cross-referencing
Before you can insert a cross-reference to anything that is not
automatically shown on the References tab, such as a heading, youmust prepare or “set” that heading as an item to be referenced. To dothis, you can either use bookmarks or set references.
When you set references, be sure to select the entire text you want touse as the reference, such as a heading or figure number. Keep a list ofwhat you have named the reference fields, and be sure every name isunique. One way to keep track of this information is by putting it in a
separate text file or a spreadsheet.
The field names are case-sensitive. You can check the field name byholding the cursor over the referenced item. In our example (Figure10), the heading has the field name word count.

Cross-referencing between subdocuments

19

Figure 10: Finding the field name for a heading

Using bookmarks
Bookmarks are listed in the Navigator and can be accessed directlyfrom there with a single mouse click. In HTML documents, bookmarks
are converted to anchors that you can jump to via hyperlink.
1) Select the text you want to bookmark. Click Insert > Bookmark.
2) On the Insert Bookmark dialog box, the larger box lists any
previously defined bookmarks. Type a name for this bookmark in
the top box. Click OK.

Figure 11: Inserting a bookmark

Setting references
1) Click Insert > Cross reference.
2) On the References tab of the Fields dialog box (Figure 12), click
Set Reference in the Type list. The Selection list shows any
references that have been defined.
You can leave this page open while you set many headings asreferences.

20

Working with Master Documents

Figure 12: Setting text to be used as a target for a crossreference3) Click in the document and highlight the text of the first heading
to be used as a target for a cross-reference. Click on the Fields
dialog box. The text of the heading will appear in the Value box in
the lower right of the dialog box. In the Name box, type some text
by which you can identify this heading.
4) Click Insert. The text you typed in the Name box now appears in
the Selection list.
5) Repeat steps 3 and 4 as often as required.

Inserting the cross-references
1) Open the master document. In the Navigator (Figure 13), select a
subdocument and click the Edit icon (or right-click and choose
Edit from the pop-up menu). The subdocument opens for editing.

Cross-referencing between subdocuments

21

Figure 13: Selecting a subdocument in the Navigator2) In the subdocument, place the cursor where you want the crossreference to appear. Click Insert > Cross Reference.
3) In the Fields dialog box, on the References page, select Insert
Reference in the Type list on the left hand side. The Selection listin the middle column shows only the reference field names for the
subdocument you are using, so ignore that list and check the list
you created manually in step 1.

Figure 14. Fields dialog box showing manual entry of field
name

22

Working with Master Documents4) In the Name field in the lower right hand column, type the nameof the reference you set in the subdocument you are referring to.
In our example, the reference is in Chapter 3, and its name isword count.
5) Click Insert, type any text you want to appear between thereference and page number (such as “on page”), and then insert
another reference with the Page format. Nothing will appear in
the subdocument except tiny gray bars indicating the fields. If you
hover the mouse pointer over one of these fields, you should see
the field name.

Figure 15: Viewing the field name
(You can turn on the display of field codes by clicking View >Field Names. The two fields shown as gray lines in Figure 15
now look like Figure 16.)

Figure 16. Displaying field codes
6) After you have inserted all the cross-references required in the
subdocument, save and close it and return to the masterdocument window.
Within the master document, navigate to the page of the
subdocument on which you inserted the cross-reference field. You
should now see the text of the cross-reference appear in the spot
where you inserted it, because within the master document, thesubdocument can find the target of that field reference.

Figure 17. Field contents visible

Cross-referencing between subdocuments

23This technique also works if you open a subdocument directly in step 2(that is, not from within the master document) and insert a crossreference field.

Creating one file from a master document
and its subdocuments
Master documents are .odm files containing linked subdocuments,
which are in .odt format. Although linked files are very useful whenwriting and editing a large document such as a book, sometimes you
might need to have a copy of the entire book in one file.
To export a master document to a .odt file (without affecting theoriginal .odm file), do this:1) Open the master document. Choose File > Export from the menubar.
2) On the Export dialog (Figure 18), type a name for the exported.odt file and choose OpenDocument Text (.odt) from the Fileformat list. Click Export. This step changes the .odm file into a.odt file, with each subdocument in a separate section.

Figure 18: Exporting a master document to an
OpenDocument Text (.odt) file3) Close the master document and open the new .odt file, updating
all links.
4) Choose Edit > Links from the menu bar.

Tip

If the Links command is greyed-out, the cursor is probably ina write-protected part of the document (for example, in one of
the linked documents). Move the cursor into a part of the
document that is not write-protected; the Links command thenbecomes available.

5) The Edit Links dialog shows all the linked files. Select all the files
in the Source file list and click Break Link. This step embeds
24

Working with Master Documents

(includes) the contents of all the subdocuments into one single file(but with each subdocument remaining in a separate section) andremoves the write protection on the sections.

Figure 19: Breaking links to include files in one document
6) After breaking the links, you may wish to also remove some or allof the sections. To do that, go to Format > Sections, select thesections you wish to remove, and click Remove. The contents of
those sections remain in the document; only the section markers
are removed.

Tip

The Help does not mention steps 4 and 5 above, giving only
the step for removing the sections. If you have no hidden
sections, that technique works fine and is faster; however, if
you want to break the links but retain some or all of thesections (particularly hidden sections), then the method
described in this chapter is safer.

Problem solving
Some combinations of choices do not work together, and sometechniques that affect master documents are not at all obvious. Thissection describes some problems and what to do about them.

Including a chapter reference in the header of thefirst pageThe problem
If you use the method described in “Step 5. Insert the subdocuments
into the master document” beginning on page 14 (putting a page breakparagraph into the master document between the subdocuments), andyou put a cross-reference to the chapter name and number in the
Problem solving

25

header of the first page of each chapter, then the cross-reference fieldon the first page will pick up the chapter name and number from theprevious chapter. This happens because with this method the first(blank) paragraph on those pages is actually the last paragraph of theprevious chapter. The example did not include a cross-reference to thechapter name and number in the header of the first page, so it did nothave this problem.
First page footers do not have this problem; they correctly pick up thecurrent chapter’s name and number.
The solution
The cure for this problem is as follows:
1) Use File > Templates > Edit to open the template used for the
master document and its subdocuments.
2) Modify the style for the chapter title (usually Heading 1) to enablea page break before, using the page style you want for the firstpage of each chapter. Save and close the template.
3) When you reopen the master document, it should ask twoquestions: “Update all links?” and “Your styles don’t match thetemplate. Do you want to update your files?” Be sure to answer
Yes to both questions.
4) Modify the chapter title style (Heading 1) in the master document
file as you did in the template file in step 2. Save the masterdocument.
5) Open the Navigator in Master Document view and delete the Text
sections between the chapters. Update all links.
The headers on the first page of each chapter will now display thecorrect chapter name and number.
The problem with the solution—and a workaround
This solution creates another problem, if you want to restart page
numbering at 1 on the first page of the first chapter and have pages
numbered sequentially through all the chapters.
Normally you would restart numbering by specifying the starting page
number when you modify the Heading 1 style to start on a new page.
However, if you do that, then each chapter restarts page numbering at
1. (Sometimes this is what you want, but often it is not.)In this case, you will have to include an “offset” in the page number
field—that is, you tell OOoWriter how many pages to subtract to makethe first page of the first chapter to be page number 1. Of course, tomake this work, you need to know how many pages are in the front
26

Working with Master Documentsmatter, and you may not know that until after you have finished theentire book. If you add or delete some pages (for example, if the tableof contents grows from 4 pages to 5), you will need to adjust the offset
accordingly. Therefore, this adjustment is best made at the end of the
project.
Here is how to do it.
1) In the master document itself—not in the subdocument—place thecursor just in front of the Page field on the first page of the firstchapter. Right-click and choose Fields from the pop-up menu.
2) In the Edit Fields dialog box, type a negative even number (–2, –4,etc.) in the Offset box. Click OK to save this change.

Figure 20. Using an offset to start at a different page number
3) You might need to make the same change on the second page ofthe first chapter.

Including landscape pages in a portrait-oriented
master document
The problem
Master documents ignore manual page breaks in subdocuments if themanual break specifies the following page style. Landscape pages areinserted into portrait-oriented documents by inserting a manual pageand specifying a landscape page style (and then changing back toportrait orientation by inserting another manual break and specifying
the following page style). This technique works fine until the document
Problem solving

27

becomes a subdocument within a master document. At that point thelandscape pages become portrait pages and the page break itself isignored.
The solution
1) Remove the landscape pages from the subdocument and put themin a separate document. Note that if the landscape pages are in
the middle of the original subdocument, you will end up with atleast three documents: (a) the portion of the subdocument before
the landscape pages, (b) the landscape pages themselves, and (c)the portion of the subdocument after the landscape pages.
2) Insert documents (a), (b), and (c) individually into the masterdocument.
3) Using the method described on page 14 to include a manual page
break in a text section before and after the landscape document.
If you want portrait headers and footers on the landscape pages, use
the technique described in Chapter 4 (Formatting Pages).

Anchoring pictures to a pageThe problem
A picture (graphic) anchored “to page” in a subdocument is not
displayed in the master document although it always appears correctlyin the subdocument.
Because the master document reorganizes the page flow, page
numbers, and cross-references when it collates all the subdocuments
together, the absolute reference to a page X in a subdocument is lost in
the master document. The picture loses its anchor reference andsimply disappears.
The solution
To avoid this problem but keep pictures positioned precisely on aparticular page, anchor the pictures as follows:
1) Right-click on the picture and choose Picture from the pop-up
menu.
2) On the Type tab of the Picture dialog box (Figure 21), set theanchor to To character or To paragraph.

28

Working with Master Documents

Figure 21. Anchoring a graphic and setting its position on apage3) Under Position, choose suitable horizontal and vertical references
to the page.

Restarting list numbering when using custom styles
The problem
When custom numbering styles are used for lists, the first item in thefirst list in a file may continue numbering from the last list in theprevious chapter.
The solution
You need to explicitly set the first list item to restart numbering at 1.
However, if you right-click on the paragraph and choose Restart
numbering, the setting is not saved when the file is saved. (This works
for other lists in a document, but not the first.)
Here is the secret:1) Right-click on the first list item in the first list in the document
and choose Paragraph, not Restart Numbering.
2) On the Paragraph dialog, go to the Outline & Numbering tab.
Problem solving

293) Under Numbering, choose Restart at this paragraph and 1 forStart with. Click OK to save.
Note: If you do not explicitly choose 1 for Start with, the setting is
not retained.
Unfortunately there seems to be no way to build it into a paragraphstyle.

30

Working with Master Documents