1

I am using the report class in TeXworks/MiKTeX and was provided with a style that is a little out of date. I am having trouble with a bold section format being transferred from a page into my Table of Contents (I want "List of Figures" to be normal in the Table of contents instead of bolded but remain bold on the page created). I could not find any examples that created the table of contents like the file I have been provided by the University.

List of Figures should not be in bold

    \def\contentsname{\bf{Table of Contents}}
    \def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
     \fi\chapter*{\contentsname
      \@mkboth{{\contentsname}}{{\contentsname}}
      }
     {\doublespacing\@starttoc{toc}}\if@restonecol\twocolumn\fi}

    \def\listfigurename{\bf{List of Figures}}
    \def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
     \fi\chapter*{\listfigurename\@mkboth
     {{\listfigurename}}{{\listfigurename}}}
     \addcontentsline{toc}{chapter}{\listfigurename}
      {\@starttoc{lof}}\if@restonecol
     \twocolumn\fi}

Later in the .tex

    \tableofcontents
    \listoftables
    \listoffigures

I can provide more of my code if it is needed.

  • \def\listfigurename{\bf{List of Figures}} is wrong: the \xxxxname macros should just be text, since bold face has been added there then all uses of the text will be bold,. (\bf shouldn't be used at all, but that's a different matter) – David Carlisle Jan 12 '16 at 9:25
1

Rather than rely on macros which you yourself consider to be "a little out of date", you may to employ the capabilities of the tocbibind and tocloft packages to achieve your formatting objectives.

Incidentally, \bf is a plain-TeX macro whose use is deprecated under LaTeX. At any rate, \bf does not take an argument; if you must use it, write {\bf List of Figures} rather than \bf{List of Figures}.

Here's a sample implementation of the screenshot you've posted that uses the tocbibind and tocloft packages.

enter image description here

\documentclass{report}

\usepackage[nottoc]{tocbibind} % Don't include ToC line in ToC

\usepackage{tocloft}
\renewcommand\contentsname{Table of Contents}
\renewcommand\cfttoctitlefont{\hfil\mdseries} % use "\bfseries" if you want it in bold
\renewcommand{\cftaftertoctitle}{\hfil}
\renewcommand{\cftchapfont}{\mdseries}
\renewcommand{\cftchappagefont}{\mdseries}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}

\setcounter{secnumdepth}{-1} % no numbers for chapters, sections, etc

\usepackage{lipsum} % for filler text

\begin{document}

\pagenumbering{roman}

\tableofcontents
\chapter{Abstract}
\chapter{Acknowledgments}
\lipsum[1-7]  % filler text

\clearpage
\listoftables

\clearpage
\listoffigures

\clearpage
\pagenumbering{arabic}

\chapter{Introduction}
\section{Scope and Objectives}

\chapter{Literature Review}

\end{document}

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.