> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/latex/zh-tw/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/59bec1354feb5769e7916179047052ff8e24be55)

加入缺少的 `\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.`，它不會排版出定界符字元。以下範例使用 `.` 一個環境中的定界符 `aligned` 環境中，該環境由 `amsmath` 套件中可用的顏色與粗細參數：

```latex
\documentclass{article}
\usepackage{amsmath} % 使用 aligned 環境所需

\begin{document}
\[
 \left.\begin{aligned}
        dF &= 0,\\
        d^{\dagger} F &= 0,
       \end{aligned}
\ \right\}
 \qquad \text{麥克斯威方程組}
\]
\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://overleaf-pro.ayaka.space/latex/zh-tw/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.
