Writer Guide 7.3

Chapter 16,
Master Documents

CopyrightThis document is Copyright © 2022 by the LibreOffice Documentation Team. Contributors arelisted below. You may distribute it and/or modify it under the terms of either the GNU General
Public License (https://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative
Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
All trademarks within this guide belong to their legitimate owners.

Contributors
To this edition
Jean Hollis WeberTo previous editions
Jean Hollis Weber
Bruce Byfield
Klaus-Jürgen Weghorn
David Blymire

Kees Kriek
Gillian Polack
Barbara Duprey

Felipe Viggiano
John A Smith
Ron Faile Jr.

Feedback
Please direct any comments or suggestions about this document to the Documentation Team’s
mailing list: documentation@global.libreoffice.org

Note
Everything you send to a mailing list, including your email address and any otherpersonal information that is written in the message, is publicly archived and cannot
be deleted.

Publication date and software version
Published March 2022. Based on LibreOffice 7.3.

Using LibreOffice on macOS
Some keystrokes and menu items are different on macOS from those used in Windows andLinux. The table below gives some common substitutions for the instructions in this document.
For a detailed list, see the application Help.
Windows or LinuxmacOS equivalent

EffectTools > Options
menu selection

LibreOffice > Preferences

Access setup options

Right-click

Control+click or right-click
depending on computer setup

Open a context menu

Ctrl (Control)⌘ (Command)

Used with other keys

Alt

⌥ (Option) or Alt, depending on
keyboard

Used with other keys

F11

⌘+T

Open Styles deck in Sidebar

Documentation for LibreOffice is available at https://documentation.libreoffice.org/en/Contents
Copyright............................................................................................................................2
Contributors.............................................................................................................................. 2
Feedback.................................................................................................................................. 2
Publication date and software version.......................................................................................2
Using LibreOffice on macOS.....................................................................................................2

Why use a master document?.........................................................................................4
Using the master document Navigator...........................................................................4
Styles in master documents and subdocuments..........................................................5
Creating a master document: scenarios.........................................................................5Starting with no existing documents..............................................................................6
Step 1. Plan the project.............................................................................................................6
Step 2. Create a template.........................................................................................................7
Step 3. Create the master document........................................................................................7
Step 4. Create subdocuments...................................................................................................7
Step 5. Add some pages to the master document.....................................................................8
Step 6. Insert the subdocuments into the master document......................................................9
Step 7. Add table of contents, bibliography, index...................................................................10

Combining several documents into a master document............................................11
Splitting a document into master and subdocuments................................................12
Restarting page numbering............................................................................................13
Editing a master document............................................................................................15
Changing the appearance of the master document.................................................................15
Editing subdocuments............................................................................................................. 15
Adding, deleting, or renaming subdocuments.........................................................................15

Cross-referencing between subdocuments.................................................................16
Preparing items as targets for cross-referencing.....................................................................16
Using bookmarks................................................................................................................ 16
Setting references.............................................................................................................. 17
Inserting the cross-references.................................................................................................18

Creating a master document template..........................................................................19
Creating one file from a master document and its subdocuments...........................20
Anchoring images...........................................................................................................20|3

Why use a master document?
A master document (.odm) is a container that joins separate text documents (.odt) into one larger
document and unifies the formatting, table of contents (TOC), bibliography, index, and othermaterial. Master documents are typically used for producing long documents such as a book, athesis, or a long report. A master document is especially useful in these situations:•

When the file size or number of pages is quite large; writing, reviewing, and editing may
be easier when done on subsets of the full document.

•

When different people are writing different chapters or other parts of the full document.

•

When files will be published as stand-alone documents as well as becoming part of alarger document. The chapters of this Writer Guide are an example of this usage.

•

When subdocuments are used in more than one final document.

You can use several methods to create master documents. Each method has its advantages anddisadvantages. 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.

Tip
A master document is not always the best method to use in any of the situations
given above. You may find that using one big file, or an ordinary document (.odt)
containing sections linked to other files, may do the job just as well. For more about
using sections to combine files, see Chapter 6, Formatting Pages: Advanced.

Using the master document Navigator
In Writer, the Navigator has two forms: one is used in ordinary text documents and the other inmaster documents.
In an ordinary text document, the Navigator displays lists of the graphics, tables, index entries,
hyperlinks, references, and other items in the document, as shown on the left in Figure 1.

Figure 1: The Navigator for a text document (left) and for a master document (right)

4|

In a master document, you can toggle between the regular and master views by clicking on the
Toggle Master View icon at the upper left. In the master view, the Navigator lists the
subdocuments and text sections, as shown on the right in Figure 1. The use of the Navigator in amaster document is covered in more detail later in this chapter (see “Step 6. Insert thesubdocuments into the master document” on page 9 and “Combining several documents into amaster document” on page 11).

Styles in master documents and subdocuments
A stand-alone document becomes a subdocument when it is linked into a master document. A
document can be used as a subdocument in several master documents. Each master document
may have different style definitions (font, type size, color, page size, margins, and so on), which
affect the appearance of the final document, but the individual documents retain their original
characteristics.
The relationship between styles in a master document and its subdocuments is as follows:•

Custom styles used in subdocuments, such as paragraph styles, are automaticallyimported into the master document.

•

If more than one subdocument uses a custom style with the same name (for example,
myBodyText), then only the one in the first subdocument to be linked is imported into themaster document.

•

If a style with the same name exists in the master document and in the subdocuments(for example, Default Style), then the style is applied as defined in the master document.

•

The styles in the subdocuments are only changed in the master document, so when asubdocument is opened for editing the original styles are not affected.

Tip
If you use the same document template for the master document and its
subdocuments, the subdocuments will look the same when they are loaded into themaster document as they do when viewed as individual files. When you modify orcreate a style, be sure to make the change in the template (not in the masterdocument or any of the subdocuments). Then when you reopen the masterdocument or a subdocument, the styles will update from the template.

Creating a master document: scenarios
Which method you choose from the three most common methods for creating a masterdocument depends on the current state of your document:•

You have no existing documents but intend to write a long book containing several
chapters, possibly by multiple authors.

•

You have several existing documents (chapters) by one or more authors that you want to
combine into one book, controlled by the master 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.

We will look at each of these scenarios in turn.

Creating a master document: scenarios | 5

Starting with no existing documents
When you start with no existing documents, you can set up everything the way you want from the
beginning. Follow these steps, in the order given. Each step is explained in detail in the following
subsections.
Step 1. Plan the project
Step 2. Create a template
Step 3. Create the master document
Step 4. Create subdocuments
Step 5. Add some pages to the master document
Step 6. Insert the subdocuments into the master document
Step 7. 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 correct any problems later. Here are some things you need toplan.
Parts of book or report required. What pages will be in the master document and what will be in
the subdocuments? 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 7

Subdocuments

Index

In master document

Page, paragraph, character, frame, and numbering styles. Determine the styles you wish touse. See Chapter 8, Introduction to Styles, and Chapter 9, Working with Styles, for instructions
on how to create or modify styles and examples of the use of styles in book design. Pay
particular attention to setting up headings using styles, as described in “Using paragraph styles todefine a hierarchy of headings” in Chapter 8.
Fields and AutoText entries, as required. See Chapter 2, Working with Text: Basics, andChapter 17, Fields, for ideas.
One or more templates for master and subdocuments. If you are starting a new project,create the master document and all the subdocuments from the same template. Not using thesame template can create style inconsistencies that could cause your document not to look as
you expect. 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.
Page numbering. In our example, the pages are numbered sequentially from the title page. (Thetitle page style can be defined not to show the page number, but it will still count as page 1.)
Therefore the first chapter begins on a higher number page, for example page 5. To create abook in which the page numbering restarts at 1 for the first chapter, you need to do some
additional work. See “Restarting page numbering” on page 13.

6|

Step 2. Create a template
You can create a template from an existing document or template that contains some or all of thepage, paragraph, character, and other styles you want for this document, or you can create thetemplate from a blank document. For more about templates, see Chapter 10, Working with
Templates. Be sure to use File > Save As Template when creating the template.

Tip
You can also create master document templates; see page 19.

Step 3. Create the master document
It does not matter in what order you create the master and subdocuments, and you do not haveto 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.
Follow this process to create the master document:
1) Open a new document from the template you created in Step 2, by choosing File > New> Templates, 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 isnot, 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.
(The TOC, index, and any fields in headers and footers can stay.)3) Click File > Send > Create Master Document. Save the master document in the folder
for this project. We will return to this master document later. For now, you can either leave
it open or close it.

