0% found this document useful (0 votes)
0 views65 pages

Ashish

The document provides a comprehensive guide on using styles in LibreOffice, explaining their importance in formatting documents consistently and efficiently. It covers various types of styles, methods for applying and modifying them, and how to create custom styles. Additionally, the document includes instructions for managing images, templates, and data consolidation within LibreOffice applications.

Uploaded by

singhrabbnoor404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views65 pages

Ashish

The document provides a comprehensive guide on using styles in LibreOffice, explaining their importance in formatting documents consistently and efficiently. It covers various types of styles, methods for applying and modifying them, and how to create custom styles. Additionally, the document includes instructions for managing images, templates, and data consolidation within LibreOffice applications.

Uploaded by

singhrabbnoor404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Contents

Using styles is highly recommended......................................................................5


What are styles?....................................................................................................................... 5
Types of styles in LibreOffice.....................................................................................6
Applying styles........................................................................................................................7
Styles deck in the Sidebar..........................................................................................7
Styles menu (Writer and Calc)...................................................................................8
Set Paragraph Style list (Writer) and Apply Style list (Calc)............................................9
Context (right-click) menu (Writer and Calc)......................................................................10
Fill Format mode (Writer and Calc)....................................................................................10
Keyboard shortcuts................................................................................................11
Modifying styles........................................................................................................11
Changing a style using the Styles deck.............................................................11
Updating a style from a selection............................................................................12
Using AutoUpdate (Writer).......................................................................................13
Creating new (custom) styles.....................................................................................13
Creating a new style using the Style dialog...............................................................13
Creating a new style from a selection......................................................................14
Dragging and dropping to create a style..................................................................15
Adding table styles in Writer................................................................................... 15
Copying styles from a template or document (Writer)..................................................16
Insert Image and graphics in documents....................................................................18
Creating and editing images........................................................................................... 18
Adding images to a document.............................................................................................18
Inserting an image file............................................................................................19
Drag and drop..................................................................................................... 19
Insert Image dialog..............................................................................................19
Copy and paste....................................................................................................20
Linking an image file...............................................................................................20
Embedding linked images.....................................................................................21
Inserting an image using a scanner.....................................................................22
Inserting an image from the Gallery.........................................................................22
Modifying, handling, and positioning images...............................................................23
Using the Image toolbar..........................................................................................24
Cropping images...............................................................................................24
Resizing an image..................................................................................................24
Rotating or flipping an image...................................................................................25
Other settings....................................................................................................................25
Exporting (saving) images.......................................................................................25
Compressing images.........................................................................................26
Positioning images.................................................................................................27
Adding captions to images.....................................................................................27
Managing the LibreOffice Gallery................................................................................27
Adding a new theme to the Gallery..........................................................................28
Adding objects to the Gallery..................................................................................29
Deleting images and themes from the Gallery..........................................................30
Location of the Gallery and the objects in it..............................................................30
Creating an image map...............................................................................................31
Creating a document from a template.........................................................................33
Creating a template...................................................................................................36
Creating a template from a document.....................................................................36
Creating a template using a wizard..........................................................................37
Adding templates obtained from other sources...........................................................38
Installing templates.................................................................................................39
Introduction...............................................................................................................40
Consolidating data.....................................................................................................40
Consolidation settings............................................................................................42
Consolidation example............................................................................................43
Creating subtotals.....................................................................................................44
Using the SUBTOTAL function................................................................................44
A SUBTOTAL example.........................................................................................45
The Subtotals tool..................................................................................................48
Using the Subtotals tool.................................................................................................48
Setting up multiple sheets.......................................................................................50
Identifying sheets........................................................................................................... 50
Inserting new sheets............................................................................................50
Inserting sheets from a different spreadsheet.........................................................54
Renaming sheets.................................................................................................55
Sharing spreadsheets................................................................................................56
Setting up a spreadsheet for sharing.......................................................................56
Opening a shared spreadsheet................................................................................57
Saving a shared spreadsheet..................................................................................58
Reviewing documents................................................................................................59
Preparing a document for review (optional)..............................................................60
Recording changes.................................................................................................60
Using a Database in LibreOffice..............................................................................62
Viewing a Database.................................................................................................62
Database Overview............................................................................................................... 63
Data Source View...................................................................................................63
Data Sources.....................................................................................................................63
Forms and Reports................................................................................................. 63
Queries.................................................................................................................. 63
Tables....................................................................................................................64
Table Design.............................................................................................................64
Table definition area...............................................................................................64
Field Name...................................................................................................................... 64
Field type........................................................................................................................ 64
Description.........................................................................................................64
Cut......................................................................................................................64
Copy................................................................................................................... 65
Paste.................................................................................................................. 65
Delete.................................................................................................................65
Insert Rows.........................................................................................................65
Primary Key................................................................................................................................. 65
Field properties............................................................................................................................... 65
Length.......................................................................................................................................... 65
Decimal places............................................................................................................................65
Default value................................................................................................................................ 65
Format example.......................................................................................................................... 65
Applying styles in Documents

Styles
Bundles formatting attributes under one name. For example, a paragraph style
defines numerous settings 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.

Using styles is highly recommended


LibreOffice is a styles-based program. It may work somewhat differently from other
programs you are familiar with. Using styles effectively requires some planning, but the
time spent in planning can save time and effort over the longer term.

Because styles apply whole groups of attributes at the same time, you can easily format
a document consistently and change the formatting of an entire document with minimal
effort. Styles are also used by LibreOffice for many processes, even if you are naot
aware of them. For example, Writer relies on heading styles (or other styles you specify)
when it compiles a table of contents. Some common uses of styles are given in
“Examples of style use” on page 1.

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 in 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 on the Menu bar, by selecting
the Clear Direct Formatting icon on Writer’s Formatting toolbar, or by
selecting the Clear Direct Formatting icon on Calc’s Standard toolbar.

What are styles?


A style is a set of formats that you can apply to selected elements such as pages, text,
frames, cells, and others in a document to quickly set or change their appearance.
Applying a style often means applying a group of formats at the same time.
Many people manually format paragraphs, words, tables, page layouts, and other parts
of their documents without paying any attention to styles. They are accustomed to
manually applying attributes such as the font family, font size, and any formatting such
as bold or italic.
Using styles means that instead of applying “font size 14pt, Times New Roman, bold,
centered” you can apply (for example) a “Title” style, because you have defined the
“Title” style to have those characteristics. In other words, using styles means that you
shift the emphasis from what the text (or page, or other element) looks like, to what the
text is.

Types of styles in LibreOffice


LibreOffice supports the following types of styles:

 Page styles include margins, headers and footers, borders and backgrounds. In
Calc, page styles also define the sequence for printing sheets.
 Paragraph styles control all aspects of a paragraph’s appearance, such as text
alignment, tab stops, line spacing, and borders, and can include character formatting.
 Character styles affect selected text within a paragraph, such as the font and
size of text, or bold and italic formats.
 Table styles apply predefined formats to tables and table elements in a text
document.
 Frame styles are used to format graphic and text frames, including text wrap,
borders, backgrounds, and columns.
 List styles allow you to select, format, and position numbers or bullets in lists.
 Cell styles include fonts, alignment, borders, background, number
formats (for example, currency, date, number), and cell protection.
 Drawing styles in drawings and presentations include line, area,
shadowing, transparency, font, connectors, dimensioning, and other attributes.
 Presentation styles include attributes for font, indents, spacing,
alignment, and tabs.

Different styles are available in the various components of LibreOffice, as listed in Table
1. Details are given in the user guide for each component.

LibreOffice comes with many predefined styles. You can use the styles as provided,
modify them, or create new ones, as described in this chapter.

Table 1. Styles available in LibreOffice components


Style Type Writer Calc Draw Impress
Page X X
Paragraph X
Character X

Frame X
List X

Table X
Cell X

Presentation X X
Drawing X X

