Hmm! I see now that I have another problem:
Assume the (trivial?) extension of the code in Thorsten's first post:
Code: Select all
\documentclass[11pt,danish]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput} % semiautomatic input selection
\SelectInputMappings{ % determination of input encoding
ae={æ}, % by selected glyphs
oslash={ø}, % for details see
Euro={€} % http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
}
\usepackage{babel}
\usepackage{titlesec}
\usepackage{titletoc}
\makeatletter
\@addtoreset{section}{part} % reset section counter in every part
\@addtoreset{subsection}{section} % reset subsection counter in every section
\@addtoreset{subsubsection}{subsection} % reset subsubsection counter in every subsection
\makeatother
\titlecontents{section}[2.3em]{}{\contentslabel{2.3em}}{\hspace*{-2.3em}}{\titlerule*[1pc]{.}\contentspage}
\renewcommand{\thesection}{\thepart.\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\begin{document}
\tableofcontents
\part{The First Part}
\section{Test~1}
\subsection{Test~a}
\subsubsection{Test~i}
\section{Test~2}
\subsection{Test~b}
\subsubsection{Test~ii}
\subsection{Test~c}
\part{The Second Part}
\section{Test~3}
\subsection{Test~d}
\subsubsection{Test~iii}
\section{Test~4}
\subsection{Test~e}
\subsubsection{Test~iv}
\subsection{Test~f}
\subsubsection{Test~v}
\end{document}
How do I add two line similar to
Code: Select all
\titlecontents{section}[2.3em]{}{\contentslabel{2.3em}}{\hspace*{-2.3em}}{\titlerule*[1pc]{.}\contentspage}
in order to get the correct horizontal spacing in all the ToC entries?
Thank you in advance!
Update:
I have now fixed it my using
Code: Select all
\makeatletter
\@addtoreset{section}{part}
\@addtoreset{subsection}{section}
\@addtoreset{subsubsection}{subsection}
\makeatother
\titlecontents{section}[2.3em]{}{\contentslabel{2.3em}}{\hspace*{-2.3em}}{\titlerule*[1pc]{.}\contentspage}
\titlecontents{subsection}[5.1em]{}{\contentslabel{2.8em}}{\hspace*{-2.3em}}{\titlerule*[1pc]{.}\contentspage}
\titlecontents{subsubsection}[8.9em]{}{\contentslabel{3.8em}}{\hspace*{-2.3em}}{\titlerule*[1pc]{.}\contentspage}
\renewcommand{\thesection}{\thepart.\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}