GS64 GettingStarted PDF
GS64 GettingStarted PDF
GS64 GettingStarted PDF
This document is Copyright © 2020 by the LibreOffice Documentation Team. Contributors are listed
below. You may distribute it and/or modify it under the terms of either the GNU General Public
License (http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons
Attribution License (http://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
All trademarks within this guide belong to their legitimate owners.
Contributors
To this edition
Jean Hollis Weber Andrew Jensen Kees Kriek
Dan Lewis Steve Fanning Claire Wood
Pulkit Krishna Roman Kuznetsov
To previous editions
Andrew Jensen Amanda Labby Cathy Crumbley
Dan Lewis Dave Barton Jean Hollis Weber
Jorge Rodriguez Olivier Hallot Paul Figueiredo
Peter Schofield John A Smith Martin Saffron
Steve Schwettman Dave Barton Hazel Russman
Ron Faile Jr. Kevin O’Brien Magnus Adielsson
Iain Roberts JiHui Choi Regina Henschel
Laurent Balland-Poirier Christian Kühl Florian Reisinger
Gisbert Friege (Dmaths) Jochen Schiffers Frédéric Parrenin
Bernard Siaud Miklos Vajna Valerii Goncharuk
Andrew Pitonyak
Feedback
Please direct any comments or suggestions about this document to the Documentation Team’s
mailing list: documentation@global.libreoffice.org
Note
Everything you send to a mailing list, including your email address and any other
personal information that is written in the message, is publicly archived and cannot be
deleted.
Preface
Who is this book for?
Anyone who wants to get up to speed quickly with LibreOffice will find this Getting Started Guide
valuable. You may be new to office software, or you may be familiar with another office suite.
Help system
LibreOffice comes with an extensive Help system. This is the first line of support for using
LibreOffice. Windows and Linux users can choose to download and install the offline Help for use
when not connected to the Internet; the offline Help is installed with the program on macOS.
To display the Help system, press F1 or select LibreOffice Help from the Help menu. If you do not
have the offline help installed on your computer and you are connected to the Internet, your default
browser will open the online Help pages on the LibreOffice website.
The Help menu also includes links to other LibreOffice information and support facilities.
Note
The following options shown here prefixed by a ‡ sign are only accessible if your
computer is connected to the Internet.
• What's This? For quick tips when a toolbar is visible, place the mouse pointer over any of
the icons to see a small box (“tooltip”) with a brief explanation of the icon’s function. For a
more detailed explanation, select Help > What's This? and hold the pointer over the icon.
In addition, you can choose whether to activate Extended Tips using Tools > Options >
LibreOffice > General.
• User Guides ‡ Opens your default browser at the Documentation page of the LibreOffice
website, https://documentation.libreoffice.org/en/english-documentation/. There you will find
copies of User Guides and other useful information.
• Show Tip-of-the-Day Opens a small window with a random tip on how to use LibreOffice.
• Get Help Online ‡ Opens your default browser at the Ask LibreOffice forum of questions
and answers from the LibreOffice community, https://ask.libreoffice.org/en/questions/.
10 | Preface
• Send Feedback ‡ Opens your default browser at the Feedback page of the LibreOffice
website, https://www.libreoffice.org/get-help/feedback/. From there you can report bugs,
suggest new features and communicate with others in the LibreOffice community.
• Restart in Safe Mode Opens a dialog window where you will have the option to restart
LibreOffice and reset the software to its default settings.
• Get Involved ‡ Opens your default browser at the Get Involved page of the LibreOffice
website, https://www.libreoffice.org/community/get-involved/. There you can choose a topic
of interest to help improve the program.
• Donate to LibreOffice ‡ Opens your default browser at the Donation page of the
LibreOffice website, https://donate.libreoffice.org/. There you can choose to make a
donation to support LibreOffice.
• License Information Outlines the licenses under which LibreOffice is made available.
• Check for Updates ‡ Opens a dialog window and checks the LibreOffice website for
updates to your version of the software.
• About LibreOffice Opens a dialog window and displays information about the version of
LibreOffice and the operating system you are using. This information will often be
requested if you ask the community for help or assistance with the software. (On macOS
this item is under the LibreOffice menu.)
Preface | 11
What you see may be different
Illustrations
LibreOffice runs on Windows, Linux, and macOS operating systems, each of which has several
versions and can be customized by users (fonts, colors, themes, window managers). The
illustrations in this guide were taken from a variety of computers and operating systems. Therefore,
some illustrations will not look exactly like what you see on your computer display.
Also, some of the dialogs may be different because of the settings selected in LibreOffice. You can
either use dialogs from your computer’s operating system or from LibreOffice. The differences
affect mainly Open, Save, and Print dialogs. To change which dialogs are used, go to Tools >
Options > LibreOffice > General and select or deselect the option Use LibreOffice dialogs.
Icons
The LibreOffice community has created icons for several icon sets:, Breeze, Breeze (SVG), Breeze
(dark), Colibre, Colibre (SVG), Elementary, Elementary (SVG), Karasa Jaga, Sifr, Sifr (dark), and
Tango. Each user can select a preferred set. The icons in this guide have been taken from a
variety of LibreOffice installations that use different sets of icons. The icons for some of the many
tools available in LibreOffice may then differ from the ones used in this guide.
To change the icon set used, go to Tools > Options > LibreOffice > View. In the Icon style
section, choose from the drop-down list.
Notes
Some Linux distributions include LibreOffice as part of the installation and may not
include all the icon sets mentioned above. You should be able to download other icon
sets from the software repository for your Linux distribution if you wish to use them.
The Galaxy and Oxygen icon sets are no longer included as part of the standard
installation package. They can be added back by downloading and installing the
following extensions:
https://extensions.libreoffice.org/extensions/galaxy-icon-theme
https://extensions.libreoffice.org/extensions/oxygen-icon-theme
Some of the previously included gallery backgrounds are now only available as an
extension from https://extensions.libreoffice.org/extensions/legacy-gallery-backgrounds
12 | Preface
What are all these things called?
The terms used in LibreOffice for most parts of the user interface (the parts of the program you see
and use, in contrast to the behind-the-scenes code that actually makes it work) are the same as for
most other programs.
A dialog is a special type of window. Its purpose is to inform you of something, or request input
from you, or both. It provides controls to use to specify how to carry out an action. The technical
names for common controls are shown in Figure 1. In most cases the technical terms are not used
in this book, but it is useful to know them because the Help and other sources of information often
use them.
Preface | 13
Frequently asked questions
How is LibreOffice licensed?
LibreOffice is distributed under the Open Source Initiative (OSI) approved Mozilla Public
License (MPL). See https://www.libreoffice.org/about-us/licenses/
It is based on code from Apache OpenOffice made available under the Apache License 2.0
but also includes software that differs from version to version under a variety of other Open
Source licenses. New code is available under LGPL 3.0 and MPL 2.0.
May I distribute LibreOffice to anyone? May I sell it? May I use it in my business?
Yes.
How many computers may I install it on?
As many as you like.
Is LibreOffice available in my language?
LibreOffice has been translated (localized) into over 40 languages, so your language
probably is supported. Additionally, there are over 70 spelling, hyphenation, and thesaurus
dictionaries available for languages, and dialects that do not have a localized program
interface. The dictionaries are available from the LibreOffice website at: www.libreoffice.org.
How can you make it for free?
LibreOffice is developed and maintained by volunteers and has the backing of several
organizations.
I am writing a software application. May I use programming code from LibreOffice in my
program?
You may, within the parameters set in the MPL and/or LGPL. Read the licenses:
https://www.mozilla.org/MPL/2.0/.
Why do I need Java to run LibreOffice? Is it written in Java?
LibreOffice is not written in Java; it is written in the C++ language. Java is one of several
languages that can be used to extend the software. The Java JDK/JRE is only required for
some features. The most notable one is the HSQLDB relational database engine.
Java is available at no cost. More information and download links to the appropriate edition
for your operating system can be found at: https://java.com/en/download/manual.jsp
Note
If you want to use LibreOffice features that require Java, it is important that the correct
32-bit or 64-bit edition matches the installed version of LibreOffice. See the Advanced
Options in Chapter 2 of this guide. If you do not want to use Java, you can still use
nearly all of the LibreOffice features.
14 | Preface
Getting Started Guide
Chapter 1
Introducing LibreOffice
What is LibreOffice?
LibreOffice is a freely available, fully-featured office productivity suite. Its native file format is Open
Document Format (ODF), an open standard format that is being adopted by governments
worldwide as a required file format for publishing and accepting documents. LibreOffice can also
open and save documents in many other formats, including those used by several versions of
Microsoft Office.
LibreOffice includes the following components.
Calc (spreadsheet)
Calc has all of the advanced analysis, charting, and decision making features expected from a
high-end spreadsheet. It includes over 500 functions for financial, statistical, and mathematical
operations, among others. The Scenario Manager provides “what if” analysis. Calc generates 2D
and 3D charts, which can be integrated into other LibreOffice documents. You can also open and
work with Microsoft Excel workbooks and save them in Excel format. Calc can also export
spreadsheets in several formats, including for example Comma Separated Value (CSV), Adobe
PDF and HTML formats.
Impress (presentations)
Impress provides all the common multimedia presentation tools, such as special effects, animation,
and drawing tools. It is integrated with the advanced graphics capabilities of LibreOffice Draw and
Math components. Slideshows can be further enhanced using Fontwork special effects text, as
well as sound and video clips. Impress is compatible with Microsoft PowerPoint file format and can
also save your work in numerous graphics formats.
Base (database)
Base provides tools for day-to-day database work within a simple interface. It can create and edit
forms, reports, queries, tables, views, and relations, so that managing a relational database is
much the same as in other popular database applications. Base provides many new features, such
as the ability to analyze and edit relationships from a diagram view. Base incorporates two
relational database engines, HSQLDB and Firebird. It can also use PostgreSQL, dBASE, Microsoft
Access, MySQL, Oracle, or any ODBC compliant or JDBC compliant database. Base also provides
support for a subset of ANSI-92 SQL.
Advantages of LibreOffice
Here are some of the advantages of LibreOffice over other office suites:
• No licensing fees. LibreOffice is free for anyone to use and distribute at no cost. Many
features that are available as extra cost add-ins in other office suites (like PDF export) are
free with LibreOffice. There are no hidden charges now or in the future.
• Open source. You can distribute, copy, and modify the software as much as you wish, in
accordance with the LibreOffice Open Source licenses.
• Cross-platform. LibreOffice runs on several hardware architectures and under multiple
operating systems, such as Microsoft Windows, macOS, and Linux.
• Extensive language support. The LibreOffice user interface, including spelling,
hyphenation, and thesaurus dictionaries, is available in over 100 languages and dialects.
LibreOffice also provides support for both Complex Text Layout (CTL) and Right to Left
(RTL) layout languages (such as Urdu, Hebrew, and Arabic).
• Consistent user interface. All the components have a similar “look and feel”, making them
easy to use and master.
• Integration. The components of LibreOffice are well integrated with one another.
– All the components share a common spelling checker and other tools, which are used
consistently across the suite. For example, the drawing tools available in Writer are also
found in Calc, with similar but enhanced versions in Impress and Draw.
– You do not need to know which application was used to create a particular file. For
example, you can open a Draw file from Writer; it will open automatically in Draw.
• Granularity. Usually, if you change an option, it affects all components. However,
LibreOffice options can be set at a component level or even at document level.
• File compatibility. In addition to its native OpenDocument formats, LibreOffice includes
support for opening and saving files in many common formats including Microsoft Office,
HTML, XML, WordPerfect, Lotus 1-2-3, and PDF.
• No vendor lock-in. LibreOffice uses OpenDocument, an XML (eXtensible Markup
Language) file format developed as an industry standard by OASIS (Organization for the
Advancement of Structured Information Standards). These files can easily be unzipped and
read by any text editor, and their framework is open and published.
• You have a voice. Enhancements, software fixes, and release dates are community-
driven. You can join the community and affect the course of the product you use.
You can read more about LibreOffice and The Document Foundation on their websites at
https://www.libreoffice.org/ and https://www.documentfoundation.org/.
Minimum requirements
LibreOffice 6.4 requires one of the following operating systems:
• Microsoft Windows: Windows 7 SP1, Windows 8, Windows Server 2012, or Windows 10;
Administrator rights are needed for the installation process.
Note
If you want to use LibreOffice features that require Java, it is important that the correct
32-bit or 64-bit edition matches the installed version of LibreOffice. See the Advanced
Options in Chapter 2 of this guide.
For a more detailed listing of hardware and software requirements, see the LibreOffice website,
https://www.libreoffice.org/get-help/system-requirements/.
Starting LibreOffice
In general, you start LibreOffice the same way you start any other program on your computer.
On Windows and Linux, entries for LibreOffice and each of its components appear in the system
menu of your computer. On macOS, only an entry for LibreOffice is added to the Applications
menu. You can make a desktop icon for LibreOffice or a component in the same way you can
make a desktop icon for any other program; see your operating system’s help for how to do this.
Clicking on the LibreOffice menu entry, desktop icon, or tile opens the LibreOffice Start Center
(Figure 2) from where you can select the individual components of LibreOffice. You can also
Toolbars
LibreOffice has two types of toolbars: docked (fixed in place) and floating. Docked toolbars can be
moved to different locations or made to float, and floating toolbars can be docked.
In a default LibreOffice installation, the top docked toolbar, just under the Menu bar, is called the
Standard toolbar. It is consistent across the LibreOffice applications.
The second toolbar at the top for Writer and Calc, in a default LibreOffice installation, is the
Formatting bar. It is context-sensitive; that is, it shows the tools relevant to the current position of
the cursor or the object selected. For example, when the cursor is on a graphic, the Formatting bar
provides tools for formatting graphics; when the cursor is in text, the tools are for formatting text.
In some cases it is convenient to reduce the number of toolbars displayed and get more space for
the document. LibreOffice provides a single-toolbar alternative to the default double-toolbar setup.
It contains the most-used commands. To activate it, enable View > User Interface > Single
Toolbar.
Other variations include Tabbed and Groupedbar Compact, both accessed from View > User
Interface. These provide a collection of tools at the top of the workspace, grouped in various ways
that may be familiar to users of Microsoft Office (the “ribbon”).
Moving toolbars
Docked toolbars can be undocked and moved to a new docked position or left as a floating toolbar.
1) Move the mouse cursor over the toolbar handle, which is the small vertical bar to the left of
a docked toolbar and highlighted in Figure 4.
2) Hold down the left mouse button and drag the toolbar to the new location. The toolbar can
be docked in a new position at the top, sides or bottom of the main window, or left as a
floating toolbar.
3) Release the mouse button.
To move a floating toolbar, click on its title bar and drag it to a new floating location or dock the
toolbar at the top or bottom of the main window.
Floating toolbars
LibreOffice includes several additional toolbars, whose default settings have them appear as
floating toolbars in response to the current position of the cursor or selection. You can dock these
toolbars to the top or bottom of the main window, or reposition them on your computer display (see
“Moving toolbars” above).
Some of these additional toolbars are context sensitive and will automatically appear depending on
the position of the cursor. For example, when the cursor is in a table, a Table toolbar appears, and
when the cursor is in a numbered or bullet list, the Bullets and Numbering toolbar appears.
• Click Customize Toolbar to open the Customize dialog; See Chapter 14, Customizing
LibreOffice, for more information.
• Click Dock Toolbar to dock the selected floating toolbar. You can reposition the toolbar to a
different docked position. See “Moving toolbars” on page 21.
• Click Dock All Toolbars to dock all floating toolbars. You can reposition the toolbars to
different docked positions. See “Moving toolbars” on page 21.
• Click Lock Toolbar Position to lock a docked toolbar into its docked position.
• Click Close Toolbar to close the selected toolbar.
Context menus
Context menus provide quick access to many menu functions. They are opened by right-clicking
on a paragraph, graphic, or other object. When a context menu opens, the functions or options
available will depend on the object that has been selected. A context menu can be the easiest way
to reach a function, especially if you are not sure where the function is located in the menus or
toolbars. Context menus may display an applicable keyboard shortcut if one has been set; you can
toggle this visibility off or on in Tools > Options > LibreOffice > View > Visibility.
Status bar
The status bar is located at the bottom of the workspace. It provides information about the
document and convenient ways to change some features quickly. It is similar in Writer, Calc,
Impress, and Draw, but each LibreOffice component includes some component-specific items. An
example of the Writer status bar is shown in Figure 7.
Sidebar
To activate the Sidebar, select View > Sidebar from the Menu bar. The Sidebar (Figure 8) is
located on the right side of the edit views of Writer, Calc, Impress, and Draw. It contains one or
more decks, based on the current document context. Decks are organized into panels. A tab bar
on the right side of the sidebar allows you to switch between different decks.
Note
If all documents are closed without exiting from LibreOffice, then the Start Center will
be displayed.
Note
When opening files stored in a remote server, you may be asked to enter your user
name and password to log in the server.
Saving documents
You can save documents as follows:
• Save – use if you are keeping the document, its current filename and location.
• Save Remote – use if your document is already stored in a remote server or will be stored
in a remote server.
• Save As – use to create a new document, or change the filename and/or file format, or
save the file in a different location on your computer.
• Save a Copy – use to save a copy of your current document and keep it open for more
editing.
• Save All – use to save all the files open in your current session.
Save As command
Password protection
To restrict who can open and read a document, or open and edit the document, use password
protection.
1) Using the Save As command above, select the Save with password option in the Save As
dialog or Save dialog.
2) Click Save and the Set Password dialog opens (Figure 11).
3) In File Encryption Password, enter a password to open the document and then enter the
same password as confirmation.
Caution
LibreOffice uses a very strong encryption mechanism that makes it almost impossible
to recover the contents of a document if you lose or forget the password.
Reloading a document
Reloading is useful in two situations.
• You may want to discard all the changes made in an editing session after the last document
save.
• You may have made some formatting changes that do not show until the document has
been closed and reopened; reloading has the same result.
To reload a document, go to File > Reload on the Menu bar. If you have made changes to a file
since the last save, a confirmation dialog will warn you that reloading will discard your last
changes. Choose whether to save or discard the changes.
On reloading the document, the File dialog does not open, because the file is already selected.
Description
Contains optional editable descriptive information about the document, which may be exported as
metadata to other file formats.
• Title – enter a title for the document.
• Subject – enter a subject for the document. You can use a subject to group documents with
similar contents.
• Keywords – enter the words that you want to use to index the content of the document.
Keywords must be separated by commas. A keyword can contain white space characters or
semicolons.
• Comments – enter comments to help identify the document.
Custom Properties
Use this page to assign custom information fields to the document. In a new document, this page
may be blank. If the new document is based on a template, this page may contain fields.You can
change the name, type, and contents of each row. The information in the fields will be exported as
metadata to other file formats.
Click Add Property to add a new custom property. Click Reset to delete all custom properties.
CMIS Properties
Used for documents stored on remote servers. See the Help for more information.
Security
Enables two password-protected security options.
• Open file read-only – select to allow this document to be opened only in read-only mode.
This file sharing option protects the document against accidental changes. It is still possible
to edit a copy of the document and save that copy with the same name as the original.
• Record changes – select to require that all changes be recorded. To protect the recording
state with a password, click Protect and enter a password. This is similar to Edit > Track
Changes > Record on the Menu bar. However, while other users of this document can
apply their changes, they cannot disable change recording without knowing the password.
Font
When Embed fonts in the document is selected, any fonts used in the document will be
embedded into the document when it is saved. This may be useful if you are creating a PDF and
want to control how it will look on other computer systems.
Only embed fonts that are used in documents – If fonts have been defined for the document
(for example, in the template), but have not been used, select this option to not embed them.
Font scripts to embed – You can choose which types of fonts are embedded: Latin, Asian,
Complex.
Statistics
Displays statistics for the current file, such as the number of pages, words, and characters.
Closing a document
If only one document is open and you want to close that document, go to File > Close on the
Menu bar or click on the X on the right or left end of the Menu bar. On Windows and Linux, the
document closes and the LibreOffice Start Center opens. On macOS, the document closes and
only the Menu bar remains at the top of the screen.
If more than one document is open and you want to close one of them, go to File > Close on the
Menu bar or click on the X on the title bar of that document’s window. The X may be located on
either the right or left end of the title bar.
If the document has not been saved since the last change, a message box is displayed. Choose
whether to save or discard your changes.
Caution
Not saving your document could result in the loss of recently made changes, or worse
still, the entire file.
Closing LibreOffice
To close LibreOffice completely, go to File > Exit LibreOffice on the Menu bar on Windows and
Linux. On macOS, go to LibreOffice > Quit LibreOffice on the Menu bar.
On Windows and Linux, when you close the last document using the X on the title bar of the
window, then LibreOffice will close completely. On macOS, you need to use LibreOffice > Quit
LibreOffice.
You can also use a keyboard shortcut as follows:
• In Windows and Linux – Ctrl+Q
• In macOS – Command ⌘+Q
If any documents have not been saved since the last change, a message box is displayed. Choose
whether to save or discard your changes.
Note
If you are unable to solve your problem using Safe Mode, the Advanced tab provides
instructions on receiving further aid.
In the Advanced tab you can also create a .zip file of your corrupted user profile which
can then be uploaded to the bug tracking system where it can be further investigated
by the developers.
However, be aware that your uploaded user profile may contain sensitive information
such as installed extensions, personal dictionaries, and settings.
Chapter 2
Setting up LibreOffice
Choosing options to suit the way you work
Introduction
This chapter briefly presents some of the setup options found under Tools > Options on the Menu
bar (LibreOffice > Preferences on macOS). Additional options, and more details about the ones
given here, are covered in the Help.
Tip
Many options are intended for power users and programmers. If you don’t understand
what an option does, it’s usually best to leave it on the default setting unless
instructions in this book recommend changing the setting.
Note
The Reset button, located in the lower right of the full Options dialog, resets the values
on that page to the values that were in place when you opened the dialog. It may be
called Revert on some installations.
General
The options on the LibreOffice – General page (Figure 18) are described below.
Help – Extended tips
When Extended tips is active, a brief description of the function of a particular icon or menu
command or a field on a dialog appears when you hold the mouse pointer over that item.
Help – Show “No offline help installed” popup
Deselect to disable this popup dialog when you select Help, if offline help is not installed.
Help – Show “Tip of the Day” dialog on start-up
Deselect to disable the “Tip of the Day” dialog. You can also disable this from the dialog.
Open/Save Dialogs – Use LibreOffice dialogs
Select this option to use the Open and Save dialogs supplied with LibreOffice. Deselect to
use the standard Open and Save dialogs for your operating system. This book uses the
LibreOffice Open and Save dialogs in illustrations.
View
The options on the LibreOffice – View page affect how the document window looks and behaves.
Some of these options are described below Figure 19. Set them to suit your personal preferences.
Some of the available options vary with your computer’s operating system; the figure below shows
the options on Windows 10.
Pasting into another No effect on the clipboard The last marked selection is the content of
document contents. the selection clipboard.
Tip
Press Shift+Ctrl+R to restore or refresh the view of the current document after
changing the anti-aliasing settings, to see the effect.
Figure 20: Font list (Left) with preview; (Right) without preview
Tip
If your printouts are incorrectly placed on the page or chopped off at the top, bottom,
or sides, or the printer is refusing to print, the most likely cause is page size
incompatibility.
Note
Linux installations have an extra option (not shown in Figure 21): PDF as Standard
Print Job Format. Select this option to change the internal print job format from a
Postscript document description to a PDF description. This format has a number of
advantages over Postscript. For more information, see
https://www.linuxfoundation.org/collaborate/workgroups/openprinting/
pdf_as_standard_print_job_format
Paths
On the LibreOffice – Paths page, you can change the location of files associated with, or used by,
LibreOffice to suit your working situation. For example, you might want to store documents by
default somewhere other than My Documents.
To make changes, select an item in the list shown in Figure 22 and click Edit. On the Select Paths
dialog (not shown; may also be titled Edit Paths), add or delete folders as required, and then click
Tip
You can use the entries on the LibreOffice – Paths page to compile a list of files, such
as those containing AutoText, that you need to back up or copy to another computer.
Fonts
You can define replacements for any fonts that might appear in your documents. If you receive
from someone else a document containing fonts that you do not have on your system, LibreOffice
will substitute fonts for those it does not find. You might prefer to specify a different font from the
one that the program chooses.
Note
These choices do not affect the default font for your documents. To do that, you need
to change the default template for documents, as described in Chapter 3, Using Styles
and Templates.
Security
Use the LibreOffice – Security page to choose security options for saving documents and for
opening documents that contain macros.
Security Options and Warnings
If you record changes, save multiple versions, or include hidden information or notes in your
documents, and you do not want some of the recipients to see that information, you can set
warnings to remind you to remove it, or you can have LibreOffice remove some of it
automatically. Note that (unless removed) much of this information is retained in a file
Figure 24: Choosing security options for opening and saving documents
Passwords for web connections
You can enter a master password to enable easy access to websites that require a user
name and password. LibreOffice will securely store all passwords that you use to access files
from web servers. You can retrieve the passwords from the list after you enter the master
password.
Macro security
Click the Macro Security button to open the Macro Security dialog (not shown here), where
you can adjust the security level for executing macros and specify trusted sources.
Certificate Path
Users can digitally sign documents using LibreOffice. A digital signature requires a personal
signing certificate. Most operating systems can generate a self-signed certificate. However, a
personal certificate issued by an outside agency (after verifying an individual’s identity) has a
higher degree of trust associated with it than does a self-signed certificate. LibreOffice does
not provide a secure method of storing these certificates, but it can access certificates that
have been saved using other programs. Click the Certificate button and select which
certificate store to use. Not available on Windows; LibreOffice uses the default Windows
location for storing and retrieving certificates.
TSAs –Time Stamping Authorities
You can optionally select a Time Stamping Authority (TSA) URL for PDF documents created
by LibreOffice. Recipients of PDF documents with a trusted timestamp can verify when the
document was digitally or electronically signed, as well as verify that the document was not
altered after the date the timestamp vouches for.
Personalization
You can customize the overall appearance of LibreOffice with themes.
On the LibreOffice – Personalization page, select Preinstalled Theme and then click on a theme
thumbnail and click Apply. After a brief pause the appearance of LibreOffice will refresh and reflect
the selected theme.
Accessibility
Accessibility options include whether to allow animated graphics or text, some options for high
contrast display, and a way to change the font for the LibreOffice user interface.
Accessibility support relies on the Java Runtime Environment for communication with assistive
technology tools. The Support assistive technology tools option is not shown on all LibreOffice
installations. See Assistive Tools in LibreOffice in the Help for other requirements and information.
Select or deselect the options as required.
Advanced
LibreOffice needs Java to run several wizards, the Mediawiki Publisher (if available; see page 59),
and some functions in the Base component.
Caution
The Expert Configuration dialog lets you access, edit, and save configuration
preferences that can turn the user profile of LibreOffice unstable, inconsistent, or even
unusable.
Online Update
On the LibreOffice – Online Update page (Figure 30), you can choose whether and how often to
have the program check the LibreOffice website for program updates. If the Check for updates
automatically option is selected, an icon appears at the right-hand end of the menu bar when an
update is available. Click this icon to open a dialog where you can choose to download the update.
If the Download updates automatically option is selected, the download starts when you click the
icon. To change the download destination, click the Change button and select the required folder in
the file browser window.
If the Send OS version and basic hardware information option is selected, information about
the computer architecture and operating system will be sent to the server for statistics collection.
General
Most of the choices on the Load/Save – General page are familiar to users of other office suites.
Some items of interest are described below.
If you choose to save relatively, the references to embedded graphics or other objects in your
document will be saved relative to the location in the file system. In this case, it does not
matter where the referenced directory structure is recorded. The files will be found regardless
of location, as long as the reference remains on the same drive or volume. This is important if
you want to make the document available to other computers that may have a completely
different directory structure, drive or volume names. It is also recommended to save relatively
if you want to create a directory structure on an Internet server.
If you prefer absolute saving, all references to other files will also be defined as absolute,
based on the respective drive, volume or root directory. The advantage is that the document
containing the references can be moved to other directories or folders, and the references
remain valid.
VBA Properties
On the VBA Properties page, you can choose whether to keep any macros in Microsoft Office
documents that are opened in LibreOffice.
If you choose Load Basic code, you can edit the macros in LibreOffice. The changed code is
saved in an ODF document but is not retained if you save into a Microsoft Office format.
If you choose Save original Basic code, the macros will not work in LibreOffice but are retained
unchanged if you save the file into Microsoft Office format.
If you are importing a Microsoft Word or Excel file containing VBA code, you can select the option
Executable code. Whereas normally the code is preserved but rendered inactive (if you inspect it
with the Basic IDE you will notice that it is all commented), with this option the code is ready to be
executed.
Figure 35: LibreOffice language options, without and with Asian and
CTL options enabled
On the right-hand side of the Language Settings – Languages page, change the User interface,
Locale setting, Default currency, and Default Languages for Documents as required. In the
example, English (USA) has been chosen for all the appropriate settings.
User interface
The language of the user interface is usually set at the time LibreOffice is installed to match
the language of the operating system. If more than one language has been installed for
LibreOffice, you can select which language will be used for menus, dialogs, and help files.
Locale setting
The locale setting is the basis for many other settings within LibreOffice, for example defaults
for numbering, currency, and units of measure. Unless you select something else here, the
locale of the operating system will be set as default.
Decimal separator key
If the Decimal separator key – Same as locale setting option is selected, LibreOffice uses
the character defined by the default locale. If this option is not selected, the keyboard driver
defines the character used.
Default currency
The default currency is that used in the country entered as locale. The default currency
determines the proper formatting of fields formatted as currency. If the locale setting is
changed, the default currency changes automatically. If the default currency is changed, all
dialogs involving currency and all currency icons will be changed in all open documents.
Documents that were saved with one currency as the default will open using the new
currency defaults.
Date acceptance patterns
Date acceptance patterns define how LibreOffice recognizes input as dates. Locale also
defines the default expression of dates. You can define additional date patterns, separated
by semicolons, using Y, M, & D for Year, Month, and Day. LibreOffice will always correctly
interpret dates entered in ISO 8601 format as Y-M-D and YYYY-MM-DD.
Caution
Data entered into a Calc spreadsheet or a Writer table must be entered in a format
defined by locale in order to be recognized as dates.
Note
An ABC icon in front of a language indicates that a spelling dictionary, thesaurus, and
hyphenation dictionary are activated for this language.
Figure 37: Choosing languages, dictionaries, and options for checking spelling
Grammar checking
Possible mistakes
Checks for things such as; with it’s, he don’t, this things and so on.
Capitalization
Checks for the capitalization of sentences. The sentence boundary detection depends on
abbreviations.
Word duplication
Checks for all word duplication, rather than just the default words ‘and’, ‘or’, ‘for’, and ‘the’.
Parentheses
Checks for pairs of parentheses and quotation marks.
Others
Convert to metric; Convert to non-metric
Converts quantities in a given type of unit to quantities in the other type of unit: metric to
imperial or imperial to metric.
Thousands separation of large numbers
Converts a number with five or more significant digits to a common format, that is one which
uses the comma as a thousands separator, or to the ISO format which uses a narrow space
as a separator, depending on the locale setting for the document.
A MediaWiki publisher is included on Windows and Linux. To enable it, select MediaWiki in the
Internet options, then click the Add button to open a dialog where you can specify the address
(URL) and login information for a wiki. You can add several wikis to the list. A JRE (Java Runtime
Environment) is needed for this feature to work.
Chapter 3
Using Styles and Templates
Using consistent formatting in your documents
Introduction
There are two basic ways to format text and other elements. Understanding these two alternatives
is essential for unlocking the power of LibreOffice:
Direct (or manual) formatting
Applies formatting directly to specific paragraphs, characters, pages, frames, lists, tables,
cells, and other elements. For example, you can select a word, then click on a button on the
Formatting toolbar to format the text as bold or italic.
Styles
Bundles formatting options under one name. For example, a paragraph style defines
numerous settings for options such as font type and size, whether paragraphs should be
indented, the space between lines, how paragraphs should be aligned on the page, and
many others.
Note
Direct formatting overrides styles. You cannot remove manual formatting by applying a
style to it. To remove direct formatting, select the text, right-click, and choose Clear
Direct Formatting from the context menu. Alternatively you can clear direct formatting
from selected text by pressing Ctrl+M (Ctrl+Shift+M in Impress), by selecting Format >
Clear Direct Formatting in the Menu bar, by selecting the Clear Direct Formatting
icon in Writer’s Formatting toolbar, or by selecting the Clear Direct Formatting icon in
Calc’s Standard toolbar.
Applying styles
LibreOffice provides several ways for you to select and apply styles:
• The Styles deck in the Sidebar
• Fill Format Mode
• The Styles menu (Writer and Calc)
• The Paragraph Style list (Writer) and Apply Style list (Calc) in the Formatting toolbar
• Keyboard shortcuts
Tip
At the bottom of the Styles deck is a drop-down list. In Figure 40 the list shows All
Styles defined for the document. It could show Applied Styles (only the styles used in
the document) or other groups of styles, for example Custom Styles.
Figure 40: The Styles deck for Writer, showing paragraph styles and filter
Caution
When this mode is active, a right-click anywhere in the document undoes the last Fill
Format action. Be careful not to accidentally right-click and undo actions you want to keep.
Set Paragraph Style list (Writer) and Apply Style list (Calc)
In Writer, after you have used a paragraph style at least once in a document, the style name
appears in the Set Paragraph Style list at the left-hand end of the Formatting toolbar.
In Calc, after you have used a cell style at least once in a spreadsheet, the style name appears in
the Apply Style list at the left-hand end of the Formatting toolbar. When you install Calc, the initial
default is for the Apply Style list to be hidden; use Tools > Customize in the Menu bar to enable
the display of the Apply Style list in Calc’s Formatting toolbar.
You can open this list and click the style you want, or you can use the up and down arrow keys to
move through the list and then press Enter to apply the highlighted style.
Tip
Select More Styles at the bottom of the list to open the Styles deck in the Sidebar.
Note
Any changes you make to a style are effective only in the current document. To
change styles in more than one document, you need to change the template.
Tip
You can also access the relevant Style dialogs through the Set Paragraph Style
(Writer) and Apply Style (Calc) lists. Click the arrow at the right of the entry for the style
to be modified and select Edit Style from the context menu. You can access the
appropriate Style dialog for the current style by selecting Styles > Edit Style from the
Menu bar.
Caution
When updating a paragraph style, make sure that the selected paragraph contains
unique properties. If it mixes font sizes or font styles, those mixed properties will
remain the same as before.
3) In the Styles deck, select the style to update, then click on the arrow next to the Styles
actions icon and select Update Selected Style.
Tip
You can also modify the current style by pressing Ctrl+Shift+F11 (Writer), or by
selecting Styles > Update Selected Style in the Menu bar (Writer and Calc), or by
pressing the Update Selected Style icon in the Formatting toolbar (Writer).
Tip
You can also modify a style through the Set Paragraph Style (Writer) and Apply Style
(Calc) lists. Click the arrow at the right of the entry for the style to be modified and
select Update to Match Selection from the drop-down menu (see Figure 43).
Figure 43: Modifying a style from the Set Paragraph Style list
Tip
If you are in the habit of manually overriding styles in your document, be sure that
AutoUpdate is not enabled.
Tip
You can also create a new style from a selection by pressing Shift+F11 (Writer), or by
selecting Styles > New Style from Selection (Writer and Calc), or by pressing the
New Style from Selection icon on the Formatting toolbar (Writer).
Figure 46: Copying styles from a template into the open document
Tip
You can also access the Load Styles dialog by selecting Styles > Load Styles in the
Menu bar.
Deleting styles
You cannot remove (delete) any of LibreOffice’s predefined styles from a document or template,
even if they are not in use.
You can remove any user-defined (custom) styles; but before you do, you should make sure the
styles are not in use in the current document.
To delete any unwanted styles, in the Styles deck select each one to be deleted (hold down the
Control key while selecting multiple styles), and then right-click on a selected style and select
Delete on the context menu.
If the style is not in use, it is deleted immediately without confirmation. If the style is in use, you
receive a warning message asking you to confirm deletion. Select Yes to continue with the
deletion.
Tip
You can also open a template by double-clicking it in the system's file explorer window.
The template the document is based upon is listed in File > Properties > General. The connection
between the template and the document remains until the template is modified and, the next time
that the document is opened, you choose not to update it to match the template.
Tip
On the Start Center, click on the Templates button to view the available templates
without opening the Templates dialog. Click on the required template to create a new
document.
Creating a template
You can create templates by saving a document as a template or (in Writer) by using a wizard.
Editing a template
You can edit a template’s styles and content, and then, if you wish, you can reapply the template’s
styles to documents that were created from that template. You cannot reapply content.
To edit a template:
1) Open the Templates dialog, as described in step 1 of “Creating a document from a
template” on page 71.
2) In the Templates dialog, find the template that you want to edit. Right-click on it to open the
context menu, then click Edit (see Figure 47). The template opens in LibreOffice.
3) Edit the template and save your changes as you would for any other document.
Caution
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.
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.
Organizing templates
LibreOffice can manage only those templates that are in its template folders (categories), although
you can create a document from a template that is not in one of these folders. You can create new
template categories and use them to organize your templates. For example, you might have one
template category for report templates and another for letter templates. You can also import and
export templates.
Tip
The location of template folders in LibreOffice depends on the operating system of
your computer. If you want to know where the template folders are located, go to
Tools > Options > LibreOffice > Paths.
To begin, open the Templates dialog as described in step 1 of “Creating a document from a
template” on page 71.
Note
You cannot create a sub-category inside a template category in LibreOffice.
Moving a template
To move a template from one template category to another, select it in the Templates dialog, and
click the Move button near the bottom of the dialog. In the Select Category dialog (Figure 53),
select the destination category and click OK. The selected template is moved to the folder. You can
also create a new category into which to move the template.
Renaming a template
You can also rename a template if the current name does not match it's purpose. To rename a
template, right click a template and select Rename in the pop up menu. The Enter New Name
dialog opens. Type a name in the Enter New Name text box and click OK.
Deleting a template
You cannot delete templates supplied with LibreOffice. Nor can you delete any templates installed
by the Extension Manager except by removing the extension that installed them.
However, you can delete templates that you have created or imported:
1) From the Filter drop-down lists at the top of the Templates dialog, select the category that
contains the template you want to delete.
2) Select the template to delete.
3) Right-click on the template to open the context menu and click Delete (Figure 47).
4) A message box appears and asks you to confirm the deletion. Click Yes.
Tip
You can also press the Delete button on the keyboard to delete the selected template
on the Templates dialog.
Exporting a template
To export a template from a template category to another location in your computer or network:
1) In the Templates dialog, locate the category that contains the template to export.
2) Select the template that you want to export.
3) Click the Export button in the bottom right of the dialog. The Select Folder or Select Path
dialog opens.
4) Find the folder into which you want to export the template and select Select Folder or OK.
5) Press OK on the displayed information dialog.
Chapter 4
Getting Started with Writer
Word processing with LibreOffice
What is Writer?
Writer is the word processor component of LibreOffice. In addition to the usual features of a word
processor (spelling check, thesaurus, hyphenation, autocorrect, find and replace, automatic
generation of tables of contents and indexes, mail merge, and others), Writer provides these
important features, which are covered in detail in the Writer Guide:
• Templates and styles (see Chapter 3)
• Page layout methods, including styles, frames, columns, and tables
• Automated tables of contents and indexes
• Embedding or linking of images, equations, spreadsheets, and other objects
• Built-in drawing tools
• Master documents, to group a collection of documents into a single document
• Change tracking during revisions
• Lists
• Tables of data
• Database integration, including a bibliography database
• Mail merge
• Export to PDF and ePub (see Chapter 10)
• Document digital signatures
• Form design and filling
• And many more
Caution
Changing the page style here may affect the styles of following pages, depending on
how the page styles are set up. See the Writer Guide for details.
Language
Shows the language at the cursor position, or for the selected text, that is used for checking
spelling and grammar as well as for hyphenation and thesaurus dictionaries.
Click to open a menu where you can choose another language for the selected text or for the
paragraph where the cursor is located. You can also choose None (Do not check spelling)
to exclude the text from a spelling check or choose More to open the Character dialog. Any
directly formatted language settings can be reset to the default language from this menu.
On Windows systems, you can hold down the Alt key while dragging to select a block of text.
You do not need to enter the block selection mode.
Document changes status
The icon that is displayed here changes appearance to indicate whether the document has
no unsaved changes, or it has been edited and the changes have not been saved. Click on
the unsaved changes icon to save the document.
Digital signature
If the document has been digitally signed, an icon is displayed here; otherwise, it is blank. To
sign the document, or to view the certificate, click the area or icon.
Section or object information
When the cursor is on a section, heading, or list item, or when an object (such as a picture or
table) is selected, information about that item appears in this field. Clicking in this area opens
a relevant dialog. For details, consult the Help or the Writer Guide.
View layout
Click an icon to change between single page, multiple pages, and book layout views. The
effect varies with the combination of window width and zoom factor in use. You can edit the
document in any view. See Figure 58.
Sidebar
The Sidebar is normally open by default on the right side of the Writer window. If necessary, select
View > Sidebar from the Menu bar, or press Ctrl+F5, to display it. An example is shown in Chapter
1, Introducing LibreOffice.
The Writer Sidebar contains five decks by default: Properties, Page, Styles, Gallery, and Navigator.
Each deck has a corresponding icon on the Tab bar on the right of the sidebar, allowing you to
switch between them.
Each deck consists of a title bar and one or more content panels. Some panels contain a small
More Options button, which opens a dialog to give greater choice of editing controls. When a
dialog is open, the document is locked for editing until the dialog is closed.
The decks are described below.
Properties deck
Contains tools for direct formatting of content.
For text editing, the default view shows tools organized into three panels:
– Style: Apply a paragraph style at the cursor position. Create or update a style.
– Character: Modify text by the font type, size, color, weight, style, and spacing.
– Paragraph: Style the paragraph by alignment, lists or bullets, background color, indent,
and spacing.
Additional panels appear when specific types of items are selected.
If an image is selected, then the following panels open:
– Area: Modify the image background fill and transparency. Further colors, gradients,
hatching, patterns, and bitmap selection and importing are available in More Options.
– Image: Modify the image brightness, contrast, color mode, and transparency.
– Wrap: Modify wrap and spacing where these are available.
– Position and Size: Modify width, height, rotation, and flip attributes.
If a drawing object is selected, then the following panels are available:
– Area: Modify fill and transparency.
– Line: Modify style, width, color, and transparency.
– Position and Size: Modify width, height, rotation, and flip attributes.
If a table is selected, then the Table panel opens: insert, select, delete rows and columns;
split/merge cells; set row height and column width; others.
If a frame is selected, then the Wrap panel opens but may be grayed-out if frame wrap is not
available.
If a video or audio clip is inserted by selecting Insert > Media > Audio or Video, the
following panels open when the clip is selected:
– Media Playback: Control for play, pause, stop, seek, loop, and volume.
– Position and Size: Modify width and height.
Caution
Be aware that by changing the options on the Page deck, you will change the page style
in use, modifying not only the current page but all pages in the document using the same
page style.
Styles deck
Manages the styles used in the document. This includes applying existing styles, modifying them,
or creating new ones. You can preview the changes by checking Show Previews at the bottom.
Gallery deck
Contains images and diagrams included in the Gallery themes. The Gallery has two sections. The
first lists the themes by name (Arrows, Bullets, Diagrams, etc.) and the second displays the images
in the selected category. Select the New Theme button to create new categories. To insert an
image into a file, or add a new image to the new category, drag and drop the selected image.
Navigator deck
Makes it easy to navigate to specific types of content and to reorganize contents based on
categories, such as headings, tables, frames, images, and so on. See “Using the Navigator” in
Chapter 1, Introducing LibreOffice.
Tip
Whenever it is possible to choose the document file format, choose the default ODF
format. This reduces the possibility of errors.
Tip
To have Writer save documents by default in a Microsoft Word file format, go to Tools
> Options > Load/Save > General. In the section named Default File Format and
ODF Settings, under Document type, select Text document, then under Always save
as, select your preferred file format.
Using Go to Page
To jump to a specific page in the document, you can use Edit > Go to Page on the Menu bar, or
the keyboard shortcut Ctrl+G, or click on the page number field in the Status Bar, to open the Go to
Page dialog (Figure 60). It initially shows the number of the current page and the number of pages
in the document. Type the number of the required destination page into the text box and click the
OK button.
Using Reminders
Reminders let you mark places in your document that you want to return to later on, for example to
add or correct information or simply mark where you finished editing. The possible uses of
reminders are limited only by your imagination.
To set a reminder at the cursor’s current location, click the Set Reminder icon in the Navigator.
You can set up to five reminders in a document; setting a sixth causes the first to be deleted.
Reminders are not highlighted in any way in the document, nor are they listed in the Navigator, so
you cannot see where they are, except that when you jump from one to the next, the location of the
cursor shows the location of the reminder.
To jump between reminders, first select the Reminder icon on the Navigation toolbar. Then click
the Previous and Next icons. Reminders are not saved with the document.
Figure 61: Selecting items that are not next to each other
For more information about keyboard selection of text, see the topic “Navigating and selecting with
the keyboard” in LibreOffice Help (F1).
Pasting text
When you paste text, the result depends on the source of the text and how you paste it. If you click
on the Paste button on the Standard toolbar or use Ctrl+V, any formatting the text has (such as
bold or italics) is retained. Text pasted from Web sites and other sources may also be placed into
frames or tables. If you do not like the results, click the Undo button or press Ctrl+Z.
To make the pasted text inherit the paragraph style at the insertion point:
• Choose Edit > Paste Special, or
• Click the arrow button of the combination Paste button on the Standard toolbar, or
• Double click the Paste button in the Standard toolbar without releasing the left mouse
button.
Then select Paste Unformatted Text or Unformatted text as applicable from the resulting menu.
Unformatted text can also be pasted with Shift+Ctrl+Alt+V.
Tip
Regular expressions offer powerful ways to search and replace text. For example, they
can find all instances where any number is followed by specific letters. However, they
can be challenging to understand. Refer to the Help files for guidance.
Caution
Use Replace All with caution; otherwise, you may end up with some highly
embarrassing (and often hilarious) mistakes. A mistake with Replace All might require
a manual, word-by-word, search to fix.
Using AutoCorrect
Writer’s AutoCorrect function has a long list of common misspellings and typing errors, which it
corrects automatically. For example, “hte” will be changed to “the”. It also includes codes for
inserting special characters, emoji, and other symbols.
AutoCorrect is turned on by default. You may wish to disable some of its features, modify others, or
turn it off completely.
You can add your own corrections or special characters or change those supplied with LibreOffice.
Choose Tools > AutoCorrect > AutoCorrect Options to open the AutoCorrect dialog. On the
Replace tab (Figure 68), you can define which strings of text are corrected and how. In most cases,
the defaults are fine.
To stop Writer replacing a specific spelling, go to the Replace tab, highlight the word pair, and click
Delete. To add a new spelling to the list, type it into the Replace and With boxes on the Replace
tab, and click New.
See the different tabs of the dialog for the wide variety of other options available to fine-tune
AutoCorrect.
To turn AutoCorrect off, uncheck Tools > AutoCorrect > While Typing.
Tip
LibreOffice has an extensive list of special characters accessible with AutoCorrect. For
example, type :smiling: and AutoCorrect will replace it with ☺. Or, (c) will be changed
to ©. You can add your own special characters.
Note
Automatic word completion only occurs after you type a word for the second time in a
document.
Using AutoText
Use AutoText to store text, tables, fields, and other items for reuse and assign them to a key
combination for easy retrieval. For example, rather than typing “Senior Management” every time
you use that phrase, you can set up an AutoText entry to insert those words when you type “sm”
and press F3.
To store some text as AutoText:
1) Type the text into your document, then select the text.
2) Choose Tools > AutoText (or press Ctrl+F3).
3) In the AutoText dialog, type a name for the AutoText in the Name box. Writer will suggest a
one-letter shortcut, which you can change.
4) Choose the category for the AutoText entry, for example My AutoText.
5) Click the AutoText button at the bottom of the dialog and select from the menu either New,
to have the AutoText retain specific formatting, no matter where it is inserted, or New (text
only), to have the AutoText take on the existing formatting around the insertion point.
6) Click Close to return to your document.
7) To insert AutoText, type the shortcut and press F3.
Tip
If the only option under the AutoText button is Import, either you have not entered a
name for your AutoText or there is no text selected in the document.
AutoText is especially powerful when assigned to fields. See Chapter 17, Fields, in the Writer
Guide for more information.
Formatting text
There are two basic ways to format text. Understanding these two alternatives is essential for
unlocking the power of LibreOffice:
Direct (or Manual) formatting
Applies formatting directly to specific paragraphs, characters, pages, frames, lists, or tables.
For example, you can select a word, then click on a button on the Formatting toolbar to
format the text as bold or italics.
Styles
Bundles formatting options under one name. For example, a paragraph style defines
numerous settings for options such as font type and size, whether paragraphs should be
indented, the space between lines, how paragraphs should be aligned on the page, and
many others.
Tip
For important information about using paragraph styles to format documents, see
Chapter 3 of this book and Chapters 8 and 9 in the Writer Guide.
Note
Direct formatting (also called manual formatting) overrides styles. This means that
when a new style is applied, direct formatting is not removed and still determines the
displayed format.
Note
When clearing direct formatting, the text formatting will return to the applied paragraph
and character style and not the default paragraph style or default character style
(unless these styles are actually applied to the text).
Note
Just as direct paragraph formatting overrides the current paragraph style, applying
direct character formatting to characters overrides the current character style
formatting.
Formatting tables
Tables in a Writer document share the same sets of formatting elements as the spreadsheets in
LibreOffice Calc.
To apply table styles, click in the table to be formatted and double-click on a style listed in the Table
Styles tab of the Sidebar’s Styles deck. Alternatively, click in the table to be formatted, choose
Table > AutoFormat Styles on the Menu bar and select a style from the dialog that opens. For
more information, refer to Chapter 13, Tables of Data, in the Writer Guide.
AutoCorrection
You can set Writer to format or correct parts of a document automatically as you type, according to
the choices made on the Options tab of the AutoCorrect dialog (Tools > AutoCorrect >
AutoCorrect Options).
Some common unwanted or unexpected formatting changes include:
• Horizontal lines. If you type three or more hyphens (---), underscores (___) or equal signs
(===) on a line and then press Enter, the paragraph is replaced by a horizontal line as wide
as the column in the page. Note that the line is actually the lower border of the preceding
paragraph.
• Bulleted and numbered lists. A bulleted list is created when you type a hyphen (-), star (*),
or plus sign (+), followed by a space or tab at the beginning of a paragraph. A numbered list
is created when you type a number followed by a period (.), followed by a space or tab at
Tip
If you notice unexpected formatting changes occurring in your document, this is the
first place to look for the cause. In most cases Edit > Undo (Ctrl+Z) fixes the issue.
To turn AutoCorrect on or off, choose Tools > AutoCorrect and select or deselect the items on the
list. The Help describes each of these choices.
Tip
Bullets and numbering applied in these ways cannot be removed with Format > Clear
Direct Formatting in the Menu bar, or with the Clear Direct Formatting icon on the
Formatting toolbar, or by using Ctrl+M. Rather, they are turned off or removed from
selected text by toggling the relevant buttons on the Formatting toolbar, or on the
Sidebar’s Properties deck.
Note
If numbering or bullets are being applied automatically in a way that you find
inappropriate, you can switch them off temporarily by unchecking Tools >
AutoCorrect > While Typing.
The Toggle Bulleted List and Toggle Numbered List buttons on the Sidebar’s Properties deck
can also be used to create nested lists. Click the down arrow next to the relevant button, then
More Bullets/Numbering to access the Bullets and Numbering dialog. However, the Sidebar does
not include tools for promoting and demoting items in the list, as found on the Bullets and
Numbering toolbar.
Tip
Using tabs to space out material on a page is not recommended. Depending on what
you are trying to accomplish, a table or frame might be a better choice.
To set the spacing of default tab stop intervals, go to Tools > Options > LibreOffice Writer >
General.
Note
Turning on hyphenation for the Default Style paragraph style affects all other
paragraph styles that are based on Default Style. You can individually change other
styles so that hyphenation is not active; for example, you might not want headings to
be hyphenated.
Any styles not based on Default Style are not affected. See Chapter 3, Using Styles
and Templates, for more about styles based on styles other than Default Style.
Note
Hyphenation options set on the Writing Aids dialog are effective only if hyphenation is
turned on through paragraph styles.
Formatting pages
Every page in Writer is based on a page style. Page styles define basic layout, including page size,
margins, headers and footers, borders, backgrounds, and so on. Changes to these settings
automatically change the page style. This means that, in contrast to paragraph styles, these
settings cannot be used to directly format individual pages.
As with other styles, Writer comes with a number of page styles. You can modify these styles or
create new ones. The Default Style page style is used when no other page style has been
specified.
In addition to page styles, several features enable you to further control page layouts, including
columns, frames, tables, and sections. For more information, see Chapters 5 (Formatting Pages:
Basics) and 6 (Formatting Pages: Advanced) in the Writer Guide.
Tip
Page layout is usually easier if you show text, object, table, and section boundaries in
Tools > Options > LibreOffice > Application Colors, and paragraph ends, tabs,
breaks, and other items in Tools > Options > LibreOffice Writer > Formatting Aids.
Numbering pages
Displaying the page number
To display page numbers automatically:
1) Insert a header or footer, as described in “Creating headers and footers” above.
2) Place the cursor in the header or footer where you want the page number to appear and
choose Insert > Page Number.
3) Change the alignment of the number if you wish (left, right, or center).
Note
The Page Count field inserts the total number of pages in the document, as shown on
the Statistics tab of the document’s Properties dialog (File > Properties). If you restart
page numbering anywhere in the document, then the total page count may not be
what you want. See the Writer Guide for more information.
Caution
When you change the margins, the page style is also changed and the changed
margins apply to all pages using that style.
Caution
The two small gray triangles on the ruler are used for indenting paragraphs. The
double-headed arrows shown in Figure 80 are mouse cursors shown in the correct
position for moving the margin markers. Because the triangles and arrows are often in
the same place, when changing page margins you need to be careful to move the
arrows, not the gray triangles.
Note
The watermark will automatically become part of the page style where it is inserted
and all other pages of the same style will have the watermark. Pages with different or
no watermarks need different Page Styles for those pages.
Formatting comments
At the bottom of the comment, Writer automatically adds the author’s name and a time stamp
indicating when the comment was created. If more than one person edits the document, each
author is automatically allocated a different background color. Figure 82 shows an example of text
with comments from two different authors.
Printing comments
When a document contains comments, the print dialog has an option for comments to be printed
next to the text in the right margin, as they appear on the screen. In that case, the text on each
page is scaled down to make space for the comments. The Print dialog also has options for placing
comments at the end of the page or at the end of the document, or for printing only the comments.
Tip
The language used at the location of the cursor is shown in the Status Bar, next to the
page style in use.
Caution
Be careful when changing a language in character or paragraph styles, as this will
change the language for all characters or paragraphs using that style. It may be useful
to include the language in the name of the style.
Also, note that languages set with direct formatting will override languages set using
styles.
Note
Although these methods are a type of direct formatting, they cannot be cleared by
using Format > Clear Direct Formatting on the Menu bar, clicking the Clear Direct
Formatting icon on the Formatting toolbar, selecting Clear Direct Formatting from
the context menu, or using Ctrl+M.
Tip
Not all changes are recorded. For example, changing a tab stop from align left to align
right, and changes in formulas (equations) or linked graphics are not recorded.
Caution
A document with track changes activated but with the changes not shown carries an
invisible history of document editing that the current user may not be aware of.
Contents deleted or modified can be recovered. While this is a feature, it is also a
potential privacy risk.
Using fields
Fields are extremely useful features of Writer. You can use them for data that changes (such as the
current date or the total number of pages) and for inserting document properties such as name,
author, and date of last update. Fields are the basis of cross-referencing (see below); automatic
numbering of figures, tables, headings, and other elements; and a wide range of other functions—
too many to describe here. See Chapter 17, Fields, in the Writer Guide for details.
Using bookmarks
Use bookmarks to rapidly navigate or link to specific locations in a document. They are listed in the
Navigator and can be accessed directly from there with a single mouse click. You can cross-
reference to bookmarks and create hyperlinks to bookmarks, as described above. To create a
bookmark:
1) Select the text you want to bookmark. Click Insert > Bookmark.
2) On the Insert Bookmark dialog, the larger box lists any previously defined bookmarks. Type
a name for this new bookmark in the top box, and then click Insert.
Chapter 5
Getting Started with Calc
Using spreadsheets in LibreOffice
What is Calc?
Calc is the spreadsheet component of LibreOffice. You can enter data (usually numerical) in a
spreadsheet and then manipulate this data to produce certain results.
Alternatively, you can enter data and then use Calc in a “What if...” manner by changing some of
the data and observing the results without having to retype the entire spreadsheet or sheet.
Other features provided by Calc include:
• Functions, which can be used to create formulas to perform complex calculations on data.
• Database functions, to arrange, store, and filter data.
• Dynamic charts; a wide range of 2D and 3D charts.
• Macros, for recording and executing repetitive tasks; scripting languages supported include
LibreOffice Basic, Python, BeanShell, and JavaScript.
• Ability to open, edit, and save Microsoft Excel spreadsheets.
• Import and export of spreadsheets in multiple formats, including HTML, CSV, PDF, and
PostScript.
Formula syntax
By default, LibreOffice Calc uses its own formula syntax, referred to as Calc A1, rather than the
Excel A1 syntax that is used by Microsoft Excel. LibreOffice will translate seamlessly between the
two. However, if you are familiar with Excel you may wish to change the default syntax in Calc by
going to Tools > Options > LibreOffice Calc > Formula and choosing Excel A1 or Excel R1C1
from the Formula syntax drop-down menu.
For more information on formula syntax, see Chapter 7, Using Formulas and Functions, in the Calc
Guide.
Macros
Microsoft Office uses Visual Basic for Applications (VBA) code, and LibreOffice uses Basic code
based on the LibreOffice API. Although the programming languages are the same, the objects and
methods are different and therefore not entirely compatible.
LibreOffice can run some Excel Visual Basic scripts if you enable this feature at Tools > Options >
Load/Save > VBA Properties.
If you want to use macros written in Microsoft Excel using the VBA macro code in LibreOffice, you
must first edit the code in the LibreOffice Basic IDE editor.
For more information, refer to Chapter 12, Calc Macros, in the Calc Guide.
Title bar
The Title bar, located at the top, shows the name of the current spreadsheet. When a spreadsheet
is newly created from a template or a blank document, its name is Untitled X, where X is a number.
When you save a spreadsheet for the first time, you are prompted to enter a name of your choice.
Menu bar
Under the Title bar is the Menu bar. When you select one of the menu items, a sub-menu drops
down to show commands. You can also customize the Menu bar; see Chapter 14, Customizing
LibreOffice, for more information.
Most of the menus are similar to those in other components of LibreOffice, although the specific
commands and tools may vary. The menus specific to Calc are Sheet and Data; in addition,
several important data analysis tools are found in the Tools menu.
Sheet
The most often used commands for handling sheets, such as insert and delete cells,
columns, rows and sheets; select cell reference type; and link to external data.
Toolbars
In a default LibreOffice installation, the top docked toolbar, just under the Menu bar, is called the
Standard toolbar. It is consistent across the LibreOffice applications. The position and use of it and
other toolbars are described in Chapter 1, Introducing LibreOffice.
Formula bar
The Formula Bar (Figure 85) is located at the top of the sheet in the Calc workspace. It is
permanently docked in this position and cannot be used as a floating toolbar. However, it can be
hidden or made visible by going to View > Formula Bar on the Menu bar.
Status Bar
The Calc Status Bar (Figure 87) provides information about the spreadsheet as well as quick and
convenient ways to change some of its features. Most of the fields are similar to those in other
components of LibreOffice; see Chapter 1, Introducing LibreOffice, for more information.
Sidebar
The Calc Sidebar (View > Sidebar or Ctrl+F5) is located on the right side of the window. It is a
mixture of toolbar and dialog. It is similar to the Sidebar in Writer (shown in Chapter 1 and Chapter
4 of this book) and consists of five decks: Properties, Styles, Gallery, Navigator, and Functions.
Each deck has a corresponding icon on the Tab panel to the right of the sidebar, allowing you to
switch between them. The decks are described below.
Properties
This deck includes five content panels. These panels, with the exception of the Style panel,
have a More Options button that opens a dialog with additional options. These dialogs lock
the document for editing until they are closed.
Style: Access to the available cell styles, update cell styles, and new cell styles.
Character: Controls for formatting the text, such as font family, size, and color. Some
controls, such as superscript, become active only when the text cursor is active in the Input
line of the Formula bar or the cell.
Number Format: Quickly change the format of numbers including decimals, currency, dates,
percentage, or numeric text; and leading zeroes.
Alignment: Controls to align the text in various ways, including horizontal and vertical
alignment, wrapping, indenting, merging, text orientation, and vertical stacking.
Cell Appearance: Controls to set the appearance of cells, including cell background color,
cell border formats including line color and style, and grid lines.
Styles, Gallery, Navigator
These decks are similar to those in Writer. Their use is described in more detail in the Calc
Guide.
Spreadsheet layout
Individual cells
The main section of the workspace in Calc displays the cells in the form of a grid. Each cell is
formed by the intersection of one column and one row in the spreadsheet.
At the top of the columns and the left of the rows are a series of header boxes containing letters
and numbers. The column headers use an alpha character starting at A and go on to the right. The
row headers use a numerical character starting at 1 and go down.
These column and row headers form the cell references that appear in the Name Box on the
Formula Bar (Figure 85). If the headers are not visible on the spreadsheet, choose View >
Headers on the Menu bar.
Sheet tabs
Each Calc spreadsheet can contain multiple sheets. At the bottom of the grid of cells are sheet
tabs indicating how many sheets are in the spreadsheet. Click on a tab to display that sheet. An
active sheet is indicated with a white tab (default Calc setup). You can also select multiple sheets
by holding down the Ctrl key while clicking on the sheet tabs.
To change the default name for a sheet (Sheet1, Sheet2, and so on), right-click on a sheet tab and
select Rename Sheet from the context menu, or double-click on the sheet tab, to open a dialog
where you can type a new name for the sheet.
To change the color of a sheet tab, right-click on the tab and select Tab Color from the context
menu to open the Tab Color dialog. Select a color and click OK. To add new colors to this color
palette, see Chapter 14, Customizing LibreOffice.
Note
Most CSV files come from database tables, queries, or reports, where further
calculations and charting are required. On Microsoft Windows, CSV files often have
the XLS file name extension to look like an Excel file, but they are still CSV files
internally.
Saving spreadsheets
For information on how to save files manually or automatically, see Chapter 1, Introducing
LibreOffice. Calc can save spreadsheets in a range of formats and also export spreadsheets to
PDF, HTML, XHTML file formats and JPEG and PNG images formats; see Chapter 6, Printing,
Exporting, E-mailing, and Signing, in the Calc Guide for more information.
Note
Once you have saved a spreadsheet in another format, all changes you make to the
spreadsheet will now occur only in the format you are using. If you want to go back to
working with a *.ods version, you must save the file as a *.ods file.
Tip
To have Calc save spreadsheets by default in a file format other than the default ODS
format, go to Tools > Options > Load/Save > General. In the Default File Format and
ODF Settings area, select Spreadsheet in Document type, then in Always save as,
select your preferred file format.
Cell navigation
When a cell is selected or in focus, the cell borders are emphasized. When a group of cells is
selected, the cell area is colored. The color of the cell border emphasis and the color of a group of
selected cells depends on the operating system being used and how you have set up LibreOffice.
• Mouse: place the mouse pointer over the cell and click the left mouse button.
• Cell reference: delete the existing cell reference in the Name Box on the Formula Bar
(Figure 85 on page 121). Type the new cell reference and press Enter. Cell references are
case-insensitive.
• Navigator: press F5 to open the Navigator (Figure 91) or click the Navigator button in the
Sidebar. Type the cell reference into the Column and Row fields and press Enter, or use the
adjacent increment / decrement buttons.
Sheet navigation
Each sheet in a spreadsheet is independent of the other sheets, though references can be linked
from one sheet to another. To navigate between sheets in a spreadsheet:
Navigator – double-click on any of the listed sheets to select the sheet.
Keyboard – Ctrl+Page Down moves one sheet to the right and Ctrl+Page Up moves one
sheet to the left.
Mouse – click on a sheet tab at the bottom of the spreadsheet to select that sheet.
If your spreadsheet contains a lot of sheets, then some of the sheet tabs may be hidden. If this is
the case:
• Using the four buttons to the left of the sheet tabs can move the tabs into view (Figure 92).
• Right-clicking on any of the arrows, or the +, opens a context menu where you can select a
sheet (Figure 93).
Note
When you insert a new sheet into a spreadsheet, Calc automatically uses the next
number in the numeric sequence as a name. Depending on which sheet is open when
you insert a new sheet, the new sheet may not be in its correct numerical position. It is
recommended to rename sheets in a spreadsheet to make them more recognizable.
Tip
You can also select a contiguous range of cells by first clicking in the Selection mode
field on the Status Bar (Figure 87 on page 122) and selecting Extending selection
before clicking in the opposite corner of the range of cells. Make sure to change back
to Standard selection or you may extend a cell selection unintentionally.
Tip
You can also directly select a range of cells using the Name Box. Click in the Name
Box on the Formula Bar (Figure 85 on page 121). Enter the cell reference for the
upper left-hand cell, followed by a colon (:), and then the lower right-hand cell
reference. For example, to select the range that would go from A3 to C6, you would
enter A3:C6.
Deleting cells
1) Select the cells you want to delete.
2) Go to Sheet > Delete Cells, or press Ctrl+-. Or, right-click on a cell and select Delete from
the context menu.
3) Select the option you require from the Delete Cells dialog (Figure 96) and click OK.
Caution
When you move or copy to another spreadsheet or a new spreadsheet, a conflict may
occur with formulas linked to other sheets in the previous location.
Tip
LibreOffice Calc does not let you hide the last visible sheet.
Renaming sheets
By default, the name for each new sheet added is SheetX, where X is the number of the next sheet
to be added. While this works for a small spreadsheet with only a few sheets, it can become
difficult to identify sheets when a spreadsheet contains many sheets.
To rename a sheet, use one of these methods:
• Enter the name in the Name text box when you create the sheet using the Insert Sheet
dialog (Figure 97 on page 132).
• Right-click on a sheet tab and select Rename Sheet from the context menu to replace the
existing name with a different one.
• Double-click on a sheet tab to open the Rename Sheet dialog.
Note
Sheet names must start with either a letter or a number; other characters, including
spaces, are not allowed. Apart from the first character of the sheet name, permitted
characters are letters, numbers, spaces, and the underscore character. Attempting to
rename a sheet with an invalid name will produce an error message.
Viewing a spreadsheet
Changing document view
Use the zoom function (View > Zoom) to show more or fewer cells in the window when you are
working on a spreadsheet. For more about zoom, see Chapter 1, Introducing LibreOffice.
Often the first row and column contain headings, which you may wish to be visible when scrolling
through a long or wide spreadsheet. To quickly freeze either or both of these, use the commands
on the drop-down menu by the Freeze Rows and Columns icon on the Standard toolbar: Freeze
First Row and Freeze First Column.
To freeze either rows or columns (single or multiple):
1) Click on the row header below the rows you want the freeze or click on the column header
to the right of the columns where you want the freeze.
2) Right-click and choose Freeze Rows and Columns from the context menu, or choose
View > Freeze Rows and Columns on the Menu bar, or click the Freeze Rows and
Columns icon on the Standard toolbar.
To freeze both rows and columns (single or multiple):
1) Click in the cell that is immediately below the rows you want to freeze and immediately to
the right of the columns you want frozen.
2) Choose View > Freeze Rows and Columns on the Menu bar, or click the Freeze Rows
and Columns icon on the Standard toolbar.
Numbers
Click in the cell and type in a number using the number keys on either the main keyboard or
numeric keypad. By default, numbers are right aligned in a cell.
Negative numbers
To enter a negative number, either type a minus (–) sign in front of the number or enclose the
number in parentheses (), for example (1234). The result for both methods of entry will be the
same, –1234.
Leading zeroes
If a number is entered with leading zeroes, for example 01481, by default Calc will drop the leading
zero. To retain a minimum number of characters in a cell when entering numbers and retain the
number format, for example 1234 and 0012, use one of these methods to add leading zeroes.
Method 1
1) With the cell selected, right-click on the cell, select Format Cells from the context menu, or
go to Format > Cells on the Menu bar, or use the keyboard shortcut Ctrl+1, to open the
Format Cells dialog (Figure 102).
2) Make sure the Numbers tab is selected, then select Number in the Category list.
3) In the Leading zeroes field within the Options area, enter the minimum number of
characters required. For example, for four characters, enter 4. Any number less than four
characters will have leading zeroes added, for example 12 becomes 0012.
4) Click OK. The number entered retains its number format and any formula used in the
spreadsheet will treat the entry as a number in formula functions.
Tip
To format numbers with only decimal places, but without a leading zero (for example,
019 instead of 0.019), then in the Format code box (Figure 102), type a . (period or full
stop) followed by ? (question marks) to represent the number of decimal places
required. For example, for 3 decimal places, type .??? and click OK. Any number with
only decimal places will then have no leading zero.
Numbers as text
Numbers can also be entered as text using one of the following methods.
Method 1
1) With the cell selected, right-click on the cell and select Format Cells from the context
menu, or go to Format > Cells on the Menu bar, or use the keyboard shortcut Ctrl+1, to
open the Format Cells dialog (Figure 102).
2) Make sure the Numbers tab is selected, then select Text from the Category list.
3) Click OK. The number is converted to text and, by default, left-aligned.
Method 2
1) Select the cell.
2) In the Sidebar, go to the Properties deck. If necessary, click the open panel icon (+ or
arrow) by Number Format to open that panel (Figure 103).
3) Select Text in the category drop-down list. Formatting is applied to the cell immediately.
Note
By default, any numbers that have been formatted as text in a spreadsheet will be
treated as a zero by any formulas used in the spreadsheet. Formula functions will
ignore text entries. You can change this feature in Tools > Options > LibreOffice
Calc > Formula. In Detailed Calculation Settings, select Custom (conversion of text
to numbers and more). Click the Details button, and then select the proper treatment
in the pop-up dialog (Conversion from text to number drop-down list).
Text
Click in the cell and type the text. By default, text is left-aligned in a cell. Cells can contain several
lines of text. If you want to use paragraphs, press Ctrl+Enter to create another paragraph.
On the Formula bar, you can extend the Input line if you are entering several lines of text. Click on
the Expand Formula Bar icon located on the right-hand end of the Formula bar and the Input line
becomes multi-line.
Note
The Insert Field > Document Title command inserts the name of the spreadsheet
and not the title defined in the Description tab in the Properties dialog for the file.
Tip
The fields are refreshed when the spreadsheet is saved or recalculated when using
the Ctrl+Shift+F9 shortcut.
AutoCorrection
Calc automatically applies many changes during data input using autocorrection, unless you have
deactivated any autocorrect changes. You can also undo any autocorrection changes by using the
keyboard shortcut Ctrl+Z or manually by going back to the change and replacing the autocorrection
with what you want to actually see.
To change the autocorrect options, go to Tools > AutoCorrect Options on the Menu bar to open
the AutoCorrect dialog (Figure 104).
Replace tab
Edit the replacement table for automatically correcting or replacing words or abbreviations.
Exceptions tab
Specify the abbreviations or letter combinations that you do not want corrected automatically.
Options tab
Select the options for automatically correcting errors as you type.
Localized Options tab
Specify the AutoCorrect options for quotation marks and for options that are specific to the
language of the text.
Reset button
Reset modified values back to their previous values.
AutoInput tool
The AutoInput tool in Calc automatically completes entries, based on other entries in the same
column. When text is highlighted in a cell, AutoInput can be used as follows:
1) To accept the completion, press Enter, or F2, or click the mouse button.
2) To view more completions, use the key combinations Ctrl+Tab to scroll forward, or
Ctrl+Shift+Tab to scroll backward.
3) To see a list of all available AutoInput text items for the current column, use the keyboard
combination Alt+Down Arrow.
When typing formulas using characters that match previous entries, a Help tip will appear listing
the last ten functions used in the Function Wizard from all defined range names and from the
content of all label ranges. AutoInput ignores the case sensitivity of any data you enter.
By default, AutoInput is activated in Calc. To turn it off, go to Tools on the Menu bar and deselect
AutoInput.
Fill tool
The Fill tool is used to duplicate existing content or create a series in a range of cells (see Figure
105).
1) Select the cell containing the contents you want to copy or start the series from.
Selection lists
Selection lists are available only for text and are limited to using only text that has already been
entered in the same column.
1) Select a blank cell in a column that contains cells with text entries.
2) Right-click and select Selection Lists from the context menu, or press Alt+Down Arrow. A
drop-down list appears listing any cell in the same column that either has at least one text
character or whose format is defined as text.
3) Click on the text entry you require and it is entered into the selected cell.
Caution
This technique automatically overwrites, without any warning, any information that is
already in the cells on the selected sheets. Make sure you deselect the additional
sheets when you are finished entering information that is going to be repeated before
continuing to enter data into the spreadsheet.
Editing data
Deleting data
Deleting data only
To delete only the data in a cell or range of cells, without deleting any of the cell formatting, select
the cells and then press the Delete key.
To completely delete cells, rows, or columns, see the instructions on page 131.
Replacing data
To completely replace data in a cell and insert new data, select the cell and type in the new data.
The new data will replace the old data but will retain the cell formatting.
Alternatively, select the cell and click in the Input line on the Formula bar (Figure 85 on page 121),
then double-click on the data to highlight it completely and type the new data.
Changing data
Sometimes it is necessary to edit the contents of cell without removing all of the data from the cell.
For example, changing the phrase “Sales in Qtr. 2” to “Sales rose in Qtr” can be done as follows.
Formatting data
Note
All the settings discussed in this section can also be set as a part of the cell style. See
Chapter 4, Using Styles and Templates, in the Calc Guide for more information.
Automatic wrapping
To automatically wrap multiple lines of text in a cell, use one of the following methods.
Merging cells
You can select contiguous cells and merge them into one as follows:
1) Select the range of contiguous cells you want to merge.
2) Right-click on the selected cells and select Merge Cells from the context menu, or go to
Format > Merge Cells > Merge Cells or Merge and Center Cells on the Menu bar, or
click on the Merge and Center Cells icon on the Formatting toolbar. Using Merge and
Center Cells will center align any contents in the cells.
3) If the cells contain any data, a small dialog (Figure 112) opens, showing choices for moving
or hiding data in the hidden cells. Make your selection and click OK.
Caution
Merging cells can lead to calculation errors in formulas used in the spreadsheet.
Splitting cells
You can reverse or split only a cell that was created from several cells by merging.
1) Select a merged cell.
2) Go to Format > Merge Cells > Split Cells on the Menu bar, or right-click and select Split
Cells from the context menu, or click on the Merge and Center Cells icon on the
Formatting toolbar.
3) Any data in the cell will remain in the first cell. If the hidden cells did have any contents
before the cells were merged, then you have to manually move the contents in to the
correct cell.
Note
Cell border properties apply only to the selected cells and can be changed only when
you are editing those cells. For example, if cell C3 has a top border, that border can
only be removed by selecting C3. It cannot be removed in C2 despite also appearing
to be the bottom border for cell C2.
AutoFormatting of cells
Using AutoFormat
You can use Calc’s AutoFormat feature to format a table (range of cells) quickly and easily. It also
lets you format different tables of the sheet with the same look and feel very easily. All formatting
applied is direct formatting.
1) Select the cells in at least three columns and rows, including column and row headers, that
you want to format.
2) Go to Format > AutoFormat Styles on the Menu bar to open the AutoFormat dialog
(Figure 113).
3) Select the type of format and format color from the list.
4) Select the formatting properties to be included in the AutoFormat style.
5) Click OK.
Note
The new AutoFormat is stored in your computer user profile and is not available to
other users. However, other users can import the new AutoFormat by selecting the
table range in the spreadsheet document and defining it as a new AutoFormat.
Using themes
Calc comes with a predefined set of formatting themes (set of styles) that you can apply to
spreadsheets. It is not possible to add new themes to Calc, but you can modify the theme styles
after the theme is applied to the spreadsheet. The modified styles are available for use only in that
spreadsheet.
To apply a theme to a spreadsheet:
1) Go to Format > Spreadsheet Theme on the Menu bar or click the Spreadsheet Theme
icon in the Tools toolbar to open the Theme Selection dialog (Figure 114).
2) Select the theme that you want to apply. The theme styles are immediately visible on the
underlying spreadsheet.
Caution
Applying a new theme over an existing one will override all existing theme styles
customization with the new theme styles.
Filtering data
A filter is a list of conditions that each entry has to meet to be displayed. Calc provides three types
of filter:
Standard – Specifies the logical conditions to filter the data.
AutoFilter – Filters data according to a specific value or string. Automatically filters the selected
cell range and creates one-row list boxes where you can choose the items that you want to display.
Advanced – Uses filter criteria from specified cells.
Setting up and using filters are explained in Chapter 2, Entering, Editing, and Formatting Data, of
the Calc Guide.
Cell protection
All or some of the cells in a spreadsheet can be password protected to prevent changes being
made by unauthorized users. This can be handy when multiple people have access to the
spreadsheet itself, but only a few are allowed to modify the data it contains. Protected cells can
optionally be hidden.
Use the Cell Protection tab of the Format Cells dialog (Figure 115) to set up cell protection and
toggle the hidden status of protected cells.
Sorting records
Sorting within Calc arranges the cells in a sheet using the sort criteria that you specify. Several
criteria can be used and a sort applies each criteria consecutively. Sorts are useful when you are
searching for a particular item and become even more useful after you have filtered data.
Also, sorting is useful when you add new information to your spreadsheet. When a spreadsheet is
long, it is usually easier to add new information at the bottom of the sheet, rather than adding rows
in their correct place. After you have added information, you then carry out a sort to update the
spreadsheet.
For more information on how to sort records and the sorting options available, see Chapter 2,
Entering, Editing, and Formatting Data, in the Calc Guide.
To sort cells in a spreadsheet using the Sort dialog:
1) Select the cells to be sorted.
2) Go to Data > Sort on the Menu bar, or press the Sort icon on the Standard toolbar, to open
the Sort dialog (Figure 118).
3) On the Sort Criteria tab, select the sort criteria from the drop down lists. The selected lists
are populated from the selected cells.
4) Select either ascending order (A-Z, 0-9) or descending order (Z-A, 9-0).
5) Adjust the settings as required on the Options tab.
6) Click OK and the sort is carried out on your spreadsheet.
Cell comments
Comments are small notes and text that can serve as a reminder or an aside to the user. A
comment is not considered a part of the spreadsheet for calculation or printing purposes, and will
only appear when hovering the mouse over the particular cell that has been commented.
The easiest way to insert a comment is by right-clicking on the desired cell and selecting Insert
Comment from the context menu. Alternatively, you can select Insert > Comment from the Menu
bar, or use Ctrl+Alt+C, or click the Insert Comment icon in the Standard toolbar.
By default, comments will remain hidden and only appear when hovering the mouse. Cells that
contain comments are marked with a red square in the upper right corner. To toggle the visibility of
comments, select View > Comments on the Menu bar.
For more information, see Chapter 11, Sharing and Reviewing Spreadsheets, in the Calc Guide.
Creating formulas
Functions and formulas can be entered directly into the Formula bar or by accessing the Function
Wizard. To launch the Function Wizard, click the Function Wizard icon to the right of the Name
Box, or select Insert > Function on the Menu bar, or press Ctrl+F2.
Inside the Function Wizard, you can search, list, and narrow down the many Calc functions
available. You can also choose to complete functions from within the wizard rather than having to
type full formulas into the Formula bar.
Note
A fast alternative to the Function Wizard is the Functions deck in the Sidebar, where
you can quickly list and narrow down functions. It provides brief explanations on their
use and syntax, but does not provide the search or data entry capabilities of the full
wizard.
For a more in-depth introduction to formulas and the Function Wizard, see Chapter 7, Using
Formulas and Functions, in the Calc Guide.
Analyzing data
Calc includes several tools to help you analyze the information in your spreadsheets, ranging from
features for copying and reusing data, to creating subtotals automatically, to varying information to
help you find the answers you need. These tools are divided between the Tools and Data menus.
Calc also includes many tools for statistical analysis of data, where you can obtain important
numerical information on data obtained from physical measurements, polls, or even business
transactions such as sales, stock quotations, and so on. These statistical data analyses are
available in the menu Data > Statistics.
See Chapter 9, Data Analysis, in the Calc Guide for more information on the tools available in Calc
to analyze data.
Pivot charts
To get a quick visual representation of the data contained in a pivot table, you can generate a pivot
chart. Functionally, pivot charts are nearly identical to regular charts except in two key areas. First,
as the data in the pivot table is altered, the pivot chart will adjust itself automatically. Second, it
includes field buttons, graphical elements that allow you to filter the content of the pivot table from
within the pivot chart itself.
For more information on pivot charts and charts in general, see Chapter 3, Creating Charts and
Graphs, and Chapter 8, Using Pivot Tables, in the Calc Guide.
Printing
Printing from Calc is much the same as printing from other LibreOffice components (see Chapter
10, Printing, Exporting, E-mailing, and Signing Documents). However, some details of printing in
Calc are different, especially regarding preparation for printing.
After print ranges have been defined, they are formatted with automatic page breaks. To view the
page breaks, go to View > Page Break on the Menu bar.
Print ranges
Print ranges have several uses, including printing only a specific part of the data or printing
selected rows or columns on every page. For more information about using print ranges, see
Chapter 6, Printing, Exporting, E-mailing, and Signing in the Calc Guide.
Note
The additional print range will print as a separate page, even if both ranges are on the
same sheet.
Printing options
To select the printing options for page order, details, and scale to be used when printing a
spreadsheet:
1) Go to Format > Page on the Menu bar to open the Page Style dialog (Figure 120).
2) Select the Sheet tab and make your selections from the available options. Click OK.
Page breaks
While defining a print range can be a powerful tool, it may sometimes be necessary to manually
adjust the Calc printout manually using a manual or page break. A page break helps to ensure that
the data prints properly according to the page size and page orientation. You can insert a
horizontal page break above or a vertical page break to the left of the active cell.
Inserting a break
To insert a page break:
1) Navigate to the cell where the page break will begin.
2) Go to Sheet > Insert Page Break on the Menu bar.
3) Select Row Break to create a page break above the selected cell. Select Column Break to
create a page break to the left of the selected cell.
Deleting a break
To remove a page break:
1) Navigate to a cell that is next to the break you want to remove.
2) Go to Sheet > Delete Page Break on the Menu bar.
3) Select Row Break or Column Break as needed.
Note
Multiple manual row and column breaks can exist on the same page. When you want
to remove them, you have to remove each break individually.
Chapter 6
Getting Started with Impress
Presentations in LibreOffice
What is Impress?
Impress is the presentation (slide show) program included in LibreOffice. You can create slides that
contain many different elements, including text, bulleted and numbered lists, tables, charts, and a
wide range of graphic objects such as clipart, drawings, and photographs. Impress also includes a
spelling checker, a thesaurus, and styles for drawings, text, and backgrounds.
This chapter includes instructions to guide you through the Impress environment while designing
your presentations. Although more difficult designs are mentioned in this chapter, explanations for
creating them are in the Impress Guide. If you have a working knowledge of how to create slide
shows, we recommend you use the Impress Guide for your source of information.
To use Impress for more than very simple slide shows requires some knowledge of the elements
which the slides contain. Slides that contain text use styles to determine the appearance of that
text. Creating drawings in Impress is similar to the Draw component of LibreOffice. For this reason,
we recommend that you also see Chapter 3, Using Styles and Templates, and Chapter 7, Getting
Started with Draw, in this guide. You may also wish to consult the Draw Guide for more details on
how to use the drawing tools.
Starting Impress
When you start Impress, it opens with the Select a Template dialog (Figure 123) displayed over the
workspace, unless you have turned off this feature. Templates are included to fit two standard
sizes of presentation slides: 4:3 and 16:9 ratios. Other slides sizes are available in the Sidebar.
Tip
To start Impress without the Select a Template dialog, deselect Show this dialog at
startup in the lower left of the dialog, or go to Tools > Options > LibreOffice Impress
> General and deselect Start with Template Selection under New Document.
Tip
You can close the Slides pane or the Sidebar by clicking the X in the upper right corner
of each pane or go to View > Slide Pane or View > Sidebar on the Menu bar to
deselect the pane. To reopen a pane, select View > Slide Pane or Sidebar again.
You can also maximize the Workspace area by clicking on the Hide/Show marker in
the middle of the vertical separator line (highlighted in Figure 124). Using the
Hide/Show marker hides, but does not close, the Slide pane or Sidebar. To restore a
pane, click again on its Hide/Show marker.
Workspace
The Workspace (normally in the center of the main window) opens in the Normal view. It has five
views: Normal, Outline, Notes, Handout, and Slide Sorter. The workspace views are described on
page 166.
Figure 124: Main window of Impress; ovals indicate the Hide/Show markers
Menu bar
The Impress Menu bar provides several menus common to all LibreOffice components, although
the commands on them may differ (File, Edit, View, Insert, Format, Tools, Window, Help), plus Slide
and Slide Show. When you select one of the menus, a sub-menu drops down to show commands.
You can customize the Menu bar; see Chapter 14, Customizing LibreOffice, for more information.
Sidebar
The Impress Sidebar is usually located on the right side of the window. It is similar to the Sidebar in
Writer (shown in Chapter 1 and Chapter 4 of this guide) and consists of seven decks. Each deck
has a corresponding icon on the Tab panel to the right of the Sidebar. To display a deck, click on its
icon or click on the Sidebar Settings icon at the top of the Tab panel and select a deck from the
drop-down list.
Properties
This deck has two panels. The Slide panel shows the characteristics of the selected slide,
which you can modify in the panel, and the available slide layouts. You can choose a layout
and use it as it is, or modify it to meet your requirements. However, it is not possible to save
customized layouts. See “Selecting slide layout” on page 170.
Slide Transition
Provides quick selection of slide transition options and transition speed (slow, medium, fast),
automatic or manual transition, and how long the selected slide should be shown (automatic
transition only). For more information, see “Slide transitions” on page 191.
Animation
A variety of animations can be used to emphasize or enhance different elements of each
slide. This panel provides an easy way to add, change, or remove animations. See page
192.
Master Slides
Here you choose the slide style for your presentation. Impress includes several designs for
Master Slide. One of them (Default) is blank; the others have a background and styled text.
For more information, see “Working with master slides and styles” on page 180.
Styles
Here you can quickly apply drawing (graphic and text) styles and presentation styles, create
new drawing styles, and open style dialogs to modify both types of styles. When you save
changes to a style, the changes are applied to all of the elements formatted with that style in
the presentation. See “Styles” on page 180.
Toolbars
Many toolbars can be used during slide creation. They can be displayed or hidden by going to
View > Toolbars on the Menu bar and selecting from the submenu. For more information, see
Chapter 1, Introducing LibreOffice.
Many of the toolbars in Impress are similar to the toolbars in Draw. Refer to the Draw Guide for
details on the functions available and how to use them.
Status bar
The Status bar (Figure 125), located at the bottom of the Impress window, contains information that
you may find useful when working on a presentation. For details on the contents and use of these
fields, see Chapter 1, Introducing LibreOffice, in this guide and Chapter 1, Introducing Impress, in
the Impress Guide.
You can hide the Status Bar by going to View on the Menu bar and deselecting Status Bar.
Workspace views
The Impress workspace has four views: Normal, Outline, Notes, and Slide Sorter. You can
display a row of View buttons above the workspace by choosing View > Views Tab Bar from the
Menu bar, or you can switch between them using entries on the View menu.
Each of the workspace views is designed to ease the completion of certain tasks. It is therefore
useful to familiarize yourself with them in order to accomplish those tasks quickly.
Note
Each workspace view displays a different set of toolbars when selected. These toolbar
sets can be customized by going to View > Toolbars on the Menu bar, then check or
uncheck the toolbars you want to add or remove.
Normal view
View > Normal is the main view for working with individual slides. Use this view to format and
design and to add text, graphics, and animation effects.
To place a slide in the slide design area (Normal view) (Figure 124 on page 163), click the slide
thumbnail in the Slides pane or double-click it in the Navigator.
Outline view
View > Outline (Figure 126) contains all the slides of the presentation in their numbered
sequence. It shows topic titles, bulleted lists, and numbered lists for each slide in outline format.
Formatting a presentation
Inserting slides
New slide
A new slide can be inserted into a presentation after the selected slide in any of these ways:
• Use Slide > New Slide on the Menu bar.
• Right-click on a slide in the Slides Pane or Slide Sorter view and select New Slide from the
context menu.
• Click the New Slide icon in the Presentation toolbar. You can also select the layout of the
new slide by clicking on the small downward arrow of the icon. If the Presentation toolbar is
not visible, go to View > Toolbars on the Menu bar and select Presentation from the list.
• Press Ctrl+M.
Duplicate slide
Sometimes, rather than starting from a new slide you may want to duplicate a slide already in the
presentation. To duplicate a slide:
1) Select the slide you want to duplicate from the Slides Pane.
2) Then do one of the following:
– Use Slide > Duplicate Slide on the Menu bar.
Tip
To view the names for the included layouts, use the Tooltip feature: position the cursor
on an icon in the Layout section and its name will be displayed in a small rectangle.
In Tools > Options > LibreOffice > General > Help, select the Extended tips option
to get more detailed tooltip information.
To select or change the layout of a slide, select the slide in the Slides Pane so that it appears in the
Workspace, then select the desired layout from the Layouts section in the Sidebar. Several layouts
contain one or more content boxes. Each of these content boxes can be configured to contain text,
movies, images, charts, or tables.
You can choose the type of content by clicking on the corresponding icon that is displayed in the
middle of the content box as shown in Figure 132. If you intend to use the content box for text, click
on Click to add text.
Note
Changes to any of the layouts included in Impress can only be made using View >
Normal. Attempting any changes by modifying a master slide, although possible, may
result in unpredictable results and requires extra care as well as a certain amount of
trial and error.
Adding text
To add text to a slide that contains a text frame, click on Click to add text in the text frame and
then type your text. The Outline styles are automatically applied to the text as you insert it. You can
change the outline level of each paragraph as well as its position within the text by using the arrow
buttons on the Outline toolbar (see Figure 133 and “Outline view” on page 166) or using the Tab
key while positioning the cursor at the beginning of the paragraph. For more information on text,
see “Adding and formatting text” on page 173.
Adding objects
To add any objects to a slide, for example a picture, clipart, drawing, photograph, or spreadsheet,
click on Insert then select from the drop down menu what type of object you want to insert. For
more information, see “Adding pictures, tables, charts, and media” on page 178.
Note
Inserting and correctly formatting a background is beyond the scope of this chapter,
but you can find all the information you need in Chapter 4, Changing Object Attributes,
of the Draw Guide or in Chapter 6, Formatting Graphic Objects, of the Impress Guide.
Note
AutoLayout text boxes can automatically resize fonts to let the box contain all the text
you insert. If you insert a long piece of text, the font size may shrink to fit into the box.
Otherwise, the font keeps its default size.
Pasting text
Text may be inserted into the text box by copying it from another document and pasting it into
Impress. However, pasted text will probably not match the formatting of the surrounding text on the
slide or that of the other slides in the presentation. This may be what you want on some occasions;
however, in most cases you want to make sure that the presentation is consistent and does not
become a patchwork of different styles, font types, bullet points, and so on.
Note
You can also create your own drawing styles in Impress. These drawing styles are only
available for the Impress presentation that you have created and saved. You can also
create templates in Impress that include any drawing styles that you have created. For
more information, see the Impress Guide.
Tip
Press Shift+Enter to start a new line without creating a new bullet point. The new line
will have the same indentation as the previous line. To switch off bullets altogether,
click the Toggle Bulleted List icon on the Text Formatting toolbar. If the Text
Formatting toolbar is not visible, go to View > Toolbar > Text Formatting to turn it on.
Text boxes
Create a bulleted or numbered list in a text box as follows:
1) Click the Text icon on the Standard toolbar and draw a text box on the slide.
2) Click the Toggle Bulleted List icon or the Toggle Numbered List icon on the Text
Formatting toolbar.
3) Type the text and press Enter to start a new bulleted line.
Adding pictures
To add a picture to a contents box:
1) Go to Insert > Image on the Menu bar, or click the Insert Image icon (Figure 132 on page
171) on the new slide and select the file from the Insert Image dialog that opens. To see a
preview of the picture, select Preview at the bottom of the Insert Image dialog.
2) Move the picture to the desired location.
3) The picture will automatically resize to fill the area of the content box. Follow the directions
in the note below when manually resizing a graphic.
Note
When resizing a graphic, right-click the picture. Select Position and Size from the
context menu and make sure that Keep ratio is selected. Then adjust the height or
width to the size you need. As you adjust one dimension, both dimensions will change
to keep the width and height ratio the same, ensuring that the picture will not become
distorted. Remember also that resizing a bitmap image will reduce its quality; it is
better to create an image of the desired size outside of Impress.
Adding tables
To add basic tables to a slide:
1) Go to Insert > Table on the Menu bar, or click the Table icon on the new slide, or click the
Table icon on the Standard toolbar.
Note
Selecting from any of the styles in the Table Design section in the Sidebar creates a
table based on that style. If you create a table by another method, you can still apply a
style of your choice later.
The Table toolbar in Impress offers the same functions as the Table toolbar in Writer, with the
exception of the calculation functions Sort and Sum. To use Sum and Sort in your presentation,
you have to insert a Calc spreadsheet.
After the table is created, you can modify it by adding and deleting rows and columns, adjusting
width and spacing, adding borders, background colors and so on. For more information on working
with tables see Chapter 3, Adding and Formatting Text, in the Impress Guide and Chapter 13,
Tables of Data, in the Writer Guide.
Entering data into table cells is similar to working with text box objects. Click in the cell you wish to
add data to and begin typing. To move around cells quickly, use the following keyboard options:
• Press the arrow keys to move the cursor to another cell if the cell is empty, or to the next
character if the cell already contains text.
• Press the Tab key to move to the next cell on the right and press Shift+Tab to move to the
next cell on the left.
Adding charts
To insert a chart in a slide:
1) Go to Insert > Chart on the Menu bar or click on the Chart icon in the Standard toolbar, or
click on the Insert Chart icon on the new slide (Figure 132 on page 171).
2) Impress will insert a default chart and open the Chart dialog. To modify the chart type, insert
your own data, and change the formatting, refer to Chapter 7, Spreadsheets, Charts, and
Other Objects in the Impress Guide, or, for more details and examples, Chapter 3, Creating
Charts and Graphs in the Calc Guide.
Styles
All of the characteristics of master slides are controlled by styles. New slides that you create using
a master slide have styles that are inherited from the master slide which was used. Changing a
style in a master slide results in changes to all slides based on that master slide, but you can
modify individual slides without affecting the master slide.
Note
Although it is highly recommended to use master slides whenever possible, there are
occasions where manual changes are needed for a particular slide, for example to
enlarge the chart area when the text and chart layout is used.
Master slides have two types of styles associated with them: presentation styles and drawing
styles. The included presentation styles can be modified, but new presentation styles cannot be
created. For drawing styles, you can modify the included styles and also create new styles.
Presentation styles affect three elements of a master slide: background, background objects (such
as icons, decorative lines, and text frames), and text placed on the slide. Text styles are further
divided into Notes, Outline 1 through Outline 9, Subtitle, and Title. The outline styles are used for
the different levels of the outline to which they belong. For example, Outline 2 is used for the sub-
points of Outline 1, and Outline 3 is used for the sub-points of Outline 2, and so on.
Drawing styles are not restricted and can affect many of the elements of a slide.
4) It is also recommended that you rename this new master slide. Right-click on the slide in
the Slides pane and select Rename master from the context menu, or click the Rename
master icon on the Master View toolbar.
5) When finished creating a master slide, click the Close Master View icon on the Master
View toolbar and return to normal slide editing mode.
Caution
Any changes made to one slide when in Master View mode will appear on all slides
using this master slide. Always make sure you close Master View and return to Normal
view before working on any of the presentation slides.
Fields
To add a field into an object or as a separate object on a slide, select Insert > Fields on the Menu
bar and select the required field from the submenu. If you want to edit this field in your slide, see
Chapter 3, Adding and Formatting Text, in the Impress Guide for more information.
The fields you can use in Impress are:
• Date (fixed)
• Date (variable): updates automatically when you reload a file
• Time (fixed)
• Time (variable): updates automatically when you reload a file
• Author: first and last names listed in the LibreOffice user data (see Tip below)
• Slide Number: the sequence number of the slide, without the word “Slide”
• Slide Title: defaults to Slide 1, Slide 2, ... if you have not renamed the slides
• Slide Count: the number of slides in the presentation
• File Name
Note
To change the number format (1,2,3 or a,b,c or i,ii,iii, and so on) for the number field,
go to Slide > Properties on the Menu bar. On the Slide Setup dialog, select a format
from the Slide numbers list in the Layout Settings area (Figure 149).
To change a paragraph style throughout the presentation, open the Styles deck in the
Sidebar and modify the appropriate style.
Creating handouts
Choose View > Master Handout to set up the layout of slides for printed (or PDF) handouts. Click
the Handout tab in the workspace to open the Properties deck on the Sidebar. Expand the Layouts
pane (Figure 151). Here you can choose to print 1, 2, 3, 4, 6, or 9 slides per page.
Tip
If several images are in the same folder, you can select a group of photos using the
Shift or Ctrl keys while clicking on their filenames.
Tip
Click on a file name to display it in the Preview area.
Impress will create a presentation with as many pages as needed. If you selected Add caption to
each slide, there will be a placeholder for the image caption (title) on each slide.
Tip
Use the Slide Sorter (see page 168) to reorder your photo album. Use slide transitions
(page 191) to go smoothly from one photo to the following photo. Use audio resources
(page 179) to insert a musical background.
Hiding slides
1) Select the slide you want to hide in the Slide Pane or Slide Sorter view in the Workspace.
2) Go to Slide > Hide Slide on the Menu bar or right-click on the slide thumbnail and select
Hide Slide. Hidden slides are marked by a diagonal bar across the slide.
Slide transitions
A slide transition is the effect that takes place between slides when one slide changes to the next
slide in a presentation. To configure the slide transition:
1) Open the Slide Transition deck in the Sidebar to display the transitions available.
2) Select the desired transition, the speed of the animation, and whether the transition should
happen when you click the mouse (preferred) or automatically after a certain number of
seconds.
3) To apply the transition to all of the slides in your presentation, click Apply Transition to All
Slides. Otherwise, select one or more slides in the Slides pane to configure different
transitions.
Tip
At the bottom of the Slide Transition deck, select the Automatic preview option.
Select its checkbox and when you make any changes in a slide transition, the new
slide is previewed in the Workspace, including its transition effect.
Slide advance
You can set the presentation to advance automatically to the next slide after a set amount of time
from the Slide Transition deck in the Sidebar.
1) Go to Advance Slide and select the Automatically after option.
2) Enter the required amount of time in seconds that each slide will be displayed.
3) Click on the Apply Transition to All Slides button.
To apply a different display time to each slide in your presentation:
1) Go to Slide Show > Rehearse Timings on the Menu bar. The slide show begins in full-
screen mode and a timer appears in the lower left corner of the display.
2) When you are ready to advance to the next slide, click on the display background or press
the right arrow or space bar on your keyboard.
3) Impress will memorize the timings for each slide and will advance to the next slide
automatically using these timings when you run the slide show.
To restart a slide show automatically after the last slide has been displayed (kiosk mode):
1) Go to Slide Show > Slide Show Settings on the Menu bar.
2) In the Presentation Mode section, select Loop and repeat after and the timing of the
pause between slide shows. Click OK when you have finished.
Animation effects
Slide animations are similar to transitions, but they are applied to individual elements (title, chart,
shape, or individual bullet point) in a single slide. For example, you may wish each bullet point to
appear when you are ready to discuss it, instead of having all of them visible as soon as the slide
is opened.
Animation effects are applied from Normal view so that you can select individual objects on a
single slide. For details, see Chapter 9, Slide Shows in the Impress Guide.
Tip
You can apply animation effects to the elements on a master slide, so that all slides
based on that master slide use the same animation.
Note
The iOS version of Impress Remote does not work with iOS version 11 or later.
Chapter 7
Getting Started with Draw
Vector Drawing in LibreOffice
What is Draw?
LibreOffice Draw is a vector graphics drawing program, although it can also perform some
operations on raster graphics (pixels). Using Draw, you can quickly create a wide variety of
graphical images.
Vector graphics store and display an image as an assembly of simple geometric elements such as
lines, circles, and polygons, rather than a collection of pixels (points on the screen). Vector
graphics allow for easier storage and scaling of the image.
Draw is fully integrated into the LibreOffice suite, and this simplifies exchanging graphics with all
components of the suite. For example, if you create an image in Draw, reusing it in a Writer
document is as simple as copying and pasting the image. You can also work with drawings directly
from within Writer or Impress, using a subset of the functions and tools from Draw.
The functionality of LibreOffice Draw is extensive and, even though it was not designed to rival
high-end graphics applications, it possesses more functionality than the drawing tools that are
generally integrated with most office productivity suites.
A few examples of the drawing functions are: layer management, magnetic grid-point system,
dimensions and measurement display, connectors for making organization charts, 3D functions
that enable small three-dimensional drawings to be created (with texture and lighting effects),
drawing and page-style integration, and Bézier curves.
This chapter introduces some features of Draw and does not attempt to cover all of the Draw
features. See the Draw Guide and the Help for more information.
Workspace
The large area in the center of the Draw main window (Workspace) is where you create your
drawings. This drawing area can be surrounded with toolbars and information areas. The number
and position of the visible tools vary with the task in hand and user preferences, therefore your
setup may look different from Figure 157.
The maximum size of a drawing page in LibreOffice Draw is limited by your computer setup and
the page size that you can set and use in your printer.
By default, the Workspace consists of three layers (Layout, Controls and Dimension Lines) and
the tabs for these default layers appear in the bottom left corner of the Workspace. The default
layers cannot be deleted or renamed, but you can add layers as and when necessary.
Pages pane
You can split drawings in Draw over several pages. Multi-page drawings are used mainly for
presentations. The Pages pane, on the left side of the Draw main window, gives an overview of the
pages that you create in your drawing. If the Pages pane is not visible, go to View on the Menu bar
and select Page Pane. To make changes to the page order, drag and drop one or more pages.
Layers bar
A layer is a workspace where you insert your drawings elements and objects. The Layers bar is
located on the bottom of the workplace and contains the guides for layer selection and layer
command. For more information on layers, see “Working with layers“ on page 201.
Sidebar
The Sidebar has five main decks in Draw. To expand a deck, click on its icon or click on the small
triangle at the top of the icons and select a deck from the drop-down list. If the Sidebar is not
visible, go to View on the Menu bar and select Sidebar from the submenu.
Properties
Contains panes for object properties: Page, Character, Paragraph, Lists, Area, Shadow,
Line, and Position and Size. The visible panes change depending on the object selected.
Shapes
Provides quick selection of most items on the Drawing toolbar: Lines & Arrows, Curves,
Connectors, Basic Shapes, Symbols, Block Arrows, Flowchart symbols, Callouts, Stars, and
3D Objects.
Styles
Here you can edit and apply Drawing styles to objects within your drawing. When you edit a
style, the changes are automatically applied to all of the elements formatted with this style in
your drawing. (In Draw, Presentation styles are not available.)
Navigator
Opens the Draw Navigator, in which you can quickly move between pages in your drawing or
select an object on the drawing. It is recommended to give pages and objects in your
drawing meaningful names so that you can easily identify them when using the Navigator.
Rulers
You should see rulers (bars with numbers) on the upper and left-hand sides of the workspace. If
they are not visible, you can enable them by selecting View > Rulers in the Menu bar. The rulers
show the size of a selected object on the page using double lines (highlighted in Figure 158).
When no object is selected, they show the location of the mouse pointer, which helps to position
drawing objects more accurately.
You can also use the rulers to manage object handles and guide lines when positioning objects.
The page margins in the drawing area are also represented on the rulers. You can change the
margins directly on the rulers by dragging them with the mouse. The margin area is indicated by
the grayed out area on the rulers as shown in Figure 158.
Note
The sizes are given in the current measurement unit. They might not be the same as
the ruler units. The measurement unit on the Status bar is defined in Tools > Options
> LibreOffice Draw > General, where you can also change the scale of the page.
Toolbars
To display or hide the various Draw toolbars, go to View > Toolbars on the Menu bar and select
which toolbars you want to display. By default, the Standard toolbar is shown, but the Line and
Filling, Text Formatting, and Options toolbars are not shown.
The tools available in the Draw toolbars are described below. See also “Editing objects” on page
214. The appearance of the toolbar icons may vary depending on your operating system and the
selection of icon size and style in Tools > Options > LibreOffice > View. For more information
about working with toolbars, see Chapter 1, Introducing LibreOffice, in this guide.
Standard toolbar
The Standard toolbar is the same for all LibreOffice components and is not described in
detail in this chapter. By default, it is located just under the Menu bar.
Drawing toolbar
The Drawing toolbar contains all the necessary functions for drawing various geometric and
freehand shapes and for organizing them on the page. By default, it is docked vertically on
the left side of the Draw window.
Line and Filling toolbar
Use the Line and Filling toolbar to modify the main properties of a drawing object. The icons
and pull-down lists vary according to the type of object selected. The functions on this toolbar
are also provided in the Properties pane of the sidebar when a drawing object is selected.
Text Formatting toolbar
If the selected object is text, the Sidebar shows relevant formatting choices in the Properties
pane. If you have enabled both the Line and Filling toolbar and the Text Formatting toolbar,
Draw switches between them depending on what object is selected.
Options toolbar
Use the Options toolbar to activate or deactivate various drawing aids.
Adding a layer
To add a layer to your drawing, select Insert > Layer from the Menu bar or right-click any layer tab
in the Layers bar on the bottom of the workspace (Figure 157 on page 198) and choose Insert
Layer. The Insert Layer dialog opens (Figure 161).
Add a name, title, and description of the layer. Select if you want it printable or not, visible or
hidden, or locked to prevent further changes or accidental edits. A hidden layer still shows in the
Layers bar, but its name is in blue. You cannot reorder layers in the Layers bar.
Note
Layers do not determine the stacking order of objects on the page, except for the
Controls layer which is always in front of other layers. The stacking order of objects is
determined by the sequence in which you add the objects. You can rearrange the
stacking order by right-clicking on an object and choosing Arrange.
You can also access several specialized color palettes in Draw, as well as change individual colors
to your own taste. To do this, go to Format > Area on the Menu bar to open the Color section in
the Area dialog (Figure 163).
Note
When you draw a basic shape or select one for editing, the Information field in the
status bar changes to reflect the present action: for example Line created, Text frame
xxyy selected, and so on.
Note
This is the default behavior of the Ctrl key. However, if the Snap to Grid option on the
View > Grid menu has been selected, the Ctrl key deactivates the snap to grid activity.
8) Keep the Shift key pressed while drawing a line to restrict the drawing angle of the line to a
multiple of 45 degrees (0, 45, 90, 135, and so on).
Note
This is the default behavior of the Shift key. However, if the option When creating or
moving objects in the Constrain Objects section of Tools > Options > LibreOffice
Draw > Grid has been selected, the action of the Shift key is the opposite. Lines will
automatically be drawn at a multiple of 45 degrees unless the Shift key is pressed.
9) Keep the Alt key pressed while drawing a line to cause the line to extend outwards
symmetrically in both directions from the start point. This lets you draw lines by starting
from the middle of the line.
When a line is drawn, it uses default attributes. To change any of these attributes, select a line by
clicking on it, then go to the Properties deck on the Sidebar and open the Line pane (Figure 164
on page 203). Alternatively, right-click and select Line from the context menu or go to Format >
Line on the Menu bar to open the Line dialog (Figure 181 on page 218). Line style, line width, and
line color can also be changed using the controls in the Line and Filling toolbar (if visible) at the top
of the workspace.
Drawing an arrow
Arrows are drawn like lines. Draw classifies arrows as a subgroup of lines: lines with arrowheads.
The information field on the Status bar shows them only as lines.
1) Use one of the following options to start drawing an arrow:
a) Click the Lines and Arrows icon in the Drawing toolbar.
b) Click the small triangle on the right of the Lines and Arrows icon in the Drawing
toolbar and select the type of arrow you require from the drop down list (Figure 167).
c) Click the icon of the type of arrow you require in the Lines and Arrows section of the
Shapes deck on the Sidebar.
2) Place the cursor at the point where you want to start the arrow and drag the mouse while
keeping the mouse button pressed. The arrowhead is drawn at the end point of the arrow
when you release the mouse button.
Note
If the option When creating or moving objects has been selected in the Constrain
Object section of Tools > Options > LibreOffice Draw > Grid, the action of the Shift
key is reversed: the Rectangle tool draws a square. To draw a rectangle, press the
Shift key. This Shift key reversal also applies when drawing ellipses and circles.
Note
If you first press and hold down the Ctrl key and then click on one of the icons for Line,
Rectangle, Ellipse, or Text, a standard sized object is drawn automatically in the work
area; the size, shape, and color are all standard values. These attributes can be
changed later, if desired. See the Draw Guide for more information.
Note
The icon for the tool used most recently is shown on the Drawing toolbar to make it
easier to use the same tool again
Curves
1) Click and hold the left mouse button to create the starting point of the curve, then drag from
the starting point to draw a line. Release the mouse button and continue to drag the cursor
to bend the line into a curve.
2) Click to set the end point of the curve and fix the line on the page.
3) To continue with the line, drag the mouse cursor to draw a straight line. Each mouse click
sets a corner point and allows you to continue drawing another straight line from the corner
point. A double-click ends the drawing of your line.
4) A filled curve automatically joins the last point to the first point to close off the figure and fills
it with the selected fill color. A curve without filling will not be closed at the end of the
drawing.
Polygons
1) Click and draw the first line from the start point with the left mouse button held down. As
soon as you release the mouse button, a line between the first and second points is drawn.
2) Move the cursor to draw the next line. Each mouse click sets a corner point and allows you
to draw another line. A double-click ends the drawing.
Polygons 45°
Like ordinary polygons, these are formed from lines, but the angles between lines are restricted to
45 or 90 degrees when the Shift key is held down as you draw the line.
Freeform lines
Using the freeform line tools is similar to drawing with a pencil on paper. Press and hold the left
mouse button and drag the cursor to the shape you require. It is not necessary to end the drawing
with a double-click, just release the mouse button and the drawing is completed.
If Freeform Line Filled is selected, the end point is joined automatically to the start point and the
object is filled with the selected color.
Adding text
To activate the text tool, click on the Text icon. You can display the Text Formatting toolbar (View >
Toolbars) or use the Character pane in the Properties deck of the Sidebar to select font type, font
size, and other text properties before you start typing.
After activating the Text command, click at the location where you want to position the text. A small
text frame appears, containing only the cursor. This frame can be moved like any other object. A
text frame is also dynamic and grows as you enter text.
The information field in the status bar shows that you are editing text and also provides details
about the current cursor location using paragraph, row, and column numbers (Figure 171).
Connectors
Connectors are lines or arrows whose ends automatically snap to a glue point of an object.
Connectors are especially useful in drawing organization charts, flow diagrams, and mind-maps.
When objects are moved or reordered, the connectors remain attached to a glue point. Figure 174
shows an example of two objects and a connector.
Draw offers a range of different connectors and connector functions. On the Drawing toolbar, click
on the triangle next to the Connector icon to open the Connectors toolbar (Figure 175), or select a
connector from Connectors section in the Shapes deck in the Sidebar. For a more detailed
description of the use of connectors, see Chapter 8, Connections, Flowcharts, and Organization
Charts, in the Draw Guide.
Tip
The use of these tools for geometric shapes is similar to the tool used for drawing
rectangles or squares. For more information, see page 207 in this chapter or Chapter
2, Drawing Basic Shapes, in the Draw Guide.
Notes
The icons for geometric shapes displayed on the Drawing toolbar will change shape
according to the last tool selected and used to draw an object.
You can add text to all of these geometric shapes. For more information, see Chapter
2 and Chapter 11 in the Draw Guide.
Basic shapes
Symbol shapes
Block arrows
Callouts
3D Objects
Selecting objects
Direct selection
The easiest way to select an object is to click directly on it. For objects that are not filled, click on
the object outline to select it. One click selects; a second click deselects. To select or deselect
more than one object, hold the Shift key down while clicking.
Selection by framing
You can also select several objects at once by dragging the mouse cursor to draw a rectangle
(also known as a marquee) around the objects. Only objects that lie entirely within the rectangle
will be selected.
To select multiple objects by framing, the Select icon on the Drawing toolbar must be active.
Note
Using the Alt key method works on computers using Windows or macOS. On Linux,
use the Tab key to cycle through the objects, stopping at the object you want to select.
To cycle through the objects in reverse order, press Shift+Tab.
Figure 177: Left end of status bar when moving or adjusting an object
Note
If you press the Shift key while resizing an object, the change in size will be carried out
symmetrically with respect to the two axes so that the aspect ratio of the object
remains the same. This Shift key behavior works on all selection handles.
This is the default behavior of the Shift key. However, if When creating or moving
objects has been selected in the Constrain Objects section of Tools > Options >
LibreOffice Draw > Grid, the action of the Shift key is reversed and the aspect ratio
will be preserved unless the Shift key is pressed.
Editing objects
To edit an object or change attributes such as color or border width, you can use the Properties
deck in the Sidebar or display and use the Line and Filling toolbar or the Text Formatting toolbar,
or right-click on an object to pop up a context menu. The functions are similar to those described
for creating objects. For more information on editing objects and changing attributes, see Chapter
4, Changing Object Attributes, in the Draw Guide.
Positioning objects
Snap function
In Draw, objects can be accurately and consistently positioned using the snap function. Grid points,
snap points and lines, object frames, individual points on objects, or page edges can all be used
with the snap function.
The snap function is easier to work with at the highest zoom values that are practical for your
display. Two different snap functions can be used at the same time; for example snapping to a
guide line and to the page edge. It is recommended, however, to activate only the functions that
you really need.
For more detailed information about the snap function, see Chapter 3, Working with Objects and
Object Points, and Chapter 11, Advanced Draw Techniques, in the Draw Guide.
Snap to grid
Use Snap to grid to position an object to a grid point. Go to View > Snap Guides > Snap to Grid
on the Menu bar or click on the Snap to Grid icon on the Options toolbar (Figure 184) to turn on
or off the snap to grid function. If the Options toolbar is not visible, you can go to View > Toolbars
> Options on the Menu bar to display it.
Help lines
Draw has help lines to help you to position an object using the rulers at the top and left side of the
workspace. To turn on or off the help lines, go to Tools > Options > LibreOffice Draw > View on
the Menu bar and select Helplines while moving or go to the Options toolbar and click the
Helplines While Moving icon.
Move the mouse cursor to one of the corner handles and it normally changes to an arc with an
arrow at each end. Click and hold the mouse button, then start to move the cursor to rotate the
object. A ghost image of the object being rotated appears and the current angle of rotation is
shown in the status bar.
Note
Rotation works differently for 3D objects because rotation occurs around global axes
and not around a single axis. For more information, see Chapter 7, Working with 3D
Objects, in the Draw Guide.
The rotation point is normally located at the center of an object. To change the position of the
rotation point, click on the object with the mouse cursor and drag the object until the rotation point
is at the desired position. This rotation point can even be outside of the object.
To slant a selected object, use the handles located at the midpoints on the top, bottom and sides of
the object. The mouse cursor changes when it hovers over one of these midpoint handles. The
axis used for slanting an object is the object edge directly opposite the midpoint handle being used
to slant the object. This axis stays fixed in location while the other sides of the object move in
relation to it as you drag the mouse cursor.
Click and hold the mouse button, then move the cursor to slant the object. A ghost image of the
object being slanted appears (Figure 188) and the current angle of slant is shown in the status bar.
Flipping an object
The quickest and easiest method to flip an object horizontally or vertically is as follows:
1) Click on a graphic object and the selection handles will show.
2) Right-click and select Flip > Vertically or Horizontally, or go to Shape > Flip > Vertically
or Horizontally on the Menu bar, or click on the Vertically or Horizontally icon on the Line
and Filling toolbar.
However, the Flip tool on the Transformations toolbar provides greater control over the flipping
process. You can use the Flip tool to change the position and angle that the object flips over, as
described in Chapter 4, Changing Object Attributes, in the Draw Guide.
Duplication
Duplication makes copies of an object while applying a set of changes such as color or rotation to
the duplicates that are created.
1) Click on an object or group of objects and go to Edit > Duplicate or Shape > Duplicate on
the Menu bar, or press Shift+F3, to open the Duplicate dialog (Figure 189).
2) Select the required options chosen from the options available. For example, when the
options in the dialog are applied to a rectangle, they produce the result shown in Figure
190.
Cross-fading
Cross-fading transforms one object shape to another object shape and only works when two
objects are selected.
1) Select two differently shaped objects.
2) Go to Shape > Cross-fading on the Menu bar to open the Cross-fading dialog (Figure
191).
– Select Increments to determine the number of shapes between the two objects.
– Select Cross-fading attributes to apply a gradual change of line and fill properties
between the two objects.
– Select Same orientation to apply a smooth transition between the two objects.
3) Click OK and the result is a new group of objects with the first object selected as the start
object and the second object selected as the end object. For example, when the options in
the dialog are applied to a rectangle and a triangle, the cross fade produces the result
shown in Figure 192.
Grouping
Temporary grouping
A temporary grouping is when several objects are selected using the Select icon on the Drawing
toolbar or using the mouse to drag a rectangle (also known as a marquee) around the objects. Any
changes to object parameters you carry out are applied to all of the objects within the temporary
group. For example, you can rotate a temporary group of objects in its entirety.
To cancel a temporary grouping of objects simply click outside of the selection handles displayed
around the objects.
Permanent grouping
A permanent grouping of objects can be created after you have selected your objects. Go to
Shape > Group > Group on the Menu bar, or right-click on the selection and select Group from
the context menu, or use the keyboard shortcut Ctrl+Shift+G. When you deselect your selection,
the objects remain grouped together.
When objects are permanently grouped, any editing operations carried out on that group are
applied to all members of the group. If you click on one member of the group, the whole group is
selected.
Combining objects
Combining objects is a permanent merging of objects that creates a new object. The original
objects are no longer available as individual entities and cannot be edited as individual objects.
Any editing of a combined object affects all the objects that were used when combination was
carried out.
Select several objects, then go to Shape > Combine on the Menu bar, or right-click on the objects
and select Shapes > Combine from the context menu, or use the keyboard shortcut Ctrl+Shift+K.
After you have selected your objects, the Merge, Subtract, and Intersect functions also become
available so that you can create a new object from your selected objects. See Chapter 5,
Combining Multiple Objects, in the Draw Guide for more information on these functions.
Exporting images
Draw saves images in the Open Document Format *.odg. To save an image or the entire Draw file
in another format, use File > Export and select a format from the drop-down list. The image
formats that Draw can export and save to are listed in Appendix B, Open Source, Open Standards,
OpenDocument, in this guide.
You can also export Draw files to HTML, XHTML, PDF, or Flash. PDF export from LibreOffice is
described in Chapter 10, Printing, Exporting, Emailing, and Signing, in this guide.
HTML export uses a conversion wizard that creates as many web pages as there are pages in
your Draw document. You can optionally choose to display pages in frames with a navigator and
set an index page. For more information, see Chapter 12, Creating HTML Files, in this guide.
Chapter 8
Getting Started with Base
Relational databases in LibreOffice
Introduction
A data source, or database, is a collection of pieces of information that can be accessed or
managed by LibreOffice. For example, a list of names and addresses is a data source that could
be used for producing a mail merge letter. A business stock list could be a data source managed
through LibreOffice.
This chapter covers creating a database, showing what is contained in a database, and how the
different parts are used by LibreOffice.
Note
LibreOffice uses the terms “Data Source” and “Database” to refer to the same thing,
which could be a database such as MySQL or dBase, or a spreadsheet or text
document holding data.
A database consists of a number of fields that contain the individual pieces of data. Each table of
the database is a group of fields. When creating a table, you also determine the characteristics of
each field within it. Forms are for data entry into the fields of one or more tables which have been
associated with the form. They can also be used for viewing fields from one or more tables
associated with the form. A query creates a new table from the existing tables based upon how you
create the query. A report organizes the information from the fields of a query or table into a
document according to your requirements.
Caution
Some of Base will work without a Java Runtime Environment (JRE), but the dialogs
and wizards that Base uses require JRE. In order to create reports, it is also required.
Please go to Tools > Options > LibreOffice > Advanced to select a JRE from those
installed on your computer.
If a JRE is not already installed, you will need to download and install one. For
Windows, you need to get Java from www.java.com. For Linux, you can download it
from the same website or you can use the JRE available from the repository of your
Linux version. macOS users can install a JRE from Apple Inc.
Base creates both flat and relational databases. This makes it fairly easy to create a database in
which the fields of the database have relationships with each other.
For example: Consider a database for a library. It will contain a field for the names of the authors
and another field for the names of the books. There is an obvious relationship between the authors
and the books they have written. The library may contain more than one book by the same author.
This is what is known as a one-to-many relationship: one author and more than one book. Most if
not all the relationships in such a database are one-to-many relationships.
Consider an employment database for the same library. One of the fields contains the names of
the employees while others contain the social security numbers, and other personal data. The
relationship between the names and social security numbers is one-to-one: only one social security
number for each name.
If you are acquainted with mathematical sets, a relational database can easily be explained in
terms of sets: elements, subsets, unions, and intersections. The fields of a database are the
elements. The tables are subsets. Relationships are defined in terms of unions and intersections of
the subsets (tables).
Instructions for creating a database for automobile expenses will be used to explain how to do this.
Tip
While we have listed fields we will create in the tables of the database, there is one
more field that may be needed in a table: the field for the primary key, an identifier
unique to each record. In some tables, a suitable field for the primary key has already
been listed. In other tables such as the payment type, an additional field for the
primary key must be created.
Without the primary key field in a table, any data added, deleted, or modified has to be
done by using the Execute SQL Statement dialog (Tools> SQL…). This takes much
longer than to insert it using the Table Data View dialog. But thereafter, the data is
visible in the table and is available to be used in queries, forms, and reports.
Note
In Writer and Calc, selecting View > Data Sources, or pressing the Ctrl+Shift+F4 key
combination, opens and closes the Data Sources window containing the list of
registered databases. If a database is not registered, this window will not contain it and
you cannot access it in Writer or Calc if you need to use data from it in the document
you are now working on.
Tip
Every time the Automobile database is opened, the Automobile.odb – LibreOffice Base
window opens. Changes can then be made to the database. The title for this window is
always <database name> – LibreOffice Base.
Caution
As you create a database, you should save your work regularly. This means more than
saving what you have just created. You must save the whole database as well.
For example, when you create your first table, you must save it before you can close it.
This makes it part of the database in memory. But it is only when you save the
database file that the table is written to disk.
Note
Database files in Open Document Format are stored with the *.odb extension. This file
format is actually a container of all elements of the database, including forms, reports,
tables, and the data itself. The same format can also store a connection to an external
database server instead of the local data, for example, to access a MySQL or
PostgreSQL database server in your network.
Note
If any of these fields requires a mandatory entry, set Entry required to Yes. A blank
field will then not be allowed. In general, only set Entry required to Yes if something
must always be put in that field. By default, Entry required is set to No. (The Entry
required option is not visible in Figure 198 because AutoValue has been set to Yes.)
Note
In Base the maximum length of each field must be specified on creation. It is not easy
to change this later, so if in doubt specify a greater length. Base uses VARCHAR as the
field format for text fields. This format uses only the actual number of characters in a
field up to the limit set, so a field containing 20 characters will occupy only 20
characters even if the limit is set at 100. Two album titles containing 25 and 32
characters respectively will use space for 25 and 32 characters and not 100 characters.
Another text format is CHAR, which has a fixed length. If the limit is set to 100
characters, every entry into this field will have a length of 100 regardless of whether the
actual length is 1 or 100.
Note
Each field has a Field type, which must be specified. Types include text, integer, date,
and decimal. If the field is going to have general information in it (for example, a name
or a description), use text. If the field will always contain a number (for example, a
price), the type should be decimal or another numerical field. The wizard picks the right
field type, so to get an idea of how this works, see what the wizard has chosen for
different fields.
Tip
Up and down arrows are available on this page (not shown in Figure 198) and you can
use these to reorder the list of fields. Also + and – buttons are available and you can
use these to remove fields from the list or to add new fields.
Tip
Using the four action buttons provided on this page, you can move selected fields, or
all fields, in either direction. You can also double-click to move a field from one list to
the other.
6) Since all the fields already have the proper field type, no changes should be needed.
However, this is the time and place to make any changes if they are needed. (See Caution
below for the reason why.) Click Create. The new table is created.
7) Click the Save button in the Standard toolbar at the top of the LibreOffice Base window.
Note
While the field types and formatting are different in Design View, the concepts are the
same as in the Table Wizard.
The first table to be created is Fuel. Its fields are FuelID, Date, FuelCost, FuelQuantity, Odometer,
and PaymentType.
1) Click Create Table in Design View in the Tasks area of the LibreOffice Base window. Base
opens the LibreOffice Base: Table Design dialog.
2) FuelID field: Type FuelID as the first Field Name entry. Press the Tab key to move to the
Field Type column. Select Integer [INTEGER] as the field type from the drop-down list.
(The default setting is Text [VARCHAR].)
Tip
A shortcut for selecting from the Field Type drop-down list: press the key for the first
letter of the choice. You can cycle through the choices for a given letter by repeatedly
pressing that key.
Tip
Certain of the integer field types (Integer and BigInt for example) have an AutoValue
field property. When using one of these field types, your selection of Yes for AutoValue
automatically makes the field the primary key.
Primary keys for any other field type must be selected by right-clicking the rectangle
before the field and selecting Primary Key in the context menu.
Note
The primary key serves only one purpose: to identify each record uniquely. Any name
can be used for this field. We have used FuelID for convenience, so we know to which
table it belongs.
Defining relationships
Now that the tables have been created, what are the relationships between our tables? This is the
time to define them based upon the questions we asked and answered in the beginning.
When on vacation, we want to enter all of our expenses at once each day. Most of these expenses
are in the Vacations table, but the fuel we buy is not. So we will link these two tables using the
Date fields. Since the Fuel table may have more than one entry per date, this relationship between
the Vacations and Fuel tables is one to many (it is designated 1:n.)
The Fuel and Maintenance tables do not really have a relationship even though they share similar
fields: Date and Odometer readings. (We are not creating the Maintenance table in these
examples.)
Tip
As you create your own databases, you will also need to determine if tables are
related and if so how.
Tip
A list box is useful when a field contains a fixed number of options. It saves you from
having to type data by hand and having to double-check that the entered data is
correct, and ensures that invalid options are not entered.
1 A field in a table that stores values of the primary key of records in another table.
Tip
Using the four action buttons in the center of this page, you can move selected fields,
or all fields, in either direction. You can also double-click to move a field from one list to
the other. The up and down arrows on the right can be used to re-order entries in the
Fields in the form list.
Note
It is possible to create a relationship between two tables that is based upon more than
one pair of fields. How to do that and why is discussed in the Base Guide.
Modifying a form
The form does not look organized at all. Every control seems to have a different size. The
background is not the best color, nor are all of the labels the way we would want them.
The reason for different sized controls is that they contain different types of field data. There are
three different sized controls: text, formatted, and date. Text controls have their width set to display
a large number of characters. Formatted controls will usually contain numbers or decimals
although they can contain a wide variety of formatting. So, these are likely going to have a limited
number of characters, hence a shorter control. Date controls obviously contain dates. Most formats
for them are fairly short, which is the reason for their width. However, one of the date formats is
day of the week, month day, year (Thursday, October 31, 2020). This needs a larger width than
10/31/2020 or 31/10/2020 for example.
First, all of the payment type controls need to be modified. The fields need to be replaced with a list
box, and each needs to be related to an existing field in the table, Payment Type. The rest of the
controls require modification based upon the category into which they fall.
Note
The steps that follow assume that the Payment Type table already contains three
single-field records. These might be Cash, Dan, and Kevin. If necessary you could use
the Form Wizard to create a very simple form to input or edit these values.
Tip
In some cases when the Form Navigator does not have the input focus, selecting a
field highlights both components (for example, label and text) of the field. If this arises,
then double-clicking the required component will highlight it, and enable you to
subsequently move from one component to another with a single click.
4) Right-click the text box in the Form Navigator and select Replace with > List Box from the
context menu.
5) In the Properties dialog, the heading becomes Properties: List Box.
6) The General tab is selected, so scroll down to the Dropdown property. Change the No to
Yes.
7) Click the Data tab.
8) Go to Type of list contents. Change Valuelist to Sql.
9) The line below this becomes List content. Click the ellipsis (…) to the right of this property.
12) Save and close this window. The SQL code appears in the List content property. (SELECT
"Type" FROM "Payment Type")
13) Change the Bound field value from 1 to 0.
14) Repeat these steps for each field containing the word “Payment”, six fields in total. (See
Note below before doing this.)
Tip
There are times, as in this example, when 8) through 12) produces the same SQL
code. When this happens, copy the code. Paste the code into the Type of list contents
property before doing 13). It is a nice shortcut.
Note
This database form contains multiple controls with the same label: Payment Type.
When this name has been entered for the first time, it can be copied. In d) for the next
label, highlight the current label name, paste the name you want, and click another
property.
Tip
You can also control the Display Grid, Snap to Grid, and Helplines While Moving
options using the View > Grid and Helplines menu.
Note
When moving a control, it is tempting to use the PositionX and PositionY properties to
place the control exactly where you want it to be. Do not do this. This will place the
control’s label and field on top of each other. These properties can be used to move a
label or field to a specific location, but are not designed to move a control. Use the
Position and Size icon on the Form Design toolbar to move a control or group of
selected controls.
The list in the Form Navigator reveals which controls needed to be grouped based upon
their names:
– lblMotel / fmtMotel with lblMPayment / txtMPayment;
– lblBreakfast / fmtBreakfast with lblBPayment / txtBPayment;
– lblLunch / fmtLunch with lblLPayment / txtLPayment;
– lblSupper / fmtSupper with lblSPayment / txtSPayment;
– lblSnackNo / txtSnackNo with lblSnCost / fmtSnCost and with lblSnPayment /
txtSnPayment (group these three controls together);
– lblMiscellaneous / fmtMiscellaneous with lblMiscPayment / txtMiscPayment.
That is six groups of controls; each one will be moved separately.
1) Make sure that the cursor is in the top left hand corner of the Database Form window. If it is
not, click in that corner to move the cursor there.
2) Press the Enter key repeatedly to move the cursor down until it aligns with the gap between
the Date field and the Breakfast field.
3) Use the Set Paragraph Style drop-down list in the Formatting toolbar to select the Heading
2 style.
4) Use the space bar to move the input cursor along the empty line to the position where you
want the first heading to appear. Type the heading Meals.
5) Use the space bar to move the input cursor along the same line to the position where you
want the second heading to appear. Type the heading Snacks.
6) Press the Enter key repeatedly to move the cursor down until it aligns with the gap between
the Supper field and the table.
7) If necessary, use the Set Paragraph Style drop-down list in the Formatting toolbar to re-
select the Heading 2 style.
8) Use the space bar to move the input cursor along the line to the position where you want
the table’s heading to appear. Type the heading Fuel Data.
Tip
If you know how to use styles, you can open the Styles deck by selecting View >
Styles, or by pressing F11. Right-clicking the Heading 2 style and selecting the Modify
option in the context menu would allow you to quickly modify the appearance of all
three headings. See the Writer Guide for details.
Figure 219: Form Design toolbar with Activation Order icon circled
1) If it is not open already, select View > Toolbar > Form Design to open the Form Design
toolbar.
2) Click the Activation Order icon (circled in Figure 219).
3) Rearrange the order of the fields in the Tab Order dialog.
a) If you click the Automatic Sort button, Base will interpret the structure of your form and
propose what it considers to be a sensible tab order.
b) You can use the Move Up and Move Down buttons to change the position of a
selected control in the list.
c) You can drag a control from one position to another in the Controls list.
d) You may chose to define your own tab order, or you could put the fields in the same
order as that shown in Figure 220.
e) Click OK.
Note
The order in which the following descriptions are presented assume a particular tab
order for the form, and this may not match the tab order that you want to define.
The quickest way to enter a date in the Date field is to click the arrow that opens the drop-down
calendar (Figure 221) and click the day that you want. Then press the Tab key to go to the next
field.
Note
The Tab key is used to move between fields. But since text fields do not have tab
positions in them, they can not be used to move from one position in the field to
another one. All spacing must be done by the space bar. The Enter key is a little more
complex. It can be used to move between non-text fields. With a text field, its action
depends upon whether the text field has a single line property. With it, pressing Enter
will move the cursor to the next field. But when the field has a multi-line property,
pressing Enter moved will only move the cursor down one line. With this field, the Tab
key has to be used to move the cursor to the next field.
If we did not have a subform for fuel data, pressing the Tab key in the last field would
save all of the fields, clear them, and make the form ready to accept data on the
second record.
Since we have a subform, using the Tab key places the cursor in the first Date field of the subform
with the date automatically entered to match the Date field of the main form.
The Fuel Cost, Fuel Quantity, and Odometer fields are numeric fields. The Payment Type field is a
drop-down list. Enter the data just as you did in the main form, and use the Tab key to go to the
next field.
When you use the Tab key to leave the Payment Type field, it goes to the Date field of the next line
and automatically enters the date. Now you can enter your second set of fuel data for this day.
Tip
The number in the Record box is the number of the record whose data is shown in the
form.
If you know the number of the record you want, you can enter it into the record box
and then type Enter to take you to that record.
Note
The Copy table operation copies only values and strings from the Calc spreadsheet. It
does not copy formulas.
Creating queries
Queries are used to get specific information from a database. Their results are special tables within
the database.
To demonstrate the use of queries, we will use two different methods:
• Using our CD-Collection table, we will create a list of albums by a particular artist. We will
do this using the Query Wizard.
• The information we might want from the Fuel table includes what our fuel economy is. We
will do this using Design View. (Queries that require calculations are best created with
Design View.)
Note
When working with a query, more than one table can be used. Since different tables
may contain the same field names, the format for naming fields in a query is table
name.field name, with a period (.) between the table name and the field name. For
example, the Lunch field of the Vacations table used in a query has the name
Vacations.Lunch.
Tip
To change the order of the fields, select the field you want to move and click the up or
down arrow to the right of the Fields in the Query list.
Note
These conditions apply to numbers, letters (using alphabetical order), and dates.
1) Since we are only searching for one thing, we will use the default setting of Match all of
the following.
2) We are looking for a particular artist, so select CD-Collection.Artist in the Fields drop-
down and is equal to in the Condition drop-down.
3) Type the name of the artist in the Value box.
4) Click Next.
Step 4: Select the type of query
We want simple information, so the default setting: Detailed query is what we want. Click Next.
Note
Since we have a simple query, the Grouping and Grouping conditions are not needed.
Steps 5 and 6 of the wizard are skipped in our query.
Base presents the results of the query in the area above the query table.
Figure 229 shows the Fuel table with my entries. The query results based upon the Fuel table are
shown in Figure 230.
Note
When entering fields for these calculations, you must follow this format: table or query
name followed by a period followed by the field name. For hyphenated or multiple-
word names (table or query), use double quotes around the table or query name. The
query will then add the rest of the double quotes as in Figure 236.
Use the arithmetical symbol between the two. More than one calculation can be done
by using parentheses to group the arithmetical operations.
1) Click the Run Query icon in the Query Design toolbar (Figure 228). The results are shown
in Figure 237.
Two of the column headers are identical. By giving these two headers different aliases, we
can distinguish them.
2) Add Aliases: Type the aliases as they are listed in Figure 238.
Note
To fully use queries requires a knowledge of set operations (unions, intersections, and,
or, complements, or any combinations of these). Having a copy of the RDBMS
manuals, is also extremely useful.
Creating reports
Reports provide information found in the database arranged in a useful way. In this respect, they
are similar to queries. They are different in that they are designed to be distributed to people.
Queries are only designed to answer a question about the database. Reports are generated from
the database’s tables, views, or queries.
Caution
Dynamic reports update only the data that is changed or added to a table or query.
They do not show any modifications made to the table or query itself. For example,
after creating the report below, open the Fuel Economy query created in the previous
section. For the “End-Reading”.“Odometer” – “Fuel”.“Odometer” column, change the
number 1 to the number 3. (See Figure 234). The report will be identical before and
after you make the change. But if you add more data to the query and run the report
again, it will contain the new data. However, all data will be based upon “End-
Reading”.“Odometer” – “Fuel”.“Odometer” having the value 1. No data will be present
in the report for which “End-Reading”.“Odometer” – “Fuel”.“Odometer” has the value
3.
Figure 243 shows part of the final template that has been built up in the Report Builder as you
reach the end of the wizard.
Step 6: Create report
1) Title the report: Vacation Expenses.
2) Select the Dynamic report option.
3) Select the Create report now option.
4) Click Finish.
5) LibreOffice opens the output report in read-only mode in Writer.
Note
Using this method of accessing a spreadsheet, you cannot change anything in the
spreadsheet using Base. You can only view the contents of the spreadsheet, run
queries, and create reports based upon the data already entered into the spreadsheet.
All changes in a spreadsheet must be made in the spreadsheet itself, using Calc. After
modifying the spreadsheet and saving it, you will see the changes in the database. If
you create and save an additional sheet in your spreadsheet, the database will have a
new table the next time you access it.
Note
Sometimes after updating LibreOffice to a newer version, your list of registered
database files disappears. When that happens, you can use these steps to re-register
your database files with your latest version of LibreOffice.
Tip
Choosing Tools > Mail Merge Wizard or clicking on the Mail Merge icon (circled in
red in Figure 248) in the Data Sources window launches the Mail Merge Wizard which
steps you through creating a mail merge document. See Chapter 14 in the Writer
Guide.
Writer documents
To insert a field from a table opened in the Data Sources window into a Writer document, click on
the field name (the gray square at the top of the field list) and, with the left mouse button held
down, drag the field onto the document. In a Writer document, it will appear as <FIELD> (where
FIELD is the name of the field you dragged).
For example, to enter the cost of meals and who paid for them on a certain date of a vacation:
1) Open the list of data sources (Ctrl+Shift+F4) and select the Vacations table in the
Automobile database.
2) Use this sentence: “On (date), our breakfast cost (amount) paid by (name), our lunch cost
(amount) paid by (name), and our supper cost (amount) paid by (name).” But only type
“On, our breakfast cost paid by, our lunch cost paid by, and our supper cost paid by.”
3) To replace (date), click the field name Date in the Data Sources window and drag it to the
right of the word On. Insert an extra space if necessary. The result: On <Date>. If you have
field shadings turned on (View > Field Shadings), <Date> has a gray background.
Otherwise it does not.
4) To replace first (amount), click the Breakfast field name and drag it to the right of our
breakfast cost. Make sure you have the proper spacing between the field names and the
words before and after them. Result: breakfast cost <Breakfast>.
5) To replace the first (name), click the BPayment field name and drag it to the right of paid by.
Result: paid by <BPayment>.
6) In the same way, fill in the rest of the fields in the sentence.
– Use <Lunch> and <LPayment> for the second set of (amount) and (name) in the
sentence.
– Use <Supper> and <SPayment> for the third set of (amount) and (name) in the
sentence.
7) Final result: On <Date>, our breakfast cost <Breakfast> paid by <BPayment>, our lunch
cost <Lunch> paid by <LPayment>, and our supper cost <Supper> paid by <SPayment>.
8) Add data to the fields of the sentence:
– Click the gray box to the left of the row of data you want to add. That row should be
highlighted like the second row of Figure 249.
– Click the Data to Fields icon in the Table Data toolbar (circled in Figure 249). This
should fill the fields with the data from the row you chose.
Calc spreadsheets
There are two ways to transfer data into a Calc spreadsheet. One enters the data into the
spreadsheet cells. The other creates complete new records in the spreadsheet. While you can
directly access the data inserted into the spreadsheet cells, new records created in the
spreadsheet are read-only.
Entering data directly to the spreadsheet cells uses the Data to Text icon as when making a table
in a Writer document. But there are certain differences.
The steps are straightforward.
1) Click the cell of the spreadsheet which you want to be the top left cell of your data,
including the column names.
2) Use Ctrl+Shift+F4 to open the Data Sources window and select the table whose data you
want to use.
3) Select the rows of data you want to add to the spreadsheet:
– Click the gray box to the left of the row (the row header) you want to select if only
selecting one row. That row is highlighted.
– To select multiple rows, hold down the Ctrl key while clicking the gray box of the rows
you need. Those rows are highlighted.
– To select all the rows, click the gray box in the upper left corner. All rows are highlighted.
4) Click the Data to Text icon to insert the data into the spreadsheet cells.
5) Save the spreadsheet.
Adding records to a spreadsheet is fairly easy. You need to have the Data Sources window open,
your spreadsheet open, and the table you want to use selected.
1) Drag and drop the gray box containing the field name for the table’s ID field (the column
header) to where you want the record to appear in the spreadsheet.
2) Repeat until you have copied all of the fields you need to where you want them in the
spreadsheet.
3) Select File > Save, or click the Save icon on the Standard toolbar, to name and save the
spreadsheet.
4) Close the file.
5) Next time you open the spreadsheet, the fields will be populated with data from the first
record of the table, and the Form Navigation toolbar will appear at the bottom of the
spreadsheet.
6) Click the arrows on the Form Navigation toolbar to view the different records of the table.
(The arrows are circled in red in Figure 251.) The number in the box changes when you
change the record number by clicking an arrow. The data in the fields changes to reflect the
data for that particular record number.
Chapter 9
Getting Started with Math
LibreOffice’s Formula (Equation) Editor
Introduction
LibreOffice Math allows you to create or edit formulas (equations) in a symbolic form, within
LibreOffice documents or as stand-alone objects; example formulas are shown below. However, if
you want to evaluate numeric values using formulas, then refer to the Calc Guide for more
information as Math does not carry out any actual calculation.
df (x)
=ln ( x)+tan −1 (x 2) or NH3 +H2 O ⇌NH+4 +OH −
dx
The Formula Editor in Math uses a markup language to represent formulas. This markup language
a
is designed to be easily read wherever possible; for example, a over b produces the fraction .
b
Getting started
Using the Formula Editor, you can create a formula as a separate document or file for a formula
library, or insert formulas directly into a document using LibreOffice Writer, Calc, Impress, or Draw.
Creating formulas
You can insert a formula using one of the following methods:
• In the Elements dock, select a category from the drop-down list, then a symbol.
• Right-click in the Formula Editor and select a category, then a symbol from the context
menu.
• Enter markup language directly in the Formula Editor.
Note
Using the Elements dock or the context menus to insert a formula provides a
convenient way to learn the markup language used by Math.
Tip
When using the Elements dock, it is recommended to have Extended tips selected in
the LibreOffice Options. This will help you identify the categories and symbols you
want to use in your formula. Go to Tools > Options > LibreOffice > General and
select Extended tips in the Help section.
Elements dock
The Elements dock can be used when entering your formula data. The Elements dock also
provides an Example category which gives you example formulas to use as a starting point for your
formula or equation.
1) Go to View > Elements on the Menu bar to open the Elements dock (Figure 254).
Note
The Elements dock can either be a floating dialog, as shown in Figure 254, or
positioned to the left of the Formula Editor, as shown in Figure 252 and Figure 253.
Context menu
The Formula Editor also provides a context menu to access categories and symbols. Right-click in
the Formula Editor to open the context menu. Select a category and then select the markup
example that you want to use from the sub-context menu, an example is shown in Figure 255.
Note
The Elements Dock and context menu contain only the most common commands that
are used in formulas. For some seldom-used commands, you must always enter the
command using the markup language. For a complete list of commands, see Appendix
A, Commands Reference, in the Math Guide.
Greek characters
Using markup language
Greek characters are commonly used in formulas, but Greek characters cannot be entered into a
formula using the Elements dock or the context menu. Use the English names of Greek characters
in markup language when entering Greek characters into a formula. See Appendix A, Commands
Reference, in the Math Guide for a list of characters that can be entered using markup language.
• For a lowercase Greek character, type a percentage % sign, then type the character name
in lowercase using the English name. For example, typing %lambda creates the Greek
character λ.
• For an UPPERCASE Greek character, type a percentage % sign, then type the character
name in UPPERCASE using the English name. For example, typing %LAMBDA creates the
Greek character Λ.
• For an italic Greek character, type a percentage % sign followed by the i character, then the
English name of the Greek character in lower or UPPER case. For example, typing
%iTHETA creates the italic Greek character Θ.
Symbols dialog
Greek characters can also be entered into a formula using the Symbols dialog.
1) Make sure your cursor is in the correct position in the Formula Editor.
2) Go to Tools > Symbols on the Menu bar, or click the Symbols icon in the Tools toolbar, to
open the Symbols dialog (Figure 256).
3) Select Greek from the Symbol set drop-down list. For italic characters, select iGreek from
the drop-down list.
4) Select the Greek character from the symbol list, then click Insert. When selected, the name
of a Greek character is shown below the symbol list.
5) Click Close when you have finished entering Greek characters into your formula.
Formula examples
Example 1
The simple formula 5×4 can be created using LibreOffice Math as follows:
1) Make sure your cursor is flashing in the Formula Editor, then select the category
Unary/Binary Operators and symbol Multiplication using one of the following methods:
– In the Elements Dock, select Unary/Binary Operators from the drop-down list and then
select the Multiplication icon .
– Right-click in the Formula Editor and select Unary/Binary Operators > a times b from
the context menu.
– Using markup language, enter 5 times 4 in the Formula Editor.
The first two methods place the formula text <?> times <?> in the Formula Editor and
the symbol appears in the document. For the third method, using markup language
in the Formula Editor places the formula 5×4 directly into your document and there is no
need to carry out the following steps.
2) Select the first placeholder <?> before the word times in the Formula Editor and replace it
with the character 5. The formula in your document updates automatically.
3) Select the second placeholder <?> after the word times in the Formula Editor and replace
it with the character 4. The formula in your document updates automatically.
Tip
To move forward from one placeholder to the next placeholder in a formula, press the
F4 key. To move backward from one placeholder to the previous placeholder in a
formula, use the key combination Shift+F4.
Example 2
You want to enter the formula π ≃ 3.14159 where the value of pi is rounded to 5 decimal
places. You know the name of the Greek character (pi), but do not know the markup associated
with the Is Similar Or Equal symbol ≃ .
1) Make sure your cursor is flashing in the Formula Editor.
2) Enter %pi in the Formula Editor to enter the Greek character for pi (π).
3) Select the category Relations and symbol Is Similar Or Equal using one of the following
methods:
– In the Elements dock, select Relations from the drop-down list and then select the Is
Similar Or Equal icon .
– Right-click in the Formula Editor and select Relations > a simeq b from the context
menu.
4) Delete the first placeholder <?> before the word simeq in the Formula Editor.
5) Select the second placeholder <?> after the word simeq in the Formula Editor and replace
it with the characters 3.14159. The formula π ≃ 3.14159 now appears in your
document.
Editing formulas
How you edit a formula and switch into formula editing mode depends on whether the formula is in
Math or another LibreOffice component.
1) In Math, double-click on a formula element in the formula that appears in the Preview
window to select the formula element in the Formula Editor, or directly select a formula
element in the Formula Editor.
2) In Writer, Calc, Impress, or Draw, double-click on the formula, or right-click on the formula
and select Edit from the context menu, to open the Formula Editor and enter editing mode.
The cursor is positioned at the start of the formula in the Formula Editor.
Note
If you cannot select a formula element using your cursor, click on the Formula Cursor
icon in the Tools toolbar to activate the formula cursor.
3) Select the formula element you want to change using one of the following methods:
– Click on the formula element in the Preview window, positioning the cursor at the
beginning of the formula element in the Formula Editor, then select the formula element
in the Formula Editor.
– Double-click on the formula element in the Preview window to select the formula
element in the Formula Editor.
– Position the cursor in the Formula Editor at the formula element you want to edit, then
select that formula element.
– Double-click directly on the formula element in the Formula Editor to select it.
Formula layout
This section provides some advice on how to lay out complex formulas in Math or in your
document.
Using braces
Math knows nothing about order of operation within a formula. You must use braces (curly
brackets) to state the order of operations that occur within a formula. The following examples show
how braces can be used in a formula.
Example 1
2
2 over x + 1 gives the result +1
x
Math has recognized that the 2 before and the x after the over as belonging to the fraction,
and has represented them accordingly. If you want x+1 rather than x to be the denominator,
you must bracket them together using braces so that both will be placed there.
2
Inserting braces into 2 over {x + 1} gives the result where x+1 is now the
x+1
denominator.
Example 2
−1
– 1 over 2 gives the result
2
Math has recognized the minus sign as a prefix for the 1 and has therefore placed it in the
numerator of the fraction. If you wish to show that the whole fraction is negative, with the
minus sign in front of the fraction, you must put the fraction in braces to signify to Math that
the characters belong together.
1
Adding braces into the markup language – {1 over 2} gives the result – and the
2
whole fraction is now negative.
Example 3
When braces are used in markup language, they are used to define the layout of the formula
and are not displayed or printed. If you want to use braces within a formula, use the
commands lbrace and rbrace within the markup language.
x
x over {–x + 1} gives the result
– x+1
Replace the braces using the commands lbrace and rbrace in the markup language. Write x
x
over lbrace –x + 1 rbrace and the result is
{– x +1}
Normally, when you use brackets within a matrix, the brackets do not scale as the matrix increases
in size. For example, ( matrix { a # b ## c # d } ) gives the result ( a b
)
c d
To overcome this problem of brackets with a matrix, Math provides scalable brackets that grow in
size to match the size of a matrix. The commands left( and right) have to be used to create
scalable brackets within a matrix. For example, left( matrix { a # b ## c # d }
right) gives the result (ac bd ) where the matrix is now bracketed by scalable brackets.
Scalable brackets can also be used with any element of a formula, such as fraction, square root,
and so on.
Tip
Use the commands left[ and right] to obtain square brackets. A list of all brackets
available within Math can be found in Appendix A, Commands Reference, of the Math
Guide.
Tip
If you want all brackets to be scalable, go to Format > Spacing on the Menu bar to
open the Spacing dialog. Click on Category, select Brackets from the drop-down list,
and then select the option Scale all brackets.
Unpaired brackets
When using brackets in a formula, Math expects that for every opening bracket there will be a
closing one. If you forget to add a closing bracket, Math places an inverted question mark next to
where the closing bracket should have been placed. This inverted question mark disappears when
all the brackets are paired. However, an unpaired bracket is sometimes necessary and you have
the following options.
Scalable brackets
To create unpaired scalable brackets or braces in a formula, the markup commands left, right,
and none are used.
x = lbrace stack {x "for" x >= 0 # -x "for" x < 0}. However, this gives an
incorrect result. To remove inverted question marks and create the correct formula, you have
to use the markup commands left, right, and none. Change your entry in the Formula
Editor to abs x = left lbrace stack {x "for" x >= 0 # -x "for" x < 0}
right none and this creates the correct formula.
Recognizing functions
In the basic installation of Math, Math outputs functions in normal characters and variables in italic
characters. However, if Math fails to recognize a function, you can tell Math that you have just
entered a function. Enter the markup command func before a function forces Math to recognize
the following text as a function and uses normal characters.
For a full list of functions within Math, see Appendix A, Commands Reference, of the Math Guide.
Some Math functions have to be followed by a number or a variable. If these are missing, Math
places an inverted question mark where the missing number or variable should be. To remove the
inverted question mark and correct the formula, you have to enter a number, a variable, or a pair of
empty brackets as a placeholder.
Tip
You can navigate through errors in a formula using the key F3 (next error) or the key
combination Shift+F3 (previous error).
Note
To write function names with primes, as is normal in school notation, you must first add
the symbols to the catalog. See “Customization” on page 304 for more information.
Note
The Special Characters dialog used by other LibreOffice components is not available
in Math. If you are going to regularly require special characters in Math, then it is
recommended to add the characters to the Math Catalog, see “Customization” on
page 304 for more information.
Text in formulas
To include text in a formula, you have to enclose any text in double-quotes, for example x " for
" x >= 0 in markup language will create the formula x for x≥0 . All characters, except double
quotes, can be used in text. However, if you require double quotes in your formula text, then you
have to create your text with double quotes in LibreOffice Writer, then copy and paste the text into
the Formula Editor as shown in Figure 257.
The font used for text in a formula will be the default font that has been set in the Fonts dialog. For
more information on how to change fonts used for in formulas, see “Changing formula appearance”
on page 289.
By default, text alignment is left-justified in formulas. For more information on how to change text
alignment, see “Adjusting formula alignment” on page 295.
gives the following result where formulas are aligned on the equals sign x + y = 2
x = 2− y
Note
The empty braces each side of the equals sign are necessary because the equals sign
is a binary operator and requires an expression on each side. You can use spaces, or `
or ~ characters each side of the equals sign, but braces are recommended as they are
easier to see within the markup language.
You can reduce the spacing on each side of the equals sign if you change the inter-column spacing
of the matrix. See “Adjusting formula spacing” on page 292 for more information.
Note
If you have already inserted formulas into your document and you change the default
font size, only formulas inserted after the change in default font size will use the new
default settings. You have to individually change the font size of formulas already
inserted if you want these formulas to use the same font size as the default settings.
Tip
There is an extension “Formatting of All Math Formulas” that allows you to change font
name and font size for all or only for selected formulas in your document. You can
download it from the official extension site:
https://extensions.libreoffice.org/extensions/formatting-of-all-math-formulas
Formula fonts
Current formula fonts
To change the fonts used for the current formula in Math or another LibreOffice component:
1) Click in the markup language in the Formula Editor.
2) Go to Format > Fonts on the Menu bar to open the Fonts dialog (Figure 259).
3) Select a new font for each of the various options from the drop-down lists.
4) If the font you want to use does not appear in the drop-down list, click Modify and select
the option from the context menu to open a fonts dialog. Select the font you want to use
and click OK to add it to the drop-down list for that option.
5) Click OK to save your changes and close the Fonts dialog.
Note
When a new font is selected for a formula, the old font remains in the list alongside the
new one and can be selected again.
Note
Variables should be written in italics, so make sure that the Italic option is selected. For
the font you want to use. For all other elements, use the basic form of a font. The style
can be easily altered in the formula itself by using the commands italic or bold to
set these characteristics and nitalic or nbold to unset them.
Note
If you have already inserted formulas into your document and you change the spacing,
only formulas inserted after the change in spacing will use the new default settings.
You have to individually change the spacing of formulas already inserted if you want
these formulas to use the same spacing as the default settings.
Spacing options
Use Category in the Spacing dialog (Figure 260) to determine the formula element for which you
would like to specify the spacing. The appearance of the dialog depends on the selected category.
A preview window shows you which spacing is modified through the respective boxes.
• Category – pressing this button allows you to select the category for which you would like
to change the spacing.
• Spacing – defines the spacing between variables and operators, between lines, and
between root signs and radicals.
– Spacing – determines the spacing between variables and operators.
– Line spacing – determines the spacing between lines.
Note
It is not possible to align formulas on a particular character and formula alignment
does not apply to text elements. Text elements are always aligned left.
Note
Independent of using formula alignment given below, it is possible to align formulas
using the commands alignl, alignc and alignr. These commands also work for
text elements.
Background color
It is not possible to select a background color for formulas in Math. The background color for a
formula is by default the same color as the document or frame that the formula has been inserted
into. However, in LibreOffice documents, you can use object properties to change the background
color for a formula. For more information on using a background color (area fill for objects) with a
formula, please refer to the user guides for Writer, Calc, Draw and Impress.
Formula library
If you regularly insert the same formulas into your documents, you can create a formula library
using formulas that you have created using the Formula Editor. Individual formulas can be saved
as separate files using the ODF format for formulas with the file suffix of .odf, or in MathML format
with the file suffix of .mml.
You can use Math, Writer, Calc, Draw, or Impress to create formulas and build up your formula
library.
Using Math
1) Create a folder on your computer to contain your formulas and give the folder a memorable
name, for example Formula Library.
2) In LibreOffice, go to File > New > Formula on the Menu bar, or click on Math Formula in
the opening splash screen to open Math and create your formula using the Formula Editor.
See “Formulas as separate documents or files” on page 277 for more information.
3) Go to File > Save As on the Menu bar or use the keyboard shortcut Ctrl+Shift+S to open a
Save As dialog.
4) Navigate to the folder you have created for your formula library.
5) Type in a memorable name for your formula in the File name text box.
6) Select from the File type drop-down list either ODF Formula (.odf) or MathML 2.0 (.mml) as
the file type for your formula.
7) Click Save to save your formula and close the Save As dialog.
Formulas in Writer
When a formula is inserted into a document, Writer inserts the formula into a frame and treats the
formula as an OLE object. Double-clicking on an inserted formula will open the Formula Editor in
Math allowing you to edit the formula.
This section explains what options you can change for each individual formula within a Writer
document. Please refer to the chapters on styles in the Writer Guide for information on how to
change the default settings for frame styles for OLE objects.
Cross referencing
1) Click in your document where you want the cross reference to appear.
2) Go to Insert > Cross-reference on the Menu bar to open the Fields dialog (Figure 262).
3) Click on the Cross-references tab, then select Text in the Type section.
4) In the Selection section, select the formula number you want to refer to.
5) In the Insert reference to section, select Reference and click Insert.
6) When you have finished creating cross references, click Close to close the Fields dialog.
Tip
To insert the cross reference number without parentheses, select Numbering instead
of Reference in the Insert reference to section.
Note
If you want to use square parentheses instead of round ones, or if you want the cross
reference number to be separated from the formula by tabs instead of using a table,
then refer to the chapter on automatic text in the Writer Guide.
Note
The anchoring options are not available in the Object dialog when you are making
changes to the various options available for frame styles. For more information on how
to modify frame styles, please refer to the chapters on styles in the Writer Guide.
Vertical alignment
The normal default setting for vertical alignment for formula objects is to use the text base line as a
reference. This default setting can be changed by modifying the Formula frame style, see the
chapters on styles in the Writer Guide for more information.
To change the vertical alignment position of an individual formula object (assuming that the As
character anchoring option is selected):
1) Right-click on the selected formula object and select Properties from the context menu, or
go to Format > Frame and Object > Properties to open the Object dialog (Figure 263).
Note
If the Position section in the Object dialog is greyed out and not available, then go to
Tools > Options > LibreOffice Writer > Formatting Aids and uncheck the option
Math baseline alignment. This setting is stored with the document and applies to all
formulas within it. Any new documents created will also use this setting.
Object spacing
A formula object, when inserted into a Writer document, has spacing each side of the formula
object. The default value used for spacing is set within the frame style for formula objects and can
be changed by modifying the Formula frame style, see the chapters on styles in the Writer Guide
for more information.
You can individually adjust the spacing for each formula object within your document as follows:
1) Create your formula in your Writer document.
2) Right-click on your selected formula object and select Properties from the context menu, or
go to Format > Frame and Object > Properties on the Menu bar to open the Object
dialog.
3) Click on the Wrap tab to open the Wrap page in the Object dialog (Figure 264).
4) In the Spacing section, enter the spacing value for Left, Right, Top and Bottom spacing.
5) Click OK to save your changes and close the Object dialog.
∑ i2
i=2
and the same formula embedded into a line of text using text mode format: ∑5i=2 i 2
Note
The size of the frame that a formula is placed in when inserted into a document cannot
be changed. The frame size for a formula object depends on the setting of the formula
font size; see “Creating formulas” on page 279 and “Editing formulas” on page 283 for
more information.
Backgrounds
1) In your document, select the formula where you want to change the background.
2) Right-click on the formula and select Properties from the context menu, or go to Format >
Frame and Object > Properties on the Menu bar to open the Object dialog.
3) Click on the Area tab and use the buttons to select the type of fill you want to use for your
formula (Figure 265).
4) Select the options you want to use for your formula background. The options change
depending on the type of fill selected.
5) Click OK to save your changes and close the Object dialog.
Borders
1) In your document, select the formula where you want to change the borders.
2) Right-click on the formula and select Properties from the context menu, or go to Format >
Frame and Object > Properties on the Menu bar to open the Object dialog.
3) Click on the Borders tab and select the options you want to use for your formula borders
(Figure 266).
4) Click OK to save your changes and close the Object dialog.
Anchoring formulas
Calc
A formula object can be anchored into your spreadsheet as To Page (default setting), or as To
Cell. To change the anchoring type of formulas in a Calc spreadsheet:
1) Select the formula object in your spreadsheet.
2) Right-click on the formula and select Anchor > To Page or To Cell from the context menu
3) Alternatively, go to Format > Anchor on the Menu bar and select To Page or To Cell.
Formulas in charts
A chart in a Calc spreadsheet is itself an OLE object, therefore, you cannot use the Formula Editor
to create and insert a formula into a chart.
To insert a formula into a chart, create the formula first using the Formula Editor and copy the
formula to the clipboard. You then create your chart in Calc and paste the formula into your chart.
The formula is automatically converted into the correct format for insertion into the chart.
If you want to change the formula at a later date, then you must repeat the whole process of
creating, copying, and pasting.
Customization
This section explains how you can customize Math to suit the way you create formulas for use in
LibreOffice documents. Also, refer to Chapter 14, Customizing LibreOffice, of this Guide for more
general information on how to customize LibreOffice.
Chemical formulas
The primary purpose of Math is to create mathematical formulas, but it can also be used to write
chemical formulas. However, in chemical formulas, the chemical symbols are normally written in
uppercase using non-italic characters. The following table shows some examples of chemical
formulas.
Construction Example Markup Language
Molecules H 2 SO 4 H_2 SO_4
238
Isotopes 92 U U lsub 92 lsup 238
2− 2-
Ions SO 4 or SO 4 SO_4^{2-{}} or SO_4^{2"-"}
To create chemical formulas using Math, you have to change the font used for variables to a non-
italic font. For more information , see “Formula fonts” on page 291.
For reversible reactions in chemical formulas, there is no symbol you can use for a double arrow in
Math. If you have a font available with correct symbols for use in chemical formulas, then you can
add these symbols to the Catalog. See “Catalog customization” on page 305 for more information
on how to add symbols to the Catalog.
Floating dialogs
The Formula Editor and Elements dock can cover a large part of your document. To help create
more space and/or allow you to move either the Formula Editor or Elements dock out of the way,
you can turn both of them into floating dialogs.
1) Position the cursor on the frame.
2) Hold down the Ctrl key and double-click. This turns the Formula Editor into the Commands
dialog (Figure 267) and the Elements dock into the Elements dialog (Figure 268).
Catalog customization
If you regularly use a symbol that is not available in Math, you can add it to the Symbols dialog
(Figure 269) by opening the Edit Symbols dialog (Figure 270).
Using the Edit Symbols dialog you can add symbols to a symbol set, edit symbol sets, or modify
symbol notations. You can also define new symbol sets, assign names to symbols, or modify
existing symbol sets.
Adding symbols
1) Go to Tools > Symbols on the Menu bar or click on the Symbols icon in the Tools toolbar
to open the Symbols dialog.
2) Click the Edit button to open the Edit Symbols dialog.
3) Select a font from the Font drop-down list.
4) Select a symbol character that you want to add from the preview box. You may have to
scroll down in the preview box to locate the symbol you want to use. The small right
preview box displays the new symbol.
5) In the Symbol box, type a memorable name for the symbol you are adding.
6) In the Symbol set box, select a symbol set from the drop-down list to add your new symbol
to, or type a new name to create a new symbol set for your new symbol.
7) If required, select a font style from the Style drop-down list – Standard, Italic, Bold, or
Bold, Italic.
Note
Numerous free fonts are available that contain several symbols if you cannot find a
symbol to use in the fonts already installed on your computer. For example, the STIX
font was developed specially for writing mathematical and technical texts. Also, the
DejaVu and Lucida fonts have a wide range of symbols that you can use.
Note
When LibreOffice is installed on a computer, only those user-defined symbols that
actually occur in the document are stored with it. Sometimes it is useful to embed all
the user-defined symbols, so that when the document is transferred to another
computer it can be edited by another person. Go to Tools > Options > LibreOffice
Math > Settings, uncheck the option Embed only used symbols (smaller file
size).This setting is only available when you are working with LibreOffice Math.
Editing symbols
Modifying symbol names
You can change the name of a symbol as follows:
1) Select the symbol name you want to change from the Old symbol drop-down list. The
symbol appears in the left preview pane at the bottom of the Edit Symbols dialog (Figure
270).
2) Type a new name for the symbol in the Symbol text box, or select a new name from the
Symbol drop-down list. The new symbol name appears above the right preview pane at the
bottom of the Edit Symbols dialog.
3) Click Modify and the symbol name is changed.
4) Click OK to close the Edit Symbols dialog.
Moving symbols
You can move a symbol from one symbol set to another as follows:
1) In the Old symbol set drop-down list, select the symbol set where the symbol you want to
move is located.
2) Select the symbol name you want move from the Old symbol drop-down list. The symbol
appears in the left preview pane at the bottom of the Edit Symbols dialog (Figure 270).
3) In the Symbol set drop-down list, select the symbol set that you want to move the symbol
to. The new symbol set name appears below the right preview pane at the bottom of the
Edit Symbols dialog.
4) Click Modify and the symbol is moved to the new symbol set.
5) Click OK to close the Edit Symbols dialog.
Note
The only way you can delete a symbol set is by deleting all of the symbols in that set.
When you delete the last symbol from a set, the set is also deleted.
Formula spacing
The grave accent (`) inserts an additional small space and the tilde (~) inserts an additional large
space into formulas. However, in the basic installation of LibreOffice, these symbols are ignored
when they occur at the end of a formula. If you are working with running text in a formula, it may be
necessary to include spacing at the end of formulas as well. This customization is only required
when you are working with a Math document and is not required when you are inserting a formula
into another LibreOffice component.
Extensions
If you create formulas frequently in your documents, you can customize LibreOffice by adding
extensions that are designed to help you create formulas. Extensions are easily installed using the
Extension Manager. For more information on how to install extensions, see Chapter 14 of the
Getting Started Guide.
One extension that is recommended for installation is Dmaths. This extension is designed for use
in Writer and adds a mathematical macro package providing five toolbars for creating formulas. For
more information on this extension, go to the website http://www.dmaths.org.
A second extension that is recommended is Formatting of All Math Formulas. It allows you to
format all Math formulas in your Writer, Calc, Draw, or Impress document. You can change font and
font size for all formulas or only for selected formulas. For more information on this extension, go to
https://extensions.libreoffice.org/extensions/formatting-of-all-math-formulas.
Note
Some internet browsers do not fully support the MathML format and your formula may
not display correctly.
If you are working on a Math document, go to File > Save as on the Menu bar or use the keyboard
combination Ctrl+Shift+S to open the Save as dialog. Select MathML from the list of available file
formats to save your formula as MathML.
If you are working in another LibreOffice component, right-click on the formula object and select
Save copy as from the context menu to open the Save as dialog. Select MathML from the list of
available file formats to save the formula object as MathML.
In Math you can also import a MathML formula. Use Tools > Import MathML from Clipboard.
Chapter 10
Printing, Exporting, Emailing
and Signing Documents
Quick printing
If the Print Directly icon is visible on the Standard toolbar, you can click it to send the entire
document with the current default print settings. If the icon is not visible, you can show it by right-
clicking on the toolbar, pointing to Visible Buttons, and selecting Print Directly.
Note
The Print Directly and other printing options are not available when viewing a Base
table or query.
You can specify the default printer on the Printer Setup dialog, displayed using File > Printer
Settings. When further printing options are available, these can be accessed by pressing the
Options button on the Printer Setup dialog.
Controlling printing
For more control over printing, use the Print dialog (File > Print, Ctrl+P (⌘+P for macOS), or the
Print icon on the Standard toolbar). The appearance of the Print dialog is different on macOS and
may include extra printer controls not described in this chapter.
The Print dialog (Figure 271) has two tabs, from which you can choose a range of options as
described in the following sections. The first tab is General; it is similar in all LibreOffice
components although some of the options available in Writer are unavailable in other components.
The second tab is component-specific.
The different components of LibreOffice have different print settings available, as summarized in
Table 4.
Table 4: Print options in LibreOffice components
Feature Writer Calc Impress Draw Math
Select pages/sheets/slides to print Yes Yes Yes Yes Yes
Print multiple pages/sheets/slides on one page Yes Yes Yes Yes No
Print a brochure Yes No Yes Yes No
Print envelopes Yes No No No No
Print labels or business cards Yes No No No No
Preview pages/sheets before printing Yes Yes No No No
Base forms and reports are printed using the Writer version of the Print dialog and hence provide
the facilities in the Writer column of Table 4.
Tip
In Writer, to print two pages per sheet in “facing pages” (book layout) style, print from
Print Preview instead. See page 321.
Calc
You can choose individual sheets, ranges of sheets, or selections of sheets for printing.
Caution
After printing, be sure to deselect the extra sheets. If you keep them selected, the next
time you enter data on one sheet, you enter data on all the selected sheets. This might
not be what you want.
Writer
On the LibreOffice Writer tab (Figure 276) you can choose to print a subset of contents (for
example, images or hidden text), print text in black (even if a color is defined for the text), whether
to print automatically inserted blank pages, and whether and where to print any comments that are
in the document (Figure 277).
Calc
The only choice on the LibreOffice Calc tab is whether to suppress the printing of blank sheets.
Impress
On the LibreOffice Impress tab (Figure 278), you can choose to print slides, handouts, notes, or an
outline. See Chapter 6, Getting Started with Impress, for more information on these features.
Handouts prints the slides in reduced size on the page, from one to nine slides per page. The
slides can be printed horizontally (landscape orientation) or vertically (portrait orientation) on the
page.
Notes prints a single slide per page with any notes entered for that slide in Notes View.
Outline prints the title and headings of each slide in outline format.
Math
On the LibreOffice Math tab (Figure 281), you can choose print options as shown.
Printing a brochure
In Writer, Impress, and Draw, you can print a document with two pages on each side of a sheet of
paper, arranged so that when the printed pages are folded in half, the pages are in the correct
order to form a booklet or brochure.
Tip
Plan your document so it will look good when printed half size; choose appropriate
margins, font sizes, and so on. You may need to experiment.
2) Depending on your language settings (Tools > Options > Language Settings >
Languages), the Writer variant of the Print dialog may include a drop-down menu adjacent
to the Brochure button (not shown in Figure 282). This provides Left-to-right script and
Right-to-left script options. Select the required setting in this menu.
3) In the Range and Copies section, select Even pages. Click OK to print.
4) Take the printed pages out of the printer and put them back into the printer in the correct
orientation to print on the blank side. You may need to experiment to find the correct
arrangement for your printer.
Tip
If your printer can print double-sided (duplex) automatically, choose All pages.Printing
envelopes, labels, business cards
Printing envelopes, labels, or business cards using Writer involves two steps: setup and printing.
For details, see Chapter 14, Using Mail Merge, in the Writer Guide.
Writer
The normal page view in Writer shows you what each page will look like when printed and you can
edit the pages in that view. If you are designing a document to be printed double-sided, you may
want to see what facing pages look like. Writer provides two ways to do this:
• View Layout (editable view): use the Book view button on the status bar.
Writer now displays the Print Preview toolbar instead of the Formatting toolbar.
2) Select the required preview icon: Single Page, Two Pages, Multiple Pages, or Book
Preview.
3) To print the document from this view, click the Print icon to open the Print dialog. Choose
the print options and click OK or Print (macOS).
Calc
To preview the sheets in Calc before printing:
1) Choose File > Print Preview on the Menu bar, or click the Toggle Print Preview button on
the Standard toolbar, or press Ctrl+Shift+O (+⌘+O for macOS).
The Calc window now displays the Print Preview toolbar instead of the Formatting toolbar.
Warning
A document in PDF format is not protected against contents tampering or editing by
default. The PDF document contents can be edited by specialized software tools,
including LibreOffice Draw.
The process and dialogs are the same for Writer, Calc, Impress, and Draw, with a few minor
differences mentioned in this section.
Tip
Unlike Save As, the Export command writes a copy of the current document in a new
file with the chosen format, but keeps the current document and format open in your
session.
Note
You can also open the PDF Options dialog from File > Export (not Math). On the
Export dialog, select the PDF file format, the file name and location, and click Save or
Export (macOS). Select the appropriate settings and then click Export.
Note
EPS (Encapsulated PostScript) images with embedded previews are exported only as
previews. EPS images without embedded previews are exported as empty
placeholders.
Note
Permissions settings are effective only if the user’s PDF viewer respects the settings.
Emailing documents
LibreOffice provides several ways to send documents quickly and easily as email attachments in
one of three formats: OpenDocument (LibreOffice’s default format), Microsoft Office formats, or
PDF.
Note
With Linux or macOS, documents can only be sent from the LibreOffice menu if a mail
program has been set up in Tools > Options > Internet > Email. With Windows,
LibreOffice uses the email program set up as the default.
Auto-redaction
To partially automate the redaction process, you can define certain words (such as names) to be
redacted wherever they are found in the document. To do this, choose Tools > Auto-Redact on
the Menu bar to open the Automatic Redaction dialog (Figure 297). Here you can load a list of
terms (targets), add targets, delete targets, edit targets, and save a list of targets.
Chapter 11
Images and Graphics
Pictures, Drawing Tools, Gallery, Fontwork
Introduction
You can add graphic and image files, including photos, drawings, and scanned images, to
LibreOffice documents. LibreOffice can import various vector (line drawing) and raster (bitmap) file
formats. The most commonly used graphic formats are GIF, JPG, PNG, and BMP. See Appendix B
for a full list of the graphic formats LibreOffice can import.
Images in LibreOffice are of these basic types:
• Image files, such as photos, drawings, PDF documents, and scanned images
• Diagrams created using LibreOffice’s drawing tools
• Artwork created using clip art or Fontwork
• Charts created using LibreOffice’s Calc component
This chapter covers images, diagrams, and Fontwork.
More detailed descriptions on working with drawing tools can be found in the Draw Guide and
Impress Guide. Instructions on how to create charts are given in the Calc Guide.
Note
If you choose the Link option, a message box appears when you click Open. It asks if
you want to embed the graphic instead. Choose Keep Link if you want the link, or
Embed Graphic if you do not. To prevent this message from appearing again,
deselect the option Ask when linking a graphic at the bottom of the message.
Caution
If the application from which the image was copied is closed before the image is
pasted into the target, the image stored in the clipboard could be lost.
Note
When inserting the same image several times in the document, LibreOffice embeds
only one copy of the image file.
Cropping images
When you are only interested in a section of the image for the purpose of your document, you may
wish to crop (cut off) parts of it. LibreOffice provides two ways to crop an image: the Crop Image
tool and the Crop tab of the Image dialog (accessed by right-clicking on the image in Writer and
selecting the Properties option in the context menu). The Crop Image tool provides a quick and
easy way to crop an image; but for more control, use the Image dialog.
Note
If you crop an image in LibreOffice, the image itself is not changed. LibreOffice hides,
not cuts off, part of the image. If you export the document to HTML, the original image
is exported, not the cropped image. For export, crop images in an external editor.
Resizing an image
To fit the image into your document, you may need to resize it. A quick and easy way to resize is by
dragging the image’s sizing handles:
1) Click the image, if necessary, to show the green sizing handles.
2) Position the pointer over one of the sizing handles. The pointer changes shape, giving a
graphical representation of the direction of the resizing.
3) Click and drag to resize the image.
Tip
The corner handles resize both the width and the height of the image simultaneously,
while the other four handles resize only one dimension at a time. To retain the original
proportions of the image, hold down the Shift key while dragging one of these handles.
For more accurate resizing of images, use the Type tab of the Image dialog.
Exporting images
If you need to make complex adjustments to the image, or want to save the image for use in
another document, you can export the image directly from your document. Right-click on the image
to select it and open the context menu. Then choose Save to open the Image Export dialog.
Depending on the original format of the image, LibreOffice will let you save the picture in many
different formats. Give a name to the image, select the desired image format in the file type filter
list, and click Save. Before the image is finally saved another dialog (not shown) opens, where you
can choose various image size and format options. The content of this dialog depends on the
output file type selected.
Compressing images
If you insert a large image in your document and resize it to fit into the layout of the page, the
complete full size original image is stored in the document file to preserve its content, resulting in a
large document file to store or send by mail.
If you can accept some loss of quality of the image rendering or want to resize it, you can
compress or resize the image object to reduce its data volume while preserving its display in the
page layout.
Right-click to select the image and open the context menu. Then choose Compress to open the
Compress Image dialog (Figure 301). Note that the Calculate New Size button updates the image
information on the dialog on each parameter set you change. Click OK to apply the compression
Positioning images
When you add an image to a text document, you need to choose how to position it with respect to
the text and other images. Positioning is controlled by four settings:
• Arrangement refers to the placement of an image on an imaginary vertical axis.
Arrangement controls how images are stacked upon each other or relative to the text.
• Alignment refers to the vertical or horizontal placement of an image in relation to the
chosen anchor point.
• Anchoring refers to the reference point for the images. This point could be the page, or
frame where the object is, a paragraph, or even a character. An image always has an
anchor point.
• Text wrapping refers to the relation of images to the surrounding text, which may wrap
around the graphic on one or both sides, be overprinted behind or in front of the graphic, or
treat the graphic as a separate paragraph or character.
The settings can be accessed in a number of ways, depending on the nature of the images:
• From the Format menu: Anchor, Wrap, and Arrange (both for images and drawing
objects).
• From the context menu displayed when you right-click the graphic; this menu also includes
an Align option.
• For images, from the Type and Wrap tabs of the Image dialog. Note that you cannot control
the arrangement using the dialog.
• For drawing objects, from the Position and Size tab of the Position and Size dialog.
• For an embedded object (such as a Calc spreadsheet or Draw document), from the OLE-
Object toolbar.
For details on all of these settings, see Chapter 11, Images and Graphics, in the Writer Guide.
Note
The default themes supplied with LibreOffice can not be customized, although new
themes can be added; see “Adding a new theme to the Gallery” on page 345. The
locked themes are easily recognizable by right-clicking on them; the only available
option in the context menu is Properties.
Note
Deleting the name of a file from the list in the Gallery does not delete the file from the
hard disk or other location.
To delete a theme from the Gallery, select it from the list of themes, right-click, then click Delete in
the context menu.
Note
Gallery themes can be packed for distribution through the LibreOffice extensions
framework. In that case, the location of the graphic files is determined by the extension
settings. To get more gallery themes, visit the LibreOffice extensions website at https://
extensions.libreoffice.org.
Tip
If you are planning to use the drawing tools repeatedly, you can tear off (undock) this
toolbar and move it to a convenient place as a floating toolbar in the window.
Note
You cannot include an embedded or linked graphic in a group with drawing objects.
You can edit an individual member of a group without ungrouping or breaking the group. Select the
group and go to Format > Group > Enter Group on the Menu bar, or right-click and select Enter
Group from the context menu, or click the Enter Group icon in the Drawing Object Properties
toolbar. When you have finished editing an individual member of a group, go to Format > Group >
Exit Group on the Menu bar, or right-click and select Exit Group from the context menu, or click
the Exit Group icon in the Drawing Object Properties toolbar.
Using Fontwork
With Fontwork you can create graphical text art objects to make your work more attractive. There
are many different settings for text art objects (line, area, position, size, and more), so you have a
large choice.
Fontwork is available with the Writer, Calc, Impress, and Draw components of LibreOffice, but you
will notice small differences in the way that each component displays it.
Fontwork Same Letter Heights: Changes the height of characters in the object. Toggles
between normal height (some characters taller than others, for example capital letters, d,
h, l and others) and all letters the same height.
Generating a QR code
A QR code (short for Quick Response code) is a type of barcode. QR codes often contain data that
points to a website or application. From LibreOffice 6.4, Writer, Calc, Impress, and Draw can
generate QR codes.
1) Choose Insert > Object > QR Code on the Menu bar to open the QR Code Generator
dialog (Figure 311).
Chapter 12
Creating HTML Files
Saving Documents as HTML Files
Introduction
HTML (Hypertext Markup Language) capabilities in LibreOffice make it possible to save and export
documents in HTML format.
This chapter describes how to do the following in Writer, Calc, Impress, and Draw:
• Create hyperlinks within a document and to other documents such as web pages, PDFs,
and other files.
• Save and export documents as HTML files.
• Create, edit, and save HTML documents using Writer/Web.
When creating a document that you plan to deliver as an HTML file, you need to consider the
following:
• In an HTML document, hyperlinks are active (clickable), but other cross-references inserted
by LibreOffice are not active links.
• An object such as an image is saved as a separate file. However, if that object has been
placed in a frame (for example, with an associated caption), it is not saved and does not
appear in the HTML document; instead, the name of the frame appears.
Note
HTML files containing links relative to the file system that will be uploaded to a web
server require the files be in a folder structure matching that of the web server.
Otherwise, the links will point to the wrong folder.
Tip
When you rest the mouse pointer on a hyperlink, a help tip displays the absolute
reference, because LibreOffice uses absolute path names internally. The complete
path and address can only be seen when you view the result of the HTML export (for
example, saving a spreadsheet as an HTML file), by loading the HTML file as text, or
by opening it with a text editor.
Tip
To change the color of hyperlinks, go to Tools > Options > LibreOffice > Application
Colors, scroll to Unvisited links and/or Visited links, pick the new colors, and click
OK. Caution: This will change the color for all hyperlinks in all components of
LibreOffice; this may not be what you want.
In Writer and Calc (but not Draw or Impress), you can also change the Internet link
character style or define and apply new styles to selected links.
Editing hyperlinks
To edit an existing link:
1) Click anywhere in the hyperlink text.
2) Click the Insert Hyperlink icon on the Standard toolbar, or go to Edit > Hyperlink on the
Menu bar, or press Ctrl+K, or right-click and select Edit Hyperlink from the context menu.
3) In the Hyperlink dialog, make your changes and click Apply to save the changes. The
Hyperlink dialog remains open, allowing you to continue editing hyperlinks. Click Apply
after editing each hyperlink.
4) When you are finished editing hyperlinks, click Close.
The standard (default) behavior for activating hyperlinks within LibreOffice is to use Ctrl+click. This
behavior can be changed in Tools > Options > LibreOffice > Security > Options by deselecting
the option Ctrl-click required to open hyperlinks. If clicking in your links activates them, check
that page to see if the option has been deselected.
Removing hyperlinks
You can remove the link from hyperlink text and leave just the text by right-clicking on the link and
selecting Remove Hyperlink from the context menu. You may then need to re-apply some
formatting to match the text with the rest of your document.
To remove the link text or button from the document, select it and press the Delete key.
Writer documents
Saving a Writer document as HTML
To save a Writer document as HTML, go to File > Save As on the Menu bar and select HTML
Document (Writer) as the file type in the Save As dialog. You may be prompted to confirm that
you wish to continue using the HTML format.
Saving a document as HTML produces a set of files. LibreOffice generates the image files and the
HTML file necessary to create an HTML page in a browser. The number of files generated by the
format conversion depends on the number of images and objects in the original text document.
Tip
Use an empty folder to save your document as HTML file and images.
The file names are created following a simple rule summarized in Table 5.
Table 5: File types created when saving as HTML format
File Contents
Myfile.html The text contents, page layout, text attributes, meta tags, and
styles.
Myfile_html_[random number].gif GIF images of visible contents of OLE objects.
Myfile_html_[random number].png, Images inserted in the text document as PNG, BMP, or JPEG
jpg, or bmp keep their original format.
Note
The HTML transformation of the text document is limited by the HTML 4.0 Transitional
specification. Text documents in office suites have a richer set of resources that will not
appear in HTML, for example page formatting. Do not expect the same layout fidelity
when saving a file in HTML format.
Saving as HTML may require more work directly on the HTML code to adjust the layout of the web
page. See “Creating, editing, and saving HTML files using Writer/Web” on page 364.
The Tab character is not rendered on exporting to XHTML. Instead, use borderless
tables to position contents instead of the Tab character in a line. This also affects bullet
and number lists that insert by default a Tab character between the bullet or number
and the text. Use a list style where the Tab character is replaced by a space.
Objects different from usual image formats are not rendered in LibreOffice XHTML
output. These include drawings, spreadsheets, charts, and OLE object in general. To
render an OLE object in XHTML, first transform its visible contents into an image and
then replace the object in your document with the image.
The use of styles in the text document is strongly recommended for getting the best results when
exporting to HTML or XHTML.
Impress presentations
Impress presentations cannot be saved in HTML format, but have to be exported as HTML
documents. The HTML files created will then use the default settings that you have not changed.
Notes
Saving in HTML format does not retain animation and slide transitions.
You can click Create on the HTML Export dialog at any step in the following
procedure.
1) Go to File > Export on the Menu bar and specify the file name and location of where to
save the web page version of your presentation.
2) Select HTML Document (Impress) as the file type and click Export or Save to open the
HTML Export dialog / wizard (Figure 316).
3) On the Assign Design page, you can choose to create a new design and select or delete an
existing design. Select New design or Existing design and click Next. If you have not
previously saved a web page design, the Existing design choice is not available.
– New design – creates a new design in the next pages of the wizard.
– Existing design – loads an existing design from the design list to use as a starting point
for the steps that follow. The list box displays all existing designs.
– Delete Selected Design deletes the selected design from the design list. If you delete a
design, you will only delete the design information. An export file will not be deleted by
this action.
Figure 317: HTML Export dialog – publication type and options page
5) Specify the options for saving images, monitor resolution, and effects used for the web
pages (Figure 318), then click Next. The options on this page are as follows:
– Save Images As – determines the image format. You can also define the compression
value for the export.
– Monitor Resolution – defines the resolution for the target screen. Depending on the
selected resolution, the image will be displayed in a reduced size. You can specify a
reduction of up to 80% from the original size. When selecting a resolution, consider
what the majority of your viewers might be using. If you specify a high resolution, then a
viewer with a medium-resolution monitor will have to scroll sideways to see the entire
slide, which is probably not desirable.
– Effects – specifies whether sound files defined as an effect for slide transitions are
exported and whether any hidden slides are exported.
For more information on the options available for this page of the HTML Export dialog, click
Help to open the help pages.
7) Select Link to a copy of the original presentation if you want to create a hyperlink to
download a copy of the presentation file, and then click Next.
8) Select the button style to be used for the web pages from the designs available (Figure
320) and then click Next.
If you do not select a button style, LibreOffice will create a text navigator.
This page is not available if you have selected either Automatic or WebCast publication
type.
9) Select the color scheme to be used for the web pages (Figure 321), including colors for
text, links, and background. This page is not available if you have selected either Automatic
or WebCast publication type.
Note
Depending on the size of your presentation and the number of graphics it contains, the
HTML export function creates several HTML, JPG, and GIF files. It is recommended to
create a folder to hold all the files created for the web version of your presentation. If
you simply save to your desktop and not in a specific folder, these separate HTML and
graphics files will be placed all over your desktop.
Note
Because HTML markup language has fewer formatting possibilities than a text
document in OpenDocument Format, Writer/Web cannot provide all formatting
features for HTML documents and some formatting dialogs have fewer options
available. For example, a HTML paragraph has no tab settings.
Note
The HTML markup content generated by Writer/Web is limited to the production of a
displayable document in a web browser. It does not consider other components of a
website such as external cascading style sheets (CSS), external JavaScript, or other
script languages. Use the HTML Source mode to manually insert links to these
external components into the page.
Chapter 13
Getting Started with Macros
Using the Macro Recorder … and Beyond
Introduction
A macro is a set of commands or keystrokes that are stored for later use. An example of a simple
macro is one that enters your address into an open document. You can use macros to automate
both simple and complex tasks. Macros are very useful when you have to repeat the same task in
the same way.
The simplest way to create a macro is to record a series of actions through LibreOffice’s user
interface. LibreOffice saves recorded macros using the open source LibreOffice Basic scripting
language, which is a dialect of the well-known BASIC programming language. Such macros can be
edited and enhanced after recording using the built-in LibreOffice Basic Integrated Development
Environment (IDE).
The most powerful macros in LibreOffice are created by writing code using one of the four
supported scripting languages (LibreOffice Basic, BeanShell, JavaScript, and Python). This
chapter provides an overview of LibreOffice’s macro facilities, mostly focused on its default macro
scripting language, LibreOffice Basic. Some examples are included for the BeanShell, JavaScript,
and Python scripting languages but fuller descriptions of the facilities for these languages are
beyond the scope of this chapter.
Sub HelloMacro
Print "Hello"
End Sub
Use the following steps to create a library which will contain your macro:
1) Go to Tools > Macros > Organize Macros > Basic to open the LibreOffice Basic Macros
dialog (Figure 324).
2) Click Organizer to open the LibreOffice Basic Macro Organizer dialog (Figure 325) and
select the Libraries tab.
3) Set the Location drop-down to My Macros & Dialogs, which is the default location.
4) Click New to open the New Library dialog (not shown here).
5) Enter a library name, for example TestLibrary, and click OK.
6) On the LibreOffice Basic Macro Organizer dialog, select the Modules tab (Figure 326).
7) In the Module list, expand My Macros and select your library (in the example, TestLibrary).
A module named Module1 already exists and can contain your macro. If you wish, you can
click New to create another module in the library.
8) Select Module1, or the new module that you created, and click Edit to open the Integrated
Development Environment (IDE) (Figure 327). The IDE is a text editor and associated
facilities that are built into LibreOffice and allow you to create, edit, run, and debug macros.
Sub HelloMacro
Print "Hello"
End Sub
Sub Main
End Sub
Recording a macro
If you have to repeatedly enter the same information, you can copy this information after it has
been entered into your document for the first time, then paste the information into your document
each time you want to use it. However, if something else is copied to the clipboard, the contents of
the clipboard are changed. This means that you have to re-copy your repeated information. To
overcome this problem, you can create a macro that enters your repeated information.
Note
For some cases when you want to repeatedly enter information into a document, it
may be more convenient to create an AutoText. See Chapter 2, Working with Text:
Basics, in the Writer Guide for more information.
Make sure macro recording is enabled by going to Tools > Options > LibreOffice > Advanced
and selecting the option Enable macro recording under Optional Features. By default, this
feature is turned off in LibreOffice.
1) Go to Tools > Macros > Record Macro to start recording a macro. A small dialog with a
Stop Recording button is displayed indicating that LibreOffice is recording a macro.
2) Type the desired information or perform an appropriate series of operations. As an
example, type your name.
3) Click Stop Recording on the small dialog and the LibreOffice Basic Macros dialog opens
(similar to Figure 324 on page 368, but with different action buttons).
4) Open the library container My Macros.
5) Find the library named Standard in My Macros. Note that every library container has a
library named Standard.
Note
When LibreOffice creates a new module, it automatically adds the macro named Main.
Running a macro
1) Go to Tools > Macros > Run Macro to open the Macro Selector dialog (Figure 328).
2) For example, select your newly created macro EnterMyName and click Run.
3) Alternatively, go to Tools > Macros > Organize Macros > Basic to open the LibreOffice
Basic Macros dialog (Figure 324), select your macro and click Run.
End Sub
rem -------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = "Your name"
Tip
As a short cut, you can use the single quote character (') to start a comment.
LibreOffice Basic is not case-sensitive for keywords, so REM, Rem, and rem can all start a
comment. If you use symbolic constants defined by the Application Programming Interface (API), it
is safer to assume that the names are case-sensitive. Symbolic constants are an advanced topic
not covered by this user guide and are not required when using the macro recorder in LibreOffice.
Note
Sometimes the word service is used. A service is supplied by a type of object which
are distinguished in order to point out how they are used.
Creating a macro
When creating a macro, it is important to ask two questions before recording:
1) Can the task be written as a simple set of commands?
2) Can the steps be arranged so that the last command leaves the cursor ready for the next
command or entering text or data into the document?
rem (3) Press Ctrl+Right Arrow to move the cursor to the start of “specifies”.
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem (4) Press Backspace twice to remove the tab and the space.
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
rem (5) Press Tab to add the tab without the space after the constant name.
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Text"
args4(0).Value = CHR$(9)
rem (6) ... and then press Shift+S to add an upper case S.
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Text"
args6(0).Value = "S"
rem (7) Press Ctrl+Right Arrow twice to move the cursor to the number.
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem -------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem (9) Press Ctrl+C to copy the selected text to the clipboard.
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem (10) Press End to move the cursor to the end of the line.
dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array())
rem (11) Press Backspace twice to remove the two trailing spaces.
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
rem -------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
rem (12) Press Home to move the cursor to the start of the line.
dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array())
rem (13) Press Ctrl+V to paste the selected number to the start of the line.
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem (15) Press Tab to insert a tab between the number and the name.
dim args17(0) as new com.sun.star.beans.PropertyValue
args17(0).Name = "Text"
args17(0).Value = CHR$(9)
Sub Main
CopyNumToCol1
End Sub
Other options
When the macro recorder is not able to solve a specific problem, the usual solution is to write code
using the LibreOffice objects. Unfortunately, there is a steep learning curve for these LibreOffice
objects. It is usually best to start with simple examples and then increase the scope of macros as
you learn more. Learning to read generated macros is a good place to start.
Macro organization
In LibreOffice, macros are grouped in modules, modules are grouped in libraries, and libraries are
grouped in library containers. A library is usually used as a major grouping for either an entire
category of macros, or for an entire application. Modules usually split functionality, such as user
interaction and calculations. Individual macros are subroutines and functions. Figure 330 shows an
example of the hierarchical structure of macro libraries in LibreOffice.
Go to Tools > Macros > Organize Macros > Basic to open the LibreOffice Basic Macros dialog
(Figure 324 on page 368). All available library containers are shown in the Macro From list. Every
document is a library container, capable of containing multiple libraries. The application itself acts
as two library containers, one container for macros distributed with LibreOffice called LibreOffice
Macros, and one container for personal macros called My Macros.
Caution
LibreOffice allows you to import libraries into a library container, but it will not allow you
to overwrite the library named Standard. Therefore, if you store your macros in the
Standard library, you cannot import them into another library container.
Just as it makes good sense to give your libraries meaningful names, it is prudent to use
meaningful names for your modules. By default, LibreOffice uses names such as Module1,
Module2, and so on.
As you create your macros, you must decide where to store them. Storing a macro in a document
is useful if the document will be shared and you want the macro to be included with the document.
Macros stored in the application library container named My Macros, however, are globally
available to all documents.
Macros are not available until the library that contains them is loaded. However, in contrast to other
libraries, the Standard and Template libraries are automatically loaded. A loaded library is
displayed differently from a library that is not loaded. To load the library and the modules it
contains, double-click on the library.
Importing macros
The LibreOffice Basic Macro Organizer dialog allows you to import macro libraries into your
document as well as creating, deleting, and renaming libraries, modules, and dialogs.
1) On the Libraries tab, select the library container to use and then click Import to import
macro libraries.
2) Navigate to the directory containing the library to import (Figure 331). There are usually two
files from which to choose, dialog.xlb and script.xlb. It does not matter which of
these two files you select; both will be imported. Macros can be stored in libraries inside
LibreOffice documents. Select a document rather than a directory on disk to import libraries
contained in a document.
Note
You cannot import the library named Standard.
3) Select a file and click Open to continue and open the Import Libraries dialog (Figure 332).
Events
Whenever something happens in LibreOffice, it is called an event. For example, opening a
document, changing status of modified, or moving the mouse cursor are all events. LibreOffice
allows events to trigger the execution of a macro; the macro is then called an event handler. Full
coverage of event handlers is well beyond the scope of this chapter, but a little knowledge can
accomplish much.
Caution
Be careful when you configure an event handler. For example, assume that you write
an event handler that is called every time that a document is modified, but you make a
mistake so the event is not properly handled. One possible result is that your event
handler will force you to kill LibreOffice.
1) Go to Tools > Customize to open the Customize dialog and select the Events tab (Figure
333). The events in the Customize dialog are related to the entire application and specific
documents.
2) In the Save In drop-down, select LibreOffice, or a specific document from the menu to
save your event.
Using extensions
An extension is a package that can be installed into LibreOffice to add new functionality.
Extensions can be written in almost any programming language and may be simple or
sophisticated. Extensions can be grouped into types, for example:
• Calc add-ins, which provide new functionality for Calc, including new functions that act like
normal built-in functions.
• New components and functionality, which normally include some level of User Interface (UI)
integration such as new menus or toolbars.
• Chart add-ins with new chart types.
• Linguistic components such as spelling checkers.
• Document templates and images.
Sub AppendHello
Dim oDoc
Dim sTextService$
Dim oCurs
BeanShell macros
BeanShell is a Java-like scripting language that was first released in 1999.
When you select Tools > Macros > Organize Macros > BeanShell, LibreOffice displays the
BeanShell Macros dialog (Figure 335).
Click the Edit button on the BeanShell Macros dialog to access the BeanShell Debug Window
(Figure 336).
import com.sun.star.uno.UnoRuntime;
import com.sun.star.sheet.XSpreadsheetView;
import com.sun.star.text.XText;
model = XSCRIPTCONTEXT.getDocument();
controller = model.getCurrentController();
sheet = view.getActiveSheet();
textCursor = cellText.createTextCursor();
return 0;
JavaScript macros
JavaScript is a high-level scripting language that was first released in 1995.
When you select Tools > Macros > Organize Macros > JavaScript, LibreOffice displays the
JavaScript Macros dialog (Figure 337).
Listing 8 is an example of a JavaScript macro that inserts the text “Hello World from JavaScript” in
cell A1 of the first sheet in a Calc spreadsheet.
Listing 8: Sample JavaScript macro
importClass(Packages.com.sun.star.uno.UnoRuntime);
importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument);
importClass(Packages.com.sun.star.container.XIndexAccess);
importClass(Packages.com.sun.star.table.XCellRange);
importClass(Packages.com.sun.star.table.XCell);
documentRef = XSCRIPTCONTEXT.getDocument();
allSheets = UnoRuntime.queryInterface(XIndexAccess,
spreadsheetInterface.getSheets());
theSheet = allSheets.getByIndex(0);
Cells = UnoRuntime.queryInterface(XCellRange,theSheet);
cellA1 = Cells.getCellByPosition(0,0);
theCell = UnoRuntime.queryInterface(XCell,cellA1);
Python macros
Python is a high-level, general-purpose programming language that was first released in 1991.
When you select Tools > Macros > Organize Macros > Python, LibreOffice displays the Python
Macros dialog (Figure 339).
import uno
def HelloWorld():
doc = XSCRIPTCONTEXT.getDocument()
cell = doc.Sheets[0]['A1']
cell.setString('Hello World from Python')
return
Included material
Many excellent macros are included with LibreOffice. Use Tools > Macros > Organize Macros >
Basic to open the LibreOffice Basic Macros dialog. Expand the Tools library in the LibreOffice
library container. Inspect the Debug module — some good examples include WritedbgInfo
(document) and printdbgInfo (sheet).
Online resources
The following links and references contain information regarding macro programming:
https://wiki.documentfoundation.org/Macros
https://ask.libreoffice.org/ (a Q & A site where volunteers answer questions related to LibreOffice)
http://forum.openoffice.org/en/forum/ (Apache OpenOffice community forum; volunteers answer
questions about LibreOffice as well)
https://wiki.documentfoundation.org/Documentation/Other_Documentation_and_Resources (look
in Programmers section for BASIC Programmers’ Guide and Developers’ Guide; the latter contains
a detailed explanation)
Chapter 14
Customizing LibreOffice
Introduction
This chapter describes some common customization that you may wish to carry out.
You can customize menus, toolbars, and keyboard shortcuts in LibreOffice, add new menus and
toolbars, and assign macros to events.
Other customizations are made easy by extensions that you can install from the LibreOffice
website or from other providers.
Note
Customization 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, Using Styles and Templates.
1) Type a name for the new menu in the Menu name box.
Creating an accelerator
You can allocate a letter in a custom menu’s name to be used as a keyboard shortcut. (That letter
will become underlined.) When you press Alt+that letter, that menu or command will be invoked.
Existing submenus can also be edited to change the letter which is used to select them using the
keyboard when the menu is open.
To create an accelerator:
1) Select a menu item from the Assigned Commands list on the Customize dialog.
2) Click the Modify button and select Rename.
3) Add a tilde (~) in front of the letter to use as an accelerator.
4) Click OK to save the change.
If for example you put a tilde before the “A” in a menu item Art, the “A” would now be underlined.
Press Alt+A and either the Art submenu will open or the Art button will be actioned (as
appropriate).
Customizing toolbars
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
toolbars.
To get to the Toolbars tab of the Customize dialog (Figure 345), do any of the following:
• On the toolbar, right-click in the toolbar and choose Customize Toolbar.
• Choose View > Toolbars > Customize from the Menu bar.
• Choose Tools > Customize from the Menu bar and click on the Toolbars tab.
Caution
Be careful when reassigning your operating system’s or LibreOffice’s predefined
shortcut keys. Many key assignments, such as F1 for Help, 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.
1) Select Tools > Customize > Keyboard. The Customize dialog opens with the Keyboard
tab displayed (Figure 348).
2) To have the shortcut key assignment available in all components of LibreOffice, select
LibreOffice in the upper right.
3) Next select the required function from the Category and Function lists.
4) Now select the desired shortcut keys in the Shortcut Keys list and click the Modify button.
Note
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 grayed-out in the listing on the Customize dialog, such as F1,
F6, and F10 for Calc on a Windows 10 installation, are not available for reassignment.
Installing extensions
To install an extension that is listed in the repository, follow these steps:
1) In LibreOffice, select Tools > Extension Manager on the Menu bar. In the Extension
Manager dialog (Figure 349), click the Get more extensions online link.
2) A browser window will open. Find the extension you want and download it to your computer.
3) After the extension is downloaded and saved, return to the Extension Manager dialog and
click Add. 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.
4) When the installation is complete, the extension is listed in the Extension Manager dialog.
To install an extension that is not listed in the repository, download the extension, then continue
with step 3 above.
Updating extensions
Click the Check for Updates button on the Extension Manager dialog to check for updates to
installed extensions.
Appendix A
Keyboard Shortcuts
Introduction
You can use LibreOffice without requiring a pointing device, such as a mouse or touchpad, by
using its built-in keyboard shortcuts.
This appendix lists some of the most common built-in keyboard shortcuts that apply to multiple
components of LibreOffice. For shortcuts specific to Writer, Calc, Impress, Draw, Math, or Base,
read the relevant component guide or search the application Help.
To assist the user with identification of useful keyboard shortcuts, their existence is indicated by
text on menu items and in the tooltips of toolbar icons. For example, in Writer:
• The menu item File > Open includes text indicating that Ctrl+O is an equivalent shortcut.
• The Underline icon in the Formatting toolbar has a tooltip indicating that Ctrl+U is an
equivalent shortcut.
• The Paste item in the right-click context menu includes text indicating that Ctrl+V is an
equivalent shortcut (providing that Tools > Options > LibreOffice > View > Visibility >
Shortcuts is not set to Hide).
The software provides further information about the available shortcuts in the list presented on the
Keyboard tab of the Tools > Customize dialog.
Warning
Some of the shortcuts listed here may not work if your operating system uses the
same shortcuts for other tasks.
To resolve any conflicts, assign different keys to these shortcuts by reconfiguring either
LibreOffice (see Chapter 14, Customizing LibreOffice, in this book) or your operating
system (see system documentation).
Press Enter to action the selected icon. If the selected icon normally demands a consecutive
mouse action, such as inserting a rectangle, then pressing the Enter key is not sufficient: in these
cases press Ctrl+Enter.
Press Ctrl+Enter on an icon for creating a draw object. A draw object will be placed into the middle
of the view, with a predefined size.
Press Ctrl+Enter on the Selection tool to select the first draw object in the document. If you want to
edit, size, or move the selected draw object, first use Ctrl+F6 to move the focus into the document.
Controlling dialogs
When you open any dialog, one element (such as a button, an option field, an entry in a list box, or
a checkbox) is highlighted or indicated by a dotted box around the field or button name. This
element is said to have the focus on it.
Shortcut Keys Result
Enter Activates selected button. In most cases where no button is selected,
Enter is equivalent to clicking OK.
Closes dialog without saving any changes made while it was open. In
Esc most cases, Esc is equivalent to clicking Cancel. When an open drop-
down list is selected, Esc closes the list.
Spacebar Checks an empty checkbox. Clears a checked checkbox.
Moves focus up and down a list. Increases or decreases value of a
Up, down arrow keys
variable. Moves focus vertically within a section of dialog.
Left, right arrow keys Moves focus horizontally within a section of a dialog.
Controlling macros
Shortcut Keys Result
Ctrl+* (multiplication sign: on
Runs a macro field. (See Chapter 13 for more about macros.)
number pad only)
Shift+Ctrl+Q Stops a running macro.
Managing documents
Shortcut Keys Result
Closes the current document. Closes LibreOffice when the last open document is
Ctrl+F4 or Alt+F4
closed.
Ctrl+O Launches the Open dialog to open a document.
Saves the current document. If you are working on a previously unsaved file, the
Ctrl+S
shortcut launches the Save As dialog.
Ctrl+N Creates a new document.
Shift+Ctrl+N Opens the Templates dialog.
Ctrl+P Opens the Print dialog to print the document.
Ctrl+Q Closes the application.
In the Save and Open dialogs, deletes the selected files or folders. Items can be
Del
retrieved from the Recycle Bin (Trash), if your desktop has one.
In the Save and Open dialogs, deletes the selected files or folders. Items are
Shift+Del
permanently deleted: they can not be retrieved from the Recycle Bin.
Backspace In the Save and Open dialogs, shows contents of the current folder’s parent folder.
Editing
Shortcut Keys Result
Ctrl+X, Shift+Del Cuts selected items.
Ctrl+C, Ctrl+Ins Copies selected items to the clipboard.
Ctrl+V, Shift+Ins Pastes copied or cut items from the clipboard.
Ctrl+Shift+V Opens the Paste Special dialog.
Ctrl+Alt+Shift+V Pastes unformatted text.
Ctrl+A Selects all.
Ctrl+Z Undoes last action.
Ctrl+Y Redoes last action.
Ctrl+Shift+Y Repeats last command.
Ctrl+F Opens the Find toolbar.
Ctrl+H Opens the Find & Replace dialog.
Further reading
For help with LibreOffice’s keyboard shortcuts, or using LibreOffice with a keyboard only, search
the application Help using the “shortcut keys” or “accessibility” keywords.
Appendix B
Open Source,
Open Standards,
OpenDocument
Introduction
LibreOffice is a productivity suite that is compatible with other major office suites and available on a
variety of platforms. It is open source software and therefore free to download, use, and distribute.
If you are new to LibreOffice, this appendix will provide some information regarding its history, its
community, and some of its technical specifications.
What is OpenDocument?
OpenDocument (ODF) is an XML-based file format for office documents (text documents,
spreadsheets, drawings, presentations, and more), developed at OASIS
(www.oasis-open.org/who/), an independent, international standards group. OpenDocument
version 1.2 was adopted by the International Standards Organization and named ISO/IEC
26300:2015 standard2.
Unlike other file formats, ODF (ISO/IEC 26300:2015) is an open standard. It is publicly available,
royalty-free, and without legal or other restrictions; therefore ODF files are not tied to a specific
office suite and anybody can build a program that interprets these files. For this reason ODF is
quickly becoming the preferred file format for government agencies, schools and other companies
who prefer not to be too dependent on any one software supplier.
Opening presentations
In addition to OpenDocument formats (.odp, .odg, .otp, and .fopd), Impress can open the formats
used by OpenOffice.org 1.x (.sxi and .sti) and the following presentation formats:
Microsoft PowerPoint 97/2000/XP (.ppt and .pot)
Microsoft PowerPoint 2007-365 (.pptx, .pptm, .potx, .potm)
StarDraw and StarImpress (.sda, .sdd, .sdp, and .vor)
Unified Office Format presentation (.uop, .uof)
CGM – Computer Graphics Metafile (.cgm)
Portable Document Format (.pdf)
Apple Keynote 5 (.key)
... and many others
Tip
When sharing a document that you do not expect the recipient to modify, the preferred
option is to convert the document to PDF. LibreOffice provides a very straightforward
way to convert documents to PDF. See Chapter 10, Printing, Exporting, Emailing, and
Signing, in this guide.
Encryption support within the Microsoft Word 97/2000/XP filter allows password protected
Microsoft Word documents to be saved.
Note
The .rtf format is a common format for transferring text files between applications, but
you are likely to experience loss of formatting and images. For this reason, other
formats should be used.
Saving drawings
Draw can save in the OpenDocument Drawing formats (.odg, .otg, and .fodg).
Draw can export to MacroMedia Flash (.swf) and any of the following graphics formats: BMP, EMF,
EPS, GIF, JPEG, PNG, SVG, TIFF, and WMF.