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
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<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 Math</bookmark_value>
<bookmark_value>grouping and brackets in Math</bookmark_value>
</bookmark>
<paragraph role="heading" id="hd_id3147341" xml-lang="en-US" level="1"><link href="text/smath/01/03091100.xhp" name="Brackets and Grouping">Brackets and Grouping</link></paragraph>
<paragraph role="note" id="par_id3150342" xml-lang="en-US">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">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">Braces "{}" are used to group expressions together to form one new expression. For example, <input>sqrt {x * y}</input> is the square root of the entire product x*y, while <input>sqrt x * y</input> 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">Set brackets were previously inserted in the Elements pane or directly in the Commands window as "left lbrace <?> 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">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: <input>lceil -3.7 rceil = -3</input> or <input>lfloor -3.7 rfloor = -4</input>.</paragraph>
<paragraph role="paragraph" id="par_id3146320" xml-lang="en-US">Operator brackets, also known as Bra-kets (angle brackets with a vertical line in between), are common in Physics notation: <input>langle a mline b rangle</input> or <input>langle a mline b mline c over d mline e rangle</input>. 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">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">All types of brackets have the same grouping function as described for "{}" brackets.</paragraph>
<paragraph role="paragraph" id="par_id3145590" xml-lang="en-US">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">Brackets do not adjust their size to the enclosed expression. For example, if you want <input>( a over b )</input> with a bracket size adjusted to a and b you must insert "left" and "right". Entering <input>left(a over b right)</input> produces appropriate sizing. If, however, the brackets themselves are part of the expression whose size is changed, they are included the size change: <input>size 3(a over b)</input> and <input>size 12(a over b)</input>. 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">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="smathcode" id="par_id3150014" xml-lang="en-US" localize="false">left lbrace x right none</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3149877" xml-lang="en-US" localize="false">left [ x right )</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3145241" xml-lang="en-US" localize="false">left ] x right [</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3156060" xml-lang="en-US" localize="false">left rangle x right lfloor</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3150935" xml-lang="en-US">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">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="smathcode" id="par_id3155989" xml-lang="en-US">[2, 3) - right open interval</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3147169" xml-lang="en-US">Using "left" and "right" makes the above expression valid in $[officename] Math: <input>left [2, 3 right )</input>. 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 <input>size *2 \langle x \rangle</input> and <input>size *2 langle x rangle</input>.</paragraph>
<paragraph role="paragraph" id="par_id3153720" xml-lang="en-US">The complete overview is as follows</paragraph>
<list type="unordered">
<listitem>
<paragraph role="smathcode" id="par_id3149715" xml-lang="en-US">\{ or \lbrace, \} or \rbrace</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3150756" xml-lang="en-US" localize="false">\(, \)</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3145207" xml-lang="en-US" localize="false">\[, \]</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3153153" xml-lang="en-US" localize="false">\langle, \rangle</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3150263" xml-lang="en-US" localize="false">\lceil, \rceil</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3147252" xml-lang="en-US" localize="false">\lfloor, \rfloor</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3154690" xml-lang="en-US" localize="false">\lline, \rline</paragraph>
</listitem>
<listitem>
<paragraph role="smathcode" id="par_id3145414" xml-lang="en-US" localize="false">\ldline, \rdline</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3147514" xml-lang="en-US">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">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">Nesting groups within each other is relatively problem-free. In the formula <input>hat "{a + b}"</input> the "hat" is displayed simply over the center of "{a + b}". Also, <input>color red lceil a rceil</input> and <input>grave hat langle x * y rangle</input> work as expected. The result of the latter can be compared to <input>grave {hat langle x * y rangle}</input>. These attributes do not compete, but rather can be combined.</paragraph>
<paragraph role="paragraph" id="par_id3147526" xml-lang="en-US">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 <input>color yellow color red (a + color green b)</input>, or which size does it have in <input>size *4 (a + size /2 b)</input>? 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">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:</paragraph>
<paragraph role="smathcode" id="par_id541545830604094" localize="false">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>
<listitem>
<paragraph role="listitem" id="par_id3158441" xml-lang="en-US">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>
<listitem>
<paragraph role="listitem" id="par_id3150994" xml-lang="en-US">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,</paragraph>
<paragraph role="smathcode" id="par_id501545831523103" localize="false">a + size *2 (b * size -8 c_1)^2</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3154196" xml-lang="en-US">"color ..." and "font ..." as well as "size n" (n is a decimal) replace any preceding operations of the same type</paragraph>
<paragraph role="paragraph" id="par_id3154136" xml-lang="en-US">for "size +n", "size -n", "size *n", and "size /n" the effects of the operations are combined,</paragraph>
<paragraph role="paragraph" id="par_id3146934" xml-lang="en-US"><input>size *2 size -5 a</input> would be double the starting size minus 5</paragraph>
<paragraph role="smathcode" id="par_id3149297" xml-lang="en-US" localize="false">font sans ( a + font serif b)</paragraph>
<paragraph role="smathcode" id="par_id3155174" xml-lang="en-US" localize="false">size *2 ( a + size /2 b )</paragraph>
<paragraph role="tip" id="par_id3154906" xml-lang="en-US">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 <input>size *</input> and <input>size /</input> (for example, <input>size *1.24 a</input> or <input>size /0.86 a</input>) the proportions remain intact.</paragraph>
<paragraph role="paragraph" id="par_id3147587" xml-lang="en-US">Examples (with a base size of 12 and 50% for indexes):</paragraph>
<paragraph role="paragraph" id="par_id3148734" xml-lang="en-US">Exactly identical proportions with <input>size 18 a_n</input> and <input>size *1.5 a_n</input>.</paragraph>
<paragraph role="paragraph" id="par_id3152766" xml-lang="en-US">This differs in different contexts: <input>x^{size 18 a_n}</input> and <input>x^{size *1.5 a_n}</input></paragraph>
<paragraph role="paragraph" id="par_id3157986" xml-lang="en-US">Examples with <input>size +n</input> for a comparison. They look identical:</paragraph>
<paragraph role="smathcode" id="par_id3158001" xml-lang="en-US" localize="false">a_{size 8 n}</paragraph>
<paragraph role="smathcode" id="par_id3147332" xml-lang="en-US" localize="false">a_{size +2 n}</paragraph>
<paragraph role="smathcode" id="par_id3155143" xml-lang="en-US" localize="false">a_{size *1.333 n}</paragraph>
<paragraph role="paragraph" id="par_id3147129" xml-lang="en-US">The following examples, however, do not look identical:</paragraph>
<paragraph role="smathcode" id="par_id3147073" xml-lang="en-US" localize="false">x^{a_{size 8 n}}</paragraph>
<paragraph role="smathcode" id="par_id3147086" xml-lang="en-US" localize="false">x^{a_{size +2 n}}</paragraph>
<paragraph role="smathcode" id="par_id3154386" xml-lang="en-US" localize="false">x^{a_{size *1.333 n}}</paragraph>
<paragraph role="note" id="par_id3153354" xml-lang="en-US">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>
|