Note
Using File > New > Master Document will create a master document file (.odm)
associated with the default template. If your document is, or will be, based on acustom template, use the method described above.

Tip
You can also create a master document directly from a master document template;see page 19.

Step 4. 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. It can still
be used as a stand-alone document. Some settings in the master document will override thesettings 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 choosing File
> New > Templates, then selecting the required template.
2) Delete any unwanted text or other material that was brought in from the template, 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 thisproject.
Starting with no existing documents | 7

If you already have some of the chapters written, the files may not be based on the template you
just created for this project. Although you can use the existing files as subdocuments as they are,you may want to change the template attached to those files; if so, use the technique describedin “Associating a document with a different template” in Chapter 10, Working with Templates.

Step 5. Add some pages to the master document
To assist you, do the following:•

Make sure paragraph marks are showing. You can set them in Tools > Options >LibreOffice Writer > Formatting Aids, or click the Toggle Formatting Marks icon on
the Standard toolbar, or press Ctrl+F10.

•

Show text boundaries, table boundaries, and section boundaries (Tools > Options >LibreOffice > Application Colors).

If your master document does not contain any required “front matter” such as a title page,
copyright page, or TOC page, add them now. The example in this section uses the sequence ofpage styles given in “Step 1. Plan the project” on page 6.
1) Open the master document (.odm file) you created and type the contents of the title page(or leave placeholders and fill in later). With the insertion point in the last blank paragraphon the page, click Insert > More Breaks > Manual Break. On the Insert Break dialog,
select Page break and the page style for the second page (Copyright Page in our
example), and leave the Change page number option deselected. Click OK.

