The Master document and the styles and templates -- practical use and logic

hi,

I’m curious… if my understanding is correct :slight_smile:

#1. When we create a Master Document (MD),
It’s kind of blank in terms of styles… It has the default ones, but it’s ready to change.
It will take “the shape” of the first document imported, i.e. its linked template will be linked.

#2. When that template is being modified, the MD will not update (or offer to update)…
That linking was just a one time action.
If you want it updated, you have to load that style in overriding mode.

#3 A Masted Document Template (MDT) can be created, but there’s no way that
a template being updated would reflect in both the sub documents and the MD.
Cause the MDT is only for MDs…

#4 Thus, a MD is a centaur…
half of it it works as a project template…
which you can only modify directly (by changing its embedded styles, or by loading an external template overriding lots of stuff in the embedded styles at once)

and the other half of it a document with linked subdocuments…

The only point in having a MD being that NAVIGATOR behaves differently (better),
and the entire UI works differently, too… (you can have a different toolbar)


#5. In Your OPINION (I’m asking cause I’m really not sure)…

…wouldn’t it be more logical if a MD would update its styles when a linked template’s styles have been modified?

Peter

No, if you consider a special use-case: I write several documents like article for a newspaper, a presentation for an exhibition etc. for different destnations. Now I wish to use the individual “sections” to be part of my new book. So while Ibuse the same names frome heading2 to emphasize I wish to redefine styles in the book.
.
So style should only update, if the styles in the Master-Document are updated in a Template used to create the MD, but not from imported sections.
.
If the only cause to use a Master is reducing the size of the individual chapter to reduce necessary memory, this concept may seem unnecessary.

2 Likes

thank you,

||| edited (for brevity)

THANK YOU * * *
For pointing it out that the MD templates (“MDT” with the rare extension of “otm”) actually work as expected!

This is something not really covered in the Writer Guide!!

Sounds convincing!! :slight_smile:
I would even “extend” your argument:
A MASTER document is “Master” meaning also that it’s top level in terms of everything in that book / project…
Nothing should override anything in a Master document! :slight_smile:

ALSO: imagine that 1 year later you want to reprint it, or edit it for a 2nd edition…
If anything had changed in the template linked to the subdocument that had been first imported into the MD, the book’s styles would be changed.

A MASTER should really be above all…

THANKS for helping me (and hopefully others in the future too ) see it more clearly! :slight_smile:

Have you read the chapter in the Writer Guide about Master documents? It may answer many of your questions.

1 Like

Which ones do you mean?

Have a look at:

Master documents in Writer and

Chapter 16, Master Documents

I have…

That’s how I got my “understanding”… which I wanted to test here with people who are more experienced than me…

I’ve read it not for the first time…
it’s like a programming language’s reference… you keep going there all the time… whenever you do something…

Let’s take questions one by one.

1 Master document creation

A master document is always created fresh, i.e. it inherits from the bare default factory template. There is no UI to base a master on a user template. The only way to link a master to a template is to use the TemplateChanger extension.

A master doesn’t “take the shape” of the first imported document. When scanning the sub-documents, if the master sees an unknown style (in its current dictionary), it imports this style into its dictionary. If the sub-documents contain conflicting style definitions, the one defined in the master or the first met sub-document will be used.

Formatting a collection of master+sub-docs is based on style names and the definition in the master is the one in effect. This allows many “interesting” tricks but they are advanced usage.

2 Template modification propagation

Template modification propagates only to the document based on the template. A document is “based on a template” if it was created with File>New>Templates (or if rebased by TemplateChanger). Double-clicking on an .ott template initialises the document with template contents but does not keep the relationship.

Thus, a sub-document will be updated but a standard master won’t (because the standard UI doesn’t allow to base a master on a template). Only TemplateChanger can alter a master to associate it with a template.

3 Template-based master

There is no “master document template” (unless you mean “template” as an initial file you duplicate to start your document, but this is not what LO technically defines as a template; a template is an .ott document which has special properties, creating initialised .odt files, never .odm).

If your template has “initial contents” (besides styles), create a standard document from it and save it as a master. Use then TemplateChanger to re-establish the link with the template. Without initial contents, apply immediately the TemplateChanger step.

4 Centaur ?

I don’t think so.

But using master+sub-docs, all based on templates (not necessarily the same – don’t do it in the beginning, this is very advanced usage), requires a very strict discipline where you exclude any direct formatting. Direct formatting is a hindrance in “ordinary” documents but becomes hell in master+subs context.

If you want your template to be the formatting conductor, you must not under any circumstance alter your styles in the master or the subs. This must be done only in the template, which implies many close-reopen steps while you’re still hesitating on the look of your styles.

One last advice: don’t name your styles for their visual effects. If you decide for a radical different look, your name is no longer valid. Adhere to the semantic styling method where style names designate the role of the paragraph, character, page, frame, list in the discourse, the significance of such objects. Thus the name is still relevant after appearance has changed.

5 Template change propagated to master

This is possible and highly desirable. But it is not offered by out-of-the-box LO. You must install TemplateChanger and apply a small procedure.