Applying styles
LibreOffice provides several ways for you to select and apply styles:
 Styles deck on the Sidebar
 Styles menu on the Menu bar (Writer and Calc)
 Set Paragraph Style list (Writer) and Apply Style list (Calc) on the Formatting
toolbar
 Right-click context menu (Writer and Calc)
 Fill Format mode (Writer and Calc)
 Keyboard shortcuts

Styles deck in the Sidebar


The Styles deck includes the most complete set of tools for styles. To use it for
applying styles:
1) Select View > Styles or Styles > Manage Styles on the Menu bar, or press
F11 (⌘+T on macOS), or click the Styles tab on the Sidebar (View > Sidebar to
open it).
The Styles deck optionally shows previews of the styles available. Figure
1 shows the panel for Writer, with Paragraph Styles visible and with previews
off.
2) Select one of the icons at the top left of the Styles deck to display a list of
styles in that category.
3) To apply an existing style, position the cursor in the paragraph, frame, page,
word, or cell, and then double-click the name of the style in one of
these lists. To apply a character style to more than one word, select the
characters first.
Tip
At the bottom of the Styles deck is a drop-down list where you can select
what styles will be listed in the Styles panel. In Figure 1 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 1: The Styles deck for Writer, showing paragraph styles and filter

Styles menu (Writer and Calc)


In Writer, the Styles menu has the most commonly used paragraph, character, and list
styles for text documents, as well as entries for style management. The Styles menu
does not have styles for frames, pages, or tables.

To apply a paragraph style, position the cursor anywhere in the paragraph, and then
select one of the paragraph styles in the Styles menu. To apply a character style to
several characters or more than one word, select the characters first and apply the
character style from the menu.
In Calc, the Styles menu has cell styles and style management entries. To apply a cell
style, select the cell or group of cells to be formatted, and then select the required style.

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. If the Apply
Style list is not visible, you can enable it using one of the methods given in “Customizing
toolbars” in Chapter 1, Introducing LibreOffice.

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 (not shown in illustration) to
open the Styles deck on the Sidebar. You may need to scroll down the list to
see it.
Figure 2: The Set Paragraph Style list in Writer
n
Context (right-click) menu (Writer and Calc)
In Writer, right-click anywhere in a paragraph to open the context menu; choose
Paragraph. Or, right-click in a word and choose Character in the context menu. In Calc,
right-click in a cell and choose Styles in the context menu.

In each case, the submenu includes some commonly used styles. You can add styles to
this submenu; see Chapter 14, Customizing LibreOffice.

Fill Format mode (Writer and Calc)


You can use Fill Format mode to apply a style to many different areas quickly without
having to go back to the Styles deck and double-click every time. This method is quite
useful when you need to format many scattered paragraphs, cells, or other items with
the same style.

1) Open the Styles deck on the Sidebar and select the style you want to apply.
2) Click the Fill Format Mode icon at the top of the Styles deck.
3) To apply a paragraph, page, frame, or cell style, hover the mouse over the
paragraph, page, frame, or cell and click. To apply a
character style, hold down the mouse button while selecting the characters.
Clicking on a word applies the character style to that word.
4) Repeat step 3 until you have applied that style everywhere you desire.
5) To quit Fill Format mode, click the Fill Format Mode icon again or press the
Esc key.
Keyboard shortcuts
Some keyboard shortcuts for applying styles are predefined. For example, in Writer
Ctrl+0 applies the Text Body style, Ctrl+1 applies the Heading 1 style, and Ctrl+2
applies the Heading 2 style. You can modify these shortcuts and create your own; see
Chapter 14, Customizing LibreOffice, for more details.

Modifying styles
LibreOffice includes some predefined styles, and you can create custom styles (see
page 1). You can modify both predefined and custom styles in several ways:

 Change a style using the Styles deck in the Sidebar


 Update a style from a selection
 Use AutoUpdate (paragraph and frame styles only)
 Load styles from another document or template
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 or
load styles from one document to another.

Changing a style using the Styles deck


To change an existing style using the Styles deck on the Sidebar, right-click on the
required style and select Modify in the context menu.

A Style dialog is displayed with title, content, and layout dependent on the type of style
selected. Each variant of the dialog has several tabs. See the chapters on styles in the
component user guides for more information.

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 in the
context menu. You can access the appropriate Style dialog for the style of
the current selection by going to Styles > Edit Style on the Menu bar.

Updating a style from a selection


To update a style from a selection:
1) Open the Styles deck on the Sidebar.
2) In the document, select an item that has the format you want to adopt as a
style.
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) On the Styles deck, select the style to update, then click on the arrow next
to the Styles actions icon and select Update Selected Style (Figure 3).
Figure 3: Updating a style from a selection

Krishank

Tip
Other ways to modify the current style include
pressing Ctrl+Shift+F11 (Writer), selecting Styles > Update Selected
Style on the Menu bar (Writer and Calc), or clicking the Update
Selected Style icon on the Formatting toolbar (Writer).
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 in the
drop-down menu (Figure 4).
Figure 4: Modifying a style from the Set Paragraph Style list

Krishank

Using AutoUpdate (Writer)


AutoUpdate applies to paragraph and frame styles only. If the
AutoUpdate option is selected on the Organizer page of the Paragraph Style or Frame
Style dialog, applying direct formatting to a paragraph or frame using this style in the
document automatically updates the style itself.

Tip
If you are in the habit of manually overriding styles in your document, be
sure that AutoUpdate is not enabled.

Creating new (custom) styles


You may want to add some new styles. You can do this by using the Style dialog, or the
New Style from Selection tool, or by dragging and dropping, as explained below.

Creating a new style using the Style dialog


To create a new style using the Style dialog, open the Styles deck on the Sidebar and
select the category of the style you wish to create by clicking one of the icons at the top
of the deck. Then right-click on any style name and select New in the context menu.

The new style will inherit characteristics from the style that you selected. If you later
change the base style (for example, by changing the font from Times to Helvetica), all
the linked styles will change as well. Sometimes this is exactly what
you want; other times you do not want the changes to apply to all the linked styles.
You can change any of those characteristics using the Style dialog.

The dialogs and choices are the same for defining new styles and for modifying existing
styles. See the chapters on styles in the user guides for details.

Creating a new style from a selection


You can create a new style by copying an existing manual format. This new style applies
only to this document; it will not be saved in the template.

1) Open the Styles deck on the Sidebar and choose the category of style you
want to create.
2) In the document, select the item you want to save as a style.
3) On the Styles deck, click on the Styles actions icon and click the New Style
from Selection menu item in Writer or the New Style from Selection icon in
Calc, Draw, and Impress.
4) In the New Style from Selection dialog (Figure 5), type a name for the new
style. The list shows the names of existing custom styles of the selected
category. Click OK to save the new style.
Figure 5: Naming a new style created from a selection

Krisha
nk

Tip
You can also create a new style from a selection by pressing
Shift+F11 (Writer), by selecting Styles > New Style from Selection (Writer,
Calc), or by clicking the New Style from Selection icon
on the Formatting toolbar (Writer).
Dragging and dropping to create a style
You can drag and drop a selection into the Styles deck to create a new style. The
element to drag depends upon the LibreOffice application.

Writer
Select some text and drag it to the Styles deck to open the Create Style dialog. If
Paragraph Styles are active, the paragraph style will be added to the list. If
Character Styles are active, the character style will be added to the list.
Calc
Drag a cell selection to the Styles deck to open the Create Style dialog and create
a cell style. (Click and then Shift+Click to select the cell.)

Adding table styles in Writer


Table styles are stored in the LibreOffice user profile, and are available to all Writer
documents. You can define new table styles following these steps:

1) Create a table and apply formatting for cells, backgrounds, borders, and more.
2) Select the whole table.
3) Drag the table and drop it in the Table Styles category of the Styles deck in the
Sidebar.

