5

I want to insert Names of authors in the toc (above the chapter title) like here: enter image description here

but the suggested methode doesn't work in the scrreprt type of document.

\documentclass[12pt,a4paper,oneside,ngerman]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
\tableofcontents

\chapter{Blabla 1}
sdadasdas

\section{Blabla 1.1}
fd
\subsection{Blabla 1.1.1}
das
\end{document}

Thanks in advance!

Dmitri
  • 349

1 Answers1

4

Adapting Gonzalo Medina's earlier answer to work with the screport instead of the memoir class isn't too difficult. The main thing that needs to be changed is to load the tocloft package explicitly. (It's loaded for you by the memoir class.)

enter image description here

\documentclass[12pt,a4paper,oneside,ngerman]{scrreprt}
\usepackage{babel}
\usepackage{blindtext}
%\usepackage[ansinew]{inputenc} %% is this needed/correct?

\renewcommand{\thesection}{\arabic{section}}
\setcounter{secnumdepth}{3} % Subsection mit Zähler (1.1) versehen

%%
% Kolumnentitel
%%
\renewcommand{\chaptermark}[1]{ \markboth{#1}{}  } % Stil der Kopfzeile zurücksetzen
\renewcommand{\sectionmark}[1]{ \markright{#1}{} } % Stil der Kopfzeile 


%%
% Inhaltsverzeichnis
%%
\usepackage{tocloft}
\renewcommand*{\cftchapdotsep}{\cftdotsep}
\setcounter{tocdepth}{0}
\renewcommand{\cftchapfont}{\normalfont}
\renewcommand{\cftchappagefont}{\normalfont}

\makeatletter
\DeclareRobustCommand\authortoctext[1]{%
{\addvspace{10pt}\nopagebreak\leftskip0em\relax
\rightskip \@tocrmarg\relax
\noindent\itshape#1\par\addvspace{-7pt}}}
\makeatother
\newcommand\authortoc[1]{%
  \gdef\chapterauthor{#1}%
  \addtocontents{toc}{\authortoctext{#1}}}

%%
% Dokumentenbeginn
%%
\begin{document}
\tableofcontents
\authortoc{Walter von der Vogelweide}
\chapter{Ich sass uf eynem Steine?}
\section{Und dachte Bein mit Beine}
\Blindtext\Blindtext\Blindtext\Blindtext

\authortoc{Hartman von Aue}
\chapter[Was auch immer]{So gebt nur mehr und immer mehr}
\section{Moralische Quellen der Irrationalitat}
\Blindtext\Blindtext\Blindtext\Blindtext
\end{document}
Mico
  • 506,678
  • Thank you very much! To get it work however, I had to comment lines 607 and 608 in the file tocloft.sty, because otherwise I got an error: line 607: Command \c@lofdepth already defined. \newcounter{lofdepth} – Dmitri May 08 '14 at 11:17
  • @Dmitri - You're welcome. What gave rise to the difficulty you report? Did you try to issue the instruction \setcounter{lofdepth}{0} or something similar? – Mico May 08 '14 at 11:28
  • I don't even know, there is no command could break lofdepth (imho). \setcounter{lofdepth}{0} doesn't helps. – Dmitri May 08 '14 at 12:30