I am using the following .tex template borrowed from my colleague:
\documentclass[11pt,twoside]{book}
\usepackage{a4wide}
\usepackage{fancyhdr}
\usepackage[dvips]{epsfig}
\usepackage{palatino,float,subfigure,shadow,fancybox,amsfonts,appendix}
\usepackage{stmaryrd}
\usepackage[nottoc]{tocbibind}
\usepackage{makeidx}
\pagestyle{fancy} \makeindex %\authorindex
\renewcommand{\headrulewidth}{.1pt}
\fancyhead[LE,RO]{{\thepage}}
\fancyhead[RE]{\nouppercase{{\leftmark}}}
\fancyhead[LO]{\nouppercase{{\rightmark}}} \fancyfoot{}
\def\baselinestretch{1.1}
\pagenumbering{roman}
\date{\today}
\clubpenalty=10000 \widowpenalty=10000
\newcommand*\chancery{\fontfamily{pzc}\selectfont}
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{hyperref}
\usepackage{upgreek}
\usepackage[utf8]{inputenc}
\usepackage{mathrsfs}
\usepackage{alltt}
\usepackage{tikz-cd}
\usepackage{aliascnt}
\usepackage{tikz}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{charter}
\usepackage{relsize}
\usepackage{amsmath,amssymb,amsthm,graphicx,amsxtra, setspace}
\usepackage{type1cm,eso-pic}
\allowdisplaybreaks
\usepackage{scalerel,stackengine}
\stackMath
\newcommand\reallywidehat[1]{%
\savestack{\tmpbox}{\stretchto{%
\scaleto{%
\scalerel*[\widthof{\ensuremath{#1}}]{\kern-.6pt\bigwedge\kern-.6pt}%
{\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
}{\textheight}%
}{0.5ex}}%
\stackon[1pt]{#1}{\tmpbox}%
}
\parskip 1ex
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{remark}[theorem]{Remark}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}
\newcommand{\mainidx}[1]{{\it #1}}
\newcommand{\boldidx}[1]{{\bf #1}}
\DeclareMathOperator*{\esssup}{ess,sup}
\DeclareMathOperator{\tr}{Tr}
\makeatletter
\newcommand{\doublewidetilde}[1]{{%
\mathpalette\double@widetilde{#1}%
}}
\newcommand{\double@widetilde}[2]{%
\sbox\z@{$\m@th#1\widetilde{#2}$}%
\ht\z@=.9\ht\z@
\widetilde{\box\z@}%
}
\makeatother
\newcommand{\mc}{\mathcal}
\newcommand{\mf}{\mathfrak}
\newcommand{\mb}{\mathbb}
\newcommand{\xra}{\xrightarrow}
\newcommand{\ra}{\rightarrow}
\newcommand{\rra}{\rightrightarrows}
\renewcommand{\d}{/\mathrm{d}/}
\renewcommand{\thefootnote}{\arabic{footnote}}
\def\listofsymbols{\input{symbols} \cleardoublepage}
\def\addsymbol #1: #2#3{$#1$ > \parbox{5in}{#2 \dotfill \pageref{#3}}\}
\def\newnot#1{\label{#1}}
\hypersetup{
%bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat�s bookmarks
pdftoolbar=true, % show Acrobat�s toolbar?
pdfmenubar=true, % show Acrobat�s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={My title}, % title
pdfauthor={Author}, % author
pdfsubject={Subject}, % subject of the document
pdfcreator={Creator}, % creator of the document
pdfproducer={Producer}, % producer of the document
pdfkeywords={keywords}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=blue, % color of internal links
citecolor=blue, % color of links to bibliography
filecolor=magenta, % color of file links
urlcolor=green % color of external links
}
\newcommand {\apgt} {\ {\raise-.5ex\hbox{$\buildrel>\over\sim$}}\ }
\newcommand {\aplt} {\ {\raise-.5ex\hbox{$\buildrel<\over\sim$}}\ }
\makeatletter
\def\myfnt{\ifx\protect@typeset@protect\expandafter\footnote\else\expandafter@gobble\fi}
\makeatother
\begin{document}
\doublespace
\include{Title}
\pagenumbering{arabic}
\setcounter{page}1
\newpage
\thispagestyle{empty} \cleardoublepage
\setcounter{secnumdepth}{3} % organisational level that receives a numbers
\tableofcontents
\newpage
\newpage
\thispagestyle{empty}
\include{Preliminaries}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
%The style you want to use for references.
\newpage
\thispagestyle{plain}\chapter*{Publications arising out of the PhD
thesis\hfill} \addcontentsline{toc}{chapter}{Publications arising
out of the PhD thesis}
\begin{enumerate}
\item [{[1]}]
\end{enumerate}
\clearpage
\newpage
\thispagestyle{empty}
\bigskip{}
\vspace{1cm} \cleardoublepage
\bibliography{references}
\bibliographystyle{plain}
\singlespace
\printindex %\printauthorindex
\end{document}
Can some one help me to remove the obsolete commands in the file (commands which are present and don't serve any purpose).
\include{chapter2}or\include{chapter3}contains. So how should we know if you load an unnecessary package. – Roland Mar 04 '21 at 05:42graphicx-- why on earth do you load it three times? Once you're done with that purge, you could start thinking about which packages aren't needed at all for your document. – Mico Mar 04 '21 at 06:07graphicsandgraphicx(hint: you don't; keep only the latter) and bothcolorandxcolor(hint: you don't; keep the latter). Does your document really feature nine [!] separate theorem-like environments? – Mico Mar 04 '21 at 06:34