Large brackets in LaTeX (left, right, big)
\left( and \right) make a pair of brackets as tall as the formula between them. They work with every delimiter, for example [ ], \{ \}, | | and \langle \rangle. \big, \Big, \bigg and \Bigg set four fixed sizes.
Preamble
The snippets on this page need these lines before \begin{document}:
\usepackage{mathtools}Brackets that grow with the content
Every \left needs a \right in the same formula. The two delimiters need not be of the same kind: \left[ 0, 1 \right) is allowed. Braces are written \{ and \}.
\[
\left( \frac{a}{b} \right)^2
\qquad
\left[ \sum_{i=1}^{n} x_i \right]
\qquad
\left\{ \frac{1}{n} \right\}
\qquad
\left\langle \frac{a}{b}, c \right\rangle
\]Change the formula
The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.
A bracket on one side only
A dot in place of the delimiter makes an invisible partner: \left. pairs with \right|, and \left\{ pairs with \right..
\[
\left. \frac{df}{dx} \right|_{x=0}
\]Change the formula
The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.
A scaled line in the middle
\middle| between \left and \right scales the bar to the same height as the outer brackets. It adds no space of its own, so put \, on both sides.
\[
\left\{ x \in M \,\middle|\, \frac{x}{2} > 1 \right\}
\]Change the formula
The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.
Fixed sizes
\bigl, \Bigl, \biggl and \Biggl open a bracket in four growing sizes; the versions ending in r close it, and \bigm| sets a bar in the middle. Use them when \left and \right pick a size that is too large, for example around a sum with limits, or for nested brackets of the same height.
\[
\Biggl( \biggl( \Bigl( \bigl( x \bigr) \Bigr) \biggr) \Biggr)
\qquad
\bigl( f(x) + g(x) \bigr)^2
\]Change the formula
The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.
Define a bracket command
\DeclarePairedDelimiter{\name}{left}{right} from mathtools defines a command with three forms: \name{...} uses the normal size, \name*{...} uses \left and \right, and \name[\big]{...} uses a fixed size.
Complete document:
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\paren}{(}{)}
\DeclarePairedDelimiter{\set}{\{}{\}}
\begin{document}
\[
\paren{x}
\qquad
\paren*{\frac{a}{b}}
\qquad
\set[\big]{1, 2, 3}
\]
\end{document}Pitfalls
- In
alignand similar environments,\leftand\righthave to stand in the same line and on the same side of every&. A\\or&between them stops with Extra \right or Missing \right. inserted. End the first line with\right.and start the next one with\left., or use fixed sizes. \left{stops with Missing delimiter (. inserted). A brace as a delimiter is\left\{.\leftand\rightadd space around the bracketed part:\sin\left(x\right)is wider than\sin(x). Around content of normal height write plain brackets.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- Error Extra \right
- Error Missing \right. inserted
- Error Missing delimiter (. inserted)
- Package
mathtools - How-to Absolute value and norm in LaTeX