> 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/no/dokumentstruktur/02-table-of-contents.md).

# Innholdsfortegnelse

I et LaTeX-dokument kan innholdsfortegnelsen genereres automatisk og tilpasses en bestemt stil. Denne artikkelen forklarer hvordan

## Innledning

Å lage innholdsfortegnelsen er enkelt, kommandoen `\tableofcontents` gjør jobben. Seksjoner, underseksjoner og kapitler er inkludert i innholdsfortegnelsen. For å legge til oppføringer manuelt, for eksempel når du vil ha en seksjon uten nummer, bruk kommandoen `\addcontentsline` som vist i følgende eksempel:

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{titlesec}
\title{Seksjoner og kapitler}
\author{Gubert Farnsworth}
\date{ }
\begin{document}

\maketitle

\tableofcontents

\section{Innledning}

Dette er den første seksjonen.

\blindtext

\addcontentsline{toc}{section}{Unummerert seksjon}
\section*{Unummerert seksjon}

\blindtext

\section{Andre seksjon}

\blindtext
\end{document}
```

[Åpne dette eksemplet i Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Table+of+contents+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Btitlesec%7D%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BGubert+Farnsworth%7D%0A%5Cdate%7B+%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cmaketitle%0A%0A%5Ctableofcontents%0A%0A%5Csection%7BIntroduction%7D%0A%0AThis+is+the+first+section.%0A%0A%5Cblindtext%0A%0A%5Caddcontentsline%7Btoc%7D%7Bsection%7D%7BUnnumbered+Section%7D%0A%5Csection%2A%7BUnnumbered+Section%7D%0A%0A%5Cblindtext%0A%0A%5Csection%7BSecond+Section%7D%0A%0A%5Cblindtext%0A%5Cend%7Bdocument%7D)

Dette eksemplet gir følgende resultat:

![Eksempel på innholdsfortegnelse laget i LaTeX](/files/6fbc5da43cead431826c7ae40e2adbd5ce2d15df)

## Endre tittelen på innholdsfortegnelsen

Standardtittelen for innholdsfortegnelsen er **Innhold**; den kan endres til det du trenger, som følgende eksempel viser:

```latex
\documentclass{article}
\title{Seksjoner og kapitler}
\author{Gubert Farnsworth}
\date{ }
\renewcommand*\contentsname{Sammendrag}
\begin{document}
\maketitle
\tableofcontents
\section{Innledning}

Dette er den første seksjonen.

Lorem  ipsum  dolor  sit  amet,  consectetuer  adipiscing
elit.   Etiam  lobortisfacilisis sem.  Nullam nec mi et
neque pharetra sollicitudin.  Praesent imperdietmi nec ante.
Donec ullamcorper, felis non sodales...

\addcontentsline{toc}{section}{Unummerert seksjon}
\section*{Unummerert seksjon}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem.  Nullam nec mi et neque pharetra
sollicitudin.  Praesent imperdiet mi necante...

\section{Andre seksjon}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem.  Nullam nec mi et neque pharetra
sollicitudin.  Praesent imperdiet mi necante...
\end{document}
```

[Åpne dette eksemplet i Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=How+to+change+title+of+table+of+contents\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BGubert+Farnsworth%7D%0A%5Cdate%7B+%7D%0A%5Crenewcommand%2A%5Ccontentsname%7BSummary%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Ctableofcontents%0A%5Csection%7BIntroduction%7D%0A+++%0AThis+is+the+first+section.%0A++++++%0ALorem++ipsum++dolor++sit++amet%2C++consectetuer++adipiscing++%0Aelit.+++Etiam++lobortisfacilisis+sem.++Nullam+nec+mi+et+%0Aneque+pharetra+sollicitudin.++Praesent+imperdietmi+nec+ante.+%0ADonec+ullamcorper%2C+felis+non+sodales...%0A+++++++%0A%5Caddcontentsline%7Btoc%7D%7Bsection%7D%7BUnnumbered+Section%7D%0A%5Csection%2A%7BUnnumbered+Section%7D%0A%0ALorem+ipsum+dolor+sit+amet%2C+consectetuer+adipiscing+elit.++%0AEtiam+lobortis+facilisissem.++Nullam+nec+mi+et+neque+pharetra+%0Asollicitudin.++Praesent+imperdiet+mi+necante...%0A%0A%5Csection%7BSecond+Section%7D%0A+++++++%0ALorem+ipsum+dolor+sit+amet%2C+consectetuer+adipiscing+elit.++%0AEtiam+lobortis+facilisissem.++Nullam+nec+mi+et+neque+pharetra+%0Asollicitudin.++Praesent+imperdiet+mi+necante...%0A%5Cend%7Bdocument%7D)

Dette eksemplet gir følgende resultat:

![Endre navn på innholdsfortegnelsen i LaTeX](/files/73bac4451f74790061b70436ecbffca5315a758c)

Linjen `\renewcommand*\contentsname{Sammendrag}` vil skrive "Sammendrag" i stedet for standardverdien. Hvis du bruker pakken *babel* for [støtte for internasjonale språk](/latex/no/sprak/03-international-language-support.md), må den nevnte kommandoen plasseres innenfor klammeparentesene til

```latex
\addto\captionsenglish{ }
```

I stedet for English i `\captionenglish` skriv navnet på språket du har satt i babel.

## Videre lesning

For mer informasjon, se:

* [Opprette et dokument i LaTeX](/latex/no/grunnleggende-latex/01-learn-latex-in-30-minutes.md)
* [Fet skrift, kursiv og understreking](/latex/no/grunnleggende-latex/03-bold-italics-and-underlining.md)
* [Støtte for internasjonale språk](/latex/no/sprak/03-international-language-support.md)
* [Kryssreferanser mellom seksjoner og ligninger](/latex/no/dokumentstruktur/03-cross-referencing-sections-equations-and-floats.md)
* [Indekser](/latex/no/dokumentstruktur/04-indices.md)
* [Ordlister](/latex/no/dokumentstruktur/05-glossaries.md)
* [Håndtering i et stort prosjekt](/latex/no/dokumentstruktur/07-management-in-a-large-project.md)
* [LaTeX-prosjekter med flere filer](/latex/no/dokumentstruktur/08-multi-file-latex-projects.md)
* [Hyperlenker](/latex/no/dokumentstruktur/09-hyperlinks.md)
* [Sidenummerering](/latex/no/formatering/03-page-numbering.md)
* [Ensidige og tosidige dokumenter](/latex/no/formatering/08-single-sided-and-double-sided-documents.md)
* [Flere kolonner](/latex/no/formatering/09-multiple-columns.md)
* [Tellere](/latex/no/formatering/10-counters.md)
* [Skriftstørrelser, skriftfamilier og stiler](/latex/no/skrifter/01-font-sizes-families-and-styles.md)


---

# 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/no/dokumentstruktur/02-table-of-contents.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.
