Ceci est une ancienne révision du document !
If you work in LibreOffice much, you will find yourself using the same formating over and over. Whether you use it to write letters or to create the next best-seller, you spend a lot of time setting up the same styles over and over again. Templates are the answer to this problem. A template is a document model used to create other documents. All the LibreOffice applications can use templates. In fact, every time you create a new document, LibreOffice is using a default template.
Styles are the key to creating templates. Styles are a preset way of displaying information. I first discussed the importance of using styles all the way back in part 3 of this series, discussing how styles help create a uniform look in your document as well as saving you time. In the spirit of saving you time, we can add one more use for styles, creating templates.
Setting Up A Template
Everything from a business letter to a scientific research paper has a required layout and format. Let us say we are writing a document that requires a numbered outline format with sublevels. Another requirement is that the title and author appear at the top of each page, and the page number at the bottom in the format of “Page # of #”.
We will tackle the numbering style first. In a new Writer document, open the Styles and Formatting window. Click on the list styles icon (the last one on the Styles toolbar). Select Numbering 1. Right-click Numbering 1 and choose Modify. On the Outline tab, pick the style that is labeled “Numeric with all sublevels” when you hover the mouse over it. Click the Apply and OK buttons.
Now, to take care of the header and footer. Open the Styles and Formatting window and click on the Page styles icon (next to last on the Styles toolbar). Right-click the Default Style page style and select Modify. On the Header tab, check Header On, then switch to the Footer tab and check Footer On. Click OK to save the changes. Click into the header area of the first page, Insert > Fields > Title. Type a space and “by”, then Insert > Fields > Author. Move your cursor down to the footer at the bottom of the page. Type “Page”, a space, then Insert > Field > Page Number. Type space “of” space, then Insert > Fields > Page Count.
Saving the Template
We are now ready to save our template. File > Save as Template will open the Template Manager. Select the template folder where you want to store your template. Click Save. A dialog will prompt you to name the template. Enter the name you want to show for the template and click Accept. Close the Template Manager.
Using the Template
Let's use our newly created template. File > New > Templates. Open the folder where you saved your template and double-click your template. The title shows as the title you gave the template. Let's change it. File > Properties. Select the Description tab and change the title to something else. Click OK. The title in the header will change to whatever you typed in.
Let's try out that outline numbering system. Open the Styles and Formatting, click on the List styles icon, and double-click Numbering 1. Your input will change to the list style we defined for the Numbering 1 when creating the template. Add some text and be sure to add several levels to make sure it is all working. Now, you can save your document like you normally would. This does not save it as the template, but as a new file on your computer.
Setting a New Default Template
If you need to use your new template most of the time, why not make it your default template? This is easily done in LibreOffice. File > New > Templates. Navigate to the folder where you have your template and select it. Click on the “Set As Default” button. Now, anytime you start a new document of that type, LibreOffice will use your template instead of the default template that comes with LibreOffice.
Different Sources for Templates
Creating your own templates is great, but you will not always need to put in all that work. The official template repository at http://templates.libreoffice.org has hundreds of templates for you to try and use. To use individual templates, import them into the template manager.
Some templates are collections. They have a extension of .OXT. To import these templates, you use the Extension Manager, Tools > Extension Manager. Click Add, and browse to your downloaded OXT file. Select the file and click Open. The Extension Manager will process the file and add the collection to your Template Manager.
Conclusion
Templates are a way to repeat the formatting of a document from one document to the next. Creating and saving templates relies mostly on the use of styles. Though I demonstrated creating a Writer template, you can create templates in the other modules of LibreOffice, too. You can even set your template as the default for that type of document. Templates are just one more time-saving tool within the LibreOffice suite.