# How to change locally titletoc

\begin{filecontents*}{\jobname.bib}
@book{ hoyningen:1993,
author         = "Hoyningen-Huene, Paul",
title          = "Recontructing Scientific Revolutions",
publisher      = "The University of Chicago Press",
location       = "Chicago",
year           = "1993",
}
\end{filecontents*}

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{titlesec}
\usepackage[dotinlabels]{titletoc}
\contentsmargin{0pt}
{}
{}
{}

\contentsmargin{0pt}
\titlecontents{section}[4pc]
{}
{}
{}

\contentsmargin{0pt}
\titlecontents{subsection}[4pc]
{}
{}
{}

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

\usepackage[style=philosophy-verbose,backend=biber]{biblatex}
\nocite{*}

\begin{document}

\tableofcontents

\chapter{Chapter One}
\section{Section one}
\section{Section two}

\chapter{Chapter Two}
\section{Section one}
\section{Section two}
\section{Section three}

\chapter{Chapter Three}
\section{Section one}
\section{Section two}

\chapter*{\bibname}

\end{document}


In spite of my code, I'd like to have in any case the page number in the Table of contents for Bibliography. Is there a way to change locally the setting for that voice? Thanx!

=======================================================================

ADDENDUM Almost perfect. I don't understand why, but I obtain where the page number of Bibliography is a little too on the right... In my case I've to set {\llap{\makebox[\dimexpr30pt +1.75em\relax][l]{\thecontentspage}}}, but only by trials and errors...

This solution works independently of the page number of the bibliography...

1. Remember to use

\printbibliography[heading=bibintoc]


\chapter*{\bibname}


to have your bibliography printed and in the ToC.

2. Define the numberless-entry-format for \chapter in the same way you've defined it for the other sectioning commands:

\titlecontents{chapter}[4pc]
{}


MWE:

\begin{filecontents*}{\jobname.bib}
@book{ hoyningen:1993,
author         = "Hoyningen-Huene, Paul",
title          = "Recontructing Scientific Revolutions",
publisher      = "The University of Chicago Press",
location       = "Chicago",
year           = "1993",
}
\end{filecontents*}

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{titlesec}
\usepackage[dotinlabels]{titletoc}

\contentsmargin{0pt}

\titlecontents{chapter}[4pc]
{}

\titlecontents{section}[4pc]
{}
{}
{}

\titlecontents{subsection}[4pc]
{}
{}
{}

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

\usepackage[style=philosophy-verbose,backend=biber]{biblatex}
\nocite{*}

\begin{document}

\tableofcontents

\chapter{Chapter One}
\section{Section one}

\chapter{Chapter Two}
\section{Section one}

\chapter{Chapter Three}
\section{Section one}

\chapter{Chapter Four}
\section{Section one}

\chapter{Chapter Five}
\section{Section one}

\chapter{Chapter Six}
\section{Section one}

\chapter{Chapter Seven}
\section{Section one}

\chapter{Chapter Eight}
\section{Section one}

\chapter{Chapter Nine}
\section{Section one}

\end{document}


Output:

Some remarks:

1. If you set

\contentsmargin{0pt}


once and don't want to change it, you don't need to repeat it.

2. You are using the second mandatory argument of \titlecontents as it was the third...

In other words, you should write

\titlecontents{section}[4pc]
{}
{}
{}


\titlecontents{section}[4pc]
{}
{}
{}

• Thanx for your solution, which works very fine and for the improvements of my code. regarding 1), in my original text I've \setcounter{secnumdepth}{-1} \chapter*{\bibname} \addcontentsline{toc}{chapter}{\bibname} \markboth{\scshape bibliografia}{\scshape bibliografia} \printbibliography[heading=testi,category=testi] \printbibliography[heading=generalia,category=generalia] \printbibliography[heading=antichita,category=antichita] and so on, I don't know if there is a better code here too – user41063 Dec 27 '14 at 19:13
• @user41063 Glad it helped. About your specific setting, open a new question with a well constructed MWE. Me or someone more skilled than me will surely help you. :-) – karlkoeller Dec 27 '14 at 22:15
• thanx both, you and Bernard – user41063 Dec 28 '14 at 22:50

You can define the formatting for numberless chapters:

\begin{filecontents*}{\jobname.bib}
@book{ hoyningen:1993,
author = "Hoyningen-Huene, Paul",
title = "Recontructing Scientific Revolutions",
publisher = "The University of Chicago Press",
location = "Chicago",
year = "1993",
}
\end{filecontents*}

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{titlesec}
\usepackage[dotinlabels]{titletoc}
\contentsmargin{0pt}
{\llap{\makebox[\dimexpr30pt +1.5em\relax][l]{\thecontentspage}}}
{}

\titlecontents{section}[4pc]
{}
{}
{}

\titlecontents{subsection}[4pc]
{}
{}
{}

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

\usepackage[style=philosophy-verbose,backend=biber]{biblatex}
\nocite{*}

\begin{document}

\tableofcontents

\chapter{Chapter One}
\section{Section one}
\section{Section two}

\chapter{Chapter Two}
\section{Section one}
\section{Section two}
\section{Section three}

\chapter{Chapter Three}
\section{Section one}
\section{Section two}

\clearpage