GeneralMissing the Word "Chapter" in ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mafendee
Posts: 4
Joined: Tue Jan 31, 2012 11:15 am

Missing the Word "Chapter" in ToC

Post by mafendee »

Hi all,

I have a problem where I lost the word chapter in my thesis ToC. What I have now roughly is something like this

ABSTRACT
ACK
APPROVAL
LIST OF TABLES
LIST OF FIGURES

1. INTRODUCTION and so on

What I want is something like this

ABSTRACT
ACK
APPROVAL
LIST OF TABLES
LIST OF FIGURES

CHAPTER

1. INTRODUCTION and so on.

Don't know what is missing. Really am in need of help. Thank u.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Missing the Word "Chapter" in ToC

Post by cgnieder »

mafendee wrote:[...] I lost the word chapter in my thesis ToC. [...]
What do you mean by “you lost it”? Does that mean you had the word “chapter” in the ToC before?

I don't quite understand what your goal is in the end. Do you want the “chapter” be inserted before every (numbered) chapter or only as a separator between unnumbered
and numbered sections/chapters?
site moderator & package author
mafendee
Posts: 4
Joined: Tue Jan 31, 2012 11:15 am

Missing the Word "Chapter" in ToC

Post by mafendee »

Sorry for the confusion. Basically I am writing a thesis with a specific .cls file given by the university. Despite that, when I run my .tex file, I realize that the word 'CHAPTER' is not in my toc. This word supposes to be generated before the list of chapter is generated such that:

ABSTRACT
ACK
APPROVAL
LIST OF TABLES
LIST OF FIGURES

CHAPTER

1. INTRODUCTION
2. LIT REVIEW
...and so on.

Currently, the word CHAPTER above is missing (from the generated pdf file). But, I want it to be there.
I hope this clear things up. Waiting for your reply.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Missing the Word "Chapter" in ToC

Post by cgnieder »

Could you post a minimal example (possibly only containing the ToC and two headings -- one before and one after the desired “CHAPTER”) and attach the cls-file you're using? Else it it rather difficult to help and all solutions would be shots in the dark.

Regards
site moderator & package author
mafendee
Posts: 4
Joined: Tue Jan 31, 2012 11:15 am

Missing the Word "Chapter" in ToC

Post by mafendee »

This is how my 'main.tex' file looks like. My .cls file is a bit messed up, sorry for that. I attach the full version of it.

Code: Select all

\documentclass[tocchapterhead]{iitthesis}

\usepackage[dvips]{graphicx}    % This package is used for Figures
\usepackage{rotating}           % This package is used for landscape mode.

\usepackage{epsfig,amsmath,graphicx,amssymb,amsfonts,color,epsfig,amsthm}
\usepackage{caption}
\usepackage[font=footnotesize]{subcaption}

\usepackage{array}
\usepackage{helvet}

\usepackage{latexsym}
\usepackage{mathrsfs}
\usepackage{natbib}

\usepackage[a4paper]{geometry}
\geometry{left=4.2cm,right=27mm,top=25mm,bottom=20mm}
\setlength{\textheight}{23.4cm}

\makeatletter
\renewcommand\@dotsep{140}   % default value 4.5
\makeatother

\widowpenalty=10000
\clubpenalty=10000

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\voffset}{0in} \setlength{\oddsidemargin}{1.8cm}
\setlength{\evensidemargin}{1.8cm} \setlength{\unitlength}{1mm}
\font\bg=cmbx10 scaled\magstep1 \font\Bg=cmbx12 scaled\magstep3
\font\small=cmr8 \font\bg=cmbx10 scaled\magstep1 \font\Bg=cmbx12
scaled\magstep3 \font\small=cmr8
\def\nt{\noindent}
\def\cal{\mathcal}

\begin{document}