Alternatively:
1) Create a table and apply formatting for cells, backgrounds, borders, and more.
2) Click in the table and select Table > AutoFormat Styles on the Menu bar.
On the AutoFormat dialog (Figure 6), click the Add button.
3) In the pop-up dialog, enter a name for the new table style, and then click OK.
4) The new table style is now listed in the left pane of the AutoFormat
dialog. Click OK again to close the dialog.

The new table style can be applied to tables as described in “Applying styles” on page 1.
Figure 6: Table AutoFormat dialog
Krisha
nk

Copying styles from a template or document (Writer)


In Writer, you can copy styles into a document by loading them from a template or from
another document:

1) Open the document you want to copy styles into.


2) On the Styles deck, click the Style actions icon, and then select Load
Styles from Template.
3) On the Load Styles from Template dialog (Figure 7), find a template from
which to copy styles. To copy styles from a document that is not a template, click
the From File button to open a file selection dialog and locate the required
document.
4) Select the categories of styles to copy from the checkboxes at the bottom of
the dialog.
5) Select Overwrite if you want to replace styles in the original document that
have the same name as styles in the template or document from which you are
importing styles. If this box is not selected, you will only copy styles whose names
are not used in the original document.
6) Click OK to copy the styles.
Figure 7: Copying styles from a template into the open document
Krishank

Tip
You can also access the Load Styles dialog by selecting Styles > Load Styles
from Template on the Menu bar.
Insert Image and graphics in documents
You can add graphic and image files, including photos, drawings, and scanned images,
to LibreOffice documents. 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. For more detailed instructions on
working with drawing tools, see the Draw Guide and Impress Guide. Instructions on how
to create charts are given in the Calc Guide.

Creating and editing images


You might create images using a graphics program, scan them, or download them from
the Internet (make sure you have permission to use them), or use photos taken with a
digital camera.

LibreOffice can import various vector (line drawing) images, and can rotate and flip such
images. LibreOffice also supports raster (bitmap) file formats, the most common of
which are GIF, JPG, PNG, and BMP. See Appendix B for a full list of the graphic formats
LibreOffice can import.

LibreOffice can also import SmartArt images from Microsoft Office files. For example,
Writer can open a Microsoft Word file that contains SmartArt, and you can use Writer to
edit the images.

To edit photos and other bitmap images, use a bitmap editor. To edit line drawings, use
a vector drawing program. You do not need to buy expensive programs. For many
graphics, LibreOffice Draw is sufficient. Open-source (and usually no-cost) tools such as
GIMP (bitmap editor) and Inkscape (vector drawing program) are excellent. These and
many other programs work on Windows, macOS, and Linux.

Adding images to a document


Images can be added to a document in several ways: by inserting an image file, directly
from a graphics program or a scanner, by dragging them from the clip art internal
gallery, or by copying and pasting from a source being viewed on your computer.
Inserting an image file
When the image is in a file stored on the computer, you can insert it into a LibreOffice
document using one of the following methods:

Drag and drop


This method embeds (saves a copy of) the image file in the document. To link the file
instead of embedding it, hold down the Ctrl+Shift keys while dragging the image.

1) Open a file browser window and locate the image you want to insert.
2) Drag the image into the LibreOffice document and drop it where you want it to
appear. A faint vertical line marks where the image will be dropped.
Insert Image dialog
1) Click in the LibreOffice document where you want the image to appear.
2) Choose Insert > Image on the Menu bar or click the Insert Image icon on
the Standard toolbar.
3) On the Insert Image dialog, navigate to the file to be inserted, and select it.
4) At the bottom of the dialog (Figure 1) is a Link option. See “Linking an image
file” below for the use of Link.
5) Click Open.
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.
Figure 1: Insert Image dialog
Krishank

Copy and paste


Using the clipboard, you can copy images into a LibreOffice document from another
LibreOffice document and from other programs. To do this:
1) Open both the source document or program and the target LibreOffice
document.
2) In the source document, select the image to be copied.
3) Copy the image to the clipboard.
4) Switch to the target document.
5) Click to place the cursor where the image is to be inserted.
6) Press Ctrl+V, or right-click and select Paste in the context menu, or click
the Paste icon on the Standard toolbar, to insert the image.
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.

Linking an image file


If the Link option in the Insert Image dialog is selected, LibreOffice creates a link to the
file containing the image instead of saving a copy of the image in the document. The
result is that the image is displayed in the document, but when the document is saved, it
contains only a reference to the image file, not the image itself. The document and the
image remain as two separate files, and they are merged together only when you open
the document again.
Linking an image has two advantages and one disadvantage:
 Advantage – You can modify the image file separately, and the modified image
will appear when you next open the document. This can be a big advantage if you (or
someone else, perhaps a graphic artist) is updating images.
 Advantage – Linking can reduce the size of the document when it is saved,
because the image file itself is not included. However, file size is usually not a problem
on a modern computer, and LibreOffice can handle quite large files.
 Disadvantage – If you send the document to someone else, or move it to a
different computer, you must also send the image files, or the receiver will not be able
to see the linked images. You need to keep track of the location of the images and
make sure the recipient knows where to put them, so that the document can find them.
For example, you might keep images in a subfolder named Images (under the folder
containing the document); the recipient of the file needs to put the images in a
subfolder with the same name and in the same place relative to the document.
Note
When inserting the same image several times in the document, LibreOffice
embeds only one copy of the image file.
Embedding linked images
If you originally linked the images, you can easily embed one or more of them later if
you wish.
Figure 2: The Edit Links dialog

Krisha
nk

1) Open the document in LibreOffice and choose Edit > Links to External Files.
2) In the Edit Links dialog (Figure 2), select the files you want to change from
linked to embedded.
3) Click the Break Link button and then click Yes to confirm embedding the
image.

Inserting an image using a scanner


If a scanner is connected to your computer, LibreOffice can call the scanning application
and insert the scanned item into your document as an image. To start this procedure,
choose Insert > Media > Scan > Select Source on the Menu bar. Select the scan source
from the list of available devices, then click in the document where you want the graphic
to be inserted, and choose Insert > Media
> Scan > Request to open the imaging software where you can adjust settings for
image quality, size, and other attributes.

Although this practice is quick and easy, it is unlikely to result in a high-quality image of
the correct size. You may get better results by scanning material into a graphics
program and cleaning it up there before inserting the resulting image into LibreOffice.

Inserting an image from the Gallery


The Gallery (Figure 3) provides a convenient way to group reusable objects such as
graphics and sounds that you can insert into your documents. The Gallery is available in
the Writer, Calc, Impress, and Draw components of LibreOffice. See “Managing the
LibreOffice Gallery” below. You can copy or link an object from the Gallery into a
document.

Figure 3: The Gallery in Icon View


Krishank

To insert an object from the Gallery into a document:


1) Click the Gallery icon on the Sidebar.
2) Select a theme in the list provided, and select an object with a single click.
3) Drag and drop the image into the document, or right-click on the object and
choose Insert in the context menu.

To insert an object as a link, hold down the Shift and Ctrl keys and drag and drop the
object into the document.

Modifying, handling, and positioning images


LibreOffice provides many tools for cropping, resizing, modifying, filtering, and
positioning images; wrapping text around images; and using images as
backgrounds and watermarks. These tools are described in relevant chapters of the
other guides. Some sophisticated adjustments are best done in an image manipulation
program and the results brought into LibreOffice, rather than using LibreOffice’s built-in
tools.

Using the Image toolbar


When you insert an image or select one already present in the document, the Image
toolbar appears. Two other toolbars can be opened from this one: the Image Filter
toolbar, which can be torn off and placed elsewhere on the window, and the Color
toolbar, which opens as a separate floating toolbar. From these three toolbars, you can
apply small corrections to the image or obtain special effects: transparency, color
adjustment, flipping and rotating, and applying special-effects filters. For more
information, see the Writer Guide.

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 tool and the Crop tab of the Image dialog in Writer (accessed by
right-clicking on the image and selecting Properties in the context menu). The Crop tool
provides a quick and easy way to crop an image; but for more control, use the Image
dialog. For more information, see the Writer Guide.