Figure 2: Inserting a page break between thetitle page and the copyright page2) Type the contents of the copyright page (or leave placeholders). With the insertion pointin the last blank paragraph on the page, use the same method to insert another manual
page break, this time setting the page style to Table of Contents page.
3) On the Table of Contents page, leave a blank paragraph or two or insert a TOC (Insert >Table of Contents and Index > Table of Contents, Index or Bibliography). The TOC
will not have any contents until you add the subdocuments, but a gray mark or box
indicates its location. For more about inserting and formatting TOCs, see Chapter 15,
Tables of Contents, Indexes, Bibliographies.

Note
Depending on the style definitions for the first paragraph (usually a heading) on the
Copyright and TOC pages, you may not need to insert manual page breaks.

8|

Step 6. Insert the subdocuments into the master document
Now we are ready to add the subdocuments.

Tip
Subdocuments are inserted into a master document before the item highlighted in
the Navigator. If you insert the last subdocument first, and then insert the othersubdocuments 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 the Navigator icon on the Sidebar).
2) Be sure the Navigator is showing the Master View (see “Using the master document
Navigator” on page 4). If necessary, click the Toggle Master View icon at the upper left
to switch between regular and master views.
3) On the Navigator, select Text, then click Insert > File on the Navigator toolbar, or rightclick on Text and select Insert > File in the context menu.

