%\newcounter{pawanfig}
%\newcounter{pawantab}
%\newcounter{karfoot}
%% Shortcuts
%%\newcommand{\etal}{\emph{et al.}} % use \etal\
%%\newcommand{\eg}{e.g.} % use \eg\
%%\newcommand{\ie}{\emph{i.e.}} % use \ie\
%%\definecolor{darkgreen}{rgb}{0.2,0.6,0.4}
%%\newcommand{\leftarw}{\xy {\ar (0,0)*{}; (7,0)*{};} \endxy}
%%\newcommand{\rightarw}{\xy {\ar (7,0)*{}; (0,0)*{};} \endxy}
%\newcommand{\longpage}{\enlargethispage{\baselineskip}}
%\newcommand{\shortpage}{\enlargethispage{-\baselineskip}}
%%% Set figure and table count to 0 for every part
%\newcommand{\pawanpart}[1]{\setcounter{figure}{0} \setcounter{table}{0} \setcounter{footnote}{0} \part{#1}}
%% Continue with figure and table count between chapters
%\newcommand{\pawanchapter}[1]{\setcounter{pawanfig}{\value{figure}} \setcounter{pawantab}{\value{table}} \setcounter{karfoot}{\value{footnote}}
%\chapter{#1} \setcounter{figure}{\value{pawanfig}} \setcounter{table}{\value{pawantab}} \setcounter{footnote}{\value{karfoot}}}
%\newcommand{\pawanchapternonum}[1]{\setcounter{pawanfig}{\value{figure}} \setcounter{pawantab}{\value{table}} \setcounter{karfoot}{\value{footnote}}
%\chapter*{#1} \setcounter{figure}{\value{pawanfig}} \setcounter{table}{\value{pawantab}} \setcounter{footnote}{\value{karfoot}}}
%% line spacing
%%\renewcommand{\baselinestretch}{1.15}
%% Changed by Karteek
%\renewcommand{\baselinestretch}{1.5}

% Changed by Karteek
% Move header footer definitions to thesis.tex for correcting the page number alignment

% Prevent page breaks between chapters
\renewcommand{\chapter}{
                     \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    %\addtocontents{lof}{\protect\addvspace{0\p@}}%
                    %\addtocontents{lot}{\protect\addvspace{0\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}

% Numbering and labeling of divisions
\renewcommand{\partname}{Chapter}
\renewcommand{\chaptername}{}
%\@addtoreset{chapter}{part}
\renewcommand{\thepart}{\arabic{part}}
%\renewcommand{\thechapter}{\thepart.\arabic{chapter}}
%\renewcommand{\thesubsection}{}
%\renewcommand{\labelenumi}{\arabic{enumi}.}
%\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}}

% Numbering and labeling of tables and figures
%\renewcommand{\thetable}{\thepart.\arabic{table}}
%\renewcommand{\thefigure}{\thepart.\arabic{figure}}
%\renewcommand{\theequation}{\thepart.\arabic{equation}}

% Table of contents entries: extra space to account for the "part" number
\renewcommand*{\l@chapter}[2]
  {\ifthenelse{\value{tocdepth}>-1}
     {\addpenalty{-\@highpenalty}
      %\vspace{1.0em plus 1pt}
      \vspace{2pt}
      \setlength{\@tempdima}{2.8em}
      \begingroup
        \setlength{\parindent}{0pt}
        \setlength{\rightskip}{\@pnumwidth}
        \setlength{\parfillskip}{-\@pnumwidth}
        \addtolength{\leftskip}{\@tempdima}
        \leavevmode\bfseries\hspace{-\leftskip}%
        #1\nobreak\hfil\nobreak\makebox[\@pnumwidth][r]{#2}\par
        \penalty\@highpenalty
      \endgroup}
     {}}
\renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{3.3em}}
\renewcommand{\l@figure}{\@dottedtocline{1}{1.5em}{3.3em}}
\renewcommand{\l@table}{\@dottedtocline{1}{1.5em}{3.3em}}

% Chapter header: change the style
%%%% Karteek changed \thechapter. to \thechapter~
\renewcommand{\@makechapterhead}[1]
  {{\phantom{0} \vspace{2pt}
    \setlength{\parindent}{0pt}\raggedright
    \normalfont\interlinepenalty=10000\Large\bfseries
    \ifthenelse{\value{secnumdepth}>-1}{\thechapter~ }{}%
    #1\par\nobreak
    \vspace{17pt}}}
\renewcommand{\@makeschapterhead}[1]
  {{\setlength{\parindent}{0pt}\raggedright
    \normalfont\interlinepenalty=10000\Large\bfseries
    #1\par\nobreak
    \vspace{17pt}}}

