I am trying format \tableofcontents I want to put the chapter's titles Topological spacesat center and Chapter 1, ...like this picture , but I can't get the result.

My code






\chapter{Topological spaces}
\section{Hello again}
\section{A section}

\chapter{Hello again}
\section{Hello again}
\chapter{Hello again}

enter image description here

enter image description here

  • Off-topic: You're loading hyperref ways too early – user31729 Jan 17 at 17:29
  • No. I can not accept your answer. Because, the page of tableifcontents does not like my picture. – minhthien_2016 Jan 19 at 10:50
  • You asked for the centering of the title ... that's what my answer did. – user31729 Jan 19 at 10:55
  • I am sorry about my English. Please help me with my picture. – minhthien_2016 Jan 19 at 10:57

Use the tocloft package to adjust the style and placing of division titles in the ToC.


\renewcommand{\cftchappresnum}{CHAPTER } % put CHAPTER before the number
\renewcommand{\cftchapfont}{\centering} % center CHAPTER and number
% start new line after the number, shift title so it is centered
    \\ \hspace{\@pnumwidth}\hspace{\@tocrmarg} \hfil\bfseries\large}
\cftpagenumbersoff{chapter} % no page numbers for chapters

\renewcommand{\cftsecpresnum}{\S\ } % put section symbol before section numbers

% then remainder of preamble and document

For more information read the manual (> texdoc tocloft).

enter image description here

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.