OpenOffice.org HowTo:

Formula

Adapted and translated from OpenOffice.org Formel
This version:1.0 24 July 2005
First Edition: Unknown
First English Edition: 05 June 2003

Contents

Table of Contents

Contents	2

Overview	3

Copyright and trademark information	3

Feedback	3

Acknowledgments	3

Modifications and updates	4

Formula Entry	5

Menu bar	5

Function bar	5

Tool bar	5

Command Icon Box	6

Command Dialog Box	6

Creating an Equation with Dialog Commands	7

Special Formating	8

Exponentiation:	8

Subscripting:	8

Leading and trailing superscript and subscript:	9

Center subscript / superscript:	9

Under brace / Over brace:	10

Various types of Brackets	10

Special Characters	11

Special Operators	12

Integral Sign:	12

Summation Character:	12

Product Character:	12

Vector and Matrix	13

Vector	13

Matrix	13

Formating	14

Size	14

Color	14

Layout	14

Alignment	15

Examples	16

Index	17

Overview

OpenOffice.org's burgeoning popularity has increased the need for a comprehensive set of HowTos to aid users.

Copyright and trademark information

© Copyright 2003 Fred Saalbach.

Permission is granted to copy, distribute and/or modify this document under the terms of the following licenses GNU Lesser General Public License, GNU General Public License, , The Public Documentation License., or the Sun Industry Standards Source License All trademarks within this guide belong to legitimate owners.

Feedback

Please direct any comments or suggestions about this document to:
dev@documentation.openoffice.org

Acknowledgments

Extensive use of the OpenOffice.org German Formel How-To by Harald Schilly was made when developing this document. The German document is available on Das Deutsch OpenOffice.org Portal

Layout is in accordance with the OpenOffice.org Style Guide for U.S. Documentation

Modifications and updates

This is the first edition. This section will record changes made for future additions.

Document Revision	Date	Description of Change
0.1	06/05/03	Initial edition issued for comment
0.2	07/26/03	Various corrections
0.3	04/04/04	Added name of author of german HowTo, and reference to the location of the german document.

Formula Entry

Main View of OpenOffice Formula.

Main View
Illustration 1Main View

Menu bar

The Menu bar contains all of the functions of Formula as drop down menus.

Illustration 2Menu bar

Function bar

Illustration 3Function bar The Function bar provides icons for basic functions like open file, save file, copy, and paste.

Tool bar

The tool bar is divided into two parts.

Illustration 4Function bar The upper part is for adjusting the on screen size of the image. The lower part contains an icon for an interactive cursor, and an icon for inserting special characters.

Command Icon Box

The command icon box provides a method of writing an equation using GUI similar to other word processors.

Illustration 5Icon box The upper two rows in the icon box are menus that call the actual command buttons into the lower portion of the command box. The command buttons are used to insert the appropriate command at the cursor position in the command field.

Command Dialog Box

Illustration 6Command dialog box The command dialog box displays the commands that create the equation. The dialog box can be edited directly.

Creating an Equation with Dialog Commands

To create an equation with equation editor, enter the programming commands in logical sequence into the dialog box. The commands entered are similar to the commands used to generate equations in TeX ( a scientific publishing format).

Maintaining logical consistency of the commands entered into the dialog box is important. The brackets used in the dialog box must be matched, for example all "(" must have a corresponding ")".

Here are some examples. As you will see it really is simple to type formulas in the dialog box.

Command Input Field	Formula
1+1=2	

Table 1Example, create equation, addition

The next example shows how round brackets ( ) and braces { } are used. The parenthesis are used when it is desired to display grouping in the equation, the brace is used to group the commands, but to not display. If braces are needed in an equation, then the lbrace and rbrace commands are used.

Command Input Field	Formula
(1+2) over (2+3)	
{ 1+2 } over { 2+3 }	
lbrace 1+2 rbrace over lbrace 2+3 rbrace	

Table 2Example, create equation, addition, brackets, division

Here is a more complicated example.

Command Input Field	Formula
{{1 over 5} +4} over {5+{4+1}over{3+3+1}}	

