2

I have report type document for my thesis. When the chapters do not have sections, the next chapter appears on the same line in toc.

enter image description here

enter image description here

Please let me know what to add more for code:

\documentclass[12pt]{report}

\renewcommand*\contentsname{Table of Contents}

\usepackage{titletoc}% http://ctan.org/pkg/titletoc
\usepackage{enumerate}
\setcounter{secnumdepth}{3}

%%---- continued ----

\titlecontents*{chapter}% <section-type>
[0pt]% <left>
{\addvspace{1em}}% <above-code>
{\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>

\setcounter{secnumdepth}{0}
\input{thesis-statement/statement}
\ifoddchapterpage
\newoddpage
\fi

%%-------------------------------------------------------------------------
\input{introduction/introduction}
\ifoddchapterpage
\newoddpage
\fi
1
  • Welcome to TeX SX! Could you post a full (yet minimal) compilable code, reproducing the problem, that we can play with?
    – Bernard
    Feb 7, 2018 at 23:46

1 Answer 1

1

From the titletoc documentation (section 6.2 And more):

This starred version groups the entries in a single paragraph.

So, use \titlecontents, not \titlecontents*:

enter image description here

\documentclass{report}

\usepackage{lipsum}
\usepackage{titletoc}

\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {\addvspace{1em}}% <above-code>
  {\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>

\begin{document}

\tableofcontents

\chapter{Thesis Statement}\lipsum[1-10]

\chapter{Introduction}\lipsum[1-10]
\section{Research approach}\lipsum[11-20]
\section{Research methodology}\lipsum[21-30]
\section{Contributions}\lipsum[31-40]

\chapter{Another chapter}\lipsum[1-10]

\chapter{Final chapter}\lipsum[1-10]

\end{document}
1
  • This works well. Thank you so much, Werner.
    – LearnLatex
    Feb 8, 2018 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.