> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/zh-cn/latex-cuo-wu/06-extra-right.md).

# 多余的 \right

当排版数学公式时，如果使用了 \right 命令但缺少对应的 \left，就会发生此错误。本文讨论了此错误的常见原因以及如何修复它们。

## 对 \left 和 \right 命令的简要介绍

该 `\left` 和 `\right` 这些命令用于排版动态大小的定界符，并且必须在数学内容中一起使用，形式为

$$\verb'\left'\thinspace\textit{delim}*{\thinspace\text{L}}\quad\textit{math expression}\quad \verb'\right'\thinspace\textit{delim}*{\thinspace\text{R}}$$

其中 $$\textit{delim}*{\thinspace\text{L}}$$ 和 $$\textit{delim}*{\thinspace\text{R}}$$ 是用于包围你的 $$\textit{math expression}$$。通常， $$\textit{delim}*{\thinspace\text{L}}$$ 和 $$\textit{delim}*{\thinspace\text{R}}$$ 可以是以下字符之一 `() [] | \| \{ \}` 或者点号“`.`”，它用作“[空定界符](#using-a-blank-delimiter)”。

### 示例

下面是一个使用 `\left` 和 `\right` 来排版完全包住一个分数的括号：

```latex
\[
  \left(\frac{x}{y} \right)
\]
```

这段代码生成 $$\left(\frac{x}{y}\right)$$

如果你不使用 `\left` 和 `\right` 在放置定界符（包括括号）时使用这些命令，那么这些定界符将不会完全包住数学表达式；例如，写成

```latex
\[
  (\frac{x}{y})
\]
```

会生成如下

$$(\frac{x}{y})$$

## 此错误的原因及一些解决方法

### 忘记包含 \left 命令

此错误通常出现在编写 `\right` 命令但忘记包含对应的 `\left`，如下例所示：

```latex
\[
\pi =
( \int_{-\infty}^{+\infty} e^{-x^2} dx \right)
\]
```

[打开此 **会产生错误的** Overleaf 中的示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+demonstrating+a+missing+delimiter\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5B+%0A%5Cpi+%3D+%0A%28+%5Cint_%7B-%5Cinfty%7D%5E%7B%2B%5Cinfty%7D+e%5E%7B-x%5E2%7D+dx+%5Cright%29%0A%5C%5D%0A%5Cend%7Bdocument%7D)

此示例会产生以下错误：

![用于演示 LaTeX 中缺少分隔符的图片](/files/4f2f4f6321b0bee07c8c30d7f6078080f304ee07)

添加缺少的 `\left` 来修复此错误，写成

```latex
\[
\pi =
\left( \int_{-\infty}^{+\infty} e^{-x^2} dx \right)
\]
```

这会产生以下输出

$$\pi = \left( \int\_{-\infty}^{+\infty} e^{-x^2} dx \right)$$

### 使用空分隔符

如果你想排版一个 `\right` 仅分隔符，请使用 ‘`.`’ 字符作为 `\left` 定界符，写成 `\left.`，它不会排版出分隔符字符。以下示例使用了一个 `.` 在一个 `对齐` 由 `amsmath` 宏包的示例代码：

```latex
\documentclass{article}
\usepackage{amsmath} % Required to use the aligned environment

\begin{document}
\[
 \left.\begin{aligned}
        dF &= 0,\\
        d^{\dagger} F &= 0,
       \end{aligned}
\ \right\}
 \qquad \text{Maxwell's equations}
\]
\end{document}
```

[在 Overleaf 中打开此示例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Using+the+dot+delimiter\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D+%25+Required+to+use+the+aligned+environment%0A%0A%5Cbegin%7Bdocument%7D%0A%5C%5B%0A+%5Cleft.%5Cbegin%7Baligned%7D%0A++++++++dF+%26%3D+0%2C%5C%5C%0A++++++++d%5E%7B%5Cdagger%7D+F+%26%3D+0%2C%0A+++++++%5Cend%7Baligned%7D%0A%5C+%5Cright%5C%7D%0A+%5Cqquad+%5Ctext%7BMaxwell%27s+equations%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

此示例排版出以下表达式：

$$\left.\begin{aligned} dF &= 0,\d^{\dagger} F &= 0,\end{aligned}\ \right}\qquad \text{Maxwell's equations}$$


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/zh-cn/latex-cuo-wu/06-extra-right.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
