Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\documentclass[12pt,a4paper]{scrartcl}
\usepackage{ngerman}
\usepackage[latin1]{inputenc}
\usepackage{hyperref}
\usepackage{graphicx}
\title{Rechtevergabe Testdokument}
\author{Test1}
\begin{document}
\maketitle
\newpage
\tableofcontents
\newpage
\addcontentsline{toc}{section}{Bereich A}
\addcontentsline{toc}{subsection}{Kapitel I}
\addcontentsline{toc}{subsection}{Kapitel II}
\addcontentsline{toc}{section}{Bereich B}
\end{document}

Gives me no TOC at all (after running pdflatex twice). Moving \addcontentsline to before \tableofcontents and removing \newpage did no change. I intend to obtain a document with TOC only. Thank you.

share|improve this question
add comment

1 Answer 1

The \addcontentsline commands are written at \shipout. But your page is empty. Removing the \newpage after \tableofcontents should work (it does for me) or put something on the page with the \addcontentsline commands, e.g. \newpage\mbox{}.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.