0

How to add Word CHAPTER # for each chapter name in toc (for .sty file)

This code from .sty file

  \renewcommand{\@makechapterhead}[1]{{
    \setlength{\topmargin}{2in}   % really 1.5in, added by bph
                                    % to meet OAP standards
    \normalfont\normalsize\bfseries  %the size of the font of the headers   of the chapter
    \begin{center}
    \etchapterheadstyle{\@chapapp{ \thechapter}}  %  CHAPTER 1 or APPENDIX


    \etchapterheadstyle{#1}                       %     TITLE OF CHAPTER
    \end{center}
    \setlength{\topmargin}{1.5in}   % back to 1in

}}
\renewcommand{\@makeschapterhead}[1]{{ 

    \setlength{\topmargin}{2in}   % really 1.5in, added by bph
                                    % to meet OAP standards
    \normalfont\normalsize\bfseries   
    \begin{center}
    \etchapterheadstyle{#1}                       %     TITLE OF CHAPTER
    \end{center}
    \setlength{\topmargin}{2in}   % back to 1in
}}

The TOC shown as follow

TOC

How to appear TOC as:

CHAPTER 1 INTRODUCTION

CHAPTER 2 Chapter 2 name

CHAPTER 3 Chapter 3 name

After I add the below code from Peter Wilson this toc appears New TOC after adding below code from Peter Wilson The Question is 1- How can I remove the word CHAPTER at the beginning of chapters toc 2- How can I make the title font smaller 3- list of figure - tables - symbols appear at the same page how can I make each of them in a single page?

marked as duplicate by Dr. Manuel Kuehner, Sebastiano, Phelype Oleinik, Stefan Pinnow, Mensch Mar 1 at 23:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Use the tocloft package.

...
\usepackage{tocloft}
\renewcommand{\cftchappresnum}{CHAPTER } % CHAPTER before number in ToC
\newlength{\mylen} % a scratch length
\settowidth{\mylen}{\bfseries\cftchappresnum\cftchapaftersnum} % extra space
\addtolength{\cftchapnumwidth}{\mylen} % add the extra space
...

Adding something before the chapter/section number means you have to allow extra spacing for the additional text. That is what the last three lines of the above code does. Of course you could just set \cftchapnumwidth to your specified value without the fiddle of the above code.

See the documentation (> texdoc tocloft) for more information.

  • When I add the above code the word CHAPTER appears before each chapter name but the font change and the list of tables list of figures appears at the same page of toc page, (before adding this code each of them appear in a single page). Moreover, the word CHAPTER appears at the beginning of chapters toc . How can I delete it?? – ahmad Hani Mar 1 at 21:12
  • Please see the figure added to the post above – ahmad Hani Mar 1 at 21:18
  • @ahmadHani I have no idea what you have done as you have not provided a MWE (from \documentclass... to \end{document}) The code I provided puts CHAPTER before the chapter numbers in the ToC and with my test document changes nothing else. I can't help any more. – Peter Wilson Mar 3 at 19:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.