How to insert a line break with no indent in TOC

This is the code I'm trying :

\documentclass{book}

\begin{document}

\chapter{Chapter one}

\chapter*{\emph{Chapter two}}
\addcontentsline{toc}{chapter}{\setlength\parindent{24pt}Chapter two\\ Explanations on Chapter two}

\tableofcontents

\end{document}


The problem with \\ is that the new line is indented, I tried \linebreak, but it wont take it

• why have you \setlength\parindent{24pt} there? there never needs to be any formatting commands in that argument, the whole point of the previous {chapter} argument is that that specifies whatver format you want for chapter level entries. – David Carlisle Nov 10 '17 at 12:28
• When I asked how to add a title for \chapter*{} in toc someone gave me that line. (it's usually why I have strange code sometimes and you ask me why it's there). I will delete it and see if it's ok. – alfred Nov 10 '17 at 12:37

Here is a suggestion using package tocbasic and declaring a new tocentry:

\documentclass{book}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
level=0,
beforeskip=1em plus 1pt,
indent=0pt,
numwidth=0pt,
linefill=\hfill,
entryformat=\textbf,
pagenumberformat=\textbf,
]{tocline}{bchap}

\begin{document}
\chapter{Chapter one}

\chapter*{\emph{Chapter two}}

\chapter{Chapter three}
\tableofcontents
\end{document}


Result:

If there should be dots between the chapter entries and the page numbers, you can use

\documentclass{book}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
level=0,
beforeskip=1em plus 1pt,
indent=0pt,
numwidth=0pt,
entryformat=\textbf,
pagenumberformat=\textbf,
]{tocline}{bchap}
\DeclareTOCStyleEntry[
pagenumberformat=\textbf
]{tocline}{chapter}

\begin{document}
\chapter{Chapter one}

\chapter*{\emph{Chapter two}}

\chapter{Chapter three}
\tableofcontents
\end{document}


Result:

• how can I add dots to the toc in this case ? – alfred Nov 10 '17 at 16:04
• @alfred See my updated answer. – esdd Nov 10 '17 at 16:13
• For some reason in my document where there are 13 chapters, the last \chapter*{} is added at the end below the frame instead of creating a new page. – alfred Nov 10 '17 at 17:46

Here is an option with tocloft:

\documentclass{book}

\usepackage{tocloft}

\begin{document}

\tableofcontents

\chapter{Chapter one}

\chapter*{\emph{Chapter two}}