Math Guide The OpenOffice.
Copyright This document is Copyright © 2005–2011 by its contributors as listed below. You may distribute it and/or modify it under the terms of either the GNU General Public License (http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later. All trademarks within this guide belong to their legitimate owners.
Contents Note for Mac users........................................................................................................ 2 What is Math?................................................................................................................ 4 Getting started........................................................................................................... 4 Entering a formula.........................................................................................................
What is Math? Math is OpenOffice.org (OOo)’s component for writing mathematical equations. It is most commonly used as an equation editor for text documents, but it can also be used with other types of documents or stand-alone. When used inside Writer, the equation is treated as an object inside the text document. Note The equation editor is for writing equations in symbolic form, as in equation 1. If you want to evaluate a numeric value, see the Calc Guide.
Entering a formula The equation editor uses a markup language to represent formulas. For example, %beta creates the Greek character beta ( ). This markup is designed to read similar to English whenever possible. For example, a over b produces a fraction: a . b You can enter a formula in three ways: • Select a symbol from the Elements window. • Right-click on the equation editor and select the symbol from the context menu. • Type markup in the equation editor.
Example 1: 5×4 For this example we will enter a simple formula: 5×4 . On the Elements window: 1) Select the top-left button of the categories (top) section. 2) Click on the multiplication symbol.
Figure 5: Result of entering 5 and 4 next to the times operator Right-click (context) menu Another way to access mathematical symbols is to right-click on the equation editor. This pops up the menu shown in Figure 6. The items in this menu correspond exactly to those in the Elements window. Figure 6: Right-click (context) menu Markup You can type the markup directly in the equation editor. For example, you can type 5 times 4 to obtain 5×4 .
Below is a short list of common equations and their corresponding markup. 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 a≤b a <= b ∞ infinity a×b a times b x⋅y x cdot y Greek characters Greek characters ( , , , , etc) are common in mathematical formulas. These characters are not available in the Elements window or the right-click menu.
Figure 7: Symbols catalog, used for entering Greek characters and some special symbols Example 2: ≃ 3.14159 For this example we will suppose that: • We want to enter the above formula (the value of pi rounded to 5 decimal places). • We know the name of the Greek character (pi). • But we do not know the markup associated with the ≃ symbol. Step 1: Type % followed by the text pi. This displays the Greek character . Step 2: Open the Elements window (View > Elements).
Step 4: Click on the a ≃ b symbol. The equation editor now shows the markup %pi > simeq >. Step 5: Delete the > text and add 3.14159 at the end of the equation. We end up with the markup %pi simeq 3.14159. The result is shown in Figure 10. Figure 10. Final result Customizations Formula editor as a floating window The formula editor can cover a large part of the Writer window. To turn the formula editor into a floating window, do this: 1) Hover the mouse over the editor frame, as shown in Figure 11.
Figure 12: Formula editor as a floating window How can I make a formula bigger? This is one of the most common questions people ask about OOo Math. The answer is simple, but not intuitive: 1) Start the formula editor and choose Format > Font size. Figure 13: Changing the font size for a formula 2) Select a larger font size under Base size (top-most entry) Figure 14.
The result of this change is illustrated in Figure 15. Figure 15. Result of changing the base font size Formula layout The most difficult part of using OOo Math comes when writing complicated formulas. This section provides some advice. Brackets are your friends OOo Math knows nothing about order of operation. You must use brackets to state the order of operations explicitly. Consider the following example.
Markup Result n ∑ ak sum from k = 1 to n a_k k =1 int from 0 to x f(t) dt or x ∫ f t dt or 0 int_0^x f(t) dt x ∫0 f t dt ∫ℜ f int from Re f ∞ ∑ 2−n sum to infinity 2^{-n} For more details on integrals and sums, see page 21. Note Brackets with matrices look ugly! For background, we start with an overview of the matrix command. Markup Result a b c d matrix { a # b ## c # d } Rows are separated by two #’s and entries within each row are separated by one #.
How do I make a derivative? Making derivatives essentially comes down to one trick: Tell OOo it’s a fraction. In other words, you have to use the over command. Combine this with either the letter d (for a total derivative) or the partial command (for a partial derivative) to achieve the effect of a derivative. Note Notice that we have to use braces (squiggly brackets) to make the derivative.
Figure 16: Changing spacing in a matrix formula Numbering equations Equation numbering is one of OOo Math’s best hidden features. The steps are simple, but obscure: 1) Start a new line. 2) Type fn and then press F3. The fn is replaced by a numbered formula: E=mc 2 (2) Now you can double-click on the formula to edit it.
Figure 17. Inserting a cross-reference to an equation number 16 OpenOffice.
Math commands - Reference Unary / binary operators Operation Command +sign +1 1 –sign –1 −1 +/– sign +–1 ±1 –/+ sign –+1 ∓1 Boolean not neg a ¬a Addition + a+b ab Dot product a cdot b a⋅b Multiplication (X) a times b a×b Multiplication (asterisk) a*b a∗b Boolean ‘and’ a and b a∧b Subtraction (–) a–b a−b Division (as a fraction) a over b a b Division (as an operator) a div b a÷b Division (with a slash) a/b a /b Boolean ‘or’ a or b a∨b Concatenation a circ b
Relational operators Operation Command Is equal a=b a=b Is not equal a <> b a≠2 Approximately a approx 2 a≈2 Divides a divides b a∣b Does not divide a ndivides b a ∤b Less than a<2 a2 Greater than a>2 a2 Similar to or equal a simeq b a≃b Parallel a parallel b a∥b Orthogonal to a ortho b a⊥b Less than or equal to a leslant b ab Greater than or equal to a geslant b Display ab Similar to a sim b a~b Congruent a equiv b a≡b Less than or equal to a <= b a≤b Gre
Set operations Operation Command Is in a in B a ∈B Is not in a notin B a ∉B Owns A owns b A∋b Empty set emptyset ∅ Intersection A intersection B A∩B Union A union B A∪B Difference A setminus B A∖ B Quotient A slash B A/ B Aleph aleph ℵ Subset A subset B A⊂B Subset or equal to A subseteq B A⊆B A supset B A⊃B Superset or equal to A supseteq B A⊇B Not subset A nsubset B A⊄B Not subset or equal A nsubseteq B A⊈B Not superset A nsupset B A⊅B Not superset or equal
Functions Operation Command Exponential func e^{a} ea Natural logarithm ln(a) ln a Exponential function exp(a) exp a Logarithm log(a) log a Power a^{b} a Sine sin(a) sin a Cosine cos(a) cos a Tangent tan(a) tana Cotangent cot(a) cot a Square root sqrt{a} a Arcsine arcsin(a) arcsin a Arc cosine arccos(a) arccosa Arctangent arctan(a) arctan a Arc cotangent arccot(a) arccot a nth root nroot{a}{b} a b Hyperbolic sine sinh(a) sinh a
Operators All operators can be used with the limit functions (“from” and “to”).
Attributes Operation Command Display Acute accent acute a a Grave accent grave a a Reverse circumflex check a a Breve breve a a Circle circle a å Vector arrow vec a a Tilde tilde a a Circumflex hat a a Line above bar a a Dot dot a ȧ Wide vector arrow widevec abc abc Wide tilde widetilde abc a bc Wide circumflex widehat abc abc Double dot ddot a ä Line over overline abc abc Line under underline abc abc Line through overstrike abc acb Tri
Operation Command Display Make color of following text white color white qv qv Make color of following text green color green qv qv Make color of following text blue color blue qv qv Make color of following text red color red qv qv Make color green returns to default color black color green X qv X qv Brace items to change color of more than one item color green {X qv} X qv Miscellaneous 3 Operation Command Display Infinity infinity ∞ Partial partial ∂ Nabla nabla ∇ There e
Brackets Operation Command Round Brackets (a) a Square Brackets [b] [b] Double Square Brackets ldbracket c rdbracket 〚c〛 Single line lline a rline ∣a∣ Double line ldline a rdline ∥a∥ Braces lbrace w rbrace {w} Angle Brackets langle d rangle 〈d 〉 Operator Brackets langle a mline b rangle 〈 a∣ b〉 Group brackets (used for program control) {a} a Scalable round brackets (add the word “left” before a left bracket and “right” before a right bracket) left ( stack{a # b # z} right )
Formats Operation Command Left superscript a lsup{b} b Center superscript a csup{b} a Right superscript a^{b} ab Left subscript a lsub{b} b Center subscript a csub{b} a Right subscript a_{b} ab Align character to left (text is aligned center by default) stack { Hello world # alignl (a) } Hello world a stack{Hello world # alignc(a)} Hello world a stack { Hello world # alignr(a)} Hello world a Align character to center Align character to right Display a b a b binom{a}{b}
Caution In localized versions of Writer, the markup names of Greek and special characters are localized. If this document is not localized to the same language, then the names below may not work for input. You may still use the Symbol catalog (Figure 7) to select the desired character by its glyph. This will also display the character's localized markup name. Once entered, the characters will display properly in any language.
Index right-click menu 7 B brackets (Math) 12 brackets commands (Math) 24 F characters – special (Math) 26 characters – Greek (Math) 26 formats commands (Math) 25 formula editor See: equation editor 10 formula layout 12 function commands (Math) 20 D L C derivative markup (Math) 14 E equation inserting 4 numbering 15 equation editor 4 equation editor brackets 12 derivative markup 14 Elements window 5 equations over more than one line 12 floating window 10 font size 11 formula layout 12 limits to sum