Math – Formula Layouts

Using Brackets in Formulas

The most difficult part in using LibreOffice Math is when writing complicated formulas. This is because LibreOffice Math knows nothing about the order of operations. We need to use brackets in order to state the order of operations explicitly. Consider the example which has been shown in the below given illustration.


Math (143)
Math (144)
Math (145)
Math (146)
Math (147)
Math (148)
Math (149)
Math (150)
Math (151)
Math (152)
Math (153)
Math (154)
Math (155)
Math (156)
Math (157)
Math (158)
Math (159)
Math (160)
Math (161)
Math (162)
Math (163)
Math (164)
Math (165)
Math (166)
Math (167)
Math (168)
Math (169)
Math (170)
Math (171)
Math (172)
Math (173)
Math (174)
Math (175)
Math (176)
Math (177)
Math (178)
Math (179)
Math (180)
Math (181)
Math (182)

Now consider the one shown below:

These two examples make it perfectly clear as to how the order of operations needs to be set using brackets. The use of brackets changes the formula completely.

The brackets belong solely to the layout of the markup code and are not printed. If you wish to print the brackets in the formula, you need to use the commands, ‘lbrace’ and ‘rbrace’. The usage has been shown in the below given illustration.

LibreOffice Math also provides scalable brackets. This means that the brackets grow in size to match the size of the contents. We can use the commands left (and right) to make scalable brackets.

Before using scalable brackets, let us see what happens when properly scaled brackets are not used. For this we need to write a matrix. A matrix has been written in the below given illustration. Rows are separated by two ‘#’s and entries within each row are separated by one ‘#’.

As can be seen, the brackets are not properly scaled. Now when we use the left and right commands, properly scaled brackets will get printed.

One important point which needs to be always considered is that Math expects that for every opening bracket there will be a closing one. If you forget a bracket, Math places an inverted question mark by the corresponding bracket. The inverted question mark disappears when all the brackets are matched. Sometimes forgetting a bracket causes the whole structure of the formula to fall apart.

However, an unpaired bracket is sometimes necessary. In such cases, we have two options. With non-scalable brackets, we need to use a preceding backslash ‘\’ to indicate that the following character should not be regarded as a bracket but as a literal character. So the half-open interval ‘[a;b[’ is represented by ‘\[ a;b \[’.

Scalable brackets can also be unpaired. The same half-open interval is represented by ‘left[ a;b right[’.
For scalable brackets, you can also use the command ‘none’ to replace a non-existent paired bracket.