Figure 3: Inserting a subdocument into amaster document using the Navigator
A standard file browser dialog opens. Select the required file (which you created in Step 4)and click Insert. This example uses seven chapters; we will load Chapter 7 first, assuggested in the Tip above.
The inserted file is listed in the Navigator before the Text item, as shown in Figure 4.

Figure 4: Navigator after inserting one subdocument
4) Because the Text section contains the title page and other material, highlight it and click
the Move Up icon to move it to the top of the list. (Or, highlight the subdocument you justinserted (Chapter 7) and click the Move Down icon to move it below the Text section.)
5) Highlight the subdocument you just inserted (Chapter 7), then click Insert > File to insert
the first subdocument; in this example, Chapter 1. Chapter 7 remains highlighted. Repeat
with Chapter 2, Chapter 3, and so on until all the subdocuments have been added to thelist. You can insert several several files at the same time. The Navigator will now looksomething like Figure 5.
6) Save the master document again.

Starting with no existing documents | 9

Figure 5: The Navigator showing a seriesof files in a master document

Step 7. Add table of contents, bibliography, index
You can generate a table of contents, bibliography, or index for the book, using the masterdocument. You must insert these items into a text section in the master document. For more
about these document elements, see Chapter 15, Tables of Contents, Indexes, Bibliographies.
In case you did not insert a table of contents in step 5, position the cursor on the page in the firsttext section where the table of contents is to go and choose Insert > Table of Contents andIndex > Table of Contents, Index or Bibliography to create it.
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 thislast 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 inthe last text section where the index is to go and create the index.
Figure 6 shows the Navigator after addition of a TOC and index.

Figure 6: Navigator showing subdocuments, table ofcontents, and index in a master document

10 |Combining several documents into a master document
When you have several existing documents, you can combine them into one document controlled
by a master document.
This method works best when all of the documents were created from the same template, but
you can also use it when the documents have been created from different templates. Thismethod is especially useful when the subdocuments are created or maintained by multiple
writers. For example, you might be creating an anthology of short stories, a book of symposium
papers, or a set of engineering test results with a standard company title page.
We will use a book of engineering test results as an example.

Tip
You could create a master document template (see page 19) and use it as thestarting point for this method. In that case, skip steps 1 and 2 and start with step 3.
1) Open the title page document that you plan to use as the master document. To avoid
creating too many subdocuments when this document is converted to a masterdocument, have only one level 1 heading present. If there are more, temporarily change
them to lower level headings and note which they are (add, for example, an asterisk at
the end of each heading to remind you which have to revert to level 1 headings later).
2) Select File > Send > Create Master Document, name and save this master document(see “How to do it” on page 13).
Let us assume the original document was named FrontPage with a single Level 1
heading, and that when we created the master document (.odm file) we named it TestFile.
In this case, the master document is a blank file containing only one section. Also createdat the same time was a subdocument named TestFile1, which is a .odt file containing thetext from the FrontPage file. When you open the .odm file and click Yes to update alllinks, this file is linked in to the master document to provide the original content.
The original FrontPage file is left intact in its folder.

Figure 7: TestFile documents created from FrontPage
3) Open the master document and click Yes to update links. The master document openswith the Navigator showing by default (see “Using the master document Navigator“ onpage 4 and “Step 6. Insert the subdocuments into the master document“ on page 9 formore detailed information).
4) Click Insert > File.

Combining several documents into a master document | 11

Figure 8: Adding files to the master document
5) Navigate to the location of the test results files (Results1.odt, Results2.odt, and so on).
Select the first file to insert, Results1.odt for example, and click Insert. The file is inserted
above the existing entry.
6) Click the Move Up icon to have the TestFile1 text above the Results1 text (file contents
are inserted above the selected file in the master document).
7) Repeat from step 4 as often as required. It does not matter which file is highlighted in themaster document when you insert the next one, just select the inserted file and use theMove Up or Move Down icons to position it as required.

