summaryrefslogtreecommitdiff
path: root/helpcontent2/source/text/smath/01/03091100.xhp
blob: b1d892f62912049033e3a976d6018eef61269552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0" encoding="UTF-8"?>



<!--
 ***********************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: 03091100.xhp,v $
 * $Revision: 1.7 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textsmath0103091100xml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Brackets and Grouping</title>
<filename>/text/smath/01/03091100.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3147341"><bookmark_value>brackets and grouping in $[officename] Math</bookmark_value>
<bookmark_value>grouping and brackets in $[officename] Math</bookmark_value>
</bookmark>
<paragraph role="heading" id="hd_id3147341" xml-lang="en-US" level="1" l10n="U" oldref="1"><link href="text/smath/01/03091100.xhp" name="Brackets and Grouping">Brackets and Grouping</link></paragraph>
<paragraph role="paragraph" id="par_id3150342" xml-lang="en-US" l10n="U" oldref="2">Note: the quotation marks in the examples are used to emphasize text and do not belong to the content of the formulas and commands.</paragraph>
<paragraph role="warning" id="par_id3146962" xml-lang="en-US" l10n="U" oldref="3">When typing example formulas into the <emph>Commands</emph> window, note that spaces are often required for correct structure.</paragraph>
<paragraph role="paragraph" id="par_id3149054" xml-lang="en-US" l10n="U" oldref="4">Braces "{}" are used to group expressions together to form one new expression. For example, "sqrt {x * y}" is the square root of the entire product x*y, while "sqrt x * y" is the square root of x multiplied by y. Braces do not require an extra space.</paragraph>
<paragraph role="paragraph" id="par_id3151392" xml-lang="en-US" l10n="CHG" oldref="5">Set brackets were previously inserted in the Formula Elements window or directly in the Commands window as "left lbrace &lt;?&gt; right rbrace". Now, a left and a right set bracket can also be inserted using "lbrace" and "rbrace", with or without wildcards.</paragraph>
<paragraph role="paragraph" id="par_id3147403" xml-lang="en-US" l10n="U" oldref="6">There are a total of eight (8) different types of brackets available. The "ceil" and "floor" brackets are often used for rounding up or down the argument to the next integer: "lceil -3.7 rceil = -3" or "lfloor -3.7 rfloor = -4".</paragraph>
<paragraph role="paragraph" id="par_id3146320" xml-lang="en-US" l10n="U" oldref="63">Operator brackets, also known as Bra-kets (angle brackets with a vertical line in between), are common in Physics notation: "langle a mline b rangle" or "langle a mline b mline c over d mline e rangle." The height and positioning of the vertical lines always corresponds exactly to the enclosing brackets.</paragraph>
<paragraph role="paragraph" id="par_id3157870" xml-lang="en-US" l10n="U" oldref="7">All brackets may only be used in pairs. The brackets have some common characteristics:</paragraph>
<paragraph role="paragraph" id="par_id3155761" xml-lang="en-US" l10n="CHG" oldref="8">All types of brackets have the same grouping function as described for "{}" brackets.</paragraph>
<paragraph role="paragraph" id="par_id3145590" xml-lang="en-US" l10n="U" oldref="9">All types of brackets, including those that are visible, permit empty group definition. The enclosed expression may therefore be empty.</paragraph>
<paragraph role="paragraph" id="par_id3154562" xml-lang="en-US" l10n="U" oldref="10">Brackets do not adjust their size to the enclosed expression. For example, if you want "( a over b )" with a bracket size adjusted to a and b you must insert "left" and "right". Entering "left(a over b right)" produces appropriate sizing. If, however, the brackets themselves are part of the expression whose size is changed, they are included the size change: "size 3(a over b)" and "size 12(a over b)". The sizing of the bracket-to-expression ratio does not change in any way.</paragraph>
<paragraph role="paragraph" id="par_id3153002" xml-lang="en-US" l10n="U" oldref="11">Since "left" and "right" ensure unique assignment of the brackets, every single bracket can be used as an argument for these two commands, even placing right brackets on the left side, or left brackets on the right. Instead of a bracket you can use the "none" qualifier, which means that there is no bracket shown and that there is no space reserved for a bracket. Using this, you can create the following expressions:</paragraph>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3150014" xml-lang="en-US" l10n="U" oldref="12">left lbrace x right none</paragraph>
</listitem>
<listitem>
<paragraph role="code" id="par_id3149877" xml-lang="en-US" l10n="U" oldref="13">left [ x right )</paragraph>
</listitem>
<listitem>
<paragraph role="code" id="par_id3145241" xml-lang="en-US" l10n="U" oldref="14">left ] x right [</paragraph>
</listitem>
<listitem>
<paragraph role="code" id="par_id3156060" xml-lang="en-US" l10n="U" oldref="15">left rangle x right lfloor</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3150935" xml-lang="en-US" l10n="U" oldref="16">The same rules apply to "left" and "right" as to the other brackets: they also work as group builders and may enclose empty expressions.</paragraph>
<paragraph role="paragraph" id="par_id3149030" xml-lang="en-US" l10n="U" oldref="17">The combination of mismatched brackets, single brackets and repositioned left and right brackets occurs often in mathematical formulas. The following is a formula that will create an error when typed:</paragraph>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3155989" xml-lang="en-US" l10n="U" oldref="19">[2, 3) - right open interval</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3147169" xml-lang="en-US" l10n="U" oldref="23">Using "left" and "right" makes the above expression valid in $[officename] Math: "left [2, 3 right )". However, the brackets do not have any fixed size because they adjust to the argument. Setting a single bracket is a bit cumbersome. Therefore, there you can display single brackets with a fixed size by placing a "\" (backslash) in front of normal brackets. These brackets then act like any other symbol and no longer have the special functionality of brackets; that is they do not work as group builders and their orientation corresponds to that of other symbols. See "size *2 \langle x \rangle" and "size *2 langle x rangle".</paragraph>
<paragraph role="paragraph" id="par_id3153720" xml-lang="en-US" l10n="U" oldref="24">The complete overview is as follows</paragraph>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3149715" xml-lang="en-US" l10n="U" oldref="25">\{ or \lbrace, \} or \rbrace</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3150756" xml-lang="en-US" l10n="U" oldref="26">\(, \)</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3145207" xml-lang="en-US" l10n="U" oldref="27">\[, \]</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3153153" xml-lang="en-US" l10n="U" oldref="28">\langle, \rangle</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3150263" xml-lang="en-US" l10n="U" oldref="29">\lceil, \rceil</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3147252" xml-lang="en-US" l10n="U" oldref="30">\lfloor, \rfloor</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3154690" xml-lang="en-US" l10n="U" oldref="31">\lline, \rline</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="code" id="par_id3145414" xml-lang="en-US" l10n="U" oldref="32">\ldline, \rdline</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3147514" xml-lang="en-US" l10n="U" oldref="33">In this way, intervals like the one above can be built in <emph>$[officename] Math</emph> without any problems: \[2", "3\) or "\]2", "3\[ (Attention: These quotation marks are part of the entry.)</paragraph>
<paragraph role="note" id="par_id3153532" xml-lang="en-US" l10n="U" oldref="34">Please note that the quotation marks must be entered and can be obtained with <emph>Shift+2</emph> and not with typographical quotation marks. Generally, punctuation marks (like the comma in this case) are set as text. Although it is also possible to type "\[2,~3\)" the above option is preferable. In the previous example, "fixed size" always describes a bracket size dependent on the font size used.</paragraph>
<paragraph role="paragraph" id="par_id3153674" xml-lang="en-US" l10n="U" oldref="35">Nesting groups within each other is relatively problem-free. In the formula hat "{a + b}" the "hat" is displayed simply over the center of "{a + b}". Also, "color red lceil a rceil" and "grave hat langle x * y rangle" work as expected. The result of the latter can be compared to "grave {hat langle x * y rangle}." These attributes do not compete, but rather can be combined.</paragraph>
<paragraph role="paragraph" id="par_id3147526" xml-lang="en-US" l10n="U" oldref="36">This differs slightly for competing or mutually influencing attributes. This is often the case with font attributes. For example, which color does the b have in "color yellow color red (a + color green b)", or which size does it have in "size *4 (a + size /2 b)"? Given a base size of 12, does it have the size 48, 6 or even 24 (which could be seen as a combination)? The following are basic resolution rules, which will be followed consistently in the future. In general, the rules apply to all group operations. This only has a visible effect on the font attributes, like "bold", "ital", "phantom", "size", "color" and "font":</paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" id="par_id3152952" xml-lang="en-US" l10n="U" oldref="37">Group operations in sequence are treated as if every single operation is enclosed by braces. They are nested, and in every level there can be no more than one operation. Here is an example of a formula with many group operations: "size 12 color red font sans size -5 (a + size 8 b)" like "{size 12{color red{font sans{size -5 (a + {size 8 b})}}}}".</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="listitem" id="par_id3158441" xml-lang="en-US" l10n="U" oldref="38">This example formula is then interpreted from left to right. The operations only affect its corresponding group (or expression). Operations further to the right "replace" or "combine themselves with" their predecessors.</paragraph>
</listitem>
</list>
<list type="unordered">
<listitem>
<paragraph role="listitem" id="par_id3150994" xml-lang="en-US" l10n="U" oldref="39">A group operation does not have any effect on higher-level operations but rather affects only lower-level groups and expressions, including their brackets and super-/subscripts. For example, "a + size *2 (b * size -8 c_1)^2"</paragraph>
</listitem>
</list>
<paragraph role="note" id="par_id3154196" xml-lang="en-US" l10n="U" oldref="40">"color ..." and "font ..." as well as "size n" (n is a decimal) replace any preceding operations of the same type</paragraph>
<paragraph role="note" id="par_id3154136" xml-lang="en-US" l10n="U" oldref="41">for "size +n", "size -n", "size *n", and "size /n" the effects of the operations are combined,</paragraph>
<paragraph role="note" id="par_id3146934" xml-lang="en-US" l10n="U" oldref="42">"size *2 size -5 a" would be double the starting size minus 5</paragraph>
<paragraph role="note" id="par_id3149297" xml-lang="en-US" l10n="U" oldref="43">"font sans ( a + font serif b)"</paragraph>
<paragraph role="note" id="par_id3155174" xml-lang="en-US" l10n="U" oldref="44">"size *2 ( a + size /2 b )"</paragraph><comment>UFI: no more StarSymbol font. Removed the following paras</comment><comment>id="par_id3151327" l10n="U" oldref="45"For the StarSymbol Unicode font there are 2 exceptions to these rules:
id="par_id3148998" l10n="U" oldref="46"It ignores "font" commands. Otherwise, there would often be different characters from the ones desired, for example, "font sans (a oplus b)" would then neither have brackets nor an "oplus".
id="par_id3143281" l10n="U" oldref="47"The "ital" command is ignored, for example, "ital (a + b)". This happens because italicized mathematical symbols are uncommon, even in combination with text in italics.</comment><paragraph role="tip" id="par_id3154906" xml-lang="en-US" l10n="U" oldref="50">To change the size of a formula, use "size +" or -,*,/. Do not use "size n". These can easily be used in any context. This enables you to copy to other areas by using Copy and Paste, and the result remains the same. Furthermore, such expressions survive a change of base size in the menu better than when using "size n". If you use only "size *" and "size /" (for example, "size *1.24 a or size /0.86 a") the proportions remain intact.</paragraph>
<paragraph role="tip" id="par_id3147587" xml-lang="en-US" l10n="U" oldref="51">Examples (with a base size of 12 and 50% for indexes):</paragraph>
<paragraph role="tip" id="par_id3148734" xml-lang="en-US" l10n="U" oldref="52">Exactly identical proportions with "size 18 a_n" and "size *1.5 a_n".</paragraph>
<paragraph role="tip" id="par_id3152766" xml-lang="en-US" l10n="U" oldref="53">This differs in different contexts: "x^{size 18 a_n}" and "x^{size *1.5 a_n}"</paragraph>
<paragraph role="tip" id="par_id3157986" xml-lang="en-US" l10n="U" oldref="54">Examples with size +n for a comparison. They look identical:</paragraph>
<paragraph role="codeintip" id="par_id3158001" xml-lang="en-US" l10n="U" oldref="55">a_{size 8 n}</paragraph>
<paragraph role="codeintip" id="par_id3147332" xml-lang="en-US" l10n="U" oldref="56">a_{size +2 n}</paragraph>
<paragraph role="codeintip" id="par_id3155143" xml-lang="en-US" l10n="U" oldref="57">a_{size *1.333 n}</paragraph>
<paragraph role="tip" id="par_id3147129" xml-lang="en-US" l10n="U" oldref="58">The following examples, however, do not look identical:</paragraph>
<paragraph role="codeintip" id="par_id3147073" xml-lang="en-US" l10n="U" oldref="59">x^{a_{size 8 n}}</paragraph>
<paragraph role="codeintip" id="par_id3147086" xml-lang="en-US" l10n="U" oldref="60">x^{a_{size +2 n}}</paragraph>
<paragraph role="codeintip" id="par_id3154386" xml-lang="en-US" l10n="U" oldref="61">x^{a_{size *1.333 n}}</paragraph>
<paragraph role="tip" id="par_id3153354" xml-lang="en-US" l10n="U" oldref="62">Note that all n here have different sizes. The size 1.333 results from 8/6, the desired size divided by the default index size 6. (Index size 50% with a base size of 12)</paragraph>
</body>
</helpdocument>