Writer Guide 24.8
Chapter 10,
Working with Templates
This document is Copyright © 2024 by the LibreOffice Documentation Team. Contributors are listed below. This document may be distributed and/or modified under the terms of either the GNU General Public License (https://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), version 4.0 or later. All trademarks within this guide belong to their legitimate owners.
To this edition
Jean Hollis Weber |
|
|
To previous editions
Jean Hollis Weber |
Kees Kriek |
Gillian Polack |
Bruce Byfield |
John A Smith |
Ron Faile Jr. |
Barbara Duprey |
Dante Legaspi |
Hazel Russman |
Please direct any comments or suggestions about this document to the Documentation Team Forum at https://community.documentfoundation.org/c/documentation/loguides/ (registration is required) or send an email to: loguides@community.documentfoundation.org.
Note
Everything sent to a forum, including email addresses and any other personal information that is written in the message, is publicly archived and cannot be deleted. Emails sent to the forum are moderated.
Published November 2024. Based on LibreOffice 24.8 Community.
Other versions of LibreOffice may differ in appearance and functionality.
Some keystrokes and menu items are different on macOS from those used in Windows and Linux. The table below gives some common substitutions used in this document. For a detailed list, see LibreOffice Help.
Windows or Linux |
macOS equivalent |
Effect |
Tools > Options |
LibreOffice > Preferences |
Access setup options |
Right-click |
Control+click or right-click depending on computer setup |
Open a context menu |
Ctrl (Control) |
⌘ (Command) |
Used with other keys |
Alt |
⌥ (Option) or Alt |
Used with other keys |
F11 |
⌘+T |
Open Styles deck in Sidebar |
A template is a model document that is used to create other documents. For example, you can create a template for business reports that has your company’s logo on the first page. New documents created from this template will all have your company’s logo on the first page.
Templates can contain anything that regular documents can contain, such as text, graphics, a set of styles, and user-specific setup information such as measurement units, language, the default printer, and toolbar and menu customization.
All documents in LibreOffice are based on templates. You can create, or download and install, as many templates as you wish, and you can set a default template for each type of document (text, spreadsheet, drawing, presentation). If you do not choose a template when you start a new Writer document, then the document is based on the default template for text documents. If you have not specified a default template, Writer uses the built-in blank template for text documents that is installed with LibreOffice. See “Setting a default template” below.
Writer supports templates for master documents as well as for ordinary documents. For more about master documents, see Chapter 16.
This chapter describes the use of LibreOffice’s template management features. You can also manage and use templates in other ways, but the effects are a bit different. See “Other ways to manage templates” below for more information.
A new installation of LibreOffice may not include many templates, but you can create your own (see “Creating a template” below) or install templates obtained from other sources (see “Adding templates obtained from other sources” below).
To create a document from a template:
Open the Templates dialog (Figure 1) using one of these methods:
Choose File > New > Templates on the Menu bar.
Choose File > Templates > Manage Templates on the Menu bar.
Press the key combination Ctrl+Shift+N.
Click the arrow next to the New icon on the Standard toolbar and select Templates.
Select Templates > Manage Templates in the Start Center (visible in LibreOffice when no document is open).
In the Filter lists at the top of the Templates dialog, select the type and category of template to use. The relevant templates are listed on the dialog. Click on the icons to the right of the Categories list to switch between Thumbnail view (Figure 1) and List view (Figure 2).
Find and double-click the required template, or select the template and click Open. A new document based on the selected template opens in Writer. Edit and save the new document.
The template the document is based on is listed in File > Properties > General.
Tip
In the Start Center, click on the Templates button or open the drop-down menu and select a type of template, to view the available templates without opening the Templates dialog. Click on the required template to create a new document.
Figure 1: Thumbnail view of Templates dialog, showing context menu for a selected user-created template
Figure 2: List view of Templates dialog
Note
The connection between a template and a document remains until the template is modified and you do not update the document to match the template.
If a document is copied or moved to a different computer which does not have a copy of that template installed, the connection is broken even though it continues to be listed in the document’s properties. See “Changing the template assigned to a document” below for a way to reconnect a template to a document.
To create a template, either save a document as a template or use a wizard.
In addition to formatting, any settings that can be added to or modified in a document can be saved within a template. Examples include printer settings; general behaviors set from Tools > Options, such as paths and colors; menu and toolbar customizations, described in Chapter 20, Customizing Writer.
Templates can also contain predefined text. For example, a letter template may contain a name, address, and salutation.
To create a template from a document:
Open a new or existing text (Writer) document.
Add any content that to appear in any document created from the new template, for example company logo or a copyright statement.
Create or modify any styles to be used in the new template.
On the Menu bar, choose File > Templates > Save as Template. The Save as Template dialog (Figure 3) opens, displaying the existing categories and a box for the name for the new template.
Select a category, for example My Templates or Business Correspondence. Optionally set this template as a default template at this time. Click Save.
Figure 3: Save as Template dialog
Writer provides wizards for creating templates for letters, faxes, and agendas. To create a template using a wizard:
On the Menu bar, choose File > Wizards > [type of template required] (Figure 4).
Follow the instructions on the pages of the wizard. This process is slightly different for each type of template, but the format is similar.
Figure 4: Choosing a template wizard
In the last section of the wizard, specify the template name that will show in the Templates dialog and the file name and location for saving the template. The two names can be different but this may cause confusion. The default location is your user templates folder but you can choose a different location.
To set the file name or change the folder, click the Path icon (the three dots to the right of the location). On the Save As dialog, make selections and click Save to return to the wizard.
Finally, choose whether to create a new document from the template immediately or manually change the template. Click Finish to save the template.
LibreOffice refers to sources of templates as repositories. A repository can be local (a directory on your computer or network to which templates have been downloaded) or remote (a URL from which you can download templates).
To open the official LibreOffice template repository, type https://extensions.libreoffice.org/ in the address bar of a web browser or click the Get more extensions online... link in the Extensions dialog (see Chapter 14, Customizing Writer). On the Extensions web page (Figure 5), in the left-hand column under Add tag filters, select Templates and Writer. The web page will update.
Figure 5: Searching for templates in the repository
Alternatively, type keywords in the What are you looking for? box at the top and click Search. In the search results, find the required template and click on its name to display a page with details; click the Download button to put the template anywhere on your computer. Proceed to “Installing templates” below.
Alternatively, choose Manage > Extensions on the upper right of the Templates dialog (Figure 6) to open an Extensions: Templates dialog (Figure 7), where you can scroll through a list of extensions or filter the list by typing a search term in the box at the top of the dialog.
Figure 6: Getting more templates for LibreOffice
Figure 7: Finding template extensions
Other websites may offer collections of templates that have been packaged into extension (.OXT) files.
Install templates using either the Templates dialog or the Extensions dialog.
To install templates using the Templates dialog:
Download the template or package and save it anywhere on your computer.
In the Templates dialog, click the Manage button on the upper right (Figure 6) and select Import in the submenu.
On the Select Category dialog, select the category where you want to import the template and click OK. A file browser window opens.
Find and select the required template and click Open. The file browser window closes and the template is imported and appears in the selected category.
To install templates using the Extensions dialog:
Download the template or package and save it anywhere on your computer.
In LibreOffice, select Tools > Extensions on the Menu bar. In the Extensions dialog, click Add to open a file browser window.
Find and select the required template or package of templates and click Open. The package begins installing. If asked, accept a license agreement.
When the package installation is complete, restart LibreOffice. The templates are available for use through the Templates dialog and the extension is listed in the Extensions dialog.
See Chapter 20, Customizing Writer, for more about the Extensions dialog.
Tip
You can manually copy new templates into the template folders. The location varies with your computer’s operating system. To learn where the template folders are stored on your computer, go to Tools > Options > LibreOffice > Paths. You can also add new template folders in other locations; for more information, see the Getting Started Guide.
You cannot edit a template that was supplied with LibreOffice. You can only edit templates that you created or imported.
After editing a template’s styles and content, you can reapply the template’s styles to documents that were created from that template. You cannot reapply content.
To edit a template:
Open the Templates dialog, as described above.
In the Templates dialog, find the required template. Right-click on it to open the context menu (Figure 1), then click Edit. The template opens in Writer.
Edit the template as you would edit any other document. To save your changes, choose File > Save on the Menu bar.
If changes have been made to a template and its styles, the next time you open a document that was created from the template before the changes, a confirmation message is displayed.
To update the document:
Select Update Styles to apply the changed styles in the template to the document.
Select Keep Old Styles if you do not want to apply the changed styles in the template to the document (but see the Note below).
Note
If you choose Keep Old Styles, the document is no longer connected to the template, even though the template is still listed under File > Properties > General. To reconnect the document to the template, use the procedure described in “Changing the template assigned to a document” below.
If all you want is to apply the updated styles from a template to a document, and you don't care whether the updated template is connected to the document, you can use the Load Styles from Template selection found under the Styles Actions icon in the Styles pane of the Sidebar. This method is described in Chapter 8, Introduction to Styles.
To change the template assigned to a document, or to reconnect a document to a template, either do it manually or use the Template Changer extension to LibreOffice.
To change or reconnect a template manually, first create a new, blank document from the required template, then copy the contents of the old document into the new document as described in “Manually changing the template” below.
To use the Template Changer extension, first download and install the extension, then restart LibreOffice to activate it. After that, open the document and use File > Templates > Change template (current document) on the Menu bar.
Note
Changing or updating a template affects only the formatting used in styles. It does not affect any content. You may also need to manually update content, for example a logo, copyright notice, or the layout of a copyright page.
For best results, the names of styles should be the same in the existing document and the new template. If they are not, you may wish to rename some of the styles in the document.
To manually associate a document with a different template:
Open the Templates dialog as described above.
In the Templates dialog, double-click the template you want to use. A new document opens, containing any text or graphics that were in the template.
Delete any unwanted text or graphics from this new document. Use File > Save As to save the new document, but leave it open.
Open the old document. (It opens in a new window.)
Use Edit > Select All, or press Ctrl+A, to select everything in the old document.
Use Edit > Copy, or press Ctrl+C, to copy the contents of the old document to the clipboard.
Click in the new document created in step 2. Use Edit > Paste, or press Ctrl+V, to paste the contents of the old document into the new one.
Update the table of contents if there is one. Save the new document using File > Save.
Close the old file without saving.
Note
Any changes recorded (tracked) in the old document will be lost during this process. The resulting document will contain only the changed text.
A document created by choosing File > New > Text Document on the Menu bar, or by clicking the Text Document button in the Start Center, is created from the default template for text documents. Writer has a built-in default template, but you can set a custom template to be the default. You can reset the default to the built-in one.
Many default settings, such as page size and margins, font choices, line spacing, and so on, can be changed using styles, but those changes apply only to the document you are working on. To make the changes the default settings for that document type, you need to replace the default template supplied with LibreOffice with a new one that you create.
You can set any template in the Templates dialog to be the default for that document type:
Open the Templates dialog as described above.
In the Templates dialog, open the category containing the template that you want to set as the default, then select the template.
Right-click the selected template and select Set as Default from the context menu (Figure 1). An icon marks the template as the default (Figure 8).
The next time that you create a document of that type by choosing File > New, the document will be created from this template.
Figure 8: Default template icon
To re-enable Writer’s built-in template as the default:
Open the Templates dialog as described above.
In the Templates dialog, click the Manage button on the upper right (Figure 9).
Figure 9: Resetting the default template for text documents
Select Reset Default Text Document in the drop-down menu. This choice does not appear unless a custom template had been set as the default, as described in the previous topic.
You can also reset the default template as follows:
Go to the Templates dialog and open the category containing the template you set as default. It is indicated by a green check mark.
Right-click on this template and select Reset Default in the context menu.
The next time that you create a document by choosing File > New (or equivalent), the document will be created from the original built-in template for the document type.
LibreOffice can manage only those templates that are in its template categories (folders), although you can create a document from a template that is not in one of these folders (see “Creating a document from a template” below). You can create new template categories and use them to organize your templates. For example, you might have one category for report templates and another for letter templates. You can also import and export templates.
To begin, choose File > Templates > Manage Templates to open the Templates dialog.
To create a template category:
Click the Manage button on the upper right of the Templates dialog.
Click New category in the context menu (Figure 9).
In the pop-up dialog, type a name for the new category and click OK. The new category now appears in the list of categories.
You cannot delete template categories supplied with LibreOffice or categories added using the Extension dialog unless you first remove the extension that installed them.
Open the Templates dialog and select the category in the Filter list at the top. Click the Manage button, and select Delete Category in the submenu (Figure 10). When a confirmation message box appears, click Yes.
Figure 10: Manage menu for a user-created template category
You cannot rename template categories supplied with LibreOffice.
Open the Templates dialog, select the category in the Filter list at the top, then click the Manage button and select Rename Category in the submenu (Figure 10). In the small dialog that opens, type a name in the Enter New Name text box and click OK.
To move a template from one template category to another, select it in the Templates dialog, right-click on it and select Move in the context menu (Figure 1). In the Select Category dialog (Figure 11), select the destination category and click OK. The selected template is moved to the selected category. You can also create a new category into which to move the template.
Figure 11: Moving a template to another category
You cannot rename templates supplied with LibreOffice. You can only rename a template that you have created or imported.
Open the Templates dialog, find and select the template you want to rename, then right-click the template and select Rename in the context menu. In the small dialog that opens, type a name in the Enter New Name text box and click OK.
This action changes the Title on the Description tab of the template’s document properties. It does not change the file name of the template.
You cannot delete templates supplied with LibreOffice. Nor can you delete any templates installed using the Extensions dialog except by removing the extension that installed them. However, you can delete templates that you have created or imported.
(Optional) In the Filter drop-down lists at the top of the Templates dialog, select the category that contains the template you want to delete.
Select the template to delete.
Right-click to open the context menu of the template and click Delete. A message box appears and asks you to confirm the deletion. Click Yes.
Tip
You can also press the Delete key on the keyboard to delete the selected template on the Templates dialog.
To export a template to another location on your computer or network:
In the Templates dialog, select the template that you want to export.
Right-click on the template and choose Export in the submenu. A file browser window opens.
Find the location where you want to export the template and select Select Folder or OK.
Click OK on the displayed information dialog.
Note
Exporting a template does not remove it from the Templates dialog. The action places a copy of the template in the location you specify.
You can create and use templates stored anywhere on your computer, without using the Templates dialog. However, some results are different from those described in this chapter.
You can create a document from a template by double-clicking the template in your computer’s file browser window. The resulting document is not associated with (linked to) the template from which it was created. The template is not listed in the document’s properties and any changes to the template cannot be directly applied to the document. For many purposes, such as writing a letter, this may be what you want.
You can create a template from a document using File > Save As and selecting ODF Text Document Template (.ott) as the file type, then saving it anywhere you want, for example in a project folder. The resulting template will not be visible in the Templates dialog, unless you import it or add the project folder to the locations shown for templates on the LibreOffice – Paths page of the Tools > Options dialog.