> 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-cn/latex-cuo-wu/23-misplaced-alignment-tab-character.md).

# 对齐标记字符 & 放置位置不当

当对齐字符“&”使用不正确时，会出现此错误。对齐字符 *&* 用于在特定环境中对齐元素，例如 *矩阵*, *align*, *table* 等。

## 错误的常见原因

**未写 \\&：**

当你想使用与号 *&* 作为正文中的一个字符，例如在标题中，你必须将其写作 `\&`。如果不这样做，你会得到如下所示的错误

```latex
这家公司名为 `Michael & Sons'
```

main.tex，第 5 行

对齐制表符字符 & 的位置不当。

l.5 公司名为 \`Michael & Sons' 我不明白你为什么想在这里使用制表符。如果你只是想要一个与号，解决方法很简单：现在只需输入 \`I\\&'。但如果上方某个右花括号过早结束了前一个对齐，那么你大概还会收到更多错误信息，你可以试着现在输入 \`S'，看看还能挽救什么。\[1

要更正此错误，请将 `&` 更改为 `\&`.

**使用了矩阵宏，而不是 amsmath:matrix：**

在基本的 LaTeX 分发版中，有一个名为 *矩阵*。当你真正想使用的是以下内容时，这通常会被错误地使用： *环境* 由该包提供的 matrix *amsmath* 宏包。如果你忘记加载 amsmath 宏包，只是写

```latex
$$
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{matrix}
$$
```

那么会出现一个 *对齐制表符位置不当* 错误信息。这是因为这不是使用该宏的正确方式 *矩阵* LaTeX 分发版提供的宏。要解决此问题，只需加载 *amsmath* 宏包。

```latex
% 在导言区（\begin{document} 之前）
\usepackage{amsmath}

% 在文档中

$$
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{matrix}
$$
```

![Amsmathmacro.PNG](/files/f0fa6a778bd8e0ff9d5c2d1d65b03649366bfd52)


---

# 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-cn/latex-cuo-wu/23-misplaced-alignment-tab-character.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.