Figure 9: Moving subdocuments
8) To edit the master document, to perhaps add a widget serial number and a client's name,in the master document right-click TestFile1.odt and select Edit in the context menu. Add
the required content to the file that opens, save and close the file (see “Editing a masterdocument” on page 15 for more detailed information).
9) Select Tools > Update > Links on the Menu bar, or click Update > Links in the
Navigator and click Yes to confirm. All the edits in the master document will now show.

Splitting a document into master and subdocuments
When you have one existing document that you want to split into a master document and several
subdocuments, you can have Writer split the document automatically at headings with an outline
level of your choice.
Although this method is quick and easy, some cleanup work may be necessary:

12 |

•

The automatically generated file names for the subdocuments are 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 file names will not directly correspond to the chapter
numbers. You may wish to rename the subdocuments; see “Adding, deleting, or
renaming subdocuments” on page 15.

•

If the original document is associated with a template, the master document (.odm) isalso associated with that template, but the subdocuments are not. The subdocuments
inherit the styles in the original document, but their association with the template is lost.

How to do it1) Open the document and choose File > Send > Create Master Document.
2) On the Name and Path of Master Document dialog (Figure 10):a) Navigate to the folder where you want to save the master document and its
subdocuments (or create a new folder).
b) Type a name for the master document in the File name box.
c) In the separated by: list, choose the outline level where the file should be split into
subdocuments. Usually this is Outline: Level 1 for a chapter heading, but yourdocument may be structured differently. For more information about outline levels,
see “Using paragraph styles to define a hierarchy of headings” in Chapter 8,Introduction to Styles.
d) Leave the Automatic file name extension option selected, and click Save to split
the document into subdocuments and create the master document.

Figure 10: Splitting a document into master and subdocuments
If you selected Outline: Level 1 and the paragraph style at that level is Heading 1, each of the
subdocuments begins with a Heading 1 paragraph.

Restarting page numbering
The examples in the previous sections showed a very basic collection of files with sequential
page numbering. This is useful for many documents, including e-books, but a typical printed bookhas the following sequence of page numbers:•

No page numbers on cover page or copyright page.

•

Lower-case roman numerals in the front matter, starting with i.

•

Arabic numerals in the body of the document, starting with 1.

•

Page numbering sequential through the rest of the book.

To set up a master document to produce such a book, you need to define a different paragraphstyle for the heading of the first chapter and assign two special characteristics to it.
Restarting page numbering | 13

Example
Each chapter may start with a Heading 1 paragraph, set up in the Breaks section of the Text
Flow tab of the Paragraph Style dialog to start on a new page (Figure 11). The Page number
checkbox is not selected, so numbering continues from the number of the previous page.

Figure 11: Breaks section of Text Flow tab of
Paragraph Style dialog for Heading 1
Look on the Outline & List tab (Figure 12) of this dialog to see what outline level Heading 1 isassigned to. Usually this will be Outline level: Level 1. The level cannot be changed here
because it has been set in Tools > Chapter Numbering.

Figure 12: Outline & List tab of Paragraph Style
dialog for Heading 1
Only one paragraph style can be assigned to Outline Level 1 through Tools > Chapter
Numbering. However, you can assign additional paragraph styles to any outline level by using
the Outline & List tab on the Paragraph Style dialog.
Therefore, you want to define a style called Heading 1 Chapter 1 that is identical in appearance
to Heading 1 but has one essential difference:
1) Right-click Heading 1 in the Paragraph Styles section of the Styles tab in the Sidebar, andselect New. On the Organizer tab of the Paragraph Style dialog, name the new style,select the next style, and be sure Inherit from shows Heading 1.

Figure 13: Organizer tab for the new style2) On the Text Flow tab, in the Breaks section (Figure 11), select Insert, Type: Page,
Position: Before, With Page Style: First Page, and Page number: 1.
3) On the Outline & List tab, set the Outline level to Level 1 (Figure 14). This ensures thatthe heading will appear in the Table of Contents along with the other chapter headings.

