Difference between revisions of "Documentation/FAQ/Formula/How do I align my equations at the equality sign?"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
<section begin=answer/>
 
<section begin=answer/>
Currently ''Math'' does not have an alignment construction (track [http://www.openoffice.org/issues/show_bug.cgi?id=5998 here]).
+
Currently, ''Math'' does not have an alignment construction (track [https://bz.apache.org/ooo/show_bug.cgi?id=5998 here]).
Instead you can use a matrix.
+
Instead, you can use a matrix.
  
 
For example to typeset the equation
 
For example to typeset the equation
Line 25: Line 25:
 
spacing of the matrix:
 
spacing of the matrix:
  
#Select '''Format-Spacing'''
+
#Select {{menu|Format|Spacing}}
#Click ''''Category'''' and choose '''Matrixes''' in the pop-up menu.
+
#Click '''Category''' and choose '''Matrices''' in the pop-up menu.
#Now enter<font color="brown">''' 0% '''</font>under ''''Column spacing''''.
+
#Now enter <font color="brown">'''0%'''</font> under '''Column spacing''' and click {{button|OK}}.
  
  

Latest revision as of 13:16, 7 October 2021


How do I align my equations at the equality sign?


Currently, Math does not have an alignment construction (track here). Instead, you can use a matrix.

For example to typeset the equation 005a.gif

you should enter the following:

matrix{
   alignr x+y # {}={} # alignl 2 ##
   alignr x   # {}={} # alignl 2-y
}

The empty braces around = are necessary because = is a binary operator and thus needs an expression on each side.

You can reduce the spacing around = if you change the inter-column spacing of the matrix:

  1. Select Format → Spacing
  2. Click Category and choose Matrices in the pop-up menu.
  3. Now enter 0% under Column spacing and click  OK .


Here is another example using a different solution:

To typeset the equation

005b.gif

the trick is to use phantom as follows:

""3(x+4)-2(x-1)=3 x+12-(2 x-2) newline
""phantom {3(x+4)-2(x-1)}=3 x+12-2 x+2 newline
""phantom {3(x+4)-2(x-1)}=x+14

The effect of the empty quotation marks is to left justify the line - a line starting with text (even an empty text) will always be left justified.

You can replace "" with alignl.


Personal tools