> 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/geng-duo-zhu-ti/09-commands-and-environments.md).

# 指令與環境

## 命令

LaTeX 文件的行為可以透過使用特定指令來控制。典型的指令結構如下：

```
\commandname[optional argument]{main argument}
```

請注意，所有指令 **必須** 都必須以反斜線開頭，而主要參數必須包含在 {..} 括號對中。

有些指令有不只一個參數，例如：

```
\multicolumn{number of columns joined}{alignment}{content}
```

有些指令不需要 {} 括號對也能正常運作，例如：

```
\item 項目內容文字
```

有些指令有可選參數，例如：

```
\item[--] 項目內容文字
\\[2ex]
```

## 環境

一種特殊類型的指令是環境。典型的環境結構如下：

```
\begin{environmentname}
 內容
\end{environmentname}
```

例如：

```latex
\begin{center}
範例文字
\end{center}
```

或

```latex
\begin{enumerate}
\item 第一點
\item 第二點
\end{enumerate}
```

請注意，所有環境 **必須** 都以 \begin{environmentname} 開始，並以 \end{environmentname} 結束。

有些環境像指令一樣，也會接受參數與可選參數。例如

```latex
\begin{tabular}[table position]{column specifications}
 表格內容
\end{tabular}
```


---

# 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/geng-duo-zhu-ti/09-commands-and-environments.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.
