> 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/opmaak/06-text-alignment.md).

# Tekstuitlijning

## Inleiding

Standaard zet LaTeX tekst volledig uitgevuld, maar soms kan links uitgelijnde tekst of "ragged right"-tekst (voor talen van rechts naar links) geschikter zijn—zoals tekst in smalle kolommen. Dit artikel legt uit hoe u de tekstuitlijning voor delen van, of het hele, document kunt wijzigen met behulp van de ingebouwde functies van LaTeX en het pakket `ragged2e`.

## De standaard LaTeX-commando's en -omgevingen

LaTeX heeft wel ingebouwde commando's om de uitlijning van tekst te wijzigen:

* links uitgelijnd (`\raggedright`)
* rechts uitgelijnd (`\raggedleft`)
* gecentreerd (`\centering`)

samen met de bijbehorende omgevingen:

* links uitgelijnd (`flushleft` omgeving)
* rechts uitgelijnd (`flushright` omgeving)
* gecentreerd (`centering` omgeving)

Echter, de [`ragged2e` pakket](https://ctan.org/pkg/ragged2e?lang=en) biedt enkele verfijningen die deze standaard LaTeX-commando's en -omgevingen verbeteren.

## Het pakket ragged2e gebruiken

Om te beginnen is hier een voorbeeld met het `ragged2e` pakket en de `[document]` optie om de *volledige documenttekst* als links uitgelijnde tekst (links uitgelijnd). De voorbeeldcode voegt de regel

```latex
\usepackage[document]{ragged2e}
```

toe aan de documentpreambule:

```latex
\documentclass{article}
\usepackage[document]{ragged2e}

\begin{document}
\section{Kop op niveau 1 (sectie)}
Hallo, hier is wat tekst zonder betekenis. Deze tekst moet laten zien hoe een gedrukte tekst er op deze plaats uit zal zien. Als u deze tekst leest, krijgt u geen informatie. Echt? Is er dan geen informatie? Is er een verschil tussen deze tekst en wat onzin zoals absoluut niet! Een blinde tekst zoals deze geeft u informatie over het gekozen lettertype, hoe de letters worden geschreven en een indruk van de uitstraling.
\end{document}
```

[Open dit `ragged2e` voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+using+ragged2e+package\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bdocument%5D%7Bragged2e%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BHeading+on+Level+1+%28section%29%7D%0AHello%2C+here+is+some+text+without+a+meaning.+This+text+should+show+what+a+printed+text+will+look+like+at+this+place.++If+you+read+this+text%2C+you+will+get+no+information.++Really%3F++Is+there+no+information%3F++Is+there+a+difference+between+this+text+and+some+nonsense+like+not+at+all%21++A+blind+text+like+this+gives+you+information+about+the+selected+font%2C+how+the+letters+are+written+and+an+impression+of+the+look.%0A%5Cend%7Bdocument%7D)

Dit voorbeeld levert de volgende uitvoer op:

![Ragged2eOLV21.png](/files/3a623db9e3968b0e97c026a8b4239456e0664a28)

## Vergelijking van \raggedright (LaTeX) versus \RaggedRight (ragged2e)

De LaTeX-opdracht `\raggedright` levert soms resultaten op die "te rafelig" lijken. Het pakket `ragged2e` pakt dit probleem aan door woordafbreking toe te staan wanneer een regel te kort is, waardoor een gelijkmatigere rafelige tekstrand ontstaat. Het volgende voorbeeld toont links uitgelijnde tekst die is gemaakt via het LaTeX-commando `\raggedright` en, ter vergelijking, dezelfde tekst gezet met het `\RaggedRight` commando dat wordt geleverd door `ragged2e`:

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{blindtext}

\begin{document}
\setlength{\hsize}{0.9\hsize}% effecten benadrukken

\subsection*{Links uitgelijnd voorbeeld met
\texttt{\string\raggedright}\\ (standaard \LaTeX{}-commando)}
\raggedright\blindtext[2]\par

\subsection*{Links uitgelijnd voorbeeld met \texttt{\string\RaggedRight}\\ (\texttt{ragged2e}-commando)}
\RaggedRight\blindtext[2]\par
\end{document}
```

[Open dit voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+left-aligned+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bragged2e%7D%0A%5Cusepackage%7Bblindtext%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Chsize%7D%7B0.9%5Chsize%7D%25+emphasize+effects%0A%0A%5Csubsection%2A%7BLeft-aligned+example+with+%0A%5Ctexttt%7B%5Cstring%5Craggedright%7D%5C%5C+%28standard+%5CLaTeX%7B%7D+command%29%7D%0A%5Craggedright%5Cblindtext%5B2%5D%5Cpar%0A%0A%5Csubsection%2A%7BLeft-aligned+example+with+%5Ctexttt%7B%5Cstring%5CRaggedRight%7D%5C%5C+%28%5Ctexttt%7Bragged2e%7D+command%29%7D%0A%5CRaggedRight%5Cblindtext%5B2%5D%5Cpar+%0A%5Cend%7Bdocument%7D)

![Leftaligncompare2.png](/files/35f0749440c70e8c4a1d2303da548c87b39c8e92)

Zoals besproken in de `ragged2e` [pakkettendocumentatie](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/ragged2e/ragged2e.pdf), `ragged2e` biedt alternatieve commando's en omgevingen om de tekstuitlijning te wijzigen, en we bekijken er enkele van.

## Omgevingen voor links uitgelijnde tekst (met een rafelige rechterrand)

De standaard LaTeX-omgeving voor het produceren van links uitgelijnde tekst is `flushleft`. Het equivalent in `ragged2e` heet `FlushLeft` (let op de hoofdletters). Het volgende voorbeeld vergelijkt de uitvoer van die omgevingen:

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{blindtext}
\begin{document}
\setlength{\hsize}{0.9\hsize}% effecten benadrukken

\subsection*{\texttt{flushleft}-omgeving: (standaard \LaTeX{})}

\begin{flushleft}
\blindtext[1]
\end{flushleft}

\subsection*{\texttt{FlushLeft}-omgeving: (\texttt{ragged2e})}

\begin{FlushLeft}
\blindtext[1]
\end{FlushLeft}

\end{document}
```

[Open dit voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+left-aligned+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bragged2e%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Chsize%7D%7B0.9%5Chsize%7D%25+emphasize+effects%0A%0A%5Csubsection%2A%7B%5Ctexttt%7Bflushleft%7D+environment%3A+%28standard+%5CLaTeX%7B%7D%29%7D%0A%0A%5Cbegin%7Bflushleft%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7Bflushleft%7D%0A%0A%5Csubsection%2A%7B%5Ctexttt%7BFlushLeft%7D+environment%3A+%28%5Ctexttt%7Bragged2e%7D%29%7D%0A%0A%5Cbegin%7BFlushLeft%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7BFlushLeft%7D%0A%0A%5Cend%7Bdocument%7D)

![Flcompare.png](/files/66d50779c5fb7e3f81371a1edda788c32b04eb32)

## Omgevingen voor rechts uitgelijnde tekst (met een rafelige linkerrand)

De standaard LaTeX-omgeving voor het produceren van rechts uitgelijnde tekst is `flushright`. Het equivalent in `ragged2e` heet `FlushRight` (let op de hoofdletters). Het volgende voorbeeld vergelijkt de uitvoer van die omgevingen:

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{blindtext}
\begin{document}
\setlength{\hsize}{0.9\hsize}% effecten benadrukken

\subsection*{\texttt{flushright}-omgeving: (standaard \LaTeX{})}

\begin{flushright}
\blindtext[1]
\end{flushright}

\subsection*{\texttt{FlushRight}-omgeving: (\texttt{ragged2e})}

\begin{FlushRight}
\blindtext[1]
\end{FlushRight}

\end{document}
```

[Open dit voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+right-aligned+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bragged2e%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Chsize%7D%7B0.9%5Chsize%7D%25+emphasize+effects%0A%0A%5Csubsection%2A%7B%5Ctexttt%7Bflushright%7D+environment%3A+%28standard+%5CLaTeX%7B%7D%29%7D%0A%0A%5Cbegin%7Bflushright%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7Bflushright%7D%0A%0A%5Csubsection%2A%7B%5Ctexttt%7BFlushRight%7D+environment%3A+%28%5Ctexttt%7Bragged2e%7D%29%7D%0A%0A%5Cbegin%7BFlushRight%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7BFlushRight%7D%0A%0A%5Cend%7Bdocument%7D)

![FRcompare.png](/files/ff833dee583c3643fee93ead9dba992b501f8690)

## Omgevingen om tekst te centreren

De standaard LaTeX-omgeving voor het produceren van gecentreerde tekst is `center`. Het equivalent in `ragged2e` heet `Center` (let op de hoofdletters). Het volgende voorbeeld vergelijkt de uitvoer van die omgevingen:

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{blindtext}
\begin{document}
\setlength{\hsize}{0.9\hsize}% effecten benadrukken

\subsection*{\texttt{center}-omgeving: (standaard \LaTeX{})}

\begin{center}
\blindtext[1]
\end{center}

\subsection*{\texttt{Center}-omgeving: (\texttt{ragged2e})}
\begin{Center}
\blindtext[1]
\end{Center}
\end{document}
```

[Open dit voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+right-aligned+text\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bragged2e%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Chsize%7D%7B0.9%5Chsize%7D%25+emphasize+effects%0A%0A%5Csubsection%2A%7B%5Ctexttt%7Bcenter%7D+environment%3A+%28standard+%5CLaTeX%7B%7D%29%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7Bcenter%7D%0A%0A%5Csubsection%2A%7B%5Ctexttt%7BCenter%7D+environment%3A+%28%5Ctexttt%7Bragged2e%7D%29%7D%0A%5Cbegin%7BCenter%7D%0A%5Cblindtext%5B1%5D%0A%5Cend%7BCenter%7D%0A%5Cend%7Bdocument%7D)

![Centrecompare.png](/files/2a404aa2055f2397324fd22663ac7b44c56f27e1)

## Volledig uitgevulde tekst

Het pakket `ragged2e` biedt het commando `\justifying` dat u kunt gebruiken zoals hieronder in het voorbeeld wordt getoond:

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{blindtext}
\begin{document}
\setlength{\hsize}{0.9\hsize}% effecten benadrukken

\Centering
\blindtext[1]

\vspace{5mm}
\justifying
\blindtext[1]
\end{document}
```

[Open dit voorbeeld in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Demonstrating+justification+with+ragged2e\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bragged2e%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csetlength%7B%5Chsize%7D%7B0.9%5Chsize%7D%25+emphasize+effects%0A%0A%5CCentering%0A%5Cblindtext%5B1%5D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cjustifying%0A%5Cblindtext%5B1%5D+%0A%5Cend%7Bdocument%7D)

![Justifyingdemo.png](/files/80a9f2b352c038ee013288cbb2f691d79cc59c5f)

## Naslaggids

**Samenvatting van omgevingen en commando's voor tekstuitlijning**

| Uitlijning         | Omgeving     | Schakelcommando | ragged2e-omgeving | ragged2e-schakelcommando |
| ------------------ | ------------ | --------------- | ----------------- | ------------------------ |
| Links              | `flushleft`  | `\raggedright`  | `FlushLeft`       | `\RaggedRight`           |
| Rechts             | `flushright` | `\raggedleft`   | `FlushRight`      | `\RaggedLeft`            |
| Gecentreerd        | `center`     | `\centering`    | `Center`          | `\Centering`             |
| Volledig uitgevuld |              |                 | `justify`         | `\justifying`            |

## Verder lezen

Voor meer informatie zie :

* [Alinea's en nieuwe regels](/latex/nl/latex-basis/02-paragraphs-and-new-lines.md)
* [Alinea-opmaak](/latex/nl/opmaak/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Vet, cursief en onderstrepen](/latex/nl/latex-basis/03-bold-italics-and-underlining.md)
* [Lettergroottes, lettertypen en stijlen](/latex/nl/lettertypen/01-font-sizes-families-and-styles.md)
* [Lettertypen](/latex/nl/lettertypen/02-font-typefaces.md)
* [Ondersteuning voor moderne lettertypen met XeLaTeX](/latex/nl/lettertypen/03-xelatex.md)
* [Regeleinden en witruimte](/latex/nl/opmaak/05-line-breaks-and-blank-spaces.md)
* [Lijsten](/latex/nl/latex-basis/04-lists.md)
* [Secties en hoofdstukken](/latex/nl/documentstructuur/01-sections-and-chapters.md)
* [Meerdere kolommen](/latex/nl/opmaak/09-multiple-columns.md)
* [Enkelzijdige en dubbelzijdige documenten](/latex/nl/opmaak/08-single-sided-and-double-sided-documents.md)
* [De niet zo korte introductie tot LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/)
* [De documentatie van het pakket ragged2e](http://mirror.hmc.edu/ctan/macros/latex/contrib/ms/ragged2e.pdf)


---

# 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/opmaak/06-text-alignment.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.
