# Preventing Certain Errors in Writing Formulas

(Difference between revisions)
 Revision as of 20:47, 23 November 2007 (edit)Jgd (Talk | contribs) (translation of the French page Fr:Éviter Certaines Erreurs dans l'Écriture des Formules)← Previous diff Current revision (09:16, 26 November 2007) (edit) (undo)Jgd (Talk | contribs) m (Preventing Some Errors in Writing Formulas moved to Preventing Certain Errors in Writing Formulas: follow Sardisson's advice) (8 intermediate revisions not shown.) Line 1: Line 1: - + You need to observe some rules to correctly display formulas and to prevent errors in writing systems, matrices, etc. NeoOffice Math marks these erros with a red question mark. - 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. + ==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 formulas or equations, you may use the matrix, stack, binom, newline commands and - *use the matrix, stack, binom, newline commands and + :use the spaces which are writen '''~''' . If you want, you can put them in braces '''{~}'''. - **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 on the terms of the formula and, sometimes, you will have to proceed by trial and error to get a good result. - *: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 alignr et alignl commands. + :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. + ::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 in the layout that they produce. - The examples below show these various methods and some differences of layout that they produce. + ===Alignment of Several Equations=== ===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 '''#'''. + '''Note''' : In writing matrices, a '''+, –''' or '''= ''' sign, must be put in quotes, if it is an element of the matrix, i.e. if it is placed between two '''#'''s.

+ {| align="center" border="1" {| align="center" border="1" Line 27: Line 25: !style="background: #efefef;" | ''Formula'' !style="background: #efefef;" | ''Formula'' |- |- - | {{preBox|left lbrace binom{a+b+c+d=f+g}{alignr h+k=i{~~~~} } right none }} + | {{preBox|left lbrace binom{a+b+c+d=f+g}{alignr h+k=i{~~~~}{}{} } right none }} || [[Image:Alignment1.png|center]] || [[Image:Alignment1.png|center]] Line 62: Line 60:

- ===Alignment of Addition, Substraction or Multiplication Signs=== + ===Alignment of Addition, Substraction, or Multiplication Signs===

Line 70: Line 68: !style="background: #efefef;" | ''Formula'' !style="background: #efefef;" | ''Formula'' - |- + - | {{preBox|a+b+c{~~~} newline a-b+c-d + - }} + - + - || [[Image:Alignment7.png|center]] + |- |- | {{preBox|~~~~a*(b+c) newline (a+c)*(b+d)}} | {{preBox|~~~~a*(b+c) newline (a+c)*(b+d)}} Line 81: Line 75: |- |- |{{preBox|a=\[b+c+g+h+j+i+k+l+m+dotslow newline |{{preBox|a=\[b+c+g+h+j+i+k+l+m+dotslow newline - ""{~~~~}d+f\] }} + ""{~~~}{}{}d+f\] }} || [[Image:Alignment9.png|center]] || [[Image:Alignment9.png|center]] Line 89: Line 83: ==Avoiding Gaps== ==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. + If you leave a location empty where Math is waiting for "something", you get an error message, i.e. a red question mark. ===Empty Boxes in Matrices=== ===Empty Boxes in Matrices=== - In a matrix, if you want that a box remains empty, you need to place a space '''~, `''', or '''{}''' in it. + In a matrix, if you want a box to remain empty, you need to place a space '''~, `''', or '''{}''' in it.

Line 109: Line 103: }} }} - || [[Image:Matrix2 .png|center]] + || [[Image:Matrix2.png|center]] |} |} + ===Binary Operators=== + A term must be present on both sides of the '''=, <, ≤, >, ≥, +, –, *''' signs, and of the union and intersection of sets symbols. - ===Binar Operators=== + ::x+y={} and {}intersection _{i in I} %omega_i - 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 [[:Using_Catalog_in_NeoOffice_Math|this article]] in NeoWiki. + '''Note''' – This last formula is not always satisfying. The intersection symbol is too small if the sets are named with capital letters. In order to fix that issue, a better method is described in [[:Using_Catalog_in_NeoOffice_Math|this article]] in NeoWiki. - {{botlangbarEN|[[Fr:Éviter Certaines Erreurs dans l'Écriture des Formules|Français]]}} + {{botlangbarEN|[[Fr:Éviter Certaines Erreurs dans l'Écriture des Formules|Français]] [[It:Prevenire_alcuni_errori_nella_scrittura_delle_formule|Italiano]]}} [[Category:Tips and Hints]][[Category:NeoOffice]] [[Category:Tips and Hints]][[Category:NeoOffice]]

## Current revision

You need to observe some rules to correctly display formulas and to prevent errors in writing systems, matrices, etc. NeoOffice Math marks these erros with a red question mark.

## Alignment of Various Elements in a Formula

To align correctly the elements of formulas or 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 on 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 in the layout that they produce.

### Alignment of Several Equations

Note : In writing matrices, a +, – or = sign, must be put in quotes, if it is an element of the matrix, i.e. if it is placed between two #s.

Command Formula
left lbrace binom{a+b+c+d=f+g}{alignr h+k=i{~~~~}{}{} } right none
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#"="#t-z-y } }
""x+y+z=t newline ""~~~x+y=t-z newline ~~~~~~~x=t-z-y

### Alignment of Addition, Substraction, or Multiplication Signs

Command Formula
~~~~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 a location empty where Math is waiting for "something", you get an error message, i.e. a red question mark.

### Empty Boxes in Matrices

In a matrix, if you want a box to remain 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 )

### Binary Operators

A term must be present on both sides of the =, <, ≤, >, ≥, +, –, * signs, and of the union and intersection of sets symbols.

x+y={} and {}intersection _{i in I} %omega_i

Note – This last formula is not always satisfying. The intersection symbol is too 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.