Page Layouttableofcontents and section problem

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
imdadullah

tableofcontents and section problem

Post by imdadullah »

dear!

I am writing my thesis.

as an example
I have the following code

Code: Select all

\chapter{Introduction}
\section{test}
some matter here

\subsection{adad}
dsafkasdf

\subsubsection{dka;kdsf}
dfaksdf;asdf
\chapter{literature Review}
adsakadf afadskf asdf
and so on

Now problem is

using \tableofcontents command

TOC produced but in each chapter chapter title also have number like

1 Introduction
1.1 test
1.1.1 asdf

2 Literature Review

I require that in each chapter, the chapter title appears without numbering but in TOC it appears with number.

When I use \section* or \chapter*
section starts from
0.1

plz help

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

tableofcontents and section problem

Post by frabjous »

Probably you can use titlesec or something like that, but it's hard to give concrete advice without a proper minimal working example. We don't even know what documentclass you're using.
imdadullah

tableofcontents and section problem

Post by imdadullah »

frabjous wrote:Probably you can use titlesec or something like that, but it's hard to give concrete advice without a proper minimal working example. We don't even know what documentclass you're using.
I am using article documentclass

another strange thing is that on one system for article documentclass winedit never give any error when I use \chpater while on other it gives error, don't know why?

plz help.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

tableofcontents and section problem

Post by frabjous »

The article class does not have chapters.

WinEDT does not generate errors; it just lists the ones LaTeX generates.

Without a proper minimal working example it is hard to guess how it is possible for you to be using chapters at all. Please click that link and read it, or else it will be hard to help you.
imdadullah

tableofcontents and section problem

Post by imdadullah »

frabjous wrote:The article class does not have chapters.

WinEDT does not generate errors; it just lists the ones LaTeX generates.

Without a proper minimal working example it is hard to guess how it is possible for you to be using chapters at all. Please click that link and read it, or else it will be hard to help you.
thanks you dear

here is some code

Code: Select all

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[dvips]{graphicx}
%\usepackage{anysize}

\usepackage{setspace}
% Essential packages
\usepackage{amsmath, amssymb, amsthm}

\usepackage{graphicx,color}
\usepackage[paper=a4paper, left=1.5in, right=1in, top=1in, bottom=1in, includefoot,headheight=13.6pt]{geometry}
\usepackage[square, comma, numbers, sort&compress]{natbib}
\usepackage{mathpazo}
\usepackage[hang, small, bf, margin=20pt, tableposition=top]{caption}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{subfig}

\parindent=0in
\parskip 8pt

\begin{document}
\doublespacing
\numberwithin{equation}{section}
\numberwithin{table}{section}
\numberwithin{figure}{section}

\pagenumbering{roman}
\tableofcontents
\newpage
\listoftables
\newpage
\listoffigures

\newpage
\pagenumbering{arabic}

\include{chap1}

\end{document} 
Chapter 1

Code: Select all

\chapter{\Huge{Chapter 1}}
\section{Introduction}
\subsection{Statement of problem}

For the last many years, the ordinary least squares (OLS) method has become one of the most widely used statistical methods to fit a linear regression model. 

The influence measures which are applied to detect influential observations in the OLS regression model are found easily because of the model simplicity. 

\begin{enumerate}
\item  Chatterjee and Hadi (1986),,,,
\item  The issue of discovering influential observation ,,,,,,
\item  ,,,,,,
\end{enumerate}

In this research, we address the problems raised above. ....

\subsection{Importance and Scope}
Influence analysis of parametric regression models .....

\begin{enumerate}
\item  ....
\item  .....
\item  ....
\item  ....
\item   .....
\end{enumerate}

Illustrative examples of these situations are given in the chapters 3-7. ....

\subsection{Methodology}
......................
.....................
Chapter 2

Code: Select all

\chapter{\Huge{Chapter 2}}
\section{The Origin and Developments of Influence Measures in Regression}
\subsection{Introduction}
................
................
\subsection{Ordinary Least Squares Regression}
\subsubsection{Multiple linear regression model and OLS estimation}
The standard multiple linear regression model may be written as
\begin{equation} \label{eq2.1}
y=1\, \beta _{0} + X_{1} \beta _{1} +\varepsilon
\end{equation}
............................
\subsubsection{Ordinary Least Squares Assumptions}
............................
It strange for me that I got final output using article class.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

tableofcontents and section problem

Post by frabjous »

It's the natbib package that is allowing you to use chapters in an article. But they still aren't really supported -- it just is suppressing the error message. If you want chapters, use either the report or book class. Pick one of those, produce another minimal working example -- and do read that link and following the instructions to make it minimal, it's tedious to deal with a bunch of other stuff unrelated to the problem.
Post Reply