OOo Off the Wall: Master Documents
If you are an MS Word user, and we all have secret shames in our pasts, you may have fallen into the habit of avoiding master documents--and for good reason. Master documents in MS Word can crash and corrupt sub-documents unless they are used so carefully that there is hardly any reason to use them at all.
But if you have this habit of avoiding master documents, you can change it when you use OpenOffice.org Writer. Master documents in Writer are much more stable. They are not immune to crashes, but unless a master document's size exceeds the available RAM on your computer, you may never see one. This stability frees master documents in Writer to be what they were meant to be: a way to organize and write long documents more efficiently.
Master documents are documents that manage and organize other Writer documents. They consist of a series of links to individual sub-documents that can be opened only when needed. They offer a savings in overhead that is noticeable even on today's high-RAM machines.
When a master document is opened, sub-documents are added to it as sections. As each sub-document is opened, it is reformatted and repaginated using the master document's styles and other settings. In particular, any numbering sequences become continuous. For instance, if a paragraph style is numbered 4 in one sub-document and the next occurrence of the style is in the next sub-document, then the next occurrence is numbered 5 in the master document. This occurs even if that paragraph style originally was numbered 1. The sub-documents then can be printed or exported as a single document.
What makes master documents useful is these changes apply only within the master document. If you save the sub-documents as part of a master document and then open them again as separate documents, they revert to their original formats and page numberings.
Master documents are useful in several circumstances:
If your computer's memory is limited: Experiment to find the maximum document size that your computer can handle without grinding. Sub-divide your document into files equal to or smaller than the maximum size. Only assemble your documents into a master document when you are ready to print.
When material has to be used in different places: A file can be used in any number of master documents, so you can re-use it as needed. However, because the master document formatting takes precedence over sub-document formatting, either try to ensure that all the master documents using the same sub-document have the same formatting, or be careful not to save a file while more than one master document is open.
When a document is divided into chapters: You then can use the special master document view in Navigator to help move around and work with the shorter sub-documents instead of the long document. In other words, the master document becomes a floating window that stores the documents to which you are most likely to refer.
You want two or more documents that are similar except in some parts: You can add all the files for all the documents and then hide or un-hide individual sub-documents before printing or exporting.
Master documents are built from three sources:
Separate files, or sub-documents: Sub-documents are treated as sections of the master document and have the same options as sections within a normal document. Within the navigator, sub-documents are listed by their file names.
Text: Areas before, between or after the sections for sub-documents. Although anything can be added to text areas in a master document, putting a lot in them defeats the purpose of using a master document in the first place. In a well-planned document, you should generally not need to use extra text. Here's another reason to avoid them: text areas are listed in the master document view in the Navigator with the unhelpful title of "Text". The main use for text areas is spacers between separate files for pagination.
Indexes and tables: Inserted into text areas of the master document, indexes and tables such as Tables of Contents and Alphabetical Indexes can provide references to the contents of sub-documents.
Master documents simplify the management of long documents. However, using them to their full advantage still requires some organization. Here are some suggestions for working with master documents and getting the most from them:
To minimize the chances of formatting problems, use the same template to create the master document and all its sub-documents. If some documents are used in more than one master document, try to make sure that all of the master documents use the same template, too. If using the same template is not possible for some reason, consider adding the sub-document as an OLE Object instead, using Insert > Object > OLE Object to preserve its formatting.
Whenever possible, place each master document and all of its sub-documents in the same directory. A convenient strategy is to place the sub-documents in a sub-directory of the folder that holds the master document. Use another sub-directory for graphics. If some documents are used in more than one master document, create a sub-directory only for them.
Ordinarily, you probably want each part of a master document to start on a separate page. You can set up this format automatically by using the Breaks section on the Text Flow tab to start a new page after:
The Heading paragraph style for each index and table, for example, Contents Heading for a Table of Contents.
The first paragraph style used in each sub-document, probably Title, Heading 1 or possibly a created style called something like Chapter Number.
The convention is to start each new part of a long document on a right, odd-numbered page. Open a book, and you will see why: most readers' eyes fall on the right page first. Because the start of a new part is one of the main guides for finding information, you want it to be as prominent as possible. To ensure that the parts start on a right page, start at the beginning and go through the master document, adding manual page breaks in the Text areas wherever they are needed. Starting each part on a new page also minimizes reformatting.
Aside from tables, indexes and page breaks, minimize the content that is added to the master document directly. Add it to the sub-documents instead. The more content added directly to the master document, the less flexible it becomes.
Because of the kludges required to add some cross-references to a master document, place them in a paragraph of their own to prevent unexpected reformatting in the master document.
Use page styles and/or manual page breaks to use different numbering for different parts of the master document. For example, one common format is to use lowercase Roman numerals for front matter, such as copyright pages and tables of contents, and Arabic numbers for the main text. And often, numbering is restarted with the main text.
-- Bruce Byfield (nanday)
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Linux-Based X Terminals with XDMCP
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- You Need A Budget
- Parallel Programming with NVIDIA CUDA
- The Linux powered LAN Gaming House
- Validate an E-Mail Address with PHP, the Right Way
- RSS Feeds
- Python for Android
- Why Python?
- I didn't knew this thing by
4 hours 24 min ago - Author's reply
7 hours 48 min ago - Link to modlys
8 hours 55 min ago - I use YNAB because of the
9 hours 6 min ago - Search
14 hours 9 min ago - Question
14 hours 32 min ago - for the record
14 hours 35 min ago - That's disappointing. Thanks
16 hours 58 min ago - Well spotted. I've corrected
18 hours 27 min ago - This is a great program. We
21 hours 27 min ago





Comments
This is a useful series
Bruce, could you convince LJ to provide links to your other OOo Off the Wall articles when you publish a new one? These are the kind of articles I want to refer back to on occasion, and it would be nice to have a collection page to add to the ol' bookmarks.
is this close enough to what you want?
http://www.linuxjournal.com/user/800902/track