LibreOffice Logo

Getting Started Guide 25.2

Chapter 9Getting Started with Math

Formula (Equation) Editor in LibreOffice

Copyright

This document is Copyright © 2025 by the LibreOffice Documentation Team. Contributors are listed below. This document may be distributed and/or modified under the terms of either the GNU General Public License (https://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), version 4.0 or later. All trademarks within this guide belong to their legitimate owners.

Contributors

To this edition

Peter Schofield

For previous editions

Bernard Siaud

Christian Kühl

Dave Barton

Florian Reisinger

Frédéric Parrenin

Gisbert Friege

Hazel Russman

Kees Kriek

Jean Hollis Weber

Jochen Schiffers

John A Smith

Laurent Balland-Poirier

Martin Saffron

Mitchell Camfield

Olivier Hallot

Peter Schofield

Rafael Lima

Regina Henschel

Roman Kuznetsov

Skip Masonsmith

Steve Fanning

Winston Min Tjong

Feedback

Please direct any comments or suggestions about this document to the Documentation Team Forum at https://community.documentfoundation.org/c/documentation/loguides/ (registration is required) or send an email to: loguides@community.documentfoundation.org.

Everything sent to a forum is publicly archived and cannot be deleted. Emails sent to the forum are moderated.

Publication date and software version

Published July 2025. Based on LibreOffice 25.2 Community.Other versions of LibreOffice may differ in appearance and functionality.

Using LibreOffice on macOS

Some keystrokes and menu items are different on macOS from those used in Windows and Linux. The table below gives some common substitutions used in this document. For a detailed list, see LibreOffice Help.

Windows or Linux

macOS equivalent

Effect

Tools > Options

LibreOffice > Preferences

Access setup options

Right-click

Control+click, Ctrl+click, or right click depending on computer setup

Open a context menu

Ctrl or Control

⌘ and/or Cmd or Command, depending on keyboard

Used with other keys

Alt

⌥ and/or Alt or Option depending on keyboard

Used with other keys

F11

⌘+T

Open the Styles deck in the Sidebar

Introduction

Math is a formula editor included as a separate LibreOffice module and is used to create or edit, in a symbolic form, formulas or equations. These formulas can then be used in LibreOffice documents or as stand-alone objects. An example of the opening window for Math is shown in Figure 1. When using Math, the Elements panel in the Sidebar also opens (Figure 2).

The images used in this document are examples ONLY. Actual images displayed when using Math does depend on computer setup and the computer operating system being used.

When creating formulas in Math, a markup language is used to represent formulas and this markup language is designed to be easily read wherever possible. For example, when the text df(x) over dx = ln(x)+tan^-1(x^2) into the Formula Editor, the following formula appears in the Formula Preview.

df(x)dx=ln(x)+tan1(x2)

Getting started

Using the Formula Editor in Math, a formula is created as a separate file for insertion into a formula library. Alternatively, formulas can be directly inserted into a document when using Writer, Calc, Impress, or Draw. For more information on using formulas, see the user guides for the specific LibreOffice module being used.

Figure 1: Math opening window

Image2 Copy 2

  1. Formula Preview

  2. Formula Editor

  3. Sidebar

Figure 2: Elements panel in Sidebar

Image1 Copy 2

Formulas as separate documents or files

As characters are entered the markup language in the Formula Editor, the formula being created appears in the Formula Preview window during, as shown in Figure 1. For more information on creating formulas as a separate document or file, see “Creating formulasbelow.

  1. Use one of the following methods to create a formula as a separate document or file:

  1. When the formula is completed as a new document or file, save the formula in ODF format.

Formulas in LibreOffice documents

A formula can also be created and inserted directly into a Writer, Calc, Draw, or Impress document. An example of creating a formula in a Writer document is shown in Figure 3. The formula box is automatically selected ready for a formula to be entered or edited.

Inserting formulas

Depending on the LibreOffice module being used when inserting a formula, the cursor position changes depending on where the formula is being inserted.

Formulas as OLE Objects

Formulas are inserted as OLE objects into documents, as follows:

  1. Go to Insert > OLE Object > Formula Object on the Menu bar to open the Formula Editor.

Figure 3: Example of creating a formula in Writer

Image3 Copy 2

Figure 4: Insert OLE Object dialog

Image4

  1. Alternatively, go to Insert > OLE Object > OLE Object on the Menu bar to open the Insert OLE Object dialog (Figure 4).

  1. Select Create new, then select LibreOffice XX Formula in Object Type.

  2. Click OK to open the Formula Editor.

  1. Create or edit the formula in the Formula Editor.

  2. When the formula has been created or edited, close the Formula Editor using one of the following methods:

If formulas are frequently inserted into documents, it is recommended to add Formula Object tool to the Standard toolbar, or create a keyboard shortcut. For more information, see Customization below.

Using the Elements panel on the Sidebar, or the context menus to create a formula is a convenient way to learn the markup language used to create formulas.

When using the Elements panel on the Sidebar, it is recommended to have Extended Tips selected in LibreOffice Options. Extended Tips helps in identifying the categories and symbols used in formulas. Go to Tools > Options > LibreOffice > General (macOS LibreOffice > Preferences > LibreOffice > General) on the Menu bar and select Extended Tips in the Help section.

Creating formulas

Formulas are created using one of the following methods:

Elements panel

The Elements panel on the Sidebar (Figure 2) is a visual tool to help create and edit formulas. It organizes mathematical symbols and operators using categories in a drop-down list. The steps below describe how to enable the Elements panel and navigate its categories and symbols.

  1. Select View > Elements on the Menu bar to open the Elements panel in the Sidebar.

  2. Select the category required for the formula from the Categories drop-down list at the top of the Elements panel.

  3. Select the symbol required from the options available in the Elements panel. The available symbols change according to the selected category.

  4. After selecting a symbol, the symbol appears in Formula Preview and the Formula Editor is updated with the markup language used for the selected symbol.

Figure 5: Examples list in Elements panel on Sidebar

Image5 Copy 1

  1. Alternatively, select an example from the Examples list in the Categories drop-down list on the Sidebar (Figure 5).

Context menu

The Formula Editor also provides a context menu to access categories and markup language options when creating a formula. An example is shown in Figure 6.

  1. Right-click in the Formula Editor to open the context menu.

  2. Select a category from the options listed in the context menu.

  3. Select a markup language option from the options available in the drop-list.

Figure 6: Example of category options in Formula Editor

Image6

The Elements panel and the context menu in the Formula Editor provide the most common options and symbols used in formulas. Other options and symbols not listed have to be entered manually using markup language. For a complete list of commands and symbols, see the Math Guide.

Markup language

Markup language is entered directly into the Formula Editor. For example, typing 5 times 4 into the Formula Editor creates a simple formula. Using markup language is the recommended method for creating formulas. Table 1 shows examples of using markup language to enter commands. For a full list of commands that can be used in the Formula Editor, see the Math Guide.

Table 1: Example commands using markup language

Display

Command

Display

Command

a=b

a = b

a

sqrt {a}

a2

a^2

an

a_n

f(x)dx

int f(x) dx

an

sum a_n

ab

a <= b

infinity

a×b

a times b

xy

x cdot y

Greek characters

Using markup language

Greek characters are commonly used in formulas, but cannot be entered into a formula using the Elements panel in the Sidebar (Figure 2), or the context menu in the Formula Editor. Use English names for Greek characters in markup language when entering Greek characters into a formula. See the Math Guide for a list of Greek characters that can be entered using markup language.

Figure 7: Tools toolbar

Image7

Figure 8: Symbols dialog — Greek

Image8

Figure 9: Symbols dialog — iGreek

Image9

Symbols dialog

Greek characters can also be entered into a formula using the Symbols dialog.

  1. Make sure the cursor is at the correct position in the Formula Editor.

  2. Go to Tools > Symbols on the Menu bar, or click Symbols in the Tools toolbar (Figure 7) to open the Symbols dialog.

  3. Select Greek in the Symbol set drop-down list (Figure 8). For italic characters, select iGreek in the Symbol drop-down list (Figure 9).

  4. Double-click the Greek character required, or select the Greek character and click Insert. When selected, the name of the character is shown below the symbol list.

  5. Click on Close to close the Symbols dialog.

Special characters

In addition to math symbols, special characters can also be part of a formula. The special characters are handled as text in the formula.

  1. Make sure the cursor is in the correct position in the Formula Editor.

  2. Go to Tools > Special Characters on the Menu bar to open the Special Characters dialog. The Special Characters dialog that opens depends on the computer setup and the computer operating system.

  3. Click on Font and select the font required from the drop-down list.

  4. Click on Character block and select the type of special character required from the drop‑down list.

  5. Select the special character required from the character block.

  6. Click on Insert to insert the selected special character into the formula. This also closes the Special Characters dialog.

Formula examples

Example 1

A simple formula 5×4 is created in Math as follows:

  1. Make sure the cursor is located and flashing in the Formula Editor.

  2. Enter Multiplication symbol using one of the following methods:

The first two methods above place the formula text <?> times <?> in the Formula Editor and the symbol Image11 appears in the document. The third method above, using markup language in the Formula Editor, places the formula directly into the document and it is not necessary to carry out the following steps.

  1. Select the first placeholder <?> before the word times in the Formula Editor and replace with the character 5. The formula in the document updates automatically.

  2. Select the second placeholder <?> after the word times in the Formula Editor and replace it with the character 4. The formula in the document updates automatically.

If necessary, to prevent a formula in a document from updating automatically, go to View on the Menu bar and deselect AutoUpdate Display. The formula can be updated manually when necessary. Press the F9 key or select View > Update on the Menu bar.

Example 2

The formula for Pi π3.14159 where value is rounded to 5 decimal places is created as follows. The Greek character (pi) is known, but the required markup language Similar Or Equal symbol is not known.

  1. Make sure the cursor is located and flashing in the Formula Editor.

  2. Enter %pi in the Formula Editor to create the Greek character for Pi (π).

  3. Select the category Relations, then select the symbol Is Similar Or Equal using one of the following methods:

  1. Delete the first placeholder symbol <?> before the word simeq in the Formula Editor.

  2. Select the second placeholder symbol <?> after the word simeq in the Formula Editor and enter 3.14159 to delete the second placeholder symbol. The formula now appears in the document.

Editing formulas

How a formula is edited after opening changes the formula editing mode depending on whether the formula is in Math or another LibreOffice module.

  1. To select the formula and open Formula Editor using one of the following methods:

If a formula element cannot be selected using the cursor, click on Formula Cursor in the Tools toolbar (Figure 7) to activate the formula cursor.

  1. Select the formula element to be changed using one of the following methods:

  1. Make all necessary changes to the selected formula element.

  2. Go to View > Update on the Menu bar, press the F9 key, or click on Update on the Tools toolbar to update the formula.

  3. Save the changes to the formula using one of the following methods:

Formula layout

Using braces

Math knows does not use order of operation within a formula. Braces (curly brackets) have to be used to define the order of formula operations. The following examples show how braces are used in a formula.

Example 1

2 over x + 1 creates the formula 2x+1

Math recognized the 2 before and the x after the over command belong to a fraction and has represented them accordingly. If x+1 is required rather than x to be a denominator, x+1 must be bracketed together using braces to create the correct formula. Inserting braces as shown in 2 over {x + 1} creates the correct result 2x+1 where x+1 is now the denominator.

Example 2

– 1 over 2 creates the formula 12

Math has recognized the minus sign as a prefix for the 1 and has placed it as the numerator of the fraction. If it is required that the whole fraction is negative with the minus sign in front of the fraction, the fraction must be placed in braces to instruct Math that all the characters are part of the whole fraction. Adding braces into the markup language – {1 over 2} creates the fraction 12 and the whole fraction is now negative.

Example 3

Braces are used in markup language to define the formula layout and are not displayed or printed. If braces used within a formula are to be printed, use the commands lbrace and rbrace within the markup language.

x over {–x + 1} gives the formula xx+1

Replace the braces with lbrace and rbrace in the markup language as follows:x over lbrace –x + 1 rbrace creates the formula x{x+1}

Brackets (parentheses) and matrices

To use a matrix in a formula, the matrix command has to be used.

Example 1

To create a simple example of a 2x2 matrix. In matrices, rows are separated by two hashes (##) and entries within each row are separated by one hash (#).

( matrix { a # b ## c # d } (abcd)

Example 2

Normally, when brackets are used within a matrix, the brackets do not scale as the matrix increases in size. The following example shows a formula where the parentheses do not scale to the size of the resulting matrix.

( matrix { a # b ## c # d } ) (abcd)

Example 3

To solve this problem, Math provides scalable brackets that change in size to match the matrix size. The commands left(and right) have to be used to create scalable brackets around a matrix. The following example shows how to create a matrix with scalable parentheses.

left( matrix { a # b ## c # d } right) (abcd)

Scalable brackets can be used with any formula element, such as fraction, square root, and so on.

To create a matrix where some values are empty, the grave accent (`) is used so that Math places a small space in the position where grave accent (`) has been placed, as shown in the following example:

left( matrix { 1 # 2 # 3 ## 4 # ` # 6 } right) (12346)

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.

If all brackets are to be scalable, go to Format > Spacing on the Menu bar to open the Spacing dialog. Click on Category and select Brackets from the drop-down list, then select the option Scale all brackets from the drop-down list.

Unpaired brackets

When using brackets in a formula, Math expects that for every opening bracket there will be a closing bracket. If a closing bracket is not used, Math places an inverted question mark next to where the closing bracket should have been placed.

For example, lbrace a; b creates because the right bracket rbrace is missing. This inverted question mark disappears when all brackets are paired. This is corrected by using lbrace a; b rbrace, which creates {a;b} . However, there are cases where an unpaired bracket is required.

Non scalable brackets

A backslash \ is placed before a non scalable bracket to indicate that the subsequent character is not a bracket, but a literal character.

Example

The unpaired brackets in the formula [ a; b [ results in an inverted question mark being entered because Math expects that [ will be closed by ]. To correct the error, use a backslash and insert \ [ a; b \ [ into the Formula Editor to create the correct result [a;b[ .

Scalable brackets

To create unpaired scalable brackets or braces in a formula, the markup commands left, right, and none are used.

Example

The following formula uses the stack command to create a two-line formula and adds a bracket only to the right side of the stack.

abs x = left lbrace stack {x "for" x >= 0 # -x "for" x < 0} right none

|x|={xforx0xforx<0

This effect is achieved by using the left lbrace command combined with the right none command. The first command indicates that the left bracket is a lbrace and the second command none tells Math that there is no right bracket added to the right side of the formula.

Recognizing functions

In the normal installation of Math, Math creates functions using normal characters and variables in italic characters. However, if Math fails to recognize a function, Math can be forced to recognize that a function has been entered. Using the markup command func before a function forces Math to recognize the following text as a function.

Some Math functions have to be followed by a number or variable. If a number or variable is 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, enter a number, variable, or pair of empty brackets as a placeholder.

For a full list of functions available in Math, see the Math Guide.

Navigate through formula errors using the function key F3 to move to the next error, or use the function key combination Shift+F3 to move to the previous error.

Multiple line formulas

When creating a formula that requires more than one line, for example x=3y=1 , the first reaction is to use the Enter key. However, when the Enter key is used, the markup language in the Formula Editor goes to a new line, but the resulting formula does not have two lines. To add a new line into a formula, the markup command newline has to be used

Table 2 shows how the markup command newline is used to add a new line to a formula. The first example simply adds an Enter command to break the line in the markup language. This does not create a new line in the formula. The second example uses the newline command. The newline command creates a two-line formula.

Table 2: Multiple line formulas

Markup Language

Resulting Formula

x = 3y = 1

x=3y=1

x = 3 newline y = 1

x=3y=1

It is not possible in Math to create multiple line formulas when a line ends with an equals sign and continue the formula on a new line. A term on the right side of the equals sign must be entered to create multiple line formulas.

If a multiple line formula is required to have an equals sign at the end of a line without a term after the equals sign, use empty quotes “”, empty braces {}, grave character `, or tilde character ˜.

By default, the alignment of a multiple line formula is center aligned. For more information on alignment using the equals sign, see “Customizationbelow.

Formula element spacing

Spacing between elements in a formula is not set by using space characters in the markup language. To add spaces into a formula, use one of the following options:

Any spaces at the end of a line in the markup language are ignored by default. For more information, see “Adjusting formula spacingbelow.

Adding limits to summations and integrals

The sum and int commands are used for summations and integrals with the parameters from and to used to set the lower and upper limits. The parameters from and to can be used singly or together as shown by the following examples. Table 3 shows how to add upper and lower bounds to summations and integrals. Note that brackets are used to define which parts of the formula correspond to the desired bounds. For more information on the sum and int commands, see the Math Guide.

Table 3: Summations and integrals

Markup Language

Resulting Formula

sum from k = 1 to n a_k

k=1nak

sum to infinity 2^{-n}

2n

sum from{ i=1 } to{ n } sum from{ j=1; i <> j } to{ m } x_ij

i=1nj=1;ijmxij

int from 0 to x f(t) dt

0xf(t)dt

int_0^x f(t) dt

0xf(t)dt

int from Re f

f

Adding derivatives

When adding derivatives to a formula, indicate in Math that it is a fraction by using the over command. The over command is combined with the character d for a total derivative, or the partial command for a partial derivative to achieve the effect of a derivative. Braces {} are used on each side of elements to enclose the elements and make the derivative as shown by the examples in Table 4.

Table 4: Adding derivatives

Markup Language

Resulting Formula

{df} over {dx}

dfdx

{partial f} over {partial y}

fy

{partial^2 f} over {partial t^2}

2ft2

To write function names with primes, as is normal in school notation, add the symbols to the catalog first. For more information, see “Catalog customizationbelow.

Markup language characters as normal characters

Characters that are used as controls in markup language cannot be entered directly as normal characters. Control characters are: %, {, }, &, |, _, ^ and ". For example, 2% = 0.02 cannot be entered into markup language and expect the same characters to appear in a formula. To overcome this limitation in markup language, use one of the following methods:

The Special Characters dialog used by other LibreOffice modules is not available in Math. If special characters are required in Math, then it is recommended to add the characters to the Math Catalog. For more information, see “Catalog customizationbelow.

Text in formulas

To include text in a formula, enclose any text in double-quotes, for example x " for " x >= 0 in markup language creates the formula x for x0 . All characters, except double quotes, can be used in text.

However, if double quotes are required in formula text, any text text created in Writer must be contained within double quotes. The text is then copied and pasted as the text into the Formula Editor as shown in Figure 10.

Figure 10: Example of using double quotes to create formula text

Image10

The font used for text in a formula is the default font that has been set in the Fonts dialog. For more information on how to change fonts used in formulas. For more information, see Appendix A, Commands Reference for more information.

By default, text alignment is left-justified in formulas. For more information, see “Adjusting formula alignmentbelow.

Formatting text in formulas

Formatting commands are not interpreted within text used in formulas. To use formatting commands within formula text, the text flow must be broken by using double quotes in the Formula Editor.

Example

Enter the following text in the Formula Editor using markup language to create text in a formula:

"In " color blue bold "isosceles" "triangles, the base angles are equal"

In isoscelestriangles, the base angles are equal

The example above shows how markup language is used to change the text color to blue and use bold text for the word “isosceles” in the formula. Note that the commands are applied to any text placed between the double quotes. The formatting command color blue bold is not applied to the rest of the text in the example because it is a separate quote block.

The command color needs to be followed by the name of the desired color or to its RGB or hexadecimal value. Refer to the Math Guide for a list of predefined color names.

Aligning formulas using equals sign

Math does not have a command for aligning formulas on a character. However, a matrix can be used to align formulas on the equals sign (=) character. The markup commands alignr, alignl and alignc are used to align each value inside a matrix to the right, left or center, respectively.

Example

The following uses a matrix to align formulas on the equals sign and uses alignment commands to align the contents of each position within the matrix. The spacing on each side of the equals sign cab be reduced if the inter-column spacing of the matrix is adjusted. See “Adjusting formula spacingbelow for more information.

matrix{ alignr x+y # {}={} # alignl 2 ## alignr x # {}={} # alignl 2-y }

x+y=2x=2y

The empty braces each side of the equals sign are required. The equals sign is a binary operator and requires an expression on each side. Spaces, or characters ` or ~ on each side of the equals sign can be used, but it is recommended to use braces because braces are easier to see within markup language.

Changing formula appearance

Only the default font or font size can be changed in a formula. Any formulas that were already inserted into a document will continue to use the previous settings for default font and font size. The font and font size of these previously inserted formulas have to be changed individually to use the new setting for default font and font size.

The extension Formatting of All Math Formulas can be used to change font name and font size for all or selected formulas in a document. The extension and instructions for use can be downloaded from the LibreOffice website using the following link: https://extensions.libreoffice.org/en/extensions/show/formatting-of-all-math-formulas.

Figure 11: Properties panel in Sidebar

Image13

Figure 12: Font Sizes dialog

Image12

Sidebar Properties panel

The Properties panel in the Sidebar provides options to set fonts, fonts size, spacing, and alignment for text in formulas (Figure 11).

Formula font size

Changing formula font size

To change the font size used in a formula already inserted into a LibreOffice document:

  1. Click in the markup language in the Formula Editor.

  2. Go to Format > Font size on the Menu bar to open the Font Sizes dialog (Figure 12).

  3. Select a different font size from the options available in Base size, or enter a new font size in the text box.

  4. Click OK to save the changes and close the dialog.

Example

Default font size 12pt: π3.14159

Font size changed to 18pt: π3.14159

Default formula font size

To change the default font size used for all formulas in a LibreOffice document:

  1. Before inserting any formulas into a document, go to Format > Font size on the Menu bar to open the Font Sizes dialog (Figure 12).

  2. Select a different font size from the options available in Base size, or enter a new font size in the text box.

  3. Click on Default and select Yes in the conformation dialog that opens to save the change in font size.

  4. Click on OK to save the changes and close the Font Sizes dialog. Any new formulas created will use the new base size font for formulas.

Font size options

The Font Sizes dialog (Figure 12) specifies the font sizes used in a formula. Change the base size and all elements in the formula created after the change will use the new base font size.

Base size

All elements of a formula are proportionally scaled to the base size. To change the base size, select or type in the desired point (pt) size. You can also use other units of measure or other metrics, which are then automatically converted to points.

Relative Sizes

Determines the relative sizes for each type of element with reference to the base size.

Text

Select the text size in a formula relative to the base size.

Indexes

Select the relative size for indexes in a formula in proportion to the base size.

Functions

Select the relative size for names and function elements in a formula in proportion to the base size.

Operators

Select the relative size of the mathematical operators used in a formula in proportion to the base size.

Limits

Select the relative size for the limits in a formula in proportion to the base size. This is used to determine the size for commands from and to used in summations and integrals.

Default

Select Default to save any changes to the font size options. The new font sizes are then used as default for all new formulas.

Formula fonts

The default font used in Math is OpenSymbol, but this can be changed using the following procedures.

Changing formula fonts

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

  3. Select a new font for each of the various options in the drop-down lists in the Fonts dialog.

  4. If the font required does not appear in the drop-down list, click Modify and select the option from the context menu to open a Fonts dialog.

  5. Select the font required and click OK to add the font to the drop-down list for the selected option.

  6. Click OK to save the changes and close the Fonts dialog.

Figure 13: Fonts dialog

Image13 Copy 1

Change default formula fonts

To change the default fonts used for all formulas in a LibreOffice document:

  1. Before inserting any formulas into a document, go to Format > Font size on the Menu bar to open the Fonts dialog (Figure 13).

  2. Select a new font for each the various options from the drop-down lists.

  3. If the font required does not appear in the drop-down list, select Modify and then select an option from the context menu to open a Fonts dialog.

  4. Select the font required and click OK to add the new font to the drop-down list for the selected option.

  5. Click on Default and select Yes in the conformation dialog that opens to save the change in font type.

  6. Click OK to save the changes and close the Fonts dialog.

Formula font options

Formula Fonts

Defines the fonts used for the variables, functions, numbers and inserted text used for formula elements.

Variables

Selects the fonts used for the variables in a formula.

Functions

Selects the fonts used for the function names and properties.

Numbers

Selects the fonts for the numbers in a formula.

Text

Defines the font used for text in a formula.

Custom Fonts

Defines fonts to format text components in a formula. The three basic fonts Serif, Sans‑serif and Fixed-width are available. Other fonts can be added using the Modify option. All fonts installed on a computer system are available for use.

Serif

Specifies the font used for a serif font format.

Sans

Specifies the font used for a sans font format.

Fixed

Specifies the font used for a fixed font format.

Modify

Select an option from the context menu to access the Fonts dialog to define the font and font attributes for a formula and for any custom fonts being used.

Default

Click on Default to save any changes as the default for all new formulas. A confirmation message appears before any changes are saved.

When a new font is used for a formula, the old font remains available and can be selected again.

Variables should be written in italics. For all other formula elements, the basic form of a font is used. The font style can be altered in the formula by using the commands italic or bold. To stop using an italic or bold font, use nitalic or nbold after the variable

Adjusting formula spacing

The alignment settings determine how formula elements located above one another are aligned horizontally relative to each other.

Current formula spacing

To change the spacing used in the current formula in a LibreOffice document:

  1. Click in the markup language in the Formula Editor.

  2. Go to Format > Spacing on the Menu bar to open the Spacing dialog (Figure 14).

  3. Click Category and select one of the options from the drop-down list. The options in the Spacing dialog change depending on which category is selected.

  4. Enter new values for the spacing category and click OK.

  5. Check the spacing format in the formula. If the spacing format is not correct, repeat the steps above.

Default formula spacing

To change the default spacing used for all formulas in a LibreOffice document:

  1. Before inserting any formulas into a document, go to Format > Spacing on the Menu bar to open the Spacing dialog (Figure 14).

  2. Click Category and select one of the options from the drop-down list. The options in the Spacing dialog change according to the category selected.

  3. Make the required changes to the category option, then click Default and confirm the changes to the formula spacing. Any new formulas created will use the new spacing for formulas.

  4. Click OK to save the changes and close the Spacing dialog.

Figure 14: Spacing dialog

Image14

Only new formulas inserted after the change in formula spacing will use the new setting for formula spacing. For any formulas inserted into a document before the default spacing was changed, the new default spacing will not be applied. The formula spacing on each formula already inserted into a document will have to be changed manually.

Formula spacing options

Use the Category options available in the Spacing dialog (Figure 14) to change the spacing for a formula element. The dialog that opens depends on the selected category. A preview window displays which spacing is being changed.

Category

Select a category to change the formula spacing.

Spacing

Defines the spacing between variables and operators, lines, and root signs and radicals.

Indexes

Defines the spacing for superscript and subscript indexes.

Fractions

Defines the spacing between the fraction bar and the numerator or denominator.

Fraction Bars

Defines the excess length and line weight of the fraction bar.

Limits

Defines the spacing between the sum symbol and the limit conditions.

Brackets

Defines the spacing between brackets and the content.

Matrices

Defines the relative spacing for the elements in a matrix.

Symbols

Defines the spacing of symbols in relation to variables.

Symbols

Defines the spacing of symbols in relation to variables.

Borders

Adds a border to a formula. This option is particularly useful for integrating the formula into a text file in Writer by combining mathematical formulas and text inside the same paragraph.

Preview Field

Displays a preview of the current selection.

Default

Saves any changes as default settings for all new formulas. A security response will appear before saving these changes.

Adjusting formula alignment

To determine how formula elements located above one another are aligned horizontally relative to each other, use the alignment settings.

It is not possible to align formulas on a character and formula alignment cannot be used to align text elements. Text elements are always aligned to the left.

It is possible to align sections of a formula using the commands alignl, alignc and alignr. Using these commands, matrices and text elements in a formula can be aligned.

Current formula alignment

To change the alignment used for a formula in a LibreOffice document:

  1. Click in the markup language in the Formula Editor.

  2. Go to Format > Alignment on the Menu bar to open the Alignment dialog (Figure 15).

  3. Select Left, Centered, or Right for horizontal alignment.

  4. Select OK and check the result in the Formula Preview. If necessary, repeat steps 1 to 3 to correct the formula alignment.

Default formula alignment

To change the default alignment used for all formulas in a LibreOffice document:

  1. Click in the markup language in the Formula Editor.

  2. Go to Format > Alignment on the Menu bar to open the Alignment dialog (Figure 15).

  3. Select Left, Centered, or Right for horizontal alignment.

  4. Select Default and confirm the changes to the formula alignment. Any new formulas created will use the new formula alignment.

  5. Select OK and check the result in the Formula Preview. If necessary, repeat steps 1 to 4 to correct the formula alignment.

Only formulas inserted after changing in formula alignment use the new default settings. For formulas already inserted into a document before the default alignment was changed, the new default alignment is not applied. The formula alignment on each formula already inserted into a document has to be changed manually.

Figure 15: Alignment dialog

Image15

Changing formula color

The color of formula characters can be changed using markup language. Use the command color followed by a color name, RGB value, or HTML hex value.

Named colors

For information on the named colors available in Math, see Appendix A. These colors are listed in the Attributes category of the Elements panel on the Sidebar (Figure 2).

RGB values

RGB (Red, Green and Blue) values for colors are from 0 to 255. To use RGB values, enter the command color rgb R G B followed by the RGB values of the required color.

Example

In this example, the formula element decision variable uses a color defined with the RGB values of 160, 82, 45.

"Let " x_ij " be a " color rgb 160 82 45 "decision variable " " in the problem under consideration"

Creates the following in a formula:

Let xij be a decision variable in the problem under consideration

Hex values

HTML colors can be used in a formula and these are defined using a hex number. Use the command hex 000000, where 00000 is the corresponding hex number for the color required. For example, using the command color hex FF0000 decision creates the output decision .

Background color

It is not possible to use a background color for formulas. The formula background color is, by default, the same color as the document or frame where the formula has been inserted. In Writer, object properties can be used to change the background color of a formula. For more information, see “Background and bordersbelow.

Formula library

If formulas are going to be regularly inserted documents, a formula library can be created using the Formula Editor. Individual formulas are saved as separate files using the ODF format file type ODF, or the MathML format for file type MML. Math, Writer, Calc, Draw, or Impress can be used to create formulas and added to a formula library.

MathML 2.0 stands for Mathematical Markup Language (MathML) Version 2.0. MathML is an XML format that describes mathematical notation and enables the use of mathematics in the World Wide Web. For more information on MathML format, visit the website at https://www.w3.org/TR/MathML2/overview.html.

Using Math

  1. Create a computer folder to contain formula files and give the folder a memorable name, for example Formula Library.

  2. Go to File > New > Formula on the Menu bar, or click on Math Formula in the Start Center to open LibreOffice Math and the Formula Editor. See “Formulas as separate documents or filesabove for more information.

  3. Create the formula required.

  4. Go to File > Save As on the main Menu bar, or use the keyboard shortcut Ctrl+Shift+S (macOS +Shift+S) to open the Save As dialog.

  5. Navigate to the folder created for a formula library.

  6. Type a memorable name for the formula in the file name or save as box.

  7. Select in the File type drop-down list select ODF Formula (.odf) or MathML 2.0 (.mml) as the file type for the formula.

  8. Click Save to save the formula and close the Save As dialog.

Using Writer, Calc, Draw, or Impress

  1. Create a computer folder to contain formula files and give the folder a memorable name, for example Formula Library.

  2. Open a document using Writer, Calc, Draw, or Impress.

  3. Go to Insert > Object > Formula Object on the Menu bar to open the Formula Editor and create a formula. See “Formulas in LibreOffice documentsabove for more information.

  4. Right-click on the formula object and select Save Copy as in the context menu to open a Save As dialog.

  5. Navigate to the folder you have created for your formula library.

  6. Type a memorable name for your formula in the File name box.

  7. Select in the File type drop-down list either ODF Formula (.odf) or MathML 2.0 (.mml) as the file type for the formula.

  8. Click Save to save the formula and close the Save As dialog.

Using a formula library

A formula in the formula library cannot be inserted into a document by dragging and dropping, or by using Insert > File on the Menu bar. A formula from the formula library must be inserted into a document as an OLE object.

  1. Open a document using Writer, Calc, Draw, or Impress.

  2. Go to Insert > OLE Object > OLE Object on the Menu bar to open the Insert OLE Object dialog (Figure 16).

  3. Select the option Create from file.

  4. Click Search to open the file browser and navigate to the formula library folder.

  5. Select the file for formula required and click Open in the file browser, or double-click on the formula required.

  6. If required, select the option Link to file or Display as icon.

Figure 16: Insert OLE Object — Create from file page

Image16

  1. Click OK to insert the formula as an OLE object in the document and close the Insert OLE Object dialog.

Formulas in Writer

This section explains which options can be changed for a formula within a Writer document. See the Writer Guide for information on how to change the settings for frame styles for OLE objects.

When a formula is inserted into a document, Writer inserts the formula into a frame and treats the formula as an OLE object. For more information on creating and editing formulas, see Creating formulas above and Editing formulas above.

Figure 17: Example of formula selected for editing in Writer

Image1

Automatic formula numbering

Automatic numbering of formulas to create formula cross references can only be carried out in Writer. The AutoText entry fn (formula numbered) is used to automatically add a numbered cross reference to formulas.

  1. Start a new line in a document at the required position for the formula.

  2. Type fn and press the F3 key to insert a two column table with no borders. The left column contains a sample formula and the right column contains the cross reference number, as shown by the following example.

  3. Delete the sample formula and insert the required formula into the left column.

E=mc2

(1)

  1. Alternatively, first insert the formula into the document, then carry out Steps 1 and 2 above replacing the sample formula with another formula.

Formula cross referencing

  1. Click in the document at the position where a cross reference for a formula is required.

  2. Go to Insert > Cross-reference on the Menu bar to open the Fields dialog (Figure 18).

  3. Click on Cross-references, then select Text in Type.

  4. In Selection, select the formula number required for the cross reference.

  5. In Refer using, select Referenced text, then click on Insert to insert the cross reference for the selected formula.

  6. Click on Close to close the Fields dialog.

Figure 18: Fields dialog — Cross-references — Referenced text

Image2 Copy 1

To insert the cross-reference number without parentheses, select Numbering instead of Reference in the Insert reference to section.

See the Writer Guide for more information on how to use square parentheses instead of curved parentheses, or require the cross reference number to be separated from the formula by tabs instead of using a table.

Anchoring formulas

A formula is an object when inserted into a Writer document. The default anchoring for a formula is As character when inserted into a document. Change the formula anchoring in a document as follows:

  1. Right-click on the selected formula and select Anchor from the context menu.

  2. Select an anchoring option from the context menu. The anchoring options available are To paragraph, To character, or As character.

  3. Alternatively, right-click on the selected 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 (Figure 19).

Figure 19: OLE Object dialog — Position and Size page

Image3 Copy 1

  1. Make sure Position and Size is selected, then select a new anchoring position from the options available in Anchor. The anchoring options available are To page, To paragraph, To character, or As character.

  2. Click OK to save the changes and close the OLE Object dialog.

When making changes to frame style options in Writer, anchoring options are not available in the Object dialog. For more information on how to modify frame styles, see the Writer Guide.

Vertical alignment

The normal default setting for vertical alignment for formulas in Writer is to use the text base line as a reference. This default setting can be changed by modifying the frame style for formulas, see the Writer Guide for more information.

  1. Make sure the To paragraph or To character option for formula anchoring is selected to change vertical formula alignment. Vertical alignment is NOT available for the As character anchoring option.

  2. Right-click on the selected formula and select Align Objects from the context menu.

  3. Select a vertical alignment option from the context menu. The options available are Align Top to Anchor, Align Middle to Anchor, and Align Bottom to Anchor.

  4. Alternatively, right-click on the selected 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 (Figure 19).

  5. Make sure Position and Size is selected, then select a new vertical alignment from the options available in Position Vertical. The vertical alignment options available are Center, Top, Bottom, or From bottom.

  6. If the From bottom option is selected for vertical alignment, enter a plus or minus value for vertical alignment.

  7. Select the type of text alignment from the drop-down list in Position Vertical. The text alignment options available are Base line, Character, and Row.

  8. Click OK to save the changes and close the OLE Object dialog.

If the Position and Size section in the OLE Object dialog (Figure 19) is grayed 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 for Math baseline alignment.

Horizontal alignment

The normal default setting for horizontal alignment for formulas is to use the text base line as a reference. This default setting can be changed by modifying the frame style for formulas, see the Writer Guide for more information.

  1. Right-click on the selected formula and select Align Objects from the context menu.

  2. Select a horizontal alignment option from the context menu. The options available are Left, Centered, and Right.

  3. Alternatively, right-click on the selected 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 (Figure 19).

  4. Make sure Position and Size is selected, then select a new horizontal alignment from the options available in Position Horizontal. The horizontal alignment options available are Left, Right, Center, or From left.

  5. If the From left option is selected for horizontal alignment, enter a plus or minus value for horizontal alignment.

  6. Select the type of text alignment from the drop-down list in Position Horizontal. The text alignment options available are Entire paragraph area, Left of paragraph text area, Right of paragraph text area, Left of page text area, Right of page text area, Entire page, Page text area, and Character.

  7. Click OK to save the changes and close the OLE Object dialog.

Object wrap and spacing

A formula, when inserted into a document, has text wrap and spacing on each side of the formula. The default settings used for wrap and spacing is set within the frame style for formulas. This default settings can be changed by modifying the formula frame style, see the Writer Guide for more information.

Object wrap

To individually adjust the wrap for a formula positioned in a Writer document:

  1. Make sure the To paragraph or To character option for formula anchoring is selected to change object wrap. Object wrap is NOT available for the As character anchoring option.

  2. Right-click on the selected formula and select Wrap from the context menu.

  3. Select a wrap option from the context menu. The options available are None, Parallel, Optimal, Before, After, Through In Background and Edit Contour.

  4. Right-click on the selected formula and select Properties in the context menu, or go to Format > Frame and Object > Properties to open the Object dialog.

  5. Click on Wrap to open the Wrap page in the Object dialog (Figure 20).

Figure 20: OLE Object dialog — Wrap page

Image4 Copy 1

  1. In Settings, select the type of wrap required for the formula. The options available are Wrap Off, Before, After, Parallel, Through and Optimal.

  2. Click OK to save the changes and close the Object dialog.

Object spacing

To individually adjust the spacing for a formula positioned in a Writer document:

  1. Right-click on the selected formula and select Align Objects from the context menu.

  2. Select a horizontal alignment option from the context menu. The options available are Left, Centered, and Right.

  3. Right-click on the selected formula and select Properties in the context menu, or go to Format > Frame and Object > Properties to open the Object dialog.

  4. Click on Wrap to open the Wrap page in the Object dialog (Figure 20).

  5. In Spacing, enter the spacing value for Left, Right, Top, and Bottom spacing.

  6. Click OK to save the changes and close the Object dialog.

Text mode

When large formulas are placed within a line of text, the formula elements can be higher than the text height. To make large formulas easier to read, it is recommended to always insert large formulas into a separate paragraph to separate a formula from the text.

i=25i2

If it is necessary to place a large formula within a line of text, double-click on the formula to open the Formula Editor and then go to Format > Text Mode on the Menu bar. The Formula Editor reduces the formula size to match text height, as shown in the following example.

The same formula embedded into a line of text using text mode format i=25i2 :

Background and borders

The default setting for background (area fill) and borders for formulas is set by the Formula frame style. For more information on changing the background and borders for Formula frame style, see the Writer Guide. If required, individual formulas in a document can use different backgrounds and borders.

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 depends on the setting of the formula font size. See “Formula font sizeabove for more information.

The following example is a formula using background color and borders. Note that the background and border properties are part of the Math OLE object and cannot be defined using markup language.

df(x)dx=ln(x)+tan1(x2)Δt'=Δt1v2c2

Backgrounds

  1. Select a formula in a document 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 OLE Object dialog.

  3. Click on Area, then select the type of fill required for the formula from the available options (Figure 21). The options available are None, Color, Gradient, Image, Pattern, and Hatch.

  4. After selecting the background type, select the properties for the formula background. The area properties change depending on the type of area fill selected.

  5. Click OK to save the changes and close the OLE Object dialog.

Borders

  1. Select a formula in a document 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 OLE Object dialog.

  3. Click on Borders, then select the of border properties required for the formula from the available options (Figure 22). The options available are Line Arrangement, Line, Padding, and Shadow Type.

  4. Click OK to save the changes and close the OLE Object dialog.

Figure 21: OLE Object dialog — Area page

Image5

Figure 22: OLE Object dialog — Borders page

Image6 Copy 1

ß

Quick formula insertion

If the markup language for a formula is available, the formula can be quickly inserted into a document without opening the Formula Editor:

df(x) over dx = ln(x)+tan^-1(x^2) %DELTA t' = { %DELTA t } over sqrt{ 1 - v^2 over c^2 }

df(x)dx=ln(x)+tan1(x2)Δt'=Δt1v2c2

  1. Copy the formula markup language required, then paste into the document at the required position, as shown by the above example.

  2. Select all of the formula markup language.

  3. Go to Insert > OLE Object on the Menu bar and select Formula Object to create a formula using the selected markup language. The formula is inserted replacing formula markup language.

Formulas in Calc, Draw, and Impress

When a formula is inserted into a Calc, Draw, or Impress document, the formula is inserted as an OLE object without any background (area fill) or borders. Each formula is inserted into a spreadsheet, drawing, or slide as follows. For more information on creating and editing formulas, see the Math Guide.

Anchoring formulas in Calc

A formula is anchored into a Calc spreadsheet using To Page, which is the default setting when anchoring a formula. Change the anchoring type of formulas in a Calc spreadsheet as follows:

  1. Select the formula in the spreadsheet.

  2. Right-click on the formula and select Anchor from the context menu. The anchoring options available in the context menu are To Cell, To Cell (resize with cell), and To Page.

  3. Alternatively, go to Format > Anchor on the Menu bar and select an anchoring option from To Cell, To Cell (resize with cell), and To Page.

If a formula is inserted into a Calc spreadsheet and appears out of scale, right click the formula and select Original Size from the context menu.

Anchoring formulas in Draw and Impress

When a formula is inserted into a drawing or slide, it is inserted as a floating OLE object in the center of a drawing or slide. The inserted formula is not anchored and can be moved to any particular position in a drawing or slide. See the Draw Guide or Impress Guide for information on moving objects in a drawing or slide.

Formula object properties

Formulas in Calc, Draw, and Impress can be modified just like any other object that has been placed in a spreadsheet, drawing, or presentation. However, formula size and changing text format in a formula cannot be carried out. For more information on how to change properties, see the Calc Guide, Draw Guide, or Impress Guide. For more information on formula size and formatting formula text, see Chapter 1, Creating and Editing Formulas.

Formulas in charts

A Calc chart is an OLE object created from a Calc spreadsheet. However, the Formula Editor cannot be used to create and insert a formula directly into a chart. A formula has to be created, then copied and pasted into a chart:

  1. Create the chart using a Calc spreadsheet. For more information, see the Calc Guide.

  2. Click in a spreadsheet cell to deselect a chart.

  3. Insert a formula by clicking on Insert > OLE Object > Formula Object on the Menu bar to open the Formula Editor in Calc.

  4. Create the required formula in the Formula Editor.

  5. Select the formula and copy the formula.

  6. Double-click the chart object to open editing mode, then paste the formula into the chart.

  7. Move the formula to the required position inside the chart.

If a formula has to be edited, the procedure above has to be repeated to create a new formula, or edit the existing formula. The new or edited formula is then pasted into the chart.

Chemical formulas

The primary purpose of Math is to create mathematical formulas. However, Math can create chemical formulas. Chemical symbols are normally written in uppercase using non-italic characters. The following table shows examples of chemical formulas.

Construction

Example

Markup Language

Molecules

H2SO4

H_2 SO_4

Isotopes

U92238

U lsub 92 lsup 238

Ions

SO42 or SO42-

SO_4^{2-{}} or SO_4^{2"-"}

To create chemical formulas using Math, the font used for variables is changed to a non-italic font. For more information on changing fonts in a formula, see Formula fonts above.

For reversible reactions in chemical formulas, there is no symbol for a double arrow in Math. If there is a font available with symbols for use in chemical formulas, then add these symbols to the Catalog. See Chapter 4, Customization for more information on how to add symbols.

Customization

This chapter explains how to customize Math when creating formulas for use in LibreOffice documents. Also, refer to Chapter 13, Customizing LibreOffice for more information on customizing LibreOffice.

Adding keyboard shortcuts

Keyboard shortcuts can be added to LibreOffice when creating documents. Following is an example of how to add a keyboard shortcut for inserting a formula into a LibreOffice document. For more information on creating keyboard shortcuts, see Chapter 13, Customizing LibreOffice.

Catalog customization

If a symbol is regularly used and is not available in Math, it can be added to the Symbols dialog (Figure 23) using the Edit Symbols dialog (Figure 24). Symbols can be modified, have names assigned, or redefined. For information on customizing the catalog, see the Math Guide.

Figure 23: Symbols dialog

Image17

Figure 24: Edit Symbols dialog

Image18

When a new symbol is added to the catalog, a percentage sign (%) followed by the name of the symbol is typed into the markup language in the Formula Editor and the symbol appears in the formula. Symbol names are case sensitive, for example, %prime is a different symbol to %Prime.

There are numerous free fonts available that contain several symbols if the required symbol is not available on the computer. For example, the STIX font was developed for use in mathematical and technical texts. Also, DejaVu and Lucida fonts have a wide range of symbols.

By default, only user defined symbols that are used in the document are stored with the document. It is useful to embed all user defined symbols so that when a document is transferred to another computer it is available for editing. Go to Tools > Options > LibreOffice Math > Settings (macOS LibreOffice > Preferences > LibreOffice Math > Settings) on the Menu bar and uncheck Embed only used symbols (smaller file size) in Miscellaneous Options.

Adding symbols

  1. Go to Tools > Symbols on the Menu bar or click on Symbols on the Tools toolbar to open the Symbols dialog (Figure 23).

  2. In Symbol set select a font to use for the new symbol from the available options in the drop-down list.

  3. Click on Edit to open Edit Symbols dialog (Figure 24).

  4. Select the symbol character required and it appears in the preview box. If necessary, scroll down in the preview box to locate the required symbol.

  5. In Symbol, enter a memorable name for the required symbol.

  6. In Symbol set, select a symbol set in the drop-down for the selected symbol, or create a new name for the selected symbol.

  7. In Font and if required, select a font for the selected symbol.

  8. In Subset and if required, select a subset from the available options for the selected symbol.

  9. In Style and if required, select a font style from the available options for the selected symbol.

  10. Click on Add, to add the symbol to Math.

  11. If required, click on Modify after making any changes to an existing symbol.

  12. If required, click on Delete if an existing symbol is no longer required.

  13. Click on OK to close the Edit Symbols dialog. The new symbol and, if created, new symbol set are now available for use.

Editing symbols

Changing symbol names

  1. In the Edit Symbols dialog (Figure 24), select the symbol name that is to be changed in the Old symbol drop-down list. The symbol appears in the left preview box at the bottom of the dialog.

  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 in the right preview pane at the bottom.

  3. Click Modify and the symbol name is changed, then click OK to close the Edit Symbols dialog.

Moving symbols

  1. In Old symbol set, select the symbol set from the options available in the drop-down list in the Edit Symbols dialog (Figure 24).

  2. Select a symbol from options available in the Old symbol drop-down list. In the left preview box at the bottom of the dialog, the name, symbol, and symbol set are displayed.

  3. In Symbol, select a symbol name from the drop-down list.

  4. In Symbol set, select the required symbol set from the drop-down list. In the right preview box at the bottom of the dialog, the name, symbol, and symbol set are displayed.

  5. If required, select an option from the drop-down lists in Font, Subset, and Style.

  6. Click on Modify and the symbol is moved to the new symbol set.

  7. Click on OK to close the Edit Symbols dialog.

Deleting symbols

  1. In Old symbol set, select the symbol set from the options available in the drop-down list in the Edit Symbols dialog (Figure 24).

  2. In Old symbol, select the symbol for deletion from the drop-down list. The selected symbol appears in the left preview pane at the bottom of the Edit Symbols dialog.

  3. Click on Delete and the symbol is deleted from the symbol set without any confirmation.

  4. Click on OK to close the Edit Symbols dialog.

To delete a symbol set all of the symbols in the selected set have to be deleted. The last symbol is deleted, the symbol 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. When working with running text in a formula, it may be necessary to also include spacing at the end of formulas. This customization is only required when working with a Math document and is not required when inserting a formula into another LibreOffice module.

To add spacing at the end of formula in Math, go to Tools > Options > LibreOffice Math > Settings (macOS LibreOffice > Preferences > LibreOffice Math > Settings) on the Menu bar and uncheck Ignore ~ and ` at the end of the line in Miscellaneous Options.

Scaling of code

By default, the code in the Formula Editor input window is scaled to 100%. To change the scaling factor go to Tools > Options > LibreOffice Math > Settings (macOS LibreOffice > Preferences > LibreOffice Math > Settings) and change the percentage in the Scaling code input window in Miscellaneous Options.

For example, to change the scaling to 150%, the code in the input window appears larger. This setting affects the Formula Editor in all LibreOffice modules. However, the Math options can only be accessed when using Math. It is not available for editing formulas in other LibreOffice modules.

Extensions

Creating formulas frequently in documents, LibreOffice can be customized by adding extensions that are designed to help in the creation of formulas. Extensions are installed using the Extension Manager. For more information on how to install extensions, see Chapter 13, Customizing LibreOffice.

A commonly used extension is Formatting of All Math Formulas. This extension allows formatting of formulas in Writer, Calc, Draw, or Impress documents. Using this extension the font names and sizes of all formulas used in LibreOffice documents. For more information on this extension, go to https://extensions.libreoffice.org/en/extensions/show/formatting-of-all-math-formulas.

Exporting and Importing

MathML format

In addition to exporting documents in PDF format, LibreOffice export formulas in the MathML format. This allows formulas to be inserted into documents that were created using other software, for example, Microsoft Office or an internet browser.

Some internet browsers do not fully support the MathML format and a formula may not display correctly when imported.

When working on a formula in Math, go to File > Save as on the Menu bar, or use the keyboard combination Ctrl+Shift+S (macOS +Shift+S) to open the Save as dialog. Select MathML 2.0 (*.mml) from the list of available file formats in File type to save the formula as MathML.

When working in another LibreOffice module, right-click on the formula object and select Save Copy as as from the context menu to open the Save as dialog. Select MathML 2.0 (*.mml) from the list of available file formats in File type to save the formula as MathML.

In Math, formulas can be imported as in MathML format. Use Tools > Import MathML from Clipboard on the Menu bar.

Microsoft file formats

To control how formulas in Microsoft format are imported and exported using LibreOffice, go to Tools > Options > Load/Save > Microsoft Office (macOS LibreOffice > Preferences > Load/Save > Microsoft Office) on the Menu bar, then select or deselect one or both options for MathType to LibreOffice Math or reverse.

[L]: Load and convert the object

[S]: Convert and save the object

[L]: Load and convert the object

Select this option if Microsoft OLE objects are to be converted into the specified LibreOffice OLE objects when a Microsoft document is opened in LibreOffice. For formulas, any embedded MathType objects must not exceed the MathType 3.1 specifications to be successfully loaded and converted. Information on MathType format can be found at https://docs.wiris.com/en/mathtype/office_tools/microsoft_office.

If a document containing OMML formulas has been saved in docx format and then converted to the older doc format, then any OMML objects are converted into graphics, which are displayed in LibreOffice as graphics.

[S]: Convert and save the object

Select this option if LibreOffice OLE objects are to be converted and saved in Microsoft file format. LibreOffice converts any formulas into a format that can be read and modified by Microsoft Equation Editor and MathType.

When this option is not selected, the formula is treated as an OLE object on conversion into a doc format and remains linked to LibreOffice. A double-click on the object in Microsoft Office opens LibreOffice.

Contents