跳到主要内容

Brackets and Parentheses

介绍

括号和括号在数学公式中非常常见。您可以在LATEX中轻松控制括号的大小和样式;本文解释了如何操作。

以下是LATEX中使用的一些常见数学大括号和括号的列表:

Some examples The size of brackets and parentheses can be manually set, or they can be resized dynamically in your document, as shown in the next example:

[ F = G \left( \frac{m_1 m_2}{r^2} \right) ] Open this LaTeX fragment in Overleaf

The above example produces the following output:

F=G(m1m2r2) Notice that to insert the parentheses or brackets, the \left and \right commands are used. Even if you are using only one bracket, both commands are mandatory. \left and \right can dynamically adjust the size, as shown by the next example:

[ \left[ \frac{ N } { \left( \frac{L}{p} \right) - (m+n) } \right] ] Open this LaTeX fragment in Overleaf

The above example produces the following output:

⎡⎣⎢N(Lp)−(m+n)⎤⎦⎥

When writing multi-line equations with the align, align* or aligned environments, the \left and \right commands must be balanced on each line and on the same side of &. Therefore the following code snippet will fail with errors:

\begin{align*} y = 1 + & \left( \frac1{x} + \frac1{x^2} + \frac1{x^3} + \ldots \ & \quad + \frac1{x^{n-1}} + \frac1{x^n} \right) \end{align*} Open this LaTeX fragment in Overleaf (with errors)

The solution is to use "invisible" brackets to balance things out, i.e. adding a \right. at the end of the first line, and a \left. at the start of the second line after &:

\begin{align*} y = 1 + & \left( \frac1{x} + \frac1{x^2} + \frac1{x^3} + \ldots \right. \ &\left. \quad + \frac1{x^{n-1}} + \frac1{x^n} \right) \end{align*} Open this LaTeX fragment in Overleaf

The above example produces the following output:

Paren-ex03.png

Controlling types and sizes The size of the brackets can be controlled explicitly, as shown in this LaTeX code fragment:

[ \Biggl \langle 3x+7 \biggr \rangle ] Open this LaTeX fragment in Overleaf

The above example produces the following output:

⟨3x+7⟩ ⟨ 3 x + 7 ⟩

The commands \Biggl and \biggr establish the size of the delimiters < and > respectively, with the l or r indicating whether it's the left or the right parenthesis. For a complete list of parentheses and sizes see the reference guide.

Reference guide LATEX markup Renders as \bigl( \Bigl( \biggl( \Biggl( {\displaystyle {\big (}{\Big (}{\bigg (}{\Bigg (}} \bigr] \Bigr] \biggr] \Biggr] {\displaystyle {\big ]}{\Big ]}{\bigg ]}{\Bigg ]}} \bigl{ \Bigl{ \biggl{ \Biggl{ {\displaystyle {\big {}{\Big {}{\bigg {}{\Bigg {}} \bigl \langle \Bigl \langle \biggl \langle \Biggl \langle {\displaystyle {\big \langle }{\Big \langle }{\bigg \langle }{\Bigg \langle }} \bigr \rangle \Bigr \rangle \biggr \rangle \Biggr \rangle {\displaystyle {\big \rangle }{\Big \rangle }{\bigg \rangle }{\Bigg \rangle }} \big| \Big| \bigg| \Bigg| ∣∣∣∣∣∣∣∣∣∣ | | | | \big| \Big| \bigg| \Bigg| ∥∥∥∥∥∥∥∥∥∥ ‖ ‖ ‖ ‖ \bigl \lceil \Bigl \lceil \biggl \lceil \Biggl \lceil ⌈⌈⌈⌈ ⌈ ⌈ ⌈ ⌈ \bigr \rceil \Bigr \rceil \biggr \rceil \Biggr \rceil ⌉⌉⌉⌉ ⌉ ⌉ ⌉ ⌉ \bigl \lfloor \Bigl \lfloor \biggl \lfloor \Biggl \lfloor ⌊⌊⌊⌊ ⌊ ⌊ ⌊ ⌊ \bigr \rfloor \Bigr \rfloor \biggr \rfloor \Biggr \rfloor ⌋⌋⌋⌋ ⌋ ⌋ ⌋ ⌋ Further reading Mathematical expressions Subscripts and superscripts Aligning equations with amsmath Display style in math mode Operators The not so short introduction to LATEX2ε