Difference between revisions of "Formula layout"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
−
= Formula layout =
+
The most difficult part of using OOo Math comes when writing complicated formulas. This section provides some advice.
−
The most difficult part of using OOoMath comes when writing complicated equations. This section provides some advice about writing complex formulas.
 
  
  
 
== Brackets are your friends ==
 
== Brackets are your friends ==
−
OOoMath knows nothing about order of operation. You must use brackets to state order of operations explicitly. Consider the following example:
+
OOo Math knows nothing about order of operation. You must use brackets to state the order of operations explicitly. Consider the following example:
  
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
Line 10: Line 9:
 
!Markup!!Result
 
!Markup!!Result
 
|-
 
|-
−
|<tt>2 over  x + 1</tt>||[[Image:Object34.png]]
+
|<tt>2 over  x + 1</tt>||<math>{2 \over x} + 1</math>
 
|-
 
|-
−
|<tt>2 over {x + 1}</tt>||[[Image:Object35.png]]
+
|<tt>2 over {x + 1}</tt>||<math>2 \over {x + 1}</math>
 
|-
 
|-
 
|}
 
|}
  
 
== Equations over more than one line ==
 
== Equations over more than one line ==
−
Suppose you want to type an equation covering more than one line. For example: [[Image:Object36.png]]
+
Suppose you want to type an equation covering more than one line. For example:  
  
−
Your first reaction would be to simply press the ''Enter'' key. However, if you press the ''Enter'' key, though the markup goes to a new line, the resulting equation does not. You must type the newline command explicitly. This is illustrated in the table below.
+
<math>x = 3\,\!</math>
 +
 
 +
<math>y = 1\,\!</math>
 +
 
 +
Your first reaction would be to simply press the ''Enter'' key. However, if you press the ''Enter'' key, though the markup goes to a new line, the resulting equation does not. You must type the <tt>newline</tt> command explicitly. This is illustrated in the table below.
  
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
 
{|border="1" cellpadding=4 style="border-collapse:collapse;"
Line 25: Line 28:
 
!Markup!!Result
 
!Markup!!Result
 
|-
 
|-
−
|<tt>x = 3</tt><br/><tt>y = 1</tt>||[[Image:Object37.png]]
+
|<tt>x = 3</tt><br/><tt>y = 1</tt>||<math>x = 3 \ y = 1</math>
 
|-
 
|-
−
|<tt>x = 3 newline</tt><br/><tt>y = 1</tt>||[[Image:Object38.png]]
+
|<tt>x = 3 newline</tt><br/><tt>y = 1</tt>||<math>x = 3\,\!</math>
 +
<math>y = 1\,\!</math>
 
|-
 
|-
 
|}
 
|}
 +
 +
{{SeeAlso|EN|
 +
* [[Documentation/FAQ/Formula/How_do_I_align_my_equations_at_the_equality_sign%3F | How do I Align my Equations at the Equality Sign?]]
 +
}}
 +
<noinclude>[[Category:Documentation]]</noinclude>

Latest revision as of 12:50, 16 July 2018

The most difficult part of using OOo Math comes when writing complicated formulas. This section provides some advice.


Brackets are your friends

OOo Math knows nothing about order of operation. You must use brackets to state the order of operations explicitly. Consider the following example:

Markup Result
2 over x + 1 Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {2 \over x} + 1}
2 over {x + 1} Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 2 \over {x + 1}}

Equations over more than one line

Suppose you want to type an equation covering more than one line. For example:

Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x = 3\,\!}

Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y = 1\,\!}

Your first reaction would be to simply press the Enter key. However, if you press the Enter key, though the markup goes to a new line, the resulting equation does not. You must type the newline command explicitly. This is illustrated in the table below.

Markup Result
x = 3
y = 1
Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x = 3 \ y = 1}
x = 3 newline
y = 1
Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x = 3\,\!}

Failed to parse (带SVG或PNG备选的MathML(建议用于现代的浏览器和辅助工具): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y = 1\,\!}



See Also

Personal tools