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

# 位置错误的对齐制表符字符 &

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

## 错误的常见原因

**未写 \\&：**

当你想在写作中把与号 *&* 当作文本字符使用时，例如在标题中，你必须写成 `\&`。如果你不这样做，就会出现如下所示的错误

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

main.tex，第 5 行

对齐制表符字符 & 位置错误。

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

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

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

在基本的 LaTeX 发行版中，有一个名为 *矩阵* 的宏。这通常会被错误地使用，而你真正想使用的是 *环境* 由 *amsmath* 包提供的

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

那么就会出现一个 *对齐制表符位置错误* 错误信息。这是因为这并不是使用 *矩阵* 宏的正确方式。为了解决这个问题，只需加载 *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://ayakaleaf-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.
