> 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/da/latex-fejl/22-misplaced-noalign.md).

# Fejlplaceret \\\noalign

Denne fejl vises, når du har brugt **`\hline`** forkert.

## Almindelige årsager

**Brug af \hline uden for en tabel:**

Den **`\hline`** kommandoen kan kun bruges inde i et **`tabular`** miljø. Du kan ikke bruge den til at indsætte vandrette linjer andre steder i dokumenter, såsom på titelsider eller i sidehoveder. Et eksempel på denne fejl er:

```latex
%I din præambel
\title{Om den generelle molekylteori om varme}
\author{A. Einstein}

% I brødteksten i dit dokument
\maketitle

\hline
```

Dette vil generere fejlen vist nedenfor

main.tex, linje 5

Forkert placeret \noalign.

\hline ->\noalign {\ifnum 0=\`}\fi \hrule \\@height \arrayrulewidth \futurelet... l.10 \hline Jeg forventer kun at se \noalign efter \cr i en justering. Fortsæt, og jeg vil ignorere dette tilfælde.

Når du vil indsætte vandrette linjer uden for et tabular-miljø, skal du bruge **`\hrule`**.

**Brug af \hline forkert i en tabel:**

Når man bruger **`\hline`** i en tabel skal hver forekomst undtagen den første være indledt med **`\\`**. Et eksempel på denne fejl er vist nedenfor

```latex
\begin{tabular}{|l|l|} \hline
    Fornavn: & Albert \\ \hline
    Efternavn: & Einstein \hline
\end{tabular}
```

Det første **`\hline`** kommandoen her er fin, da den første **`\hline`** i en tabel behøver ikke at være indledt med **`\\`**. Problemet er vores sidste **`\hline`** som skal være indledt med **`\\`**. Den korrekte måde at skrive denne tabel på er:

```latex
\begin{tabular}{|l|l|} \hline
    Fornavn: & Albert \\ \hline
    Efternavn: & Einstein \\ \hline
\end{tabular}
```

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


---

# 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/da/latex-fejl/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.
