Difference between revisions of "Documentation/FAQ/Formula"

From Apache OpenOffice Wiki
Jump to: navigation, search
(link to math syntax right up the top)
Line 1: Line 1:
{{Documentation/FAQTOC}}
+
{{Documentation/FAQTOC}}<div style="margin-bottom:15px; margin-top:15px"><span style="padding:10px; border:solid 1pt black;background-color:#EEEEFF">'''Note''': A useful first resource is the '''[[Documentation/OOoAuthors User Manual/Writer Guide/Math commands - Reference|OpenOffice Math Syntax Reference]]'''.</span></div>
{{DISPLAYTITLE:{{OOo}} Math FAQ}}
+
  
 +
{{DISPLAYTITLE:{{OOo}} Math FAQ}}
 
<DPL>
 
<DPL>
 
   category=Documentation/FAQ/Formula
 
   category=Documentation/FAQ/Formula
Line 7: Line 7:
 
   secseparators=<br>
 
   secseparators=<br>
 
</DPL>
 
</DPL>
 +
 +
<!-- this way of laying out the FAQ sucks -- alphabetical ordering is crazy, there should be some kind of ordering based on what you want to know first, then later, etc. -->
  
 
<table border=0><tr><td>
 
<table border=0><tr><td>
Line 18: Line 20:
 
</inputbox>
 
</inputbox>
 
</td></tr></table>
 
</td></tr></table>
 
 
  
 
==I enter <font color="brown">'''x^*'''</font> to typeset x<SUP>*</SUP>, but get an error message. Why?==
 
==I enter <font color="brown">'''x^*'''</font> to typeset x<SUP>*</SUP>, but get an error message. Why?==

Revision as of 01:17, 11 November 2008

doc OOo


Note: A useful first resource is the OpenOffice Math Syntax Reference.



I enter x^* to typeset x*, but get an error message. Why?

The problem is that * is a binary operator, that is there has to be an expression on both sides of the symbol.

You either have to enter the expression x^{{}*{}} to avoid the error message, or you could type x^"*" as well, where the quotes will interprete the asterisk not as a binary operator but as a "standalone" symbol.

If you use this construction a lot you might want to define the symbol as a userdefined symbol. See I need a symbol that Math does not provide. What can I do?. If you have defined the * as a userdefined symbol, say %ast, you can enter x^%ast.

This answer applies to a lot of other symbols as well. Some operators, such as +, are unary, that is there only has to be an expression to the right of the symbol. To typeset x+ you can enter x^{+{}}< or, of course, x^"+".

When I enter one of the symbols #, & ,|,^ or _ I get an unexpected result or an error message. How can I use these symbols?

These symbols all have a special meaning in Math:

  • The symbol # is used in stacks and matrices.
  • The symbols & and | are used for logical and and logical or.
  • The symbols ^ and _ are used for

subscripts and superscripts.


To use them in your formula you can put them in quotation marks, which means that you insert them as text.

If you want to use the symbol "|" you should consider whether the construction you need is one of the the following:

  • a divides b is used to typeset a| b.
  • abs a is used to typeset |a|.

When I enter 3xy the number 3 comes out in italics. Is this a bug?

Not really. What happens here is, that Math uses multi-letter variables, which are common in some disciplines, like economics. The rule is that a variable consists of a sequence of letters, numbers and dots (the first character can not be a dot).

So when you enter 3xy this is considered a variable - and variables are typeset in italics. The only odd thing here is, that a variable can start with a number.

The correct way to enter the expression if you mean 3 times x times y is 3 x y (with spaces between the characters).


I want to use a binary operator (like union or otimes) as a large operator (like int or sum). How can I do that?

You have to define the symbol you want to use as a user-defined symbol first. See <A HREF="012.html">FAQ #012</A> for instructions; most of the symbols used by Math are part of the StarMath font.

Let's say you have defined the union symbol as the user-defined symbol %union. You can then enter for example

oper%union from i in I A_i

in order to typeset the formula

006a.gif

Note: In build 633 this doesn't work if there is a space before %union (this is a bug in the parser).

Any user-defined symbol can be used as a large operator if it is preceded with oper as in the example.

Personal tools