> 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/ja/latexer/22-misplaced-noalign.md).

# \noalignの位置が不適切です

このエラーは、次を使用したときに表示されます **`\hline`** 誤って。

## よくある原因

**表の外で \hline を使用する:**

その **`\hline`** コマンドは、 **`tabular`** 環境内でのみ使用できます。タイトルページやページヘッダーなど、文書の他の場所に水平線を入れるためには使用できません。この誤りの例は次のとおりです:

```latex
%プリアンブル内で
\title{On the General Molecular Theory of Heat}
\author{A. Einstein}

% 文書本文内で
\maketitle

\hline
```

これにより、以下に示すエラーが生成されます

main.tex, 5行目

不適切な位置の \noalign。

\hline ->\noalign {\ifnum 0=\`}\fi \hrule \\@height \arrayrulewidth \futurelet... l.10 \hline 整列の \cr の後にのみ \noalign が現れるはずです。続けてください。この場合は無視します。

表外で水平線を入れたい場合は、 **`\hrule`**.

**表内で \hline を誤って使用する:**

を使うときは **`\hline`** 表では、最初のものを除くすべての箇所の前に **`\\`**&#x3092;付ける必要があります。以下にこのエラーの例を示します

```latex
\begin{tabular}{|l|l|} \hline
    名: & アルベルト \\ \hline
    2番目の名前: & アインシュタイン \hline
\end{tabular}
```

最初の **`\hline`** ここでのコマンドは問題ありません。最初の **`\hline`** 表内では前に **`\\`**。問題は最後の **`\hline`** には前に **`\\`**。この表の正しい書き方は次のとおりです:

```latex
\begin{tabular}{|l|l|} \hline
    名: & アルベルト \\ \hline
    2番目の名前: & アインシュタイン \\ \hline
\end{tabular}
```

![Table.PNG](/files/ca1525c40d5fad3b2d7ffe73eba62b6a05d7b476)


---

# 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/ja/latexer/22-misplaced-noalign.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.
