1<?xml version="1.0" encoding="UTF-8"?>
2
3
4
5<!--***********************************************************
6 *
7 * Licensed to the Apache Software Foundation (ASF) under one
8 * or more contributor license agreements.  See the NOTICE file
9 * distributed with this work for additional information
10 * regarding copyright ownership.  The ASF licenses this file
11 * to you under the Apache License, Version 2.0 (the
12 * "License"); you may not use this file except in compliance
13 * with the License.  You may obtain a copy of the License at
14 *
15 *   http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing,
18 * software distributed under the License is distributed on an
19 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20 * KIND, either express or implied.  See the License for the
21 * specific language governing permissions and limitations
22 * under the License.
23 *
24 ***********************************************************-->
25
26
27
28
29		<helpdocument version="1.0">
30<meta>
31<topic id="textsmath0103091100xml" indexer="include" status="PUBLISH">
32<title id="tit" xml-lang="en-US">Brackets and Grouping</title>
33<filename>/text/smath/01/03091100.xhp</filename>
34</topic>
35</meta>
36<body>
37<bookmark xml-lang="en-US" branch="index" id="bm_id3147341"><bookmark_value>brackets and grouping in $[officename] Math</bookmark_value>
38<bookmark_value>grouping and brackets in $[officename] Math</bookmark_value>
39</bookmark>
40<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>
41<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>
42<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>
43<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>
44<paragraph role="paragraph" id="par_id3151392" xml-lang="en-US" l10n="CHG" oldref="5">Set brackets were previously inserted in the 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>
45<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>
46<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>
47<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>
48<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>
49<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>
50<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>
51<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>
52<list type="unordered">
53<listitem>
54<paragraph role="code" id="par_id3150014" xml-lang="en-US" l10n="U" oldref="12">left lbrace x right none</paragraph>
55</listitem>
56<listitem>
57<paragraph role="code" id="par_id3149877" xml-lang="en-US" l10n="U" oldref="13">left [ x right )</paragraph>
58</listitem>
59<listitem>
60<paragraph role="code" id="par_id3145241" xml-lang="en-US" l10n="U" oldref="14">left ] x right [</paragraph>
61</listitem>
62<listitem>
63<paragraph role="code" id="par_id3156060" xml-lang="en-US" l10n="U" oldref="15">left rangle x right lfloor</paragraph>
64</listitem>
65</list>
66<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>
67<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>
68<list type="unordered">
69<listitem>
70<paragraph role="code" id="par_id3155989" xml-lang="en-US" l10n="U" oldref="19">[2, 3) - right open interval</paragraph>
71</listitem>
72</list>
73<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>
74<paragraph role="paragraph" id="par_id3153720" xml-lang="en-US" l10n="U" oldref="24">The complete overview is as follows</paragraph>
75<list type="unordered">
76<listitem>
77<paragraph role="code" id="par_id3149715" xml-lang="en-US" l10n="U" oldref="25">\{ or \lbrace, \} or \rbrace</paragraph>
78</listitem>
79</list>
80<list type="unordered">
81<listitem>
82<paragraph role="code" id="par_id3150756" xml-lang="en-US" l10n="U" oldref="26">\(, \)</paragraph>
83</listitem>
84</list>
85<list type="unordered">
86<listitem>
87<paragraph role="code" id="par_id3145207" xml-lang="en-US" l10n="U" oldref="27">\[, \]</paragraph>
88</listitem>
89</list>
90<list type="unordered">
91<listitem>
92<paragraph role="code" id="par_id3153153" xml-lang="en-US" l10n="U" oldref="28">\langle, \rangle</paragraph>
93</listitem>
94</list>
95<list type="unordered">
96<listitem>
97<paragraph role="code" id="par_id3150263" xml-lang="en-US" l10n="U" oldref="29">\lceil, \rceil</paragraph>
98</listitem>
99</list>
100<list type="unordered">
101<listitem>
102<paragraph role="code" id="par_id3147252" xml-lang="en-US" l10n="U" oldref="30">\lfloor, \rfloor</paragraph>
103</listitem>
104</list>
105<list type="unordered">
106<listitem>
107<paragraph role="code" id="par_id3154690" xml-lang="en-US" l10n="U" oldref="31">\lline, \rline</paragraph>
108</listitem>
109</list>
110<list type="unordered">
111<listitem>
112<paragraph role="code" id="par_id3145414" xml-lang="en-US" l10n="U" oldref="32">\ldline, \rdline</paragraph>
113</listitem>
114</list>
115<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>
116<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>
117<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>
118<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>
119<list type="unordered">
120<listitem>
121<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>
122</listitem>
123</list>
124<list type="unordered">
125<listitem>
126<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>
127</listitem>
128</list>
129<list type="unordered">
130<listitem>
131<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>
132</listitem>
133</list>
134<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>
135<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>
136<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>
137<paragraph role="note" id="par_id3149297" xml-lang="en-US" l10n="U" oldref="43">"font sans ( a + font serif b)"</paragraph>
138<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:
139id="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".
140id="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>
141<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>
142<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>
143<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>
144<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>
145<paragraph role="codeintip" id="par_id3158001" xml-lang="en-US" l10n="U" oldref="55">a_{size 8 n}</paragraph>
146<paragraph role="codeintip" id="par_id3147332" xml-lang="en-US" l10n="U" oldref="56">a_{size +2 n}</paragraph>
147<paragraph role="codeintip" id="par_id3155143" xml-lang="en-US" l10n="U" oldref="57">a_{size *1.333 n}</paragraph>
148<paragraph role="tip" id="par_id3147129" xml-lang="en-US" l10n="U" oldref="58">The following examples, however, do not look identical:</paragraph>
149<paragraph role="codeintip" id="par_id3147073" xml-lang="en-US" l10n="U" oldref="59">x^{a_{size 8 n}}</paragraph>
150<paragraph role="codeintip" id="par_id3147086" xml-lang="en-US" l10n="U" oldref="60">x^{a_{size +2 n}}</paragraph>
151<paragraph role="codeintip" id="par_id3154386" xml-lang="en-US" l10n="U" oldref="61">x^{a_{size *1.333 n}}</paragraph>
152<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>
153</body>
154</helpdocument>
155