Contents master document level

Writing in .odt document, template- and style-based (however only the real styles - not those implemented to mimic a style), LO Writer 24.2.7.2.

I orientate on Writer 24.2 Guide and refer here to two recommendations the Writer Guide makes.
Chapter 16.
Recommendation 1: Figure 1
Recommendation 2: Section “Starting with a master document template”

Former one means to place stuff like Cover, Foreword, TOC, indices, Bibliography, back cover in master document - not in its template. Latter recommendation reads “Ideally, the template should contain […], the document’s front and back covers, the table of contents, and other parts of the final document”. As these two statement are not in-line to each another the question is: which one of these two should be followed with higher priority?

The question is also if placing these contents types directly to master document template is really better than doing it in master document itself. I mean as long as sub-documents are not inserted to master document (not to mention the case these don’t exist) the fields like TOC, etc. will be blank, or will present some code in best case. In case of template I think it will look yet worse: template will never insert sub-documents.

Addition to Figure 1:

1 Like

Both recommendations interfere with each other but are not contradictory.

The problem comes from the definition of a master document template.

A template in Writer is a special document used to initialise a common one. A template has extension .ott. When you open it, it instantly turns into an .odt with default Untitledx.odt filename. This means that any modification you make to it will not overwrite the .ott, protecting it for later usage.

Therefore, you can put in your template a “skeleton” for the future book with cover, licence, TOC, dummy topic page, indexes, bibliography, … It is easier to remove and delete things than to add consistent parts. I don’t mention styles which are the primary reason for templates and the only reliable way to maintain uniformity across a collection of documents.

The relationship between a document and a template is not broken after creation. When you modify styles in a template, you are asked if you accept the changes in styles on next document open. A positive answer updates the local copy of styles in the document. Note that initial contents is never updated because it could result in loss of data.

A master document is different. It is a kind of binder referencing existing (sub-) documents for dynamic inclusion. Subdocs are not copied, only referenced, which means you always get the latest state.

A master contains its specific, unique text: cover, TOC, unique chapters and references shared material .

A master can be based on a template, so that style changes are forwarded to the master. But there is no UI way to do that. You must “cheat” with TemplateChanger extension to force reference to a template.

Remember that creating a document from a template gives an .odt only, not an .odm. This makes use of TemplateChanger mandatory.

The notion of master document template would make sense if you repeatedly create masters with the same structure, i.e. master template → .odm. Then an initial list of subdocz could be forwarded to the created master. To the best of my knowledge, this is not possible and likely not planned.

Here LO 24.8.4.2

1 Like

Thanks for hints. I am checking what these mean for my question.

https://books.libreoffice.org/en/WG72/WG7216-MasterDocuments.html#toc12
cit.

Step 3. Create the master document

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.

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 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. (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.

https://books.libreoffice.org/en/WG72/WG7216-MasterDocuments.html#toc7
cit.
Tip

[…] When you modify or create a style, be sure to make the change in the template (not in the master document or any of the subdocuments). Then when you reopen the master document or a subdocument, the styles will update from the template.


Few more citations:

  1. A stand-alone document becomes a subdocument when it is linked into a master document.
  2. 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. Chapter 16, Master Documents

Conclusion for me: Every time myself will encounter term “subdocument” in Writer documentation I will consider/see a that document as seen through master-document glasses; not its presentation in stand-alone mode.

As far as particular case here is considered the set of template, master, sub-documents are used for one single writing. Future works will get new framework.
TOC, indices, Bibliography, back cover in master document are master document-specific. These can’t become inconsistent. Cover, Foreword will be handled and merged to final document form by means external to Writer.