Table 3Example, complicated

Special Formating

Of course there are many other types of groupings that can be created with Open Office.

Exponentiation:

Command Input Field	Formula
2^3	
5^(1+3+3^2)	

Table 4Example, exponentiation

Subscripting:

Command Input Field	Formula
2_3	
(1 over 2)_%alpha +4_3	

Table 5Example, subscripting

Leading and trailing superscript and subscript:

Command Input Field	Formula
2 lsub ( 123 )	
2 rsub ( 123 )	
2 lsup ( 123 )	
2 rsup ( 123 )	
Bi lsup{209}+fe lsup{58} toward Mt lsup{266}lsub{109} +n lsup {1}	

Table 6Example, leading and trailing superscript and subscript.

In the last example, the 'Mt' has both leading superscript and subscript applied. This requires only typing both commands after 'Mt'.

Center subscript / superscript:

Command Input Field	Formula
{2-4*3} csub ( 123 )	
+18 csup ( plus ) - (1+2+3+4) csub {minus}	

Table 7Example, center subscript and superscript.

Under brace / Over brace:

Command Input Field	Formula
+ 18 underbrace plus - ( 1 + 2 + 3 + 4) underbrace minus	
+ 18 overbrace plus - ( 1 + 2 + 3 + 4) overbrace minus	

Table 8Example, under brace and over brace.

Various types of Brackets

In almost all equations various types of brackets are required. OpenOffice formula allows the use of several kinds of brackets.

{ } structural braces: used to group parts of an equation for programming purposes.

( ) Parenthesis: used to group parts of an equation. Parenthesis are displayed in the final equation.

[ ] square brackets: usage is the same as parenthesis ( ).

{ } braces: as the keyboard characters { } are used for program commands and are not displayed in the resulting formula, braces must be typed as lbrace for '{' and rbrace for '}'

The size of brackets can be controlled with the commands 'left' and 'right'

Command Input Field	Formula
(1+2 - 2 cdot (2 over (2 - 1 )))	
left (1+2-2 cdot left (2 over {2-1} right ) right )	
left lbrace a^2+b^2=c^2 right rbrace	

Table 9Example, brackets

Special Characters

Many equations use special characters in addition to the usual characters of the alphabet. Open office provides an easy method to use Greek characters, while any other character in the available fonts can be used.

The Sigma appears in the tool bar when Open Office Formula is active. This activates the dialog for special characters.

The Greek letters and other symbols can be entered directly into the command dialog box by entering the name of the special character followed by %, for example %SIGMA produces and %mu gives .

Special Operators

The following examples show the use of some special operators

Integral Sign:

Command Input Field	Formula
int from {0} to {infinity}{a^2 over 3} = "?"	

Table 10Example, integral sign.

Summation Character:

Command Input Field	Formula
sgn (%sigma) cdot sum from {%SIGMA in %PHI}{1 over {1 - aleph_%sigma^2}}	

Table 11Example, character.

Product Character:

Command Input Field	Formula
prod from {i=1} to {i=100}{{ (x_i+1) cdot x_i^3} over { x_i^2 -1 } } = "?"	
5^(1+3+3^2)	

Table 12Example, product character.

Vector and Matrix

Vectors and Matrices are created by the 'stack' and 'matrix' commands respectively. These commands are used with the octothorp # to indicate elements, and double octothorp ## to indicate new line. An empty element is indicated by structural braces {}.

Vector

Vectors are composed using the 'stack' command as follows:

