1

After I inserted titletoc and changed the Table of Contents the ToC ends after the first page is full. Before I added these settings it started a new page automatically.

This is how my Table of Contents looks: enter image description here As you can see the table is cut off during 8.3 and is not continued on the next page.

This is my code:

\documentclass[fontsize=9pt, BCOR=5mm, ngerman, paper=a4]{scrreprt}
%+------------------------------------------------------------------------------+
%| packages einbinden                                                             |
%+------------------------------------------------------------------------------+

\usepackage[ngerman]{babel}
\usepackage[babel,german=quotes]{csquotes} 
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{titletoc}
\usepackage{scrpage2}
\usepackage{lastpage}
\usepackage{geometry}
\usepackage{float}
\usepackage{tocloft}
\usepackage{csquotes}
%+------------------------------------------------------------------------------+
%| settings                                                               |
%+------------------------------------------------------------------------------+

% —– titletoc - format ToC —– %
\titlecontents{chapter}[1.5em]{\addvspace{1pc}\bfseries}{\contentslabel{1.5em}}
{\hspace*{-1.5em}}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{section}[3.7em]{}{\contentslabel{2.2em}}{}
{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsection}[6.7em]{}{\contentslabel{2.95em}}{}
{\titlerule*[0.3pc]{.}\contentspage}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
% —– End: format ToC —– %

%+------------------------------------------------------------------------------+
%| document                                                    |
%+------------------------------------------------------------------------------+
\begin{document}
\tableofcontents

 \chapter{ 1 }
   Some example Text
  \section{1.1}
  \section{1.2}
  \section{1.3}
  \section{1.4}

 \chapter{ 2 }
  \section{2.1}
  \section{2.2}
  \section{2.3}
  \section{2.4}
  \section{2.5}

 \chapter{ 3 }
   ...
\end{document}

I think that I am missing some options for my titletoc formatting but I don't know how to correct it.

7
  • Are you sure titletoc is compatible with koma-script?
    – Bernard
    Nov 15, 2016 at 12:32
  • I am not sure if it is compatible... I just thought that there is a mistake with my titletoc settings because the others are working
    – Sweetspell
    Nov 15, 2016 at 12:44
  • I don't know well koma-script, but there might be incompatibilities. The table of contents formatting is documented in the koma-script guide, §3.9, pp. 65–69.
    – Bernard
    Nov 15, 2016 at 12:50
  • Remove package tocloft.
    – esdd
    Nov 15, 2016 at 13:48
  • @esdd Do you want to add some kind of answer?
    – Johannes_B
    Mar 18, 2018 at 9:48

1 Answer 1

5

If you want to use package titletoc to format your TOC then remove package tocloft:

\documentclass[fontsize=9pt, BCOR=5mm, ngerman, paper=a4,DIV=calc]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[babel,german=quotes]{csquotes} 
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{titletoc}
\usepackage{scrlayer-scrpage}% replaces the outdated scrpage2
\usepackage{lastpage}
\usepackage{geometry}
\usepackage{float}
\usepackage{scrhack}% if package float is really needed, load scrhack too
\usepackage{csquotes}

% —– titletoc - format ToC —– %
\titlecontents{chapter}[1.5em]{\addvspace{1pc}\bfseries}{\contentslabel{1.5em}}
{\hspace*{-1.5em}}{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{section}[3.7em]{}{\contentslabel{2.2em}}{}
{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{subsection}[6.7em]{}{\contentslabel{2.95em}}{}
{\titlerule*[0.3pc]{.}\contentspage}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\begin{document}
\tableofcontents
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\end{document}

enter image description here

Note that KOMA-Script class scrreprt loads package tocbasic automatically. So maybe its better to remove titletoc too und use something like

\documentclass[fontsize=9pt, BCOR=5mm, ngerman, paper=a4,DIV=calc]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[babel,german=quotes]{csquotes} 
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{scrlayer-scrpage}% replaces the outdated scrpage2
\usepackage{lastpage}
\usepackage{geometry}
\usepackage{float}
\usepackage{scrhack}% if package float is really needed, load scrhack too
\usepackage{csquotes}

\RedeclareSectionCommand[
  toclinefill=\TOCLineLeaderFill,
  tocbeforeskip=1pc
]{chapter}
\RedeclareSectionCommand[
  tocnumwidth=2.2em
]{section}
\RedeclareSectionCommand[
  tocindent=3.75em,
  tocnumwidth=2.95em
]{subsection}

\makeatletter
\show\@dotsep
\renewcommand\@dotsep{1}
\makeatother

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\begin{document}
\tableofcontents
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\chapter{A Chapter}
\section{A Section}\section{A Section}\section{A Section}\section{A Section}
\section{A Section}\section{A Section}\section{A Section}
\end{document}
1
  • Now, a fresh bunch of votes and the first is left here.
    – Johannes_B
    Mar 19, 2018 at 6:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .