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

# Fejlplaceret justeringstabulatortegn &

Denne fejl vises, når justeringstegnet '&' bruges forkert. Justeringstegnet *&* bruges til at justere elementer i bestemte miljøer, såsom *matrix*, *align*, *tabel* osv.

## Almindelige årsager til fejlen

**Ikke at skrive \\&:**

Når du vil bruge et og-tegn *&* som et teksttegn i din tekst, f.eks. i en titel, skal du skrive det som `\&`. Hvis du ikke gør det, får du en fejl som vist nedenfor

```latex
Virksomheden hedder `Michael & Sons'
```

main.tex, linje 5

Forkert placeret justeringstegnsfane &.

l.5 Virksomheden hedder \`Michael & Sons' Jeg kan ikke se, hvorfor du skulle ville bruge et tabulatortegn her. Hvis du bare vil have et og-tegn, er løsningen enkel: Skriv bare \`I\\&' nu. Men hvis en højre klamme et sted ovenfor har afsluttet en tidligere justering for tidligt, står du sandsynligvis over for flere fejlmeddelelser, og du kan prøve at skrive \`S' nu bare for at se, hvad der kan reddes. \[1

For at rette denne fejl skal du ændre `&` til `\&`.

**Matrix-makro brugt i stedet for amsmath:matrix:**

I den grundlæggende LaTeX-distribution findes der en makro ved navn *matrix*. Denne bruges ofte forkert, når det, du egentlig vil bruge, er den *miljø* matrix, som leveres af *amsmath* pakken. Hvis du glemmer at indlæse amsmath-pakken og blot skriver

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

så vil en *forkert placeret justeringsfane* fejlmeddelelse vises. Dette skyldes, at dette ikke er den korrekte måde at bruge *matrix* makro, som leveres af LaTeX-distributionen. For at løse dette problem skal du blot indlæse *amsmath* pakken.

```latex
% I din præambel (før \begin{document})
\usepackage{amsmath}

% I dit dokument

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

![Amsmathmacro.PNG](/files/562e2b6c94504de7b4ef3779ca318b3166631801)


---

# 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/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.
