What if I asked you to add the formula shown in Figure 1 into an OpenOffice document? How would you do that? Would you attempt to create it using OpenOffice.org Writer? If so how? Would you have to somehow manipulate tables and font sizes and add special characters? Or would you attempt to create a graphic in The Gimp and then insert a png or jpg file? But what if that formula needed to change? Would you then have to go back and re-create the formula and re-add the image?¬†

What if I told you that OpenOffice.org has a tool specifically for the creation and use of formulas into the various pieces of the suite? OpenOffice.org Math is an outstanding means to creating complex formulas which can then be inserted as objects into of the OpenOffice.org tools. And although OpenOffice.org Math does require both an understanding of the formulas you want to create and a little bit of problem solving, it is not complicated to use. But ultimately, without Math, the task of using complex formulas in your documents would be ex harder.

In this tutorial you are going to see how to create complex formulas with OpenOffice.org Math, and then use those formulas within OpenOffice.org.

**Understanding Objects**

Before we go about working with these formulas it might be wise to first understand how objects work in OpenOffice.org. An OLE (Object Linking and Embedding) object is an object created in one application and linked to from another application. And if you have any understanding of linking, you know that if the original object is changed that change will be reflected in the document that links to it.

Let me explain it another way:

- You create Object A in OpenOffice.org Math.
- You insert Object A as an Object in OpenOffice.org Writer.
- You decide the Object is incorrect so you open up Math and make a change.
- That change is automatically reflected in the inserted object in the Writer document.

That is why using objects like a Math formula is so much more efficient than creating and inserting images. If you created an image for your formula, you would have to edit the image and then re-insert the image in Writer in order for the change to be reflected. And who knows how difficult editing that image would be.¬†

**Creating Your First Formula**

Now let's get to the creation of a formula. ¬†If you look in the Office subdirectory of your main menu you should see an entry for OpenOffice.org Math entry. If not, in order to open Math, you will have to do so from within another one of OpenOffice.org's applications. Most likely, however, you will have an entry for Math.

When you open up Math you will see two windows (see Figure 2). The larger of the two windows is where you do your work. In that window the upper pane is the preview pane and the lower pane is the work pane.¬†

The smaller of the two windows is¬† the Selection window. Here pieces of formulas are selected and added to your work. The Selection does not have to be used. All formulas can be entered manually in the bottom pane of the work window. The Selection window just offers an easier solution for those not as familiar with creating formulas with Math.

For our first formula we will start simple. Let's use the Pythagorean theorem for our first example. This theorem (for those that do not know) is:

a2+b2=c2

Although this theorem is fairly simple to create in a word processor, it makes for easy demonstration. Here's the steps for adding this formula:

- From the upper section of the Selection window click on the Uniary/Binary Operators button.
- Click on the
*a+b*button. - Highlight the first in the lower pane of the working window.
- Click on the Formats button.
- Click on the xb button and you will see ^{} appear in the lower pane of the working window.
- Replace the first with "a" (no quotes).
- Replace the second (inside the braces) with "2" (no quotes).
- Highlight the first after the¬† "+" symbol.
- Click on the xb button in the Selection window again.
- Replace the first with "b" (no quotes).
- Replace the second (inside the braces) with "2" (no quotes).¬†

What you should now see will resemble what you see in Figure 3. Of course what is missing is the right side of the equation.

- Go back to the Selection window and click the Relations button.
- Click the a=b button.
- In the lower pane of the working window you will see that
**=**has been added.¬† - Delete the first from new section.
- Highlight the remaining .
- Go back to the Formats section in the Selections window.
- Click on the xb button.
- Replace the first with "c" (no quotes).
- Replace the final with "2" (no quotes).

¬†You now have Pythagorean's theorem ready to save and use as an OLE object for any tool in OpenOffice.org.

Because this particular formula is so simple, you could have just typed in the following (in the lower pane of the working window):

*a^2 + b^2 = c^2*

which would render the same results.

Now you need to save your formula. Follow these steps:

- Go to the File menu and select Save.
- Navigate to the directory where you want to save your formula.
- Select .odf as the file type.
- Click Save.

Your formula is ready to be used in another application. Open up OpenOffice.org Writer and follow these steps in order to insert your formula:

- Click on the Insert menu.
- Click on the Object sub-menu.
- Select OLE Object.
- Click the Create from file radio button.
- Click the Search button.
- Navigate to where you saved the formula and select that formula.
- Click OK.

The formula will appear in your document.¬†

Now, say you need to make changes to your formula. Go to the new document you created. If you right click on your formula a new menu will appear. From that menu select the "Activate OLE Object" entry and a new pane will open up (see Figure 4). In the lower pane you can edit the formula to reflect your changes. Once you are done making your changes click anywhere in the upper pane to dismiss the editor and your changes will automatically appear.

The adding of formulas is the same, no matter how complex they are and no matter which OpenOffice.org tool you use.

**Final Thoughts**

Without OpenOffice.org Math, creating formulas for documents would be a nightmare of a task. But thankfully OpenOffice.org has taken care of that task. If you find yourself having trouble piecing together more complex formulas, you might check out the OpenOffice.org Math Command Wiki. That resource will go a long way to help you getting your formulas together.