0

I am trying to modify my table of content and here is some part of my code

\renewcommand{\contentsname }{ TABLE OF CONTENTS}

\tableofcontents
\addtocontents{toc}{~\hfill  Page\par}
\let\LaTeXStandardTableOfContents\tableofcontents

\renewcommand{\tableofcontents}{%
\begingroup%
\renewcommand{\bfseries}{\relax}%
\LaTeXStandardTableOfContents%
\endgroup%
}%

The output is

enter image description here

What I want is

enter image description here

There are two differences.

1) TABLE OF CONTENTS is not bold.

2) The word CHAPTER 1 does not appear above INTRODUCTION

How could I fix these?

1 Answer 1

1

Here is a solution with titletoc:

\documentclass[11pt, english]{book}
\usepackage[utf8]{inputenc}
\usepackage{babel} 
\usepackage{fourier, erewhon, cabin}
\usepackage[showframe]{geometry}
\usepackage[clearempty, pagestyles]{titlesec}
\usepackage{titletoc}
\usepackage{lipsum}

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

\addto\captionsenglish{\renewcommand*\contentsname{Table of Contents}}

\titlecontents{chapter}
[0em] %
{\medskip}
{\contentslabel[\rlap{\MakeUppercase\chaptername~\thecontentslabel}]{0em}\endgraf\MakeUppercase}% for numbered chapters
{\MakeUppercase} % for unnumbered chapters
{\hfill\contentspage}[\smallskip]

\titlecontents{section}
 [3em]%
 {\medskip}
 {\thecontentslabel\enspace}% for numbered sections
 {\hspace*{1.82em}} for unnumbered sections
 {\hfill\contentspage}%]

\begin{document}

\frontmatter
    \tableofcontents

\listoffigures \addcontentsline{toc}{chapter}{\listfigurename}
\listoftables \addcontentsline{toc}{chapter}{\listtablename}

\mainmatter
    \chapter{Introduction}
    \lipsum[1]
    \section{Clinical Trials}

   \lipsum[2-5]
\section*{A test section}\addcontentsline{toc}{section}{A test section}
\lipsum[6-10]
    \chapter{Chapter Two}
    Content

\end{document} 

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.