2 Likes

Wow!
I was convinced of the opposite! Even seeing you explanation I expected you to be wrong :slight_smile: :slight_smile: (Which really was a wrong thing of me! :)) Cause I’ve had it so many times that I import the first sub-doc and voila, it changes the page size from A! to A5 (in my specific case)…

But you are right, the reality is what you described…
The imported document’s linked template’s styles DON’T override the Master Document’s styles…

(My experience was misleading, cause those pages don’t use the Default page style)

Understanding this behavior is absolutely crucial, so thanks thanks and thanks!
(this hasn’t been the first time I’ve learned something extremely important from you :))

A word of warning: Import is rather ambiguous a word. It usually involves data transfer. Therefore, I’d rather use it for Insert>Text from File where file contents is copied into the current document and “detached” from the original file. Whatever happens later to this original file is not echoed into the document.

A subdocument is not “imported” in this way. Only a link is recorded in the master, not contents (perhaps there is a cache for it in case the file is temporarily unavailable, but this is not relevant here). Writer references the effective sub-doc contents (therefore displaying current state) but applies the master style definitions. This is kind of criss-cross but it is the basis of the power and “economy” of the master feature.

I have realized that this is a very logical concept.

Now I have to contradict you…
There’s a thing called MAster Document Template…
It can be created from a master document → save as template…
and it’ll have the extension of “otm”…

But they admit it in the Writer Guide that “it is not an ordinary template” :slight_smile:

:slight_smile: I’ve read this from you earlier… and always wanted to reply… :slight_smile:
If one is acquainted with HTML5, and website building (as opposed to creating a page) “CSS”, that is external style sheets are a must and a must only…

Knowing HMTL5 is a great advantage, every should know it…
Abolishing direct formatting is a great cause, everyone should join in :slight_smile:

I mean, I totally agree with you, except that I’d not call this practice “advanced”…
This is entry level… although, sure… entry level doesn’t mean that everybody actually enters :slight_smile:
let’s call it a non-instinctive use :slight_smile: based on conscious learning :slight_smile:

Sure, the way to go…
if your style is “large font” you can’t change it to small without conceptual mess…
It should be named for what you use it… “sub title”

I’ve never heard of Template Changer, but I respect is, and I’ll check.

IN my opinion…
The concept should be consistent…
Including that even a Master Document should have its “external styles sheet”, so to speak…

The start could be that from a Master Document we could export the styles to a template…
But having an external template to a Master Document is crucial, absolutely! :slight_smile:

. . .

Yes!
This should be the universal concept.

NOTE:
“which implies many close-reopen steps while you’re still hesitating on the look of your styles.”
This might not necessarily be the case…
Personally, I’ll edit a copy of the document I’m working on… (“sub” document, .odt)
I’ll change the style in the document…
(I always make sure that no “auto-update” should be checked :slight_smile: )
Change it and see what it looks like…
and when it looks good I’ll do it in the template, too…


NOTE 2:

There’s a mysteriously intuitive “behavior” in Writer…
Sometimes, when you edit a template,
and click okay on a modification,
the document window will come up…
and you’ll see the changes applied to it…
and when you get back to the template window, you’ll notice that it has been saved :slight_smile:

Very cool…
I only wish I knew how exactly it works :slight_smile: )

“Import” is what I like to call it…
and I’ve even realized why… :slight_smile:
BUT you are right!!! I agree!


“Import” means getting something (let’s say, an image file) into your document to be available…

whereas

“Insert” means placing an image into the document’s body.
.
Import means getting that thing into the project…
Insert means placing it into the actual document…
(Video editing is a good model: you import videos and you place them on the timeline – in the actual film…
.
these are 2 different things…
.
But we can also think of Scribus and its “scrapbook”…
stuff in there is usable, “insertable”… it is available in the project)
.
… Why I used “Import” – up to now :slight_smile:
I used to say “import”, cause I’d just arbitrarily right-clicked somewhere in Navigator…
Sometimes it’d be the right place, sometimes it’d be up or down by one “row”…
I’d only move it later to its intended place… (in the next moment)
Hence my “Import” obsession :slight_smile:
.
But you’ right, since we actually place the linked document into the text, the right thing to say is “insert” … :slight_smile:
.
So, I agree… “import” is a different method than “insert”…
and in Writer, we should use insert

BREAKING :slight_smile:

turns out to be WRONG :slight_smile:

  • We create a Master Document → (a_master_doc**.odm**)
  • then File / Templates / Save as template → (a_template_for_Master_Docs_only**.otm**)

Now, we create a brand new master document…
File / New / Templates doubkle clicking the recently created a_template_for_Master_Docs_only**.otm**

and from now on, this Brand New Master Document is BASED on that template…
and when that template gets updated,
the same update mechanism is activates as in the case of normal documents! :slight_smile:

Now, this is really logical!
// Only there should be a “save as master document” option for documents…

Great to know, thanks. But does it solve the following issue: having both a master and its sub-documents based on the same template?

It looks like a very-very good project!
thank you!!