> 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/nl/latex-fouten/16-latex-error-missing-begin-document.md).

# LaTeX-fout: ontbrekende \begin document

Deze fout verschijnt wanneer u bent vergeten op te nemen **`\begin{document}`** in uw document. Het kan ook verschijnen als u niet hebt geschreven **`\documentclass[...]{...}`** aan het begin van uw hoofddocument.

## Veelvoorkomende oorzaken

**Vergeten om \begin{document} op te nemen:**

De meest fundamentele oorzaak van deze fout treedt op wanneer u bent vergeten te schrijven **`\begin{document}`** na de preambule in uw hoofddocument. Als u deze fout maakt, krijgt u de foutmelding hieronder:

main.tex, regel 5

LaTeX-fout: ontbrekende \begin{document}.

Raadpleeg de LaTeX-handleiding of LaTeX Companion voor uitleg. Typ H voor onmiddellijke hulp. ... U hebt hier een probleem. Probeer iets te typen om door te gaan. Als dat niet werkt, typ X om af te sluiten.

Om deze fout op te lossen, moet u er gewoon voor zorgen dat u **`\begin{document}`** na de preambule in uw hoofddocument hebt opgenomen. Zie [hier](/latex/nl/latex-basis/01-learn-latex-in-30-minutes.md) om meer te leren over hoe u documenten in LaTeX structureert.

**\documentclass\[...]{...} op de verkeerde plaats:**

Een andere veelvoorkomende oorzaak van deze fout is als **`\documentclass[...]{...}`** op de verkeerde plaats is geschreven. Dit moet aan het begin van het hoofddocument worden geschreven. Als u een apart bestand voor uw preambule hebt, kunt u **niet** opnemen **`\documentclass[...]{...}`** in dat bestand. Het moet nog steeds bovenaan het hoofdbestand van het project verschijnen, anders wordt alleen het bestand met de preambule gecompileerd.

**Hoofddocument onjuist ingesteld:**

Deze fout kan ook verschijnen als u het hoofddocument onjuist hebt ingesteld in het menu aan de linkerkant. Dit kan gebeuren als **`\documentclass[...]{...}`** op de verkeerde plaats is geschreven, dus u moet dit eerst corrigeren indien nodig. Om de keuze van het hoofddocument te wijzigen, opent u het menu aan de linkerkant:

![Lefthandmenu.PNG](/files/62d2d6986770810ab2235dec28499285017952ea)

en ga naar het *Hoofddocument* keuzemenu:

![Maindocument.PNG](/files/ceb2e7f0290b26d1a6cd676e8e98e73fc5eb31c2)


---

# 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/nl/latex-fouten/16-latex-error-missing-begin-document.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.
