5

I've the following formula:

(x^6+x^4+x^2+x+1)(x^7+x+1)
= x^13+x^11+x^9+x^8+x^7+
x^7+x^5+x^3+x^3+x^2+x+
x^6+x^4+x^2+x+1
= x^13+x^11+x^9+x^8+2x^7+x^6+x^5+x^4+2x^3+2x^2+2x+1

Putting this in OpenOffice.org Math causes every line be concatenated, which I want to avoid. I've already tried putting newline between the lines, but it adds a strange question mark in the formula. Using matrices did not work for me either.

I want to achieve a nicely formatted formula like this one (taken from FIPS 197 pdf): Nicely formatted formula

Lekensteyn
  • 6,624

2 Answers2

15

Found the answer om the OpenOffice.org forum. Rather than inserting newline, {}newline{} should be used instead.

In my case:

(x^6+x^4+x^2+x+1)(x^7+x+1){}newline{}
= x^13+x^11+x^9+x^8+x^7+{}newline{}
x^7+x^5+x^3+x^3+x^2+x+{}newline{}
x^6+x^4+x^2+x+1{}newline{}
= x^13+x^11+x^9+x^8+2x^7+x^6+x^5+x^4+x^3+2x^2+2x+1

To get it nicely aligned to the left, I used:

alignl (x^6+x^4+x^2+x+1)(x^7+x+1){}newline
alignl {}= x^13+x^11+x^9+x^8+x^7+{}newline
alignl {}""phantom{=}x^7+x^5+x^3+x^3+x^2+x+{}newline
alignl {}""phantom{=}x^6+x^4+x^2+x+1{}newline
alignl {}= x^13+x^11+x^9+x^8+2x^7+x^6+x^5+x^4+x^3+2x^2+2x+1

alignl causes the text to be aligned to the left; ""phantom{=} inserts an hidden =, which adds the extra whitespace before the line. (found at FAQ: How do I align my equations at the equality sign)

If you're curious how the formula looks like:

Result in OOo Math

Lekensteyn
  • 6,624
0

this one works for me:

size 20 { } F_y=0 drarrow  newline  +N-w_y=0  { }

Edit:

the previous line of code has trouble with "size" or "bold" commands, as well as the "=" symbol -they don't work. I think a better way to deal with this problem is to write the formula line by line using {} at the end of each line, like this:

size 20 { F_y=0 drarrow {} }