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

# Felplacerad \noalign

Detta fel visas när du har använt **`\hline`** på fel sätt.

## Vanliga orsaker

**Användning av \hline utanför en tabell:**

Den **`\hline`** kommandot kan endast användas inom en **`tabular`** miljö. Du kan inte använda det för att infoga horisontella linjer någon annanstans i dokument, till exempel på titelsidor eller i sidhuvuden. Ett exempel på detta misstag är:

```latex
%I din preambel
\title{Om den allmänna molekylära teorin om värme}
\author{A. Einstein}

% I brödtexten i ditt dokument
\maketitle

\hline
```

Detta kommer att generera felet som visas nedan

main.tex, rad 5

Felplacerad \noalign.

\hline ->\noalign {\ifnum 0=\`}\fi \hrule \\@height \arrayrulewidth \futurelet... l.10 \hline Jag förväntar mig att se \noalign endast efter \cr i en uppradning. Fortsätt, så kommer jag att ignorera detta fall.

När du vill inkludera horisontella linjer utanför en tabular-miljö måste du använda **`\hrule`**.

**Felaktig användning av \hline i en tabell:**

När du använder **`\hline`** i en tabell måste varje förekomst utom den första föregås av **`\\`**. Ett exempel på detta fel visas nedan

```latex
\begin{tabular}{|l|l|} \hline
    Förnamn: & Albert \\ \hline
    Andra namn: & Einstein \hline
\end{tabular}
```

Det första **`\hline`** kommandot här är okej, eftersom det första **`\hline`** i en tabell inte behöver föregås av **`\\`**. Problemet är vår sista **`\hline`** som faktiskt behöver föregås av **`\\`**. Det korrekta sättet att skriva denna tabell är:

```latex
\begin{tabular}{|l|l|} \hline
    Förnamn: & Albert \\ \hline
    Andra namn: & Einstein \\ \hline
\end{tabular}
```

![Table.PNG](/files/841e9167e544b21cfb530bc89e0eb4679ea9402a)


---

# 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/sv/latex-fel/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.