Note
If you crop an image in LibreOffice, the image itself is not changed.
LibreOffice hides, but does not cut off, part of the image. If you export the
document to HTML, the original image is exported, not the cropped image.
For exporting individual cropped images, see “Exporting (saving) images”
below.

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 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.

Rotating or flipping an image


To quickly flip an image vertically or horizontally, or rotate it, right-click the image and
select Rotate or Flip in the context menu, then choose the desired option in the
submenu.

Writer provides more rotation options than the other LibreOffice components. See the
Writer Guide for more information.
Other settings
The Image dialog in Writer has ten tabs:
 Type: define the size and anchor of the image and its position on the page.
 Options: give the image a descriptive name, define the alternative text to be
displayed when the mouse hovers over the image, and protect some of the image
settings from changes.
 Wrap: choose how text wraps around the image, and the spacing between the
image and the text.
 Hyperlink: associate a hyperlink to the image, or create an image map.
 Image: flip or rotate the image, and display the original location of the file in case
the image is linked rather than embedded.
 Crop: cut off portions of the image, scale it and set its size.
 Borders: create borders around the image and add a shadow.
 Area: change the background (color, bitmap, gradient, pattern, or hatching) of the
image. This setting produces the desired results only for images with a transparent
color.
 Transparency: set the transparency and gradient options for the image.
 Macro: associate a macro to the image. You can choose among the predefined
macros or write your own.

Exporting (saving) images


To make complex adjustments to the image in another program, or to save the image
for use in another document, you can export it directly from the document. Right-click
on the image and choose Save in the context menu to open the Image
Export dialog. LibreOffice will let you save the picture in several formats. Name the
image, select the desired image format in the File type list, and click Save.

Before the image is saved another dialog opens, where you can choose various image
size and format options. The content of this dialog depends on the output file type
selected. If the image has been modified within Writer, you will also see a confirmation
dialog where you can choose to save the original version or the modified version of the
image.

Compressing images
If you insert a large image in a 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, possibly 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 4). Use the Calculate
New Size button to update the image information on the dialog on each parameter set
you change.
Click OK to apply the compression settings. If the resulting image is not acceptable,
press Ctrl+Z to undo and choose another compression setting. For more information,
see the Help.

Figure 4: The Compress Image dialog


Krishank
Positioning images
When you add an image to a document, you need to choose how to position it with
respect to the text and other images. For details, see the relevant component guide
(Writer, Calc, and so on).
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, the frame or cell where the object is, a paragraph, or even a character. An image
always has an anchor point.
 Text wrapping in a Writer document refers to the relation of images to the
surrounding text, which may wrap around the image on one or both sides, be
overprinted behind or in front of the image, or treat the image as a separate paragraph
or character.
In Writer, the settings can be accessed in several ways, depending on the nature of the
graphic:
 In the Format menu: Anchor, Wrap, and Arrange (for images and drawing
objects).
 In the context menu displayed when you right-click the graphic; this menu also
includes an Align Objects option.
 For images, on the Type and Wrap tabs of the Image dialog. Note that you cannot
control the arrangement using the dialog.
 For drawing objects, on the Position and Size tab of the Position and Size dialog.
 For an embedded object (such as a Calc spreadsheet or Draw document), on the
OLE-Object toolbar.

Adding captions to images


You can add captions to Writer images in three ways: automatically, by using the
Caption dialog, or manually. See the Writer Guide for details.

Managing the LibreOffice Gallery


Graphics in the Gallery are grouped by themes, such as Arrows, Diagrams, and Icons.
You can create other groups or themes and add your own pictures or find extensions
containing more graphics. Click on a theme to see its contents displayed in the Gallery
window.

You can display the Gallery in Icon View (Figure 3) or Detailed View (Figure 5),
and you can hide or show the Gallery by clicking on the Sidebar’s Hide button.

Figure 5: Gallery in Detailed View

Krishank

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” below. The
locked themes are easily recognizable by right- clicking on them; the only option in
the context menu is Properties.

Adding a new theme to the Gallery


You may wish to add your own theme to the Gallery to hold any images or other objects
that you use frequently, for example, a company logo. Or you may wish to add several
themes, each holding images for a specific project.

To add a new theme to the Gallery:


1) Click the New button below the list of themes (Figure 5).
2) In the Properties of New Theme dialog, click the General tab and type a name
for the new theme.
3) Click the Files tab and add images to the theme, as described below.
Tip
You can also get more gallery themes from the LibreOffice extensions website at
https://extensions.libreoffice.org/, including themes from previous versions of
LibreOffice, that are no longer installed by default with the program. See
Chapter 14, Customizing LibreOffice,
for instructions on how to manage extensions.
Adding objects to the Gallery
To add objects to a theme that you have created:
1) Right-click on the name of the theme and select Properties in the context
menu.
2) In the theme’s Properties dialog, click the Files tab (Figure 6).
Figure 6: Gallery Properties dialog

Krisha
nk

To add several files at once:


1) In the Properties dialog, click the Find Files button.
2) The Select Path dialog (not shown) opens. You can enter the path for the file’s
directory in the path text box, or you can navigate to locate the file’s directory.
3) Click the Select button to start the search. A list of files is then displayed in
the Properties dialog. You can use the file type drop-down list to limit the files
displayed.
4) To add all of the files shown in the list, click Add All. Otherwise, select the
files to add and then click Add (hold down either the Shift key or the Ctrl key
while clicking on the files).
To add a single file:
1) In the Properties dialog, click Add to open the Gallery dialog.
2) Use the navigation controls to locate the image to add to the theme. Select
it and then click Open to add it to the theme.
3) Click OK on the Properties dialog to close it.
Deleting images and themes from the Gallery
To delete an image from a theme, right-click on the name of the image file or its
thumbnail in the Gallery, then click Delete in the context menu. A message appears,
asking if you want to delete this object. Click Yes.

To delete a theme from the Gallery, select it from the list of themes, right-click, then
click Delete in the context menu. You cannot delete a theme supplied with LibreOffice.

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.

Location of the Gallery and the objects in it


Graphics and other objects shown in the Gallery can be located anywhere on your
computer’s hard disk, on a network drive, or other removable media. When you add
graphics to the Gallery, the files are not moved or copied; the location of each new
object is simply added as a reference.

In a workgroup, you may have access to a shared Gallery (where you cannot change the
contents unless authorized to do so) and a user Gallery, where you can add, change, or
delete objects.

The location of the user Gallery is specified in Tools > Options > LibreOffice > Paths.
You can change this location, and you can copy your gallery files (*.sdv) to other
computers.
Gallery contents provided with LibreOffice are stored in a different location. You cannot
change this location.

Note
The locations of Gallery themes distributed through LibreOffice extensions are
determined by the extensions’ settings.

Creating an image map


An image map defines areas of an image (called hotspots) with hyperlinks to web
addresses, other files on the computer, or parts of the same document. Hotspots are
the graphic equivalent of text hyperlinks (described in Chapter 12, Creating HTML Files).
Clicking on a hotspot causes LibreOffice to open the linked page in the appropriate
program (for example, the default browser for an HTML page; LibreOffice Calc for an
ODS file; a PDF viewer for a PDF). You can create hotspots of various shapes and
include several hotspots in the same image.
To use the image map editor:
1) In the LibreOffice document, click on the image in which you want to define
the hotspots.
2) Choose Tools > ImageMap on the Menu bar. The ImageMap Editor dialog
(Figure 7) opens. The main part of the dialog shows the image on which the
hotspots are defined.
3) Use the tools and fields in the dialog (described below) to define the required
hotspots and links. A hotspot is identified by a line indicating its shape. The
information needed for the hotspot includes the address pointed to by the
hyperlink and the text you want to be displayed when the mouse pointer is moved
over the hotspot.
4) Click the Apply icon to apply the settings.
5) When done, click the Save icon to save the image map to a file, then close the
dialog.
Figure 7: The dialog to create or edit an image map
Krishank

The toolbar at the top of the dialog contains the following tools:
 Apply: applies the changes.
 Open, Save, Close, and Select.
 Rectangle, Ellipse, Polygon, and Freeform Polygon: tools for drawing a hotspot
shape. These tools work in the same way as the tools in the Drawing toolbar.
 Edit, Move, Insert, Delete Points: advanced editing tools to manipulate the
shape of a polygon hotspot. Select the Edit Points tool to activate the other tools.
 Undo and Redo: cancels the previous action or reapplies the previous canceled
action.
 Active: toggles the status of a selected hotspot between active and
inactive.
 Macro: associates a macro with the hotspot instead of just associating a
hyperlink.
 Properties: sets the hyperlink properties and adds the Name attribute to the
hyperlink.
Below the toolbar, specify for the selected hotspot:
 Address: the address pointed to by the hyperlink. You can also point to an anchor
in a document; to do this, write the address in this format:
file:///<path>/document_name#anchor_name
 Text: type the text that you want to be displayed when the cursor is moved over
the hotspot.
 Frame: where the target of the hyperlink will open: pick among _blank (opens
in a new browser window), _self (opens in the active browser window),
_top or _parent.
Tip

A template is a model document that you use to create other documents. For example,
you can create a template for business reports that has your company’s logo on the first
page. New documents created from this template will all have your company’s logo on
the first page.

Templates can contain anything that regular documents can contain, such as text,
graphics, a set of styles, and user-specific setup information such as measurement
units, language, the default printer, and toolbar and menu customization.

All documents in LibreOffice are based on templates. You can create, or download and
install, as many templates as you wish, and you can set a default template for each type
of document (text, spreadsheet, drawing, presentation). If you do not choose a template
when you start a new Writer document, then the document is based on the default
template for text documents. If you have not specified a default template, Writer uses
the built-in blank template for text documents that is installed with LibreOffice. See
“Setting a default template” below.
In Writer, you can create templates for master documents as well as for ordinary
documents.

This chapter describes the use of LibreOffice’s template management features. You can
also use templates in other ways, but the effects are a bit different. See “Other ways to
manage templates” below for more information.

Creating a document from a template


A new installation of LibreOffice may not include many templates, but you can create
your own (see “Creating a template” below) or install templates obtained from other
sources (see “Adding templates obtained from other sources” below).
To create a document from a template:
1) Open the Templates dialog (Figure 1) using one of these methods:
 Choose File > New > Templates or File > Templates > Manage
Templates on the Menu bar.
 Press the key combination Ctrl+Shift+N.
 Click the arrow next to the New icon on the Standard toolbar and
select Templates.
 Select Templates > Manage Templates in the Start Center (visible in
LibreOffice when no document is open).
2) In the Filter lists at the top of the Templates dialog, you can select the type
and category of template you want to use. The relevant templates are listed on
the dialog. Click on the icons to the right of the Categories list to switch between
Thumbnail view (Figure 1) and List view (Figure 2).
3) Find and double-click the required template, or select the template and click
Open. A new document based on the selected template opens in Writer. You can
then edit and save the new document.

The template the document is based on is listed in File > Properties > General.
Tip
In the Start Center, you can click on the Templates button, or open the drop-
down menu and select a type of template, to view the available templates
without opening the Templates dialog. Click on the required template to
create a new document.
Figure 1: Thumbnail view of Templates dialog, showing context menu for
a selected user-created template
Krishank

Figure 2: List view of Templates dialog

Note
The connection between a template and a document remains until the template is
modified and you do not update the document to match
the template.
If you copy or move the document to a different computer which does not
have a copy of that template installed, the connection is broken even
though it continues to be listed in the document’s properties. See
“Changing the template assigned to a document” below for a way to
reconnect a template to a document.
Creating a template
You can create templates in two ways: by saving a document as a template or by using
a wizard.

Creating a template from a document


In addition to formatting, any settings that can be added to or modified in a document
can be saved within a template. For example, printer settings; general behaviors set
from Tools > Options, such as paths and colors; menu and toolbar customizations,
described in Chapter 20, Customizing Writer.

Templates can also contain predefined text, saving you from having to type it every time
you create a new document. For example, a letter template may contain your name,
address, and salutation.

To create a template from a document:


1) Open a new or existing text (Writer) document.
2) Add any content that you want to appear in any document you create from the
new template, for example company logo or a copyright statement.
3) Create or modify any styles that you want to use in the new template.
4) On the Menu bar, choose File > Templates > Save as Template. The Save as
Template dialog (Figure 3) opens, displaying the existing categories and a box for
the name for the new template.
5) Select a category, for example My Templates or Business Correspondence.
You can also set this template as a default template at this time. Click Save.
Figure 3: Save as Template dialog
Creating a template using a wizard
You can use wizards to create templates for letters, faxes, and agendas. To create a
template using a wizard:

1) On the Menu bar, choose File > Wizards > [type of template
required] (Figure 4).
2) Follow the instructions on the pages of the wizard. This process is
slightly different for each type of template, but the format is similar.
Figure 4: Choosing a template wizard
3) In the last section of the wizard, you can specify the template name that will
show in the Templates dialog and the file name and location for saving the
template. The two names can be differsent but this may cause confusion. The
default location is your user templates folder but you can choose a different
location.
4) To set the file name or change the folder, click the Path icon (the three dots to
the right of the location). On the Save As dialog, make your selections and click
Save to return to the wizard.
5) Finally, you can choose whether to create a new document from the template
immediately or manually change the template. Click Finish to save the template.

Adding templates obtained from other sources


LibreOffice refers to sources of templates as repositories. A repository can be local (a
directory on your computer to which you have downloaded templates) or remote (a URL
from which you can download templates).

To get to the official LibreOffice template repository, type


https://extensions.libreoffice.org/ in your web browser’s address bar or click the Get
more extensions online... link in the Extension Manager, described in Chapter 14,
Customizing Writer. This opens the Extensions web page (Figure 5). In the Search
section, click the Templates tag filter. You can narrow your search by also choosing
other tag filters. such as Writer. After setting the filters, click the Search button. In the
search results, find the required template and click on its name to display a page with
details; click the Download button to put the template anywhere on your computer.
Proceed to “Installing templates” below.

Figure 5: Searching for templates in the repository

You can also choose Extensions in the submenu of the Manage button on the upper
right of the Templates dialog (Figure 6) to open an Extensions: Templates dialog, where
you can scroll through a list of extensions. In this version of LibreOffice, there is no easy
way to filter this list, so you may prefer to go directly to the web page, as described
above.

Figure 6: Getting more templates for LibreOffice


Krishank

On other websites, you may find collections of templates that have been packaged into
extension (.OXT) files.

Installing templates
You can install templates using either the Templates dialog or the Extension Manager.

To install templates using the Templates dialog:


1) Download the template or package and save it anywhere on your computer.
2) In the Templates dialog, click the Manage button on the upper right (Figure 6)
and select Import in the submenu.
3) On the Select Category dialog, select the category where you want to import
the template and click OK. A file browser window opens.
4) Find and select the template that you want to import and click Open. The file
browser window closes and the template is imported and appears in the selected
category.
To install templates using the Extension Manager:
1) Download the template or package and save it anywhere on your computer.
2) In LibreOffice, select Tools > Extension Manager on the Menu bar. In the
Extension Manager dialog, click Add to open a file browser window.
3) Find and select the template or package of templates you want to install and
click Open. The package begins installing. You may be asked to accept a license
agreement.
4) When the package installation is complete, restart LibreOffice. The templates
are available for use through the Templates dialog and the extension is listed in
the Extension Manager.
ANALYSE DATA IN SPREADSHEET

Introduction
Once you are familiar with functions and formulas, the next step is to learn how to use
Calc’s automated processes to quickly perform useful analysis of your data.

