Difference between revisions of "Documentation/UserGuide/Math/Syntax"
Line 4: | Line 4: | ||
On this section some basic elements about how to build a mathematical expression on Apache OpenOffice Math will be provided. | On this section some basic elements about how to build a mathematical expression on Apache OpenOffice Math will be provided. | ||
− | |||
− | |||
− | |||
− | |||
= Simple Commands and Functions = | = Simple Commands and Functions = | ||
Line 18: | Line 14: | ||
{{Documentation/Note|Any text that it is not a command (function, operator, etc) ''will be considered as variable''. By default, variables are shown on italics.}} | {{Documentation/Note|Any text that it is not a command (function, operator, etc) ''will be considered as variable''. By default, variables are shown on italics.}} | ||
+ | |||
+ | For a partial list of commands, see [[Documentation/Reference/Math_commands|this page]]. | ||
+ | |||
+ | {{Documentation/Tip|With a right click on the Math editor area, you have access to an organized list with all available commands.}} | ||
= Commands that Needs Parameters = | = Commands that Needs Parameters = |
Revision as of 10:22, 10 February 2013
Template:Documentation/DraftPage
On this section some basic elements about how to build a mathematical expression on Apache OpenOffice Math will be provided.
Simple Commands and Functions
As seen on the section about inserting a Math object, the Math editor works on "text mode".
There are several kinds of Math instructions, all of them represented by text with a particular meaning. For example, writing %gamma a Greek character will be obtained, cos will be interpreted as the cosine function while newline will insert a new line on the expression.
For a partial list of commands, see this page.
Commands that Needs Parameters
Some commands needs to be applied to other object because alone do not have sense. For example, the "decorations" like a vector arrow:
vec a
will give while
widevec a
will give
This second command can be used to put the arrow over more than one element, to obtain for example
There are also instructions that need the use of parameters to define their action, for example the command "color"
A color red {BC} D
will give
Operators and Relations
Writing on a Math object the command over without any other text, only a red question mark will be obtained: the command over is a binary operator that needs two objects (numerator and denominator of the fraction) to work.
Unitary Operators
Unitary operators only need one element. Example of unitary operators are:
+a will give
-a will give
+-a will give
-+a will give
Other examples the the sum operator, the integral (int), close integral (oint), etc.
Binary Operators
As commented above, binary operators need two elements. Examples of binary operators are
a over b will give
a >= b will give
Special Operators
Some operators modify the output of other operators. For example, the operators from and to can be used to insert limits on operators
int from a to b f will give
A particular operator is "nospace": this operator reduce the horizontal space between two elements, as it is possible to see on the following screen shot
Finally, there are two operators that can be used to turn any element into an operator: oper and boper. The first one turn the following element into a unitary operator while the second turn the element on a binary operator. The reader can check the result of the following line of code on a Math object
oper A from a to b A
Groups and Brackets
Compare the result of the following expressions
a over b + c
a over {b + c}
the first one will give while the second will give .
The braces are used to group elements on an equation. It is important to note that the braces, as well as the brackets, needs to be closed: with only a left brace or a right brace Math will display an error.
To insert braces that can be seen on the resulting expression, the commands lbrace and rbrace must be used for { and } respectively.
Brackets can be inserted from the keyboard directly.
To obtain scalable brackets that grows with the expression the commands left and right must be used. For example
lbrace a over b rbrace
will give , while
left lbrace a over b right rbrace
will give
Using left and right it is possible to match any pair of brackets, or even left one extreme "empty" with the none command
left ] a over b right (
left [ a over b right none
will give, respectively, and
Inserting "Normal" Text
As commented above, every text not recognized as command or function will be considered as variable, displaying, on the default configuration, on italics.
To insert short text sections, the best way is to enclose it between double quotes. The reader can try the following on a Math object
two words "two words"
On the first part, the text will show on italics and without space between the words while the second part will be displayed as normal text.