0

I am trying to create table of contents for a book class as shown below. enter image description here

How could this be achieved? I looked around and tried to use the tocloft package but I end up in errors. Below is a MWE, where I commented out th tocloft package macros.

\documentclass[10pt, 
]{book}                                                     % document type and language

\usepackage[l2tabu,orthodox]{nag}                           % force newer (and safer) 
                                                            % LaTeX commands

%% Page dimensions
\usepackage[portrait, 
    a5paper, 
    hmargin=0.75in,
    vmargin={0.88in, 0.94in},
]{geometry}                                                 % control page layout

%% Fonts & languages
\usepackage[utf8]{inputenc}                                 % type Unicode characters 
                                                            % directly from the keyboard
\usepackage[T1]{fontenc}                                    % font encoding
\usepackage[english]{babel}                                 % multi-language support
\usepackage[protrusion=true, 
    expansion=true, 
    final, 
    babel,
]{microtype}                                                % improves word spacing
\usepackage{lmodern}

%% Lists & tables
\usepackage{enumitem}                                       % more list formatting options
\usepackage[raggedrightboxes]{ragged2e}                     % text justification

\usepackage[pdftex,
    bookmarks,
    colorlinks,
    breaklinks,
    hypertexnames=false,
]{hyperref}                                                 % pdf coloured hyperlinks

% TOC customisation
\iffalse
\usepackage[titles]{tocloft}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\renewcommand{\cftmarkZ}{}
\renewcommand{\cftafterZtitle}{%
    \\
    [\baselineskip]
    \mbox{}
    \hfill{\normalfont PAGE}
}
\fi

\begin{document}
\raggedbottom
\frontmatter

\pagenumbering{gobble}
\chapter*{PREFACE}% 
\label{cha:PREFACE}

\thispagestyle{empty}
\tableofcontents

\mainmatter{}

\chapter{FIRST CHAPTER}%
\label{cha:FIRST_CHAPTER}

\chapter{SECOND CHAPTER}%
\label{cha:SECOND_CHAPTER}

\chapter{THIRD CHAPTER}%
\label{cha:THIRD_CHAPTER}

\chapter{FOURTH CHAPTER}%
\label{cha:FOURTH_CHAPTER}
\end{document}

When I uncomment, I end up with the following error messages compiling with pdftex

! LaTeX Error: Command \cftmarkZ undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.40 \renewcommand{\cftmarkZ}
                             {}

Please let me know how to proceed futher. Thank you.

1 Answer 1

0

After some exploration I found out that titletoc package can be used to achieve most of what I want. Below is the MWE

\documentclass[10pt, 
]{book}                                                                                     % document type and language

\usepackage[l2tabu,orthodox]{nag}                 % force newer (and safer) 
                                                  % LaTeX commands

%% Page dimensions
\usepackage[portrait, 
    a5paper, 
    hmargin=0.75in,
    vmargin={0.88in, 0.94in},
]{geometry}                                       % control page layout

%% Fonts & languages
\usepackage[utf8]{inputenc}                       % type Unicode characters 
                                                  % directly from the keyboard
\usepackage[T1]{fontenc}                          % font encoding
\usepackage[english]{babel}                       % multi-language support
\usepackage[protrusion=true, 
    expansion=true, 
    final, 
    babel,
]{microtype}                                      % improves word spacing
\usepackage{lmodern}

%% Lists & tables
\usepackage{enumitem}                             % more list formatting options
\usepackage[raggedrightboxes]{ragged2e}           % text justification

\usepackage[pdftex,
    bookmarks,
    colorlinks,
    breaklinks,
    hypertexnames=false,
]{hyperref}                                       % coloured hyperlinks in pdf  

%% TOC customisation & formatting
\usepackage{titlesec}                             % section formatting
\usepackage{titletoc}                             % TOC formatting 
\addto\captionsenglish{\def\contentsname{%        % format title of TOC
    \Large\centering CONTENTS}}                   % to be used with babel
\addtocontents{toc}{~\hfill\scriptsize{PAGE}\par} % add page above page numbers
\renewcommand{\thechapter}{\centering             % centered chapter and Roman
  \Roman{chapter}}                                % numeral counter
\titlecontents{chapter}[2pc]                      % format the appearance of
  {%                                                                                            %   TOC entries 
        \addvspace{0.5pc}%                                                          
     \filleft%  
     \normalfont%
  }
  {%
        \centering%
    \large\MakeUppercase{\chaptertitlename} %
        \thecontentslabel%
    \\*[1.0pc]%
    \footnotesize
  }
  {}
  {\titlerule*[3pc]{.}\normalsize\contentspage}
  [\addvspace{1.5pc}]   
     
\begin{document}
\raggedbottom{}
\frontmatter

\pagenumbering{gobble}
\chapter*{PREFACE}% 
\label{cha:PREFACE}

\thispagestyle{empty}
\tableofcontents

\mainmatter{}

\chapter{FIRST CHAPTER}%
\label{cha:FIRST_CHAPTER}

\chapter{SECOND CHAPTER}%
\label{cha:SECOND_CHAPTER}

\chapter{THIRD CHAPTER}%
\label{cha:THIRD_CHAPTER}

\chapter{FOURTH CHAPTER}%
\label{cha:FOURTH_CHAPTER}
\end{document}

The above MWE results in enter image description here

However, I am still unsure about placement of PAGE between CHAPTER I and FIRST CHAPTER and centering it above page numbers. Also, I want to edit the running head of TOC. I am trying to not have one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .