1

I need a set up the table of content with:

chapters heading as 16pt bold sections heading as 14 bold subsections heading 12pt bold

the rest Chapters (Dedication, Acknowledgment, list of figures) should be 14pt and bold.

I used the package tocloft to specify fontsize and boldness, but I want to set up different fontsize and unbold Chapters (Dedication, Acknowledgment, list of figures).

Please check a minimum working example:

\documentclass[a4paper,12pt]{report}
\usepackage[lmargin=3.0cm, rmargin=2.5cm,tmargin=2.5cm,bmargin=2.5cm] {geometry}
\usepackage{blindtext}
\usepackage{tocloft}
\usepackage[nottoc]{tocbibind}
\newcounter{loopcntr}

\renewcommand\cftchapfont{\fontsize{16}{19}\bfseries\selectfont}
\addtolength{\cftchapnumwidth}{10pt}
\renewcommand\cftsecfont{\fontsize{14}{17}\bfseries\selectfont}
\renewcommand{\cftsubsecfont}{\fontsize{12}{14}\bfseries\selectfont}

\begin{document}
\tableofcontents

\addtocontents{toc}
{\begingroup\protect\renewcommand\protect\cftchapfont{\protect\fontsize{14}{17}\protect\selectfont}}
\listoffigures

\addcontentsline{toc}{chapter}{ DEDICATION}
\include{frontmatter/dedication}
\addcontentsline{toc}{chapter}{ACKNOWLEDGMENT}
\include{frontmatter/acknowledgement}
\addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
\renewcommand*{\listfigurename}{LIST OF FIGURES}

\listoffigures
\addcontentsline{toc}{chapter}{ABSTRACT}
\include{frontmatter/abstract}
\addtocontents{toc}{\endgroup}

\include{chapters/introduction}
\loop\unless\ifnum25<\value{loopcntr}%
\stepcounter{loopcntr}
\chapter{ch\number\value{loopcntr}}

\repeat

\end{document}

Regards

  • 1
    Can you specify what the question is? – user36296 Oct 2 '17 at 18:29
  • I want to unbold and change the fontsize of chapters (dedication, acknowledgment, list of the figures) in the table of content. – n.a.s Oct 2 '17 at 19:01
1

I don't recommend having different font sizes/weights for the ToC -- it does not really look nice, but ...

... it can be achieved by writing the changes to the ToC itself, all in a \begingroup...\endgroup pair (which must appear in the ToC too.) This way the changes act only as long as being inside the group, the 'regular' chapters use the previous definitions.

I also used tocbibind (by the same authors as tocloft) in order to add the LoF to the ToC.

\documentclass[a4paper,12pt]{report}
\usepackage[lmargin=3.0cm, rmargin=2.5cm,tmargin=2.5cm,bmargin=2.5cm]{geometry}

\usepackage{blindtext}
\usepackage{tocloft}
\usepackage[nottoc]{tocbibind}
\newcounter{loopcntr}

\renewcommand\cftchapfont{\fontsize{16}{19}\bfseries\selectfont}
\addtolength{\cftchapnumwidth}{10pt}
\renewcommand\cftsecfont{\fontsize{14}{17}\bfseries\selectfont}
\renewcommand{\cftsubsecfont}{\fontsize{12}{14}\bfseries\selectfont}
\begin{document}
\tableofcontents

\addtocontents{toc}{\begingroup\protect\renewcommand\protect\cftchapfont{\protect\fontsize{14}{17}\protect\selectfont}}
\listoffigures
\chapter{Dedication}
\chapter{Acknowledgement}
\chapter{Abstract}
\addtocontents{toc}{\endgroup}

\loop\unless\ifnum25<\value{loopcntr}%
\stepcounter{loopcntr}
\chapter{ch\number\value{loopcntr}}

\repeat

\end{document}

enter image description here

  • Thanks a lot @Christian!. I will accept your solution :). – n.a.s Oct 3 '17 at 11:28
  • Hi @Christian. I have an issue with this when I applied to my thesis. It works, but the unbold continues to the chapter one in the Table of content. How can I avoid that? Thank you. – n.a.s Oct 25 '17 at 11:40
  • 1
    @n.a.s: Well, as you can see from my answer, it works, if you are using something different I can't see here, it's almost impossible to say what is going wrong for your thesis. – user31729 Oct 25 '17 at 12:02
  • 1
    @nas: That's not really useful information. Especially those dreadful \include statements and spaghettification of code. Especially you should not need to add it for each chapter. – user31729 Oct 25 '17 at 12:07
  • 1
    @n.a.s: Again: Such comments are not useful. I don't know what you have done actually – user31729 Oct 25 '17 at 19:16

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.