Archive | LibreOffice Writer

# Using Someone’s Programming: LibreOffice Math

For the last couple weeks, I’ve been completely absorbed in the calculus class I’m taking this month. I volunteered to write up the professor’s handwritten lecture notes for the class for extra credit. Unfortunately, that means trying to type things like:

…and…

into a word document… This is about as fun as you’d guess.

When I volunteered for this assignment, I figured I’d use LibreOffice Math for the formulas bit. The first thing I learned? LibreOffice Math is useless by itself for notetaking. The only thing it does is write equations, so don’t even bother trying to annotate anything in it. Luckily for me, Writer isn’t useless. After poking around, I figured out that you could embed Math formulas into a Writer document. I was off!

First, you need to show the insert toolbar. Click `View -> Toolbars -> Insert`

The button you are looking for on your new toolbar is:

When you click that, the bottom of your Writer window will be taken over by Math. Insert your formula and click out when your done. The Math pane will disappear. When you are done, you can export your document to .pdf, thereby ensuring anybody can view it, not just people who can open a .odf file.

To export, click this button: , which should be on the Standard toolbar.

## Example: Integral

The code for the Integral example above is:

``````int from 0 to 29 {{e^{-5 x} abs{lnx}} over {x^-x} dx}
``````

Going through that step by step:

` int from X to Y {...} ` Creates the integral sign, bounded by X and Y. X is the bottom bound, and Y is the top. If you omit from X to Y and just enter int {…}, your integral will be unbounded.

NOTE: use {} to group things. If you don’t, it can make life difficult. Sometimes things will work, sometimes they wont. Obviously there are rules, but you can either remember said rules, or just put things in braces. I chose the latter, I have enough problems right now…

`X^Y` Creates an exponent: X to the power of Y. Using braces you can put pretty much anything in an exponent.

`X over Y` Creates a fraction: X/Y. Once again, group things in braces, or know true fear.

`abs{X}` The absolute value of X

## Example: Bounded Brace:

The code for the bounded brace example above is:

``````[1,000,000,000^{x^2}]binom {1,000}{-1,000}
``````

Notable things in that:

Inside the brace is an example of a nested exponent.

` binom {X}{Y}` Places X directly on top of Y. There doesn’t appear to be support for a bounded brace, however the effect can be simulated using the `binom` command. This example is a good illustration of why you use braces. If you leave it off, Math will set 1,000-1,000 as the top number.

## Formatting:

Math supports many formatting options. Some I’ve found useful:

`underline{X}` underlines X. Useful for showing answers and things of that nature.

`newline` inserts a newline

`rightarrow` inserts a right arrow. Yes, left up and down work too.

``` and `~` inserts a small and large space. Math ignores whitespace, so if you want to insert whitespace, this is the way to go.

NOTE: Make sure you type ` (on the same button as ~), not ‘ (on the same button as “)! The second one will only succeed in putting a random apostrophe in your formula!

## In conclusion:

There are many more commands, as well as a simple to use pallet of options. If you want to know how to do something, just find and click the button and it will be inserted at the cursor. Once you get the hang of it, Math is actually a pretty easy program to use.

Just be careful: I’ve noticed that sometimes my formulas delete themselves from my Writer document. I haven’t been able to determine what causes it, but if I do, it may just become my first contribution to LibreOffice!