In addition to formulas and functions, Calc includes several tools for processing your
data. These tools include features for copying and reusing data, creating subtotals,
running what-if analysis, and performing statistical analysis. They can be found under
the Tools and Data menus on the Menu bar. Although they are not necessary when
using Calc, they can help you save time and effort with handling large data sets or
preserving your work for future review.

Note
A related tool, the Pivot Table, is not mentioned here, as it is complex enough to
require its own chapter. See Chapter 9, Using Pivot Tables,
for more information.

Consolidating data
The Consolidate tool allows you to combine and aggregate data spread across one or
more sheets. This tool is useful if you need to quickly summarize a large, scattered set
of data for review. For example, you could use it to consolidate multiple department
budgets from different sheets into a single company-wide budget contained in a master
sheet.
To consolidate data:
1) Open the document containing the cell ranges to be consolidated.
2) Select Data > Consolidate on the Menu bar to open the Consolidate dialog
(Figure 1).
3) Click on the Source data ranges field, then type a reference to a source data
range, a named range, or select it with the mouse. Use the associated Shrink /
Expand button if you need to minimize the dialog while you select the range.
Alternatively, select a named range from the drop- down list to the left of the field.
4) Click Add. The selected range is added to the Consolidation ranges list.
5) Repeat steps and to add additional source ranges.
6) To delete an entry in the Consolidation ranges list, select it and click
Delete. The deletion is carried out without further confirmation.
7) Click on the Copy results to field, then type a reference to the first cell of the
target range or select it with your mouse. You can also select a named range in
the drop-down list to the left of the field.
8) Select a function to aggregate your data in the Function drop-down list. The
default is Sum. Other available functions are Count, Average, Max, Min, Product,
Count (numbers only), StdDev (sample), StDevP (population), Var (sample), and
VarP (population).
9) Click OK to consolidate the ranges. Calc runs the function from step on your
source data ranges and populates the target range with the results.
Tip
If you are consolidating the same cell ranges repeatedly, consider converting
them into reusable named ranges to make the process easier. For more
information about named ranges, see Chapter 14,
Calc as a Database.
Figure 1: Consolidate dialog
Krishank

Consolidation settings
In the Consolidate dialog, expand the Options section to access the settings shown in
Figure 2.

Figure 2: Consolidate dialog – Options section

Consolidate by
In this section, choose whether to consolidate your source data ranges by their
range position or by matching labels. Consolidation labels must be
contained within each range, and the text of corresponding row or column labels
must match for the rows or columns themselves to be combined.
 Row labels – Consolidates rows by matching label. If this option is
unchecked, the tool will consolidate rows by position instead.
 Column labels – Works the same as Row labels, but with
columns instead.
Options
Select Link to source data to add formulas in the target range that link back to
values in the source ranges. When you select this option, any changes you make
in the source ranges will automatically update values in the target range.
Note
If you use the Link to source data option, each source link is inserted into
the target range, then ordered and hidden from view. Only the final results
of consolidation are displayed by default.

Consolidation example
Figures 3, 4, and 5 show a simple example of consolidation using a spreadsheet with
the sheets Year 1, Year 2, and Consolidated Sales. Figure 3 shows the contents of the
Year 1 sheet, with sales figures by region for each of the four product colors.
Figure 3: Year 1 sales by region

Krishank

Figure 4 shows the Year 2 sheet, sales figures by region for each of four product colors.
Note the different ordering of row and column labels between the two figures.

Figure 4: Year 2 sales by region


Figure 5 shows the consolidated sales data, created by using the Consolidate dialog
settings shown in Figure 2. Note that because the Link to source data option
was selected, clicking on the plus sign (+) indicators to the left of the data will reveal
formula links back to the source ranges.

The source ranges and target range are saved as part of the document. If you later open
a document with consolidated ranges, they will still be available in the Consolidation
ranges list of the Consolidate dialog.
Figure 5: Consolidated sales by region

Creating subtotals
Calc offers two methods of creating subtotals: the SUBTOTAL function and the
Subtotals tool.

Using the SUBTOTAL function


The SUBTOTAL function is listed under the Mathematical category of the Function
Wizard, and the Functions deck of the Sidebar, which are described in Chapter 8,
Using Formulas and Functions. SUBTOTAL is a relatively limited method for generating
a subtotal, and works best if used with only a few categories.

A SUBTOTAL example
To illustrate how to use the SUBTOTAL function, we use the sales data sheet shown in
Figure 6. The AutoFilter function is already applied to the sales data, as indicated by the
down arrow buttons at the head of each column. AutoFilters are described in Chapter 2,
Entering and Editing Data.

Figure 6: Sales data with AutoFilter applied (only the first few rows are
shown)

To create a summation subtotal for the Sales Value field using the Function Wizard:

1) Select the cell to contain a subtotal. Typically, this cell is at the bottom of the
column being subtotaled, which, for our example, is the Sales Value column.
2) Use one of the following methods to open the Function Wizard dialog (Figure
7):
 Select Insert > Function on the Menu bar
 Click the Function Wizard icon on the Formula bar
 Press Ctrl+F2
Figure 7: Function Wizard dialog
Krishank

3) Select SUBTOTAL in the Function list of the Function Wizard dialog and click
Next.
4) Enter the numeric code of a function into the Function field on the right side of
the dialog. This code must be a value in the range 1 to 11, or 101 to 111, with the
meaning of each value shown in Table 1.
Note
Values 1 to 11 include hidden values in the calculated subtotal, while values 101
to 111 do not. Hiding and showing data is described in Chapter 2, Entering and
Editing Data. Filtered-out cells are always excluded by the SUBTOTAL function.
Table 1: SUBTOTAL function numbers
Function index Function index
(includes hidden values) (ignores hidden values) Function
1 101 AVERAGE

2 102 COUNT
3 103 COUNTA
Function index Function index
(includes hidden values) (ignores hidden values) Function
4 104 MAX
5 105 MIN

6 106 PRODUCT
7 107 STDEV

8 108 STDEVP

9 109 SUM

10 110 VAR
11 111 VARP
5) Click on the Range field, then type a reference to the Sales Value range or
select the cells with your mouse (Figure 7). Use the Shrink /
Expand button if you need to temporarily minimize the dialog while selecting the
cells.
6) Click OK to close the Function Wizard dialog. The cell you selected in step
now contains the total sales value.
7) Click on the AutoFilter down arrow button at the top of the
Employee column and remove all marks from the filter area except those next to
Brigitte and (empty). The cell that you selected in step should now reflect the sum
of all of Brigitte’s sales (Figure 8).
Note
If the cell range used to calculate a subtotal contains other subtotals, these
subtotals will not be counted in the final one. Similarly, if you
use this function with AutoFilters, only the data satisfying the current filter
selections will be displayed. Any filtered-out data is ignored.
Figure 8: SUBTOTAL result for Brigitte’s sales
The Subtotals tool
Calc offers the Subtotals tool as a more comprehensive alternative to the SUBTOTAL
function. In contrast to SUBTOTAL, which only works on a single array, the Subtotals
tool can create subtotals for up to three arrays arranged in labeled columns. It also
groups subtotals by category and sorts them automatically, thereby eliminating the
need to apply AutoFilters and filter categories by hand.

Using the Subtotals tool


To insert subtotal values into a sheet:
1) Select the cell range for the subtotals that you want to calculate, and
remember to include the column heading labels. Alternatively, click on a single
cell within your data to allow Calc to automatically identify the range.
2) Select Data > Subtotals on the Menu bar to open the Subtotals dialog (Figure
9).
3) In the Group by drop-down list on the 1st Group tab, select a column by its
label. Entries in the cell range from step will be grouped and sorted by matching
values in this column.
4) In the Calculate subtotals for box on the 1st Group tab, select a column
containing values to be subtotaled. If you later change values in this column, Calc
will automatically recalculate the subtotals.
5) In the Use function box on the 1st Group tab, select a function to calculate the
subtotals for the column selected in step .
6) Repeat steps and to create subtotals for other columns on the 1st Group tab.
7) You can create two more subtotal categories by using the 2nd Group
and 3rd Group tabs and repeating steps to . If you do not want to add more
groups, then leave the Group by list for each page set to “- none
-”.
8) Click OK. Calc will add subtotal and grand total rows to your cell range.
Figure 9: Subtotals dialog

