
Preventing Certain Errors in Writing Formulas
From NeoWiki
Revision as of 20:55, 23 November 2007 (edit) Jgd (Talk  contribs) m (→Alignment of Various Elements in a Formula) ← Previous diff 
Revision as of 08:42, 24 November 2007 (edit) (undo) Jgd (Talk  contribs) m (→Alignment of Various Elements in a Formula  better lauout) Next diff → 

Line 3:  Line 3:  
==Alignment of Various Elements in a Formula==  ==Alignment of Various Elements in a Formula==  
  To align correctly the elements of a formula or of equations, you may  +  To align correctly the elements of a formula or of equations, you may use the <tt>matrix, stack, binom, newline</tt> commands and 
  +  :use the spaces which are writen '''~''' . If you want, you can put them in braces '''{~}'''.  
  +  ::The number of spaces which are to be added depends of the terms of the formula and, sometimes, you will have to proceed by trial and error to get a good result.  
  +  
or  or  
  :  +  :use the <tt>alignr</tt> et <tt>alignl</tt> commands. 
::You can replace <tt>alignl</tt> with quotes <tt>""</tt>, that you must place before the term which needs to be left aligned.  ::You can replace <tt>alignl</tt> with quotes <tt>""</tt>, that you must place before the term which needs to be left aligned.  
  
The examples below show these various methods and some differences of layout that they produce.  The examples below show these various methods and some differences of layout that they produce.  
Line 19:  Line 17:  
'''Note''' : In writing matrices, a '''+, –''' ou '''= ''' sign, must be put in quotes, if it is an element of the matrix, i.e. if it is placed between two '''#'''.  '''Note''' : In writing matrices, a '''+, –''' ou '''= ''' sign, must be put in quotes, if it is an element of the matrix, i.e. if it is placed between two '''#'''.  
<br>  <br>  
+  
{ align="center" border="1"  { align="center" border="1" 
Revision as of 08:42, 24 November 2007
You need to observe some rules to get a correct display of the formulas, and to prevent errors in writing systems, matrices, etc. NeoOffice Math points to these errors by displaying a red interrogation mark.
Contents 
Alignment of Various Elements in a Formula
To align correctly the elements of a formula or of equations, you may use the matrix, stack, binom, newline commands and
 use the spaces which are writen ~ . If you want, you can put them in braces {~}.
 The number of spaces which are to be added depends of the terms of the formula and, sometimes, you will have to proceed by trial and error to get a good result.
or
 use the alignr et alignl commands.
 You can replace alignl with quotes "", that you must place before the term which needs to be left aligned.
The examples below show these various methods and some differences of layout that they produce.
Alignment of Several Equations
Note : In writing matrices, a +, – ou = sign, must be put in quotes, if it is an element of the matrix, i.e. if it is placed between two #.
Command  Formula 

left lbrace binom{a+b+c+d=f+g}{alignr h+k=i{~~~~} } right none
 
a*(b+c)=ab+ac{~~~~} newline (a+c)*(b+d)=ab+cb+ad+cd
 
matrix {alignr a*(b+c)#"="#alignl ab+ac ##
alignr (a+c)*(b+d)#"="#ab+cb+ad+cd}
 
left lbrace matrix{alignr x+2y+5z#"="# "" 3 ##
alignr x + y~~~~~ #"="# "" 2##
alignr x~~~~ "–" 3z #"="# "" 1} right none
 
matrix{ x+y+z#"="#""t ##
alignr x+y#"="#""t–z##
alignr x#"="#tzy }
}
 
""x+y+z=t newline
""~~~x+y=tz newline
~~~~~~~x=tzy

Alignment of Addition, Substraction or Multiplication Signs
Command  Formula 

a+b+c{~~~} newline ab+cd
 
~~~~a*(b+c) newline (a+c)*(b+d)
 
a=\[b+c+g+h+j+i+k+l+m+dotslow newline
""{~~~~}d+f\]

Avoiding Gaps
If you leave empty a location where Math is waiting for "something", you get an error message, i.e. a red quotation mark.
Empty Boxes in Matrices
In a matrix, if you want that a box remains empty, you need to place a space ~, `, or {} in it.
Command  Formula 

left ( matrix{I_n # ~ ## ~ # I_m}right )=I_{n+m}
 
left ( matrix{A_n # {}# {} ## {} # dotsdown # {} ## {}#{}# A_m}right )

Binar Operators
A term must be present on the two sides of the =, <, ≤, >, ≥, +, –, * signs, and of the union and intersection of sets symbols.
 x+y={} et {}intersection _{i in I} %omega_i
Note – This last formula is not always satisfying. The intersection symbol is to small if the sets are named with capital letters. In order to fix that issue, a better method is described in this article in NeoWiki.