Use (assign) an other template to a document

With help of this forum my understanding of templates increase and I could make a good template, which I used for multiple documents. I created e default template with the extension .ott. Creating a new document will use this template, so this is good.

The template must be equal for all this document. Now I noticed a minor change has to be made. But a change it the template is not effective in my other documents, using the same template. I now, from the past, that a template can be linked to a document, because sometimes I get a message like “template is updated, would you like to use the updated template?”

So it exist in LibreOffice, but I do not know how.

When I check my documents with Menu → File → properties the field “template” is empty. So there seems no template to be assigned. This is the same for all the others documents using this template. So I would like to assign this template to the documents. So a change to the template will effect all others documents with the same template, which is my goal.

In the end I would like to have one master document (.odm) , with the same template as the detail documents (.odt) as chapters. So in the chapter I can see f.e. to reduce the content with one line so it would fit in one page less. This results then identical in the master. If these templates are not identical then, when editing the .odt document I do not know for sure how it will look and fit in the .odm document.

I found a similar question in 230872/assign-a-template-to-a-document But the advised DocumentTemplateChanger extension link does not work, nor can I find this in the LO ExtentionManager So this does not work. Also personally I would like to reduce external extensions as much as possible.

An other answer is 69314/how-do-i-assign-a-template-to-a-document has one complex, and error phrone manual solution, and further also refer to this DocumentTemplateChanger extension.

But this is weird. I do not have this extension and still, in the past, I got the message like “the template has changed, do you like to update”. I recall, but I do not know for sure, this even happened in LO 7.04.2 the current version I use. If the extension would be the only solution, I could not have gotten this message.

(links edited by ajlittoz to make them more descriptive)
(added master document section to be more complete)

@ajlittoz Thanks, my preference is to use your “integration” solution, to keep the multiple documents in sync.

As you can see I edit in the question master section. There was to less place in this comment to do here.

It is contra-intuitive when you wants to make a new document to create a template. But is works for my documents (*.odt). So now I have one reference template which will be used for all my documents. I can see in Menu → File → Properties the property has indeed the template filename. This is what I wanted.
With this I could already reach a lot to use the same template. But not for all.

It would be nice if there is a solution for the the same template for master-documents and detailed-documents. Would the extension Template Changer help here?

Using the extension is the only way to assign a template to a master document.

What is counter-intuitive in new document creation? Either the document is File>New>Text Document in which case it is based on the default template (which can be a user template), or it is File>New>Templates. Note the plural form in the latter case. You don’t create a template, you create a new document from a template. I agree that the wording is a bit concise to convey the meaning but it involves no template creation (the target template must preexist). This command is necessary to be able to start new documents different from your usual ones.

Don’t forget to check the answer if it answers your question.

It is good to know the Template Changer, you mentioned, can also work for master documents. I checked the site and unfortunately the lasted version is only for LO 6.3 and I work with LO 7.0. I will check that extension regularly and hope I can use it in the future.

I downloaded version 1.0.4 in May 2020 and didn’t even checked the site since then for new version. I have just reinstalled it now in 7.0.4.2 to check the behaviour with masters. Even though the site says 6.3, I think you can be confident that version 2.0.1 is probably better than old 1.0.4. I’ll install the newer one.

Thanks for pointing me to reading the site.

Thanks, I downloaded the extension and installed it. And I could assign the same template to the master (.odm) and the document (.odt). In the properties of both documents I could check if the template was assigned and this is ok. But changes made in the .odm template are not reflected in the .odt document with the same template.

Warning! A master is not a template. Change your styles in the template, then reopen both the master and the slave for the changes to be forwarded.

@ajlittoz, thanks, a very important warning, because indeed I had the wrong assumption. What is even more important then a direct solution, is the comprehension of templates. This is complex. Not because it is complex by itself, but because the hierarchy of styles (one align right at template level, may be override by an align left in the styles of the document, which again may be override by just align center by direct formatting. This would not be a problem if it would be visible, So you can see (with a kind of What You See is What You Get) which value is set where. Everybody makes mistakes, but then it is easy detectable and can be solved. Now I have to do in all in my mind and work as faultless as possible.

I wanted to upvote your answer again, but unfortunately that was not possible.

Upcoming 7.1 will have a “style inspector” where this style hierarchy will be visible and direct formatting will be clearly reported to the user. This is a significant advance.

I can also add another warning when working with master. Formatting information between slave and master is transferred through style name (and of course direct formatting, but leave it aside and avoid it because it is the source of all evil). This means the state of styles may be different in master and slave. When you work on the slave, formatting is done with local definition. When the book is merged in the master, style definition from the master is applied. You could end up with unexpected formatting differences if you play with your styles other than in the template.

As with any complex task, you must follow a very strict discipline otherwise you get lost.

There are two ways to derive a document from a template.

  • “Independence”

    You simply double-click on a template icon (or you File>Open it which is the same). This duplicates the .ott file in memory and make it a new untitled document with initial content of the template file.

    Apart from changing the document extension and giving it no name, Writer does not see this comes from a template. Therefore the template property in File>Properties is left blank. The document is not linked to a template.

    Later when the template is modified, this will have no consequence on the document because there is no link.

  • “Integration”

    The template must have been saved with File>Templates>Save as Template. In this case it is stored in the “extended user profile” and will be known to Writer as a "template.

    You create a template-linked document with File>New>Templates. The document will be associated with the template.

    After a template modification, you’ll be asked whether you want to update the style definitions (only, not the content because you may have already entered non-default text in your document) to remain in sync with the template.

##Other considerations

  • When Save as Template is used, you have no control as to where the .ott is stored. Traditionally the “user profile” directory is a hidden directory and it is not very convenient to go through it to edit files within it. Add to that it is rarely recommended to interfere with application internals.

    To compensate, you can store your templates in your own visible directory (there is a Templates/ directory in most Linux home directory structure) and tell Writer where to look for templates. For that, go to Tools>Options, LibreOffice>Paths and add your user directory to the list for Templates.

    You then no longer need to File>Templates>Save as Template. You simply File>Save to your user directory, taking care to select the correct extension .ott.

  • The Template Changer extension is still available and can be used to assign a template to a “free” document or to change a current template.

    Like you, I prefer to work with a “bare metal” LO app but the Template Changer extension is so handy for my workflow that I installed it (and it is the only one!).

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.