14 |The List Style for this heading is No List, as it was not assigned an outline level throughthe Outline Numbering dialog.

Figure 14: Assign the style to Outline level 14) Now, assign the new style to the first paragraph of Chapter 1, and you’re done.

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

Changing the appearance of the master document
You can change the styles in the template as your project develops. Do not make changes tostyles in the master document or in any of the subdocuments; make those changes in thetemplate.
To update the master document (and all of the subdocuments) with changes to the template,
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 these messages.

Editing subdocuments
You cannot edit a subdocument from within the master document. Instead, you must open the
subdocument, either by double-clicking 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 otherdocument.
If, while editing a subdocument, you want to make changes to the styles that apply to the masterdocument, see “Changing the appearance of the master document” above.
If you change the contents of any subdocument, you need to manually update the table ofcontents, bibliography, and index from within the master document.

Adding, deleting, or renaming subdocuments
To add a subdocument, follow the method described in “Step 6. Insert the subdocuments into themaster document“ on page 9.
To delete a subdocument, right-click its file name in the Navigator and choose Delete.
If you rename a subdocument by changing its file name, the next time you update links in themaster document, that subdocument will show up in the Navigator as a broken link (shown inred). To fix this, you can either change back the name of the file (the link will be restored in thenext update) or follow these steps:
1) Right-click the broken link in the Navigator and choose Edit link.
2) In the Edit Sections dialog (Figure 15), select the renamed file, and edit the name of thesection (which is the name shown in the Navigator).
3) Click OK to save the changes.

Editing a master document | 15

Figure 15: Editing a link in a master document

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

CautionThe method described does not work well if the subdocuments will be used
standalone as well as within a master document. As shown in Figure 20 on page 19,
the cross-reference will show as an error in a standalone document, but it will showcorrectly in the master document.

Preparing items as targets for cross-referencing
Before you can insert a cross-reference to a heading, figure, or other item in another document,
you must prepare that item as a target for cross-referencing. To do this, you can either use
bookmarks or set references. Bookmarks can be used only for location references such as page
numbers, not for text references; set references can be used for text (such as headings or figure
captions) as well as location references.

Using bookmarks
Bookmarks are listed in the Navigator and can be accessed directly from there.
1) Select the text you want to bookmark or click in the required place in the text. Choose
Insert > Bookmark on the Menu bar.
2) On the Insert Bookmark dialog (Figure 16), the larger box lists any previously definedbookmarks. Type a name for the new bookmark in the top box. Click Insert.

16 |Figure 16: Inserting a bookmark

Setting references
When you set references, be sure to select the entire text you want to use as the reference, suchas a heading or figure number. Keep a list of your names for the reference fields, and be sureeach name is unique. One way to keep track of this information is to save it in a separate file.
The field names are case-sensitive. You can check the field name by holding the cursor over thereferenced item. In our example (Figure 17), the heading has the field name word count.

Figure 17: Finding the field name for a heading
Open the subdocument in which you want to set references.
1) Click Insert > Cross-reference.
2) On the Cross-references tab of the Fields dialog (Figure 18), click Set Reference in theType list. The Selection list now shows any references that have been defined. You canleave this tab open while you set many headings as references.
3) Click in the document and highlight the text of the first heading to be used as a target fora cross-reference. Click on the Fields dialog. The text of the heading will appear in the
Value box in the lower right of the dialog. 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, keeping a note of your references as needed.
6) Repeat for other subdocuments if wanted. Click Close to save and exit the dialog.

Cross-referencing between subdocuments | 17

Figure 18: Setting text to be used as a target for a cross-reference

