Formatieren Sie Inhaltstitel genauso wie Abschnittstitel

Formatieren Sie Inhaltstitel genauso wie Abschnittstitel

Wie kann ich dafür sorgen, dass Abschnittstitel \tableofcontentsgenauso aussehen wie normale Abschnittstitel, die ich mit den folgenden titlesecBefehlen formatiert habe:

\titleformat{\section}{\Large\scshape}{\thesection. }{}{}
\titlespacing*{\section}{0pt}{1em}{0.4em}

Die erste Zeile sorgt dafür, dass Abschnittsüberschriften grundsätzlich Kapitälchen verwenden, die zweite Zeile legt den Abstand darum herum fest.

Die Abschnittsüberschriften sehen anschließend also folgendermaßen aus:

Korrekt formatierte Titel

Das Gleiche soll auch mit meinem Inhaltsverzeichnis passieren, das derzeit folgendermaßen aussieht:

Ein regelmäßig formatiertes Inhaltsverzeichnis in Latex mit der Beschriftung, wie ich es mir vorstelle

Ein minimales funktionierendes Beispiel:

\documentclass{article}

\usepackage{titlesec}

% format section title
\titleformat{\section}{\Large\scshape}{\thesection. }{}{}

% set section titles spacing
\titlespacing*{\section}{0pt}{1em}{0.4em}

% also format subsection title
\titleformat{\subsection}{\scshape}{\thesubsection. }{}{} 

\begin{document}

\tableofcontents

\section{One}
\subsection{SubOne}
\subsection{SubTwo}
\section{Two}
\section{Three}

\end{document}

Ich bin für jede Hilfe dankbar – danke!

Antwort1

Die Formatierung des Inhaltsverzeichnisses kann angepasst werden mittitletoc, ein Begleiter für titlesec.

\documentclass{article}

\usepackage{titlesec}
\usepackage{titletoc}

% format section title
\titleformat{\section}{\Large\scshape}{\thesection.}{.5em}{}
% set section titles spacing
\titlespacing*{\section}{0pt}{1em}{0.4em}
% set section titles in TOC
\titlecontents{section}[1.5em]{\scshape}{\contentslabel{1.5em}}{}{}

% also format subsection title
\titleformat{\subsection}{\scshape}{\thesubsection.}{.5em}{}
% format subsection titles in TOC
\dottedcontents{subsection}[3.8em]{\scshape}{2.3em}{.6pc}

\begin{document}

\tableofcontents

\section{One}
\subsection{SubOne}
\subsection{SubTwo}
\section{Two}
\section{Three}

\end{document}

verwandte Informationen