1

What can I do if I want LaTeX to give me 'CHAPTER 1: ' etc, instead of just numbers like '1 'etc as it normally do? I want it to write the word 'CHAPTER' in capitals followed by chapter number then ':' colon and the 'CHAPTER TITLE' in capitals too. May you please assist. It should look like this:

CHAPTER 1: THE CHAPTER ONE
1.1 The section one
1.1.1 The subsection one

Stefan Pinnow
  • 29,535
  • 1
    (1) welcome, (2) this depends on the document class you use, you do not give any details so I'll assume a standard class, in that case have a look at the tocloft package, it han handle such designs – daleif Aug 19 '16 at 11:20
  • 1
    See also this question: http://tex.stackexchange.com/questions/171047/adding-word-chapter-into-table-of-contents-for-only-numbered-chapter-entries – Martin Nyolt Aug 19 '16 at 11:22

1 Answers1

1

Something like this? I'used titlesec and titletoc:

\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{fourier, erewhon, cabin}

\usepackage[english]{babel}
\usepackage{geometry}
\usepackage[clearempty]{titlesec}
\usepackage{titletoc}
\usepackage{lipsum} \addto\captionsenglish{ \renewcommand*\contentsname{\centerline{Table of contents}}}

\titleformat{\chapter}[display]%
{\null\vskip1em\sffamily\bfseries\Large\filcenter}{Chapter \thechapter}{2ex}{\LARGE}[]
\titleformat{name = \chapter, numberless}[block]%
{\null\vskip1em\sffamily\bfseries\Large\filcenter}{}{0em}{\LARGE}
\titlespacing*{\chapter}{0em}{-2\baselineskip}{6\baselineskip}

\titlecontents{chapter}
[7em] % ie, width of contentslabel + 0.5em
{\bigskip}
{\contentslabel[\MakeUppercase\chaptername~\thecontentslabel]{6.5em}\MakeUppercase}%\thecontentslabel
{\hspace*{-6.5em}\MakeUppercase}
{\hfill\contentspage}[\medskip]

\begin{document}

\tableofcontents
\newpage

\chapter*{An Unnumbered Chapter}
\addcontentsline{toc}{chapter}{An Unnumbered Chapter}
\chapter{Chapter One}
\lipsum[1]
\section{A first nice section}
\lipsum[2-5]
\subsection{A first subsection}
\lipsum[6]
\chapter{Chapter Two}
Content

\end{document} 

enter image description here

Or maybe this code:

\titlecontents{chapter}
[6.5em] % 
{\bigskip}
{\contentslabel[\MakeUppercase\chaptername~\thecontentslabel]{6.5em}\MakeUppercase}%\thecontentslabel
{\hspace*{-6.5em}\MakeUppercase}
{\hfill\contentspage}[\smallskip]

\titlecontents{section}
 [0em] % i
 {\medskip}
 {\thecontentslabel\enspace}%\thecontentslabel
 {\hspace*{-6.5em}}
 {\hfill\contentspage}%]

\titlecontents{subsection}
 [0em] %
 {\smallskip}
 {\thecontentslabel\enspace}%\thecontentslabel
 {\hspace*{-6.5em}}
 {\hfill\contentspage}

enter image description here

Bernard
  • 271,350