Inserting the cross-references
1) Open the master document. In the Navigator, select a subdocument, right-click andchoose Edit in the context menu. The subdocument opens for editing.
2) In the subdocument, place the cursor where you want the cross-reference to appear.
Click Insert > Cross Reference.
3) On the Cross-references tab of the Fields dialog (Figure 19), select Insert Reference in
the Type list on the left. The Selection list on the right shows only the reference fieldnames for the subdocument you are using, so ignore that list and check the list you
created manually in “Preparing items as targets for cross-referencing” above. SelectReference in the Insert reference to list.

Figure 19: Fields dialog showing manual entry of field name18 |4) In the Name field in the lower right, type the name of the reference you set in the
subdocument you are referring to. In our example, the name of the reference is word
count.
5) Click Insert, type any text you want to appear between the reference and page number(such as “on page”), and then insert another reference with Page in the Insert reference
to list. The cross-references will show an error as shown in Figure 20. When you hover
the mouse pointer over one of these fields, you will see the field name.
(You can turn on the display of field codes by clicking View > Field Names. The two error
fields shown in Figure 20 now look like Figure 21.)6) After you have inserted all the cross-references required in the subdocument, click Closeto save it and return to the master document window.

Figure 20: Viewing the field nameFigure 21: Displaying field codes
Select Tools > Update > Links on the Menu bar, or click Update > Links in the Navigator. All theedits in the master document will now show. Within the master document, navigate to the page ofthe subdocument on which you inserted the cross-reference field. You should now see the text ofthe cross-reference appear in the spot where you inserted it. If it does not work, save the masterdocument, close it, and open it again, updating the links. (If you open the subdocument forediting, the error message in Figure 20 will be shown.)

Figure 22: Field contents visible
This technique also works if you open a subdocument directly in step 2 (that is, not from within
the master document) and insert a cross-reference field.

Creating a master document template
A master document template is created in much the same way as any other template, describedin Chapter 10, Working with Templates:
1) First, create the master document using File > Send > Create Master Document, as
described in earlier sections of this chapter.
2) Then, use File > Templates > Save as Template to create the template (.otm), which willthen be listed in the Templates dialog along with other templates.

Creating a master document template | 19

TipInclude in the name you give a master document template some indication that it is
not an ordinary template.

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 when writing and editing a large document such as a book,sometimes you might need to have a copy of the entire book in one file, for example whensending it to a publisher.
To export a master document to a .odt file (without affecting the original .odm file):
1) Open the master document and update all links. Choose File > Export on the Menu bar.
2) On the Export dialog (Figure 23), type a name for the exported .odt file and choose ODF
Text Document (.odt) in the File format list (it should be the default choice). ClickExport. This step creates an .odt file, with each subdocument in a separate writeprotected section.
3) Close the master document and open the new .odt file, updating all links.
4) To break the links and remove the write protection, go to Format > Sections, select thefirst item in the Section list, then Shift+click on the last item in the list in order to select all
the items. Deselect both Link in the Link section and Protect in the Write Protection
section.
5) Click OK.

Figure 23: Exporting a master document to an Open Document Text (.odt) fileIf you wish to eliminate some or all of the sections to have a plain text document, select thesections you wish to remove, and click Remove. The contents of those sections remain in the
document; only the section markers are removed. Click OK.

Anchoring images
An image (graphic) anchored “to page” in a subdocument is not displayed when the
subdocument is opened as part of a master document. 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 themaster document. The image loses its anchor reference and simply disappears.
In contrast, an image anchored “to page” in a text section of a master document stays with thatpage and does not move if the length of subdocuments changes. The image may then end up ona page somewhere in the middle of a subdocument, not where you want it to be.
20 |To avoid these problems but keep an image positioned precisely on a particular page, anchor theimage as follows:
1) Right-click the image and choose Properties in the context menu.
2) On the Type tab of the Image dialog (Figure 24), set the anchor to To character or To
paragraph.
3) Under Position, choose suitable horizontal and vertical references to the page. Click OK
to save the changes.

Figure 24: Anchoring an image and setting its position on a page

Anchoring images | 21