0

I am trying to customize the table of contents like in figure below. enter image description here

I read the description on the link (Pretty Table of Contents). However, I am getting numerous errors. Preamble of my file looks as follows. I am also not sure where to add the code or modify the code for fancy TOC from above link.

    \documentclass[11pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
%\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage[paperheight=24cm,paperwidth=17cm,left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{blindtext}

\usepackage{indentfirst}
\setlength\parindent{1cm}

\usepackage{ebgaramond,newtxmath,ebgaramond-maths}



% Adding box to the chapter
\usepackage{eso-pic,xcolor}
\definecolor{chapterthumbbg}{HTML}{6F7170}
\AddToShipoutPictureFG{%
  \AtPageLowerLeft{%
    \ifshowchapterthumb\ifodd\value{page}\else
      \makebox[\paperwidth][r]{%
        \raisebox{\dimexpr.5\paperheight-.5\height}{%
          \setlength{\fboxsep}{\baselineskip}%
          \colorbox{chapterthumbbg}{\textcolor{white}{\thechapter}}%
        }%
      }%
    \fi\fi
  }
}
\newif\ifshowchapterthumb



\begin{document}

\showchapterthumbfalse

%\input{Frontmatter/Title}
%\pagebreak
%\input{Frontmatter/committe}
%\pagebreak
%\input{Frontmatter/official_title}
%\pagebreak
%\input{Frontmatter/approvedby}


\tableofcontents
%\newpage
%\thispagestyle{empty}
%\mbox{}



\part{Part 1}
\showchapterthumbtrue
\include{Mainmatter/Chapter_1}
%\newpage
%\thispagestyle{empty}
%\mbox{}
\include{Mainmatter/Chapter_2}

\part{Part 2}
\include{Mainmatter/Chapter_3}


\end{document}

I will be really grateful if someone can help me.

Thanks in advance.

  • Your code is incomplete – user31729 Nov 30 '17 at 17:28
  • I have updated whole code now. – pukumarathe Nov 30 '17 at 17:33

Your Answer

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

Browse other questions tagged or ask your own question.