Difference between revisions of "Documentation/FAQ/Formula"

From Apache OpenOffice Wiki
Jump to: navigation, search
(How do I align my equations at the equality sign?)
(I enter x^* to typeset x*, but get an error message. Why?)
 
(49 intermediate revisions by 10 users not shown)
Line 1: Line 1:
==How can I get a left bracket without a right bracket?==
+
{{DISPLAYTITLE:{{AOo}} Math FAQ}}__NOTOC__{{Documentation/FAQTOC}}{{Note| A useful first resource is the '''[[Documentation/Reference/Math_commands|OpenOffice Math Syntax Reference]]'''.}}
Since brackets have a grouping function they must always match and
+
Search the FAQs: <googlefaq/>
be correctly nested.
+
This list is ordered by popularity. The most popular FAQs are at the top. But also have a look at the bottom to find any new entries.
  
To get a single bracket without a matching bracket partner you
+
Below the list you can find some more FAQs that have special characters in the title.
have to escape the bracket with a backslash. For example to get a &quot;[&quot;
+
without a corresponding &quot;]&quot; you should enter "'''\['''".
+
  
Thus to typeset the interval [3;8) you should enter <font color="brown">'''\[3 ";" 8\)'''</font>. The quotation marks around the semicolon ensures that it
+
<DPL>
is not typeset in italic. (You're right, this has nothing to do with
+
  category=Documentation/FAQ/Formula
brackets!)
+
  ordermethod=counter
 +
  order=descending
 +
  replaceintitle=/Documentation.*\//,
 +
  secseparators=<br>
 +
</DPL>
  
For scalable brackets it is essential that '''left''' and
+
<div style="background-color:#EEE;border:solid 1pt #AAA;padding:10px;margin-top:20px">
'''right''' matches, since the content that the brackets
+
===Add a new FAQ entry===
encloses must be well defined.
+
<inputbox>
 +
bgcolor=#EEE
 +
type=create
 +
default=Documentation/FAQ/Formula/<FAQ_TITLE>
 +
preload=Documentation/FAQ_Template
 +
buttonlabel=Add new FAQ
 +
break=no
 +
</inputbox>
 +
'''Instructions'''
 +
* Do '''not ask questions''' here, but '''give answers'''.
 +
* If you have a '''question to ask''', go to the [https://forum.openoffice.org/en/forum/ User Forum].
 +
* Replace ''<FAQ_TITLE>'' part in the input box above by the title you would like to give the FAQ item and click '''Add New FAQ'''
 +
</div>
  
In this case you can use the invisible bracket '''none''' to
 
get a single bracket. For example to get a scalable &quot;[&quot;
 
without a corresponding &quot;]&quot; you should enter <font color="brown">'''left [
 
... right none'''</font>.
 
  
Thus to typeset
+
[[Category: Documentation/FAQ]]
[[Image:001a.gif]]you
+
[[Category:User FAQ]]
should enter<font color="brown">''' x=left lbrace binom -5 3 right none'''</font>.
+
 
+
==I enter <font color="brown">'''x^*'''</font> to typeset x<SUP>*</SUP>, but get an error message. Why?==
+
 
+
The problem is that<font color="brown">''' * '''</font>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<font color="brown">''' x^{{}*{}} '''</font>to avoid the
+
error message, or you could type <font color="brown">''' x^"*"'''</font> 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 <A HREF="012.html">FAQ #012</A>.
+
If you have defined the * as a userdefined symbol, say<font color="brown">''' %ast'''</font>,
+
you can enter<font color="brown">''' x^%ast'''</font>.
+
 
+
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<SUP>+</SUP> you can enter<font color="brown">''' x^{+{}}<'''</font> or, of course, <font color="brown">'''x^"+"'''</font>.
+
 
+
 
+
==When I enter one of the symbols '''<font color="brown">#</font>,<font color="brown"> &amp;</font> ,<font color="brown">|</font>,<font color="brown">^</font>''' or <font color="brown">'''_'''</font> 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<font color="brown">''' # '''</font>is used in stacks and matrices.
+
*The symbols<font color="brown">''' &amp; '''</font>and<font color="brown">''' | '''</font>are used for logical and and logical or.
+
*The symbols<font color="brown">''' ^ '''</font>and<font color="brown">''' _ '''</font>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 &quot;|&quot; you should consider
+
whether the construction you need is one of the the following:
+
 
+
*<font color="brown">'''a divides b '''</font>is used to typeset a| b.
+
*<font color="brown">'''abs a '''</font>is used to typeset |a|.
+
 
+
==When I enter<font color="brown">''' 3xy '''</font>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 economy. 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<font color="brown">''' 3 x y '''</font>(with spaces between the characters).
+
 
+
==How do I align my equations at the equality sign?==
+
 
+
Currently ''Math'' does not have an alignment construction.
+
Instead you can use a matrix.
+
 
+
For example to typeset the equation
+
[[Image:005a.gif]]
+
 
+
you should enter the following:
+
<pre>
+
matrix{
+
  alignr x+y # {}={} # alignl 2 ##
+
  alignr x  # {}={} # alignl 2-y
+
}
+
</pre>
+
The empty braces around = are necessary because = is a binary
+
operator and thus needs an expression on each side.
+
 
+
You can reduce the spacing around = if you change the inter-column
+
spacing of the matrix:
+
 
+
 
+
*Select '''Format-Spacing'''
+
*Click ''''Category'''' and choose'''Matrixes''' in the pop-up menu.
+
*Now enter<font color="brown">''' 0% '''</font>under ''''Column spacing''''.
+
 
+
 
+
Here is another example using a different solution:
+
 
+
To typeset the equation
+
 
+
[[Image:005b.gif]]
+
 
+
the trick is to use <font color="brown">'''phantom'''</font> as follows:
+
 
+
<pre>&quot;&quot;3(x+4)-2(x-1)=3 x+12-(2 x-2) newline
+
&quot;&quot;phantom {3(x+4)-2(x-1)}=3 x+12-2 x+2 newline
+
&quot;&quot;phantom {3(x+4)-2(x-1)}=x+14</pre>
+
 
+
<P STYLE="margin-top: 0.2cm; margin-bottom: 0.21cm; font-weight: medium">
+
The effect of the empty quotation marks is to left justify the line -
+
a line starting with text (even an empty text) will always be left
+
justified.</P>
+
 
+
You can replace<font color="brown">''' &quot;&quot; '''</font>with <font color="brown">'''alignl'''</font>.
+
 
+
==I want to use a binary operator (like <font color="brown">'''union'''</font> or<font color="brown"> '''otimes'''</font>) as a large operator (like <font color="brown">'''int'''</font> or <font color="brown">'''sum'''</font>). 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 <font color="brown">'''%union'''</font>. You can then enter for example
+
 
+
<pre>oper%union from i in I A_i</pre>
+
 
+
in order to typeset the formula
+
 
+
[[Image:006a.gif]]
+
 
+
<em>Note</em>: In build 633 this doesn't work if there is a space before
+
<font color="brown">'''%union'''</font> (this is a bug in the parser).
+
<P>Any user-defined symbol can be used as a large operator if it is
+
preceded with<font color="brown">''' oper '''</font>as in the example.</P>
+

Latest revision as of 13:12, 8 October 2021

doc OOo


Documentation note.png A useful first resource is the OpenOffice Math Syntax Reference.

Search the FAQs:

This list is ordered by popularity. The most popular FAQs are at the top. But also have a look at the bottom to find any new entries.

Below the list you can find some more FAQs that have special characters in the title.

Add a new FAQ entry

Instructions

  • Do not ask questions here, but give answers.
  • If you have a question to ask, go to the User Forum.
  • Replace <FAQ_TITLE> part in the input box above by the title you would like to give the FAQ item and click Add New FAQ
Personal tools