askvity

How to Make Brackets in LaTeX?

Published in LaTeX Brackets 2 mins read

In LaTeX, creating brackets is straightforward, and there are several options depending on your needs. Here’s a comprehensive guide:

Basic Brackets and Parentheses

You can use ordinary keyboard symbols for the most common types:

  • Parentheses: ( ) are created simply by typing (2 + 3) which will render as (2 + 3).
  • Brackets (Square Brackets): [ ] are generated by typing [3 + 7] which results in [3 + 7].

Curly Braces

Curly braces are special characters in LaTeX and need to be escaped:

  • Curly Braces: To create { and }, use \{ and \} respectively. For example, \{a, b, c\} will output {a, b, c}.

Important Note on Scaling

The basic symbols for parentheses, brackets, and curly braces do not automatically adjust their size to match the content they contain. This means that they may look too small when used with larger expressions or fractions.

Scaling Brackets with \left and \right

To ensure that the brackets scale appropriately with the content they enclose, use the commands \left and \right:

  • Usage: Place \left before the opening bracket or brace, and \right before the closing bracket or brace.
    • For example, \left( \frac{x}{y} \right) will produce a parenthesis that scales with the fraction.
    • Similarly, \left[ \sum_{i=1}^{n} i \right] will scale square brackets.
    • And \left\{ x, y, z \right\} will scale curly braces.
  • Matching: Every \left command must have a corresponding \right command. If you need only one bracket (e.g., in a piecewise function), use a period (.) as a placeholder. For example, \left. \frac{1}{x} \right] will only show the right square bracket.

Summary Table

Bracket Type LaTeX Code Output Scalable
Parentheses ( ) ( ) No
Brackets [ ] [ ] No
Curly Braces \{ \} { } No
Scaled Parens \left( \right) ( ) Yes
Scaled Brackets \left[ \right] [ ] Yes
Scaled Curly Braces \left\{ \right\} { } Yes

Practical Insights

  • Using \left and \right is highly recommended for visually consistent and professional-looking documents, especially when working with complex mathematical formulas.
  • Remember that you can use \left and \right with any of the bracket types (( ), [ ], and \{ \}).
  • Always ensure the \left and \right pairs are correctly matched to avoid errors.

Related Articles