Command Input Field	Formula
left (stack {A # B # a+b=c } right )	
left( stack {alignr 1 # 2 } right) + left( stack { 2 # 3 } right) + left( stack { 3 # 1 } right)	

Table 13Example, vector

Matrix

Matrices are composed using the matrix command as follows:

Command Input Field	Formula
left( matrix { 1 # 2 ## 2 # 3 } right) = x	
abs matrix { a # b ## c # {} } = y	
abs matrix { {1 over 2} # b ## c # d } = z	

Table 14Example, matrix

Formating

There are some additional formating commands that are available in Open Office Formula. These allow adjustment of the size, color, and layout of your equation.

Size

The instruction size changes the size of text in the equation.

Command Input Field	Formula
size -2 { a+b} = size +10 {C}	

Table 15Example, size.

Color

The instruction color changes the color of the text in the equation.

Colors available are red, blue, green, yellow, white, and black (default),

Command Input Field	Formula
color blue A	
left( matrix { { color red 1} # { color blue 2} ## {color green 3} # 4 } right) = color black {x}	

Table 16Example, color

Layout

Various text formating commands are available to change your layout.

Command Input Field	Formula
bold {"bold"} newline "newline"	

Table 17Example, color

Alignment

The alignment commands are available to change the position of the elements of an equation with respect to each other.

Command Input Field	Formula
stack{ alignr a ={} # alignr b+c+d ={}} stack{ alignl 12 # alignl b^2-2 }	
5^(1+3+3^2)	

Table 18Example, alignment

Examples

Now for the complicated examples:

Command Input Field	Formula
nroot{4}{nroot {3} {1 over 3+x^2} }	
ldline R_ %alpha rdline =left ldline matrix {sin %alpha # -cos %alpha ## cos %alpha # sin %alpha} right rdline	
{partial over {partial t} x(t)}+a(x)=%lambda cdot F(x,t)	
matrix{ a_11 # a_12 # dotsaxis #a_{"1m"} ## a_21 # a_22 # dotsaxis # a_{"2m"} ## dotsvert #dotsvert #dotsdown #dotsvert ## a_{"n1"} # a_{"n2"} # dotsaxis #a_{"nm"} }	
sqrt{1-x} = 1 - x over 2 - 1 over 2 x^2 over 4 - dotslow	
t= size +6 int from {r_0} to {r_t} size -8 {dr over sqrt {2 over %my [E_cm - V(r)] - l^2 over {%my^2 r^2} } }	
left ( stack{n # k} right ) = fact n over {fact k cdot fact (n-k)}	
f(x) = left lbrace matrix {1# x in setZ ## 1 over x # x in setQ ##0 # x in setR } right none	
[a;a_0,a_1,a_2,dotslow ] = a+{1 over {a_0+1 over {a_1+{1 over {a_2+1 over dotslow}}}}}	

Table 19Example, complicated

Index

Alphabetical Index

Index of Tables

Table 1Example, create equation, addition	7

Table 2Example, create equation, addition, brackets, division	7

Table 3Example, complicated	8

Table 4Example, exponentiation	8

Table 5Example, subscripting	8

Table 6Example, leading and trailing superscript and subscript.	9

Table 7Example, center subscript and superscript.	9

Table 8Example, under brace and over brace.	9

Table 9Example, brackets	10

Table 10Example, integral sign.	11

Table 11Example, character.	11

Table 12Example, product character.	11

Table 13Example, vector	12

Table 14Example, matrix	12

Table 15Example, size.	12

Table 16Example, color	13

Table 17Example, color	13

Table 18Example, alignment	13

Table 19Example, complicated	14

Table 20Commands, unary & binary.	15

Table 21Commands, relations.	16

Table 22Commands, set operators.	17

Table 23Commands, function.	18

Table 24Commands, operators.	19

Table 25Commands, attributes.	21

Table 26Commands, others.	22

Table 27Commands, braces.	23

Table 28Commands, formats.	24

Table 29Characters, Greek.	25

Table 30Characters, special.	25

Illustration Index

Illustration 1Main View	5

Illustration 2Menu bar	5

Illustration 3Function bar	5

Illustration 4Function bar	6

Illustration 5Icon box	6

Illustration 6Command dialog box	6

MN

What's the purpose of the "%my" in this example? It does not appear to be a valid command.

MN

What's the purpose of the "%my" in this example? It does not appear to be a valid command.

Contents

OpenOffice.org Formula How-To	18

18

OpenOffice.org Formula How-To	xviii

Version 1

InsertTheTitleOfYourDocumentHere	18

18	Open Office Formula How-To

Fred Saalbach

2003-05-29T19:58:18