\newlength{\defbaselineskip}
\setlength{\defbaselineskip}{\baselineskip}
\newcommand{\setlinespacing}[1]%
           {\setlength{\baselineskip}{#1 \defbaselineskip}}
\newcommand{\doublespacing}{\setlength{\baselineskip}%
                           {2.0 \defbaselineskip}}
\newcommand{\singlespacing}{\setlength{\baselineskip}{\defbaselineskip}}

\newcommand{\myspace}{1.5}
\newcommand{\myspacea}{1.1}
\newcommand{\myspaceq}{1.0}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{roman}

\tolerance=10000 \baselineskip18truept
\newbox\thebox
\global\setbox\thebox=\vbox to 0.2truecm{\hsize 0.15truecm\noindent\hfill}
\def\boxit#1{\vbox{\hrule\hbox{\vrule\kern0pt
     \vbox{\kern0pt#1\kern0pt}\kern0pt\vrule}\hrule}}
\def\qed{\lower0.1cm\hbox{\noindent \boxit{\copy\thebox}}\bigskip}
\def\ss{\smallskip}
\def\ms{\medskip}
\def\bs{\bigskip}
\def\c{\centerline}
\def\nt{\noindent}

\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary} 
\newtheorem{pro}[thm]{Proposition}
\newtheorem{alg}[thm]{Algorithm}
\newtheorem{cnj}[thm]{Conjecture}
\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}
\theoremstyle{definition}
\newtheorem{dfn}[thm]{Definition}

\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}

\newtheorem{example}[thm]{Example}
\newtheorem{note}{Note}

\include{title}
\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf DEDICATIONS}
\include{dedication}
\addtocontents{toc}{\protect\vspace*{-9pt}}

\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf ABSTRACT}
\include{abs}
\addtocontents{toc}{\protect\vspace*{-9pt}}

\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf ABSTRAK}
\include{absm}
\addtocontents{toc}{\protect\vspace*{-9pt}}

\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf ACKNOWLEDGMENTS}
\include{ack}
\addtocontents{toc}{\protect\vspace*{-9pt}}

\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf APPROVAL}
\include{approval}
\addtocontents{toc}{\protect\vspace*{-9pt}}

\setlinespacing{0.9}
\addcontentsline{toc}{chapter}{\bf DECLARATION}
\include{dec}


\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{contents}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{tables}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{figures}
%\addtocontents{toc}{\protect\vspace*{-7pt}}
\addcontentsline{toc}{chapter}{\bf LIST OF ABBREVIATIONS}
\include{abbrevs}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\addcontentsline{toc}{chapter}{\bf LIST OF NOTATIONS}
\include{notats}



\pagenumbering{arabic}
\setlength{\parindent}{0.0cm}
\setlinespacing{1.4}

\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
\include{chapter7}

\setlinespacing{0.9}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{bibliography}
%\addtocontents{toc}{\protect\vspace*{-7pt}}
\include{appendix}

\setlinespacing{1.4}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{biodata}

\setlinespacing{0.9}
\addtocontents{toc}{\protect\vspace*{-9pt}}
\include{listpub}

\end{document}
Attachments
iitthesis.cls
(37.86 KiB) Downloaded 208 times
Last edited by Stefan Kottwitz on Wed Feb 01, 2012 9:39 am, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Missing the Word "Chapter" in ToC

Post by cgnieder »

Well, this code is not a minimal example (e.g. see my signature)...

Anyway, I can't even get the IIT-Thesis class running. Not even this code:

Code: Select all

\documentclass[tocchapterhead]{iitthesis}
\begin{document}

Hello World

\end{document}
Since I'm not very keen on going through the whole code of the class for figuring out why, I only can give you this idea. Add the desired entry manually:

Code: Select all

\addtocontents{toc}{\protect\contentsline{chapter}{CHAPTER:}{}}
site moderator & package author
mafendee
Posts: 4
Joined: Tue Jan 31, 2012 11:15 am

Re: Missing the Word "Chapter" in ToC

Post by mafendee »

Sorry for the late response. I was out of office the last few days. Thank you for your input. Finally it works after spending sometimes playing around with your suggestion. Thank you so much.
vjramana
Posts: 7
Joined: Sun Mar 02, 2014 5:54 pm

Re: Missing the Word "Chapter" in ToC

Post by vjramana »

Dear #mafendee,

Could you please indicate where did you put the command "\addtocontents{toc}{\protect\contentsline{chapter}{CHAPTER:}{}}" in the latex script?

Your reply may help me to fix similar problem that I am facing now.

Thank you in advance.

Vijay
Post Reply