This chapter describes some common customizations that you may wish to do.
You can customize menus, toolbars, and keyboard shortcuts in LibreOffice, add new menus and toolbars, and assign macros to events. However, you cannot customize context (right-click) menus.
Other customizations are made easy by extensions that you can install from the LibreOffice website or from other providers.
|Customizations to menus and toolbars can be saved in a template. To do so, first save them in a document and then save the document as a template as described in Chapter 3, Styles and Templates.|
In addition to changing the menu font (described in Chapter 2, Setting up LibreOffice), you can add and rearrange categories on the menu bar, add commands to menus, and make other changes.
To customize menus:
- Choose Tools > Customize.
- On the Customize dialog, choose the Menus page.
- In the Save In drop-down list, choose whether to save this changed menu for the application (for example, LibreOffice Writer) or for a selected document (for example, SampleDocument.odt).
- In the section LibreOffice [name of the program (example: Writer)] Menus, select from the Menu drop-down list the menu that you want to customize. The list includes all the main menus as well as submenus (menus that are contained under another menu). For example, in addition to File, Edit, View, and so on, there is File | Send and File |Templates. The commands available for the selected menu are shown in the central part of the dialog.
- To customize the selected menu, click on the Menu or Modify buttons. You can also add commands to a menu by clicking on the Add button. These actions are described in the following sections. Use the up and down arrows next to the Entries list to move the selected menu item to a different position.
- When you have finished making all your changes, click OK (not shown in illustration) to save them.
In the Menus page of the Customize dialog, click New to display the New Menu dialog, shown in Figure 317.
- Type a name for your new menu in the Menu name box.
- Use the up and down arrow buttons to move the new menu into the required position on the menu bar.
- Click OK to save.
The new menu now appears on the list of menus in the Customize dialog. (It will appear on the menu bar itself after you save your customizations.)
After creating a new menu, you need to add some commands to it, as described in “Adding a command to a menu” on page 340.
To modify an existing menu, either user-made or inbuilt, select it in the Menu list and click the Menu button to drop down a list of modifications: Move, Rename, Delete. Not all of these modifications can be applied to all the entries in the Menu list. For example, Rename and Delete are not available for the supplied menus, and Move is not available for submenus.
To move a menu (such as File), choose Menu > Move. A dialog similar to the one shown in Figure 317 (but without the Menu name box) opens. Use the up and down arrow buttons to move the menu into the required position.
To move submenus (such as File | Send), select the main menu (File) in the Menu list and then, in the Menu Content section of the dialog, select the submenu (Send) in the Entries list and use the arrow keys to move it up or down in the sequence. Submenus are easily identified in the Entries list by a small black triangle on the right hand side of the name.
In addition to renaming, you can allocate a letter in a custom menu’s name, which will become underlined, to be used as a keyboard shortcut, that allows you to select that menu when you press Alt+ that letter. Existing submenus can be edited to change the letter which is used to select them from the keyboard once the menu is open.
- Select a custom menu or a submenu in the Menu drop-down list.
- Click the Menu button and select Rename.
- Add a tilde (~) in front of the letter that you want to use as an accelerator. For example, to select the Send submenu command by pressing S (after opening the File menu using Alt+F), enter ~Send. This changes it from the default d.
|When allocating a shortcut to custom menus, be careful to not use an existing shortcut letter.|
You can add commands to the supplied menus and to menus you have created. On the Customize dialog, select the menu in the Menu list and click the Add button in the Menu Content section of the dialog.
On the Add Commands dialog (Figure 318), select a category and then the command, and click Add. The dialog remains open, so you can select several commands. When you have finished adding commands, click Close. Back on the Customize dialog, you can use the up and down arrow buttons to arrange the commands in your preferred sequence.
In addition to changing the sequence of entries on a menu or submenu, you can add submenus, rename or delete the entries, and add group separators.
To begin, select the menu or submenu to be modified, from the Menu list near the top of the Customize page, then select the entry in the Entries list under Menu Content. Click the Modify button and choose the required action from the drop-down list of actions.
Most of the actions should be self-explanatory. Begin a group adds a separator line after the highlighted entry.
You can customize toolbars in several ways, including choosing which icons are visible and locking the position of a docked toolbar (as described in Chapter 1, Introducing LibreOffice), and adding or deleting icons (commands) in the list of those available on a toolbar. You can also create new toolbars. This section describes how to create new toolbars and add or delete icons on existing ones.
To get to the toolbar customization dialog, do any of the following:
- On the toolbar, click the arrow at the end of the toolbar and choose Customize Toolbar.
- Choose View > Toolbars > Customize from the menu bar.
- Choose Tools > Customize from the menu bar and go to the Toolbars page.
Modifying existing toolbars[编辑]
To modify an existing toolbar:
- In the Save In drop-down list, choose whether to save this changed toolbar for the application (for example, Writer) or for a selected document.
- In the section LibreOffice [name of the program (example: Writer)] > Toolbars, select from the Toolbar drop-down list the toolbar that you want to customize.
- You can create a new toolbar by clicking on the New button, or customize existing toolbars by clicking on the Toolbar or Modify buttons, and add commands to a toolbar by clicking on the Add button. These actions are described below.
- When you have finished making all your changes, click OK to save them.
Creating a new toolbar[编辑]
To create a new toolbar:
- Choose Tools > Customize from the menu bar and go to the Toolbars tab.
- Click New. On the Name dialog, type the new toolbar's name and choose from the Save In drop-down list where to save this changed menu: for the application (for example, Writer) or for a selected document. Click OK.
The new toolbar now appears on the list of toolbars in the Customize dialog. After creating a new toolbar, you need to add some commands to it, as described below.
Adding a command to a toolbar[编辑]
If the list of available buttons for a toolbar does not include all the commands you want on that toolbar, you can add commands. When you create a new toolbar, you need to add commands to it.
- On the Toolbars page of the Customize dialog, select the toolbar in the Toolbar list and click the Add button in the Toolbar Content section of the dialog.
- The Add Commands dialog is the same as for adding commands to menus (Figure 318). Select a category and then the command, and click Add. The dialog remains open, so you can select several commands. When you have finished adding commands, click Close. If you insert an item which does not have an associated icon, the toolbar will display the full name of the item: the next section describes how to choose an icon for a toolbar command.
- Back on the Customize dialog, you can use the up and down arrow buttons to arrange the commands in your preferred sequence.
- When you are done making changes, click OK to save.
Choosing icons for toolbar commands[编辑]
Toolbar buttons usually have icons, not words, on them, but not all of the commands have associated icons.
To choose an icon for a command, select the command and click Modify > Change icon. On the Change Icon dialog, you can scroll through the available icons, select one, and click OK to assign it to the command.
To use a custom icon, create it in a graphics program and import it into LibreOffice by clicking the Import button on the Change Icon dialog. Custom icons should be 16 x 16 pixels in size to achive the best quality and should not contain more than 256 colors.
Example: Adding a Fax icon to a toolbar[编辑]
You can customize LibreOffice so that a single click on an icon automatically sends the current document as a fax.
- Be sure the fax driver is installed. Consult the documentation for your fax modem for more information.
- Choose Tools > Options > LibreOffice Writer > Print. The dialog shown in Figure 321 opens.
- Select the fax driver from the Fax list and click OK.
- Click the arrow icon at the end of the Standard toolbar. In the drop-down menu, choose Customize Toolbar. The Toolbars page of the Customize dialog appears (Figure 319). Click Add.
- On the Add Commands dialog (Figure 322), select Documents in the Category list, then select Send Default Fax in the Commands list. Click Add. Now you can see the new icon in the Commands list.
- In the Commands list, click the up or down arrow button to position the new icon where you want it. Click OK and then click Close.
Your toolbar now has a new icon to send the current document as a fax.
Assigning shortcut keys[编辑]
In addition to using the built-in keyboard shortcuts (listed in Appendix A), you can define your own. You can assign shortcuts to standard LibreOffice functions or your own macros and save them for use with the entire LibreOffice suite.
|Be careful when reassigning your operating system’s or LibreOffice’s predefined shortcut keys. Many key assignments are universally understood shortcuts, such as F1 for Help, and are always expected to provide certain results. Although you can easily reset the shortcut key assignments to the LibreOffice defaults, changing some common shortcut keys can cause confusion, especially if other users share your computer.|
To adapt shortcut keys to your needs, use the Customize dialog, as described below.
- Select Tools > Customize > Keyboard. The Customize dialog opens.
- To have the shortcut key assignment available in all components of LibreOffice select the LibreOffice radio button.
- Next select the required function from the Category and Function lists.
- Now select the desired shortcut keys in the Shortcut keys list and click the Modify button at the upper right.
- Click OK to accept the change. Now the chosen shortcut keys will execute the function chosen in step 3 above whenever they are pressed.
|All existing shortcut keys for the currently selected Function are listed in the Keys selection box. If the Keys list is empty, it indicates that the chosen key combination is free for use. If it were not, and you wanted to reassign a shortcut key combination that is already in use, you must first delete the existing key.
Shortcut keys that are greyed-out in the listing on the Customize dialog, such as F1 and F10, are not available for reassignment.
Example: Assigning styles to shortcut keys[编辑]
You can configure shortcut keys to quickly assign styles in your document. Some shortcuts are predefined, such as Ctrl+0 for the Text body paragraph style, Ctrl+1 for the Heading 1 style, and Ctrl+2 for Heading 2. You can modify these shortcuts and create your own.
- Click Tools > Customize > Keyboard. The Keyboard page of the Customize dialog (Figure 323) opens.
- To have the shortcut key assignment available only with one component (for example, Writer), select that component’s name in the upper right corner of the page; otherwise select LibreOffice to make it available to every component.
- Choose the shortcut keys you want to assign a style to. In this example, we have chosen Ctrl+9. This enables the Modify button.
- In the Functions section at the bottom of the dialog, scroll down in the Category list to Styles. Click the expansion symbol (usually a + sign or triangle) to expand the list of styles.
- Choose the category of style. (This example uses a paragraph style, but you can also choose character styles and others.) The Function list will display the names of the available styles for the selected category. The example shows some of LibreOffice’s predefined styles.
- To assign Ctrl+9 to be the shortcut key combination for the List 1 style, select List 1 in the Function list, and then click Modify. Ctrl+9 now appears in the Keys list on the right, and List 1 appears next to Ctrl+9 in the Shortcut keys box at the top.
- Make any other required changes, and then click OK to save these settings and close the dialog.
Saving changes to a file[编辑]
Changes to the shortcut key assignments can be saved in a keyboard configuration file for use at a later time, thus permitting you to create and apply different configurations as the need arises. To save keyboard shortcuts to a file:
- After making your keyboard shortcut assignments, click the Save button at the right of the Customize dialog (Figure 323).
- In the Save Keyboard Configuration dialog, select All files from the Save as Type list.
- Next enter a name for the keyboard configuration file in the File name box, or select an existing file from the list. If you need to, browse to find a file from another location.
- Click Save. A confirmation dialog appears if you are about to overwrite an existing file, otherwise there will be no feedback and the file will be saved.
Loading a saved keyboard configuration[编辑]
To load a saved keyboard configuration file and replace your existing configuration, click the Load button at the right of the Customize dialog, and then select the configuration file from the Load Keyboard Configuration dialog.
Resetting the shortcut keys[编辑]
To reset all of the keyboard shortcuts to their default values, click the Reset button near the bottom right of the Customize dialog. Use this feature with care as no confirmation dialog will be displayed; the defaults will be set without any further notice or user input.
Assigning macros to events[编辑]
In LibreOffice, when something happens, we say that an event occured. For example, a document was opened, a key was pressed, or the mouse moved. You can associate a macro with an event, so the macro is run when the event occurs. A common use is to assign the “open document” event to run a macro that performs certain setup tasks for the document.
To associate a macro with an event, use the Events page of the Customize dialog. For more information, see Chapter 13, Getting Started with Macros.
Adding functionality with extensions[编辑]
An extension is a package that can be installed into LibreOffice to add new functionality.
Several popular extensions are shipped bundled with LibreOffice and are installed with the program. Others can be downloaded from various websites. The official extension repository is located at http://extensions.libreoffice.org/. These extensions are free of charge.
Some extensions from other sources are free of charge; others are available for a fee. Check the descriptions to see what licenses and fees apply to the ones that interest you.
To install an extension, follow these steps:
- Download an extension and save it anywhere on your computer.
- In LibreOffice, select Tools > Extension Manager from the menu bar. In the Extension Manager dialog (Figure 324), click Add.
- A file browser window opens. Find and select the extension you want to install and click Open. The extension begins installing. You may be asked to accept a license agreement.
- When the installation is complete, the extension is listed in the Extension Manager dialog.
|To download extensions that are listed in the repository, you can open the Extension Manager and click the Get more extensions online... link.|
|To install a shared extension, you will need write access to the LibreOffice installation directory.|