Krisha
nk

For our sales data example, a partial view of the results is shown in Figure 10. The group
settings are identified in Table 2.
Setting up multiple sheets
Chapter 1, Introduction, gives a detailed explanation of how to set up multiple sheets in
a spreadsheet. Here is a quick review.

Identifying sheets
When you open a new spreadsheet it has, by default, one sheet named Sheet1. You can
specify a different number of sheets to be created in a new document, or a different
prefix name for new sheets, by going to Tools > Options > LibreOffice Calc > Defaults
on the Menu bar (Figure 1).

Figure 1: Options > LibreOffice Calc > Defaults dialog

Krishank

Sheets in Calc are managed using tabs located at the bottom of the spreadsheet.

Inserting new sheets


There are several ways to insert a new sheet. The fastest method is to click on the Add
Sheet (+) icon located to the left of the sheet tabs, at the bottom of the spreadsheet.
This inserts one new sheet without opening any dialog, with a
default name (Sheet2, for example) and with the new sheet’s tab positioned at the right
hand end of the sheet tabs.
Use one of these other methods to insert more than one sheet, to rename the sheet at
the same time, or to insert the sheet somewhere else in the sequence.
 Left-click a sheet tab and select Sheet > Insert Sheet on the Menu bar.
Calc displays the Insert Sheet dialog with the Before current sheet and
New sheet options preselected.
 Select Sheet > Insert Sheet at End on the Menu bar. Calc displays the
Append Sheet dialog.
 Select Sheet > Insert Sheet from File on the Menu bar. Calc displays the
Insert Sheet dialog with the Before current sheet and From file options
preselected. It also displays a file browser dialog on top of the Insert Sheet
dialog to enable you to first select the source file containing the sheet to be
inserted.
 Right-click on a sheet tab and select Insert Sheet in the context menu
(Figure 2). Calc displays the Insert Sheet dialog with the Before current sheet
and New sheet options preselected.
 Left-click in the empty space at the right end of the line of sheet tabs
(Figure 2). Calc displays the Insert Sheet dialog with the Before current sheet
and New sheet options preselected.
 Right-click in the empty space at the right end of the line of sheet tabs and
select Insert Sheet in the context menu (Figure 2). Calc displays the Insert
Sheet dialog with the Before current sheet and New sheet options
preselected.
Figure 2: Creating a new sheet through the sheet tabs area
Krishank

The above methods use either the Insert Sheet dialog (Figure 3) or the Append Sheet
dialog (Figure 4).

On the Insert Sheet dialog, you can:

 Choose whether to put the new sheet before or after the currently
selected sheet tab.
 Choose how many sheets to insert.
 Choose the name for a single sheet (the Name field is unavailable if more
than one sheet is to be inserted).
The From file option is described in “Inserting sheets from a different
spreadsheet” (page 1).

Figure 3: Insert Sheet dialog


Krishank

Figure 4: Append Sheet dialog

For John’s spreadsheet we need six sheets, one for each of his five accounts and one
as a summary sheet. We also want to name each of these sheets for the account they
represent: Summary, Checking Account, Savings Account, Credit Card 1, Credit Card 2,
and Car Loan.
After creating a new spreadsheet with one sheet, we could:

 Insert five new sheets and rename all six sheets afterwards
 Rename the existing sheet, then insert the five new sheets one at a time,
renaming each new sheet during the insert step.
To insert sheets and rename them afterwards:
1) Make sure that the correct sheet tab is selected and open the Insert Sheet
dialog.
2) Choose the position for the new sheets (in this example, we use After
current sheet).
3) Choose New sheet and enter 5 after No. of sheets:. Because you are
inserting more than one sheet, the Name box is not available.
4) Click OK to insert the sheets.
For the subsequent steps to rename the sheets, see “Renaming sheets” (page 1).
To insert sheets and name them at the same time:
1) Rename the existing sheet as Summary, as described in “Renaming
sheets” (page 1).
2) Make sure that the correct sheet tab is selected and open the Insert Sheet
dialog.
3) Choose the sheet tab position for the new sheet (Before current
sheet or After current sheet, as applicable).
4) Choose New sheet and enter 1 in the No. of sheets field.
The Name box is now available.
5) In the Name box, type a name for this new sheet, for example Checking
Account.
6) Click OK to insert the sheet.
7) Repeat steps to for each new sheet, giving them the names Savings
Account, Credit Card 1, Credit Card 2, and Car Loan.
Inserting sheets from a different spreadsheet
On the Insert Sheet dialog, you can also add a sheet from a different spreadsheet (for
example, another Calc or Microsoft Excel file), by choosing the From file option.
Click Browse, select the file using the file browser dialog, and click Open. A list of
the available sheets in that file appears in the adjacent list box (Figure 5). Select the
sheet to import (you can only import one at a time). If, after you select the file, no sheets
appear, you probably selected an invalid file type (not a spreadsheet, for example).

Figure 5: From file area of Insert Sheet dialog showing file path and
names of available sheets
If you prefer, select the Link option to insert the external sheet as a link instead of as a
copy. This is one of several ways to include “live” data from another spreadsheet – see
also “Linking to external data” (page 1). The links can be updated manually to show the
current contents of the external file using Edit > Links to External Files on the Menu bar.
Alternatively the links can be updated automatically whenever the file is opened,
depending on the options set on the dialog accessed by selecting Tools > Options >
LibreOffice Calc > General on the Menu bar. The three options available in the
Update links when opening section are Always (from trusted locations), On
request, and Never.
To define trusted file locations, select Tools > Options > LibreOffice > Security
> Macro Security (Trusted Sources tab) on the Menu bar. This is useful if you want
to use macros in your spreadsheet. For more information about macros see Chapter 13,
Macros.

Renaming sheets
Sheets can be renamed at any time. To give a sheet a more meaningful name:
 Enter the name in the Name box when you create the sheet.
 Double-click on the relevant sheet tab and replace the existing name
through the Rename Sheet dialog.
 Right-click on the relevant sheet tab, select Rename Sheet in the context
menu, and replace the existing name through the Rename Sheet dialog.
 Left-click on the relevant sheet tab, select Sheet > Rename Sheet on the
Menu bar, and replace the existing name through the Rename Sheet dialog.
Figure 6: Rename Sheet dialog
A sheet name cannot be empty and must not be a duplicate of an existing name.

Sharing and reviewing spreadsheets

Sharing spreadsheets
Sharing a spreadsheet allows several users to open the same file for editing at the
same time. The spreadsheet needs to be on a shared drive, server, website, or similar.
Some conditions must be met on operating systems with user permission
management:

 The shared file needs to reside in a location which is accessible by all


collaborators.
 The file permissions for both the document and the corresponding lock file
need to be set so that all collaborators can create, delete, and change the files.
Consult your operating system’s documentation for details on setting file permissions.
See also “Opening and saving files on remote servers” in Chapter 1, Introducing
LibreOffice, in the Getting Started Guide.

Tip
In order to correctly identify the changes, each collaborator should enter their
name in Tools > Options > LibreOffice > User Data on
the Menu bar.

Setting up a spreadsheet for sharing


With the spreadsheet open, choose Tools > Share Spreadsheet on the Menu bar to
enable or disable sharing.

Figure 1: Share Document dialog


Krishank

c
To enable sharing, select the checkbox at the top of the dialog (Figure 1) and click OK. If
the spreadsheet has been saved previously, a message appears stating that you must
save it to activate shared mode; click Yes to continue. If the spreadsheet has not been
saved previously, the Save dialog opens. After saving, the text “(shared)” is shown on
the Title bar, after the title.

Tools > Share Spreadsheet on the Menu bar can also be used to switch a spreadsheet
from shared to unshared. However, this means that other users can no longer edit it.
Instead, you may wish to save a copy of the shared spreadsheet using another name or
path, thus creating a copy of the shared spreadsheet, and then switch the copy to
unshared.

Opening a shared spreadsheet


When you open a shared spreadsheet, a message appears stating that some features
are not available in this mode. After reading it, click OK to remove the message and
open the document. You can select the option to not show the warning again.
The following features are disabled in a shared spreadsheet:
Edit > Track Changes, except for Merge Document
Insert > Media > Audio or Video
Insert > Comment
Insert > Object
Insert > Chart
Insert > Named Range or Expression
Insert > Pivot Table
Insert > Floating Frame
Insert > Fontwork
Insert > Signature Line
Format > Cells
Merge Format > Print
Ranges
Sheet > Move or Copy Sheet
Sheet > Delete Sheet
Sheet > Insert Sheet from File
Sheet > Named Ranges and Expressions
Sheet > Rename Sheet
Sheet > Sheet Tab Color
Data > Define Range
Data > Sort
Data > Sort Ascending
Data > Sort Descending
Data > Subtotals
Data > Validity
Data > Multiple Operations
Data > Consolidate
Data > Group and Outline
Data > Pivot Table
Tools > Protect Sheet
Tools > Protect Spreadsheet Structure
Saving a shared spreadsheet
When you save a shared spreadsheet, and if it has not been modified and saved by
another user since you opened it, it is saved as usual.

If the spreadsheet has been modified and saved by another user since you opened it, one
of the following will occur:

 If the changes do not conflict, the document is saved, the message “Your
spreadsheet has been updated with changes saved by other users” appears, and
any cells modified by the other user are shown with a red border.
Figure 2: Resolve Conflicts dialog

 If the changes conflict, the Resolve Conflicts dialog (Figure 2) is shown.


You must decide for each conflict which version to keep, yours or the other
person’s. When all conflicts are resolved, the document is saved. While you are
resolving the conflicts, no other user can save the shared document.
 If another user is trying to save the shared spreadsheet and resolve
conflicts, they see a message that the file is locked due to a merge in progress.
They can cancel the Save command and retry saving later.
When you successfully save a shared spreadsheet, the document shows the latest
version of all changes saved by all users.

Reviewing documents
You can use several methods to review, edit, and comment on a spreadsheet. Each
reviewer works on a separate copy of the document.
 You can use change marks to show added and deleted material. Later, you
or another person can review the document and accept or reject each change.
 You can make changes to a copy of the document (stored in a different
folder, under a different name, or both), then use Calc to compare the files and
show the changes. See “Comparing documents” below.
 You can save versions that are stored as part of the original file. See
“Saving versions” below.
Reviewers can leave comments in the document, either attached to specific changes or
standalone.

Preparing a document for review (optional)


Before you send a spreadsheet to someone else to review or edit, you may want to set it
up so that the editor or reviewer does not have to remember to turn on the revision
marks.

After you have turned on revision marks, you can optionally password protect the
spreadsheet so that any user must enter the correct password in order to accept or
reject changes.

1) Open the spreadsheet and select Edit > Track Changes > Record on the
Menu bar, or press Ctrl+Shift+C. You can also use File > Properties > Security
and select Record changes.
2) If you want to protect the spreadsheet, click Edit > Track Changes > Protect
on the Menu bar. On the Protect Records dialog, type a password (twice) and click
OK. You can also use File > Properties > Security and click the Protect button to
open the similar Enter Password dialog. Guidelines for choosing a suitable
password are in the Help.

Recording changes
To record changes, open the spreadsheet and make sure that the Edit > Track Changes
> Record menu item has a check mark next to it, indicating that change recording is
active.
Caution
After making some changes, do not turn off change recording. Turning off
change recording in Calc causes all the recorded changes to be accepted
and no longer shown as changes. A message box will warn if you try to do
this.

When changes are made in a cell, a colored border with a dot in the upper left- hand
corner appears around the cell (Figure 3). A deleted column or row is marked by a heavy
colored bar.

Figure 3: Edited document with red border on changed cells


To see the changed information, hover the mouse pointer over the changed cell. See
Figure 4.

Figure 4: Showing details of the change

Note
Some changes, for example cell formatting, are not recorded and marked.
Tip
To change the color that indicates a changed cell, select Tools > Options >
LibreOffice Calc > Changes on the Menu bar.
You may want to explain your rationale for the changes. You can do this by adding
comments to the changes you made or by adding general comments to the
spreadsheet.

In LibreOffice Base, you can access data that is stored in a wide variety of database file
formats. LibreOffice Base natively supports some flat file database formats, such as the
dBASE format. You can also use LibreOffice Base to connect to external relational
databases, such as databases from MySQL or Oracle.
The following database types are read-only types in LibreOffice Base. From within
LibreOffice Base it is not possible to change the database structure or to edit, insert, and
delete database records for these database types:
 Spreadsheet files
 Text files
 Address book data

Using a Database in LibreOffice


 To create a new database file, choose File - New - Database.
The Database Wizard helps you to create a database file and to register a new database
within LibreOffice.

The database file contains queries, reports, and forms for the database as
well as a link to the database where the records are stored. Formatting
information is also stored in the database file.

 To open a database file, choose File - Open. In the File type list box,
select to view only "Database documents". Select a database document
and click Open.

Viewing a Database
There are two different methods of viewing a database in LibreOffice.
 Choose File - Open to open the database file.
The database file gives you full access to tables, queries, reports, and
forms. You can edit the structure of your tables and change the
contents of the data records.
 Choose View - Data source to view the registered databases.
The data source view can be used to drag-and-drop table fields from
registered databases into your documents and to produce mail merges.

Database Overview
Working with databases in LibreOffice

Data Source View


Choose View - Data Sources or press Ctrl + Shift + F4 keys to call the data source view
from a text document or spreadsheet.
On the left you can see the Data source explorer. If you select a table or query there, you
see the contents of this table or query on the right. At the top margin is the Table Data
bar.

Data Sources
Address book as data source
View data source contents Menu
bar of a database file

Forms and Reports


Create new form document, edit form controls, Form Wizard Entering data
versus editing form
Report Wizard
Using and Editing Database Reports

Queries
Create new query or table view, edit query structure Query
Wizard
Enter, edit and copy records
Tables
Create new table, edit table structure, index, relations Table
Wizard
Enter, edit and copy records

Table Design
In the Table Design window you define new tables or edit the structure of an existing
table.
To access this command...
In a database file window, click the Tables icon. Choose Insert - Table
Design or Edit - Edit.

Database Overview Table


Design
The window has its own menu bar. It also contains the following new
command: Index Design

Table definition area


This area is where you define the table structure. Field
Name
Specifies the name of the data field. The database engine may impose restrictions on the
length of the table name, and the use of special characters and spaces within the table
name.
Field type
Specifies the field type. The available field types are limited by the database engine
being used.
Description
Specifies an optional description for each field.
The row headers contain the following context menu commands: Cut
Cuts the selected row to the clipboard.
Copy
Copies the selected row to the clipboard.
Paste
Pastes the content of the clipboard. Delete
Deletes the selected row.
Insert Rows
Inserts an empty row above the current row, if the table has not been saved. Inserts
an empty row at the end of the table if the table has already been saved.
Primary Key
If this command has a check mark, the data field is defined as a primary key. By clicking
the command you activate/deactivate the primary key definition of the field. The
command is only visible if the data source supports primary keys.

Field properties
Defines the field properties of the currently selected field. Length
Specifies the maximum number of characters allowed for data entry of the
corresponding data field including any spaces or special characters.
Decimal places
Specifies the number of decimal places for a numerical field or decimal field.
Default value
Specifies the value that is the default in new data records. Format
example
Displays a sample of the format code of the field by applying it to the default
value. Select the format code with the Format Field button.

You might also like