%%
%% This is file KHas_thesis.sty
%% It provides you macros necessary to typeset a thesis
%% in the format required by the School of Graduate
%% Studies, Kadir Has University.
%%
%% Prepared by Feza Kerestecioglu
%%
%% Last modified on 10/12/2021
%%
%% COPYRIGHT 2018, 2021 by
%% Feza Kerestecioglu <kerestec@khas.edu.tr>, <kerestec@boun.edu.tr>
%%
%% Copying of part or all of any file in the KHas_thesis package is
%% allowed under the following conditions only:
%% (1) You may freely distribute unchanged copies of the files.
%%     Please include the documentation when you do so.
%% (2) You may modify a renamed copy of this file, but only for
%%     personal use.
%% (3) You may copy fragments from the files, for personal use
%%     or for use in a macro package for distribution, as long
%%     as credit is given where credit is due.
%%
%% You are NOT ALLOWED to take money for the distribution or
%% use of these and associated files or modified versions or
%% fragments thereof.
%%
%% Please report any bugs or suggestions to
%% Feza Kerestecioglu <kerestec@khas.edu.tr>.
%%
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{KHas_thesis}
%
\RequirePackage[a4paper]{geometry}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
%
\newcounter{thesistype}  % 1:graduation project, 2:M.S thesis, 3: M.A. Thesis, 4:PhD Thesis

\DeclareOption{turkce}
    {
    \newcommand\prefacename{\"ONS\"OZ} 
    \newcommand\forewordname{\"ONS\"OZ}
    \newcommand\ackname{TE\c{S}EKK\"UR}
    \renewcommand\contentsname{\.I\c{C}\.INDEK\.ILER}
    \newcommand\ozetname{\"OZET}
    \newcommand{\listsymbolname}{S{\.I}MGELER L\.ISTES\.I}
    \newcommand{\listabbname}{KISALTMALAR L\.ISTES\.I}
    \renewcommand\indexname{D\.IZ\.IN}
    \renewcommand\partname{KISIM}
    \renewcommand\appendixname{EK}
    \renewcommand\abstractname{ABSTRACT}
    \renewcommand\listfigurename{\c{S}EK\.ILLER L\.ISTES\.I}
    \renewcommand\listtablename{TABLOLAR L\.ISTES\.I}
    \renewcommand{\bibname}{KAYNAK\c{C}A}
    \newcommand{\bibncname}{B\.IBL\.IYOGRAFYA}
    \renewcommand\figurename{\c{S}ekil}
    \renewcommand\tablename{Tablo}
%
    \newcommand\downtitle{
      \thisTHESISTYPE
      \vskip100pt
      \@program\ Program{\i}'nda
      \ifnum\@thesistype=4 {doktora} \else {y\"{u}ksek lisans} \fi
      derecesi i\c{c}in gerekli k{\i}smi \c{s}artlar{\i}n yerine getirilmesi amac{\i}yla
      Kadir Has \"{U}niversitesi Lisans\"{u}st\"{u} E\u{g}itim Enstit\"{u}s\"{u}'ne
      teslim edilmi\c{s}tir.
      \vfill
      \.Istanbul, \@submonth, \@subyear \\ \null
    }
%
    \newcommand\thisthesistype{
      \unskip
      \ifnum\@thesistype=1 {Y\"uksek Lisans Bitirme Projesi}
      \else
          \ifnum\@thesistype=2 {Y\"uksek Lisans Tezi}
          \else
              \ifnum\@thesistype=3 {Y\"uksek Lisans Tezi}
              \else {Doktora Tezi}
              \fi
          \fi
      \fi
      \unskip
    }
%
%   Capitalized thesis type must be handled separately, because \MakeUppercase do not
%   capitalize "i" correctly.
    \newcommand\thisTHESISTYPE{
      \unskip
      \ifnum\@thesistype=1 {Y\"{U}KSEK L{\.I}SANS B{\.I}T{\.I}RME PROJES{\.I}}
      \else
          \ifnum\@thesistype=2 {Y\"{U}KSEK L{\.I}SANS TEZ{\.I}}
          \else
              \ifnum\@thesistype=3 {Y\"{U}KSEK L{\.I}SANS TEZ{\.I}}
              \else {DOKTORA TEZ{\.I}}
              \fi
          \fi
      \fi
      \unskip
    }
%
    \newcommand\makeapprovalpage{%
      \relaxtitlestuff
      \clearpage
      \pagestyle{fancy}
      \addtocounter{page}{1}
      \ifx\@dateofapproval\empty \@@warning{No \string\dateofapproval\space given}\fi
      \begin{center} 
      {\large\bfseries ONAY} \par
      \end{center}
      {\bfseries \@author\ }taraf{\i}ndan haz{\i}rlanan {\bfseries\@title\ }ba\c{s}\-l{\i}k\-l{\i}\ bu \c{c}al{\i}\c{s}ma j\"urimiz
      taraf{\i}ndan {\bfseries \thisTHESISTYPE}\ olarak kabul edil\-mi\c{s}\-tir. \par
      \def\pmss{\vspace*{-0.3\baselineskip} \\ \mbox{}}    % \pmss: poor mans single spacing %\mbox prevents underfull hbox warning
      \ifx\@advisor\empty \@@warning{No \string\advisor\space given}
      \else \@advisor\ (Dan{\i}\c{s}man) \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@advisoraff \\ \pmss \fi
      \ifx\@coadvisor\empty
      \else \@coadvisor\ (E\c{s}-Dan{\i}\c{s}man) \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@coadvisoraff \\ \pmss \fi
      \ifx\@examineri\empty
      \else \@examineri \hfill \makebox[40mm]\dotfill \pmss \@examineriaff  \\ \pmss \fi
      \ifx\@examinerii\empty
      \else \@examinerii \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examineriiaff  \\ \pmss \fi
      \ifx\@examineriii\empty
      \else \@examineriii \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examineriiiaff \\ \pmss \fi
      \ifx\@examineriv\empty
      \else \@examineriv \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examinerivaff  \\ \pmss \fi
      \ifx\@examinerv\empty
      \else \@examinerv \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examinervaff  \\ \pmss \fi
      \pmss
      Yukar{\i}daki imzalar{\i}n ad{\i}\ ge\c{c}en \"o\u{g}retim \"uyelerine ait oldu\u{g}unu onaylar{\i}m. \\
      \vspace*{0.5\baselineskip} \\
      \hspace*{\fill} \makebox[40mm]\dotfill \\
      \hspace*{\fill} \@dean \\
      \hspace*{\fill} Lisans\"ust\"u E\u{g}itim Enstit\"us\"u M\"ud\"ur\"u \\
      \hspace*{\fill} Onay Tarihi:\hspace{0.3em}
      \ifx\@dateofapproval\empty \@@warning{No \string\dateofapproval\space given}
      \else \@dateofapproval \fi
    }
%
    \newcommand{\makedeclaration}{
      \clearpage
      \begin{center}
        \bf{ARA\c{S}TIRMA ET{\.I}\u{G}{\.I} VE \\
        YAYIN Y\"ONTEMLER{\.I} B{\.I}LD{\.I}R{\.I}M{\.I}}
      \end{center}
      \noindent Ben, \@author; 
      \begin{itemize}
      \item Haz{\i}rlad{\i}\u{g}{\i}m bu \thisthesistype nin
        tamamen kendi \c{c}al{\i}\c{s}mam oldu\u{g}unu ve ba\c{s}ka
        \c{c}al{\i}\c{s}malardan yapt{\i}\u{g}{\i}m al{\i}nt{\i}lar{\i}n
        kaynaklar{\i}n{\i} kurallara uygun bi\c{c}imde tez i\c{c}erisinde
        belirtti\u{g}imi;
      \item Bu \thisthesistype nin ba\c{s}ka bir e\u{g}itim kurumunda
        bir derece veya diplomaya sunulan veya kabul edilen herhangi bir materyal
        i\c{c}ermedi\u{g}ini;
      \item ``Y\"uksek \"O\u{g}retim Kurulu Etik Davran{\i}\c{s} \.Ilkeleri"
        uyar{\i}nca haz{\i}rlanan ``Kadir Has \"Universitesi Akademik Etik
        \.Ilkeleri"ni takip etti\u{g}imi onayl{\i}yorum.
      \end{itemize}
      \noindent Buna ek olarak, bu \c{c}al{\i}\c{s}ma ile ilgili ortaya \c{c}{\i}kabilecek
      herhangi bir usuls\"{u}zl\"{u}k iddias{\i}n{\i}n, \"universite mevzuat{\i}na uygun olarak
      disiplin i\c{s}lemi ile sonu\c{c}lanaca\u{g}{\i}n{\i} kabul ediyorum.
      \par
      \vspace{\baselineskip}
      \noindent\@author \\
      \vspace*{0.5\baselineskip} \\
      \makebox[40mm]\dotfill \\
      \@dateofapproval
      \global\let\@author\@empty         \global\let\author\relax
      \global\let\@dateofapproval\@empty \global\let\dateofapproval\relax
      \global\let\@advisor\@empty        \global\let\advisor\relax
      \global\let\@coadvisor\@empty      \global\let\coadvisor\relax
      \global\let\@examineri\@empty      \global\let\examineri\relax
      \global\let\@examinerii\@empty     \global\let\examinerii\relax
      \global\let\@examineriii\@empty    \global\let\examineriii\relax
      \global\let\@examineriv\@empty     \global\let\examineriv\relax
      \global\let\@examinerv\@empty      \global\let\examinerv\relax
      \global\let\@advisoraff\@empty     \global\let\advisoraff\relax
      \global\let\@coadvisoraff\@empty   \global\let\coadvisoraff\relax
      \global\let\@examineriaff\@empty   \global\let\examineriaff\relax
      \global\let\@examineriiaff\@empty  \global\let\examineriiaff\relax
      \global\let\@examineriiiaff\@empty \global\let\examineriiiaff\relax
      \global\let\@examinerivaff\@empty  \global\let\examinerivaff\relax
      \global\let\@examinervaff\@empty   \global\let\examinervaff\relax
      \global\let\@dean\@empty           \global\let\dean\relax
      }
}
\DeclareOption{english}
    {
    \newcommand\prefacename{PREFACE} 
    \newcommand\forewordname{FOREWORD}
    \newcommand\ackname{ACKNOWLEDGEMENT}
    \renewcommand\contentsname{TABLE OF CONTENTS}
    \newcommand\ozetname{\"OZET}
    \newcommand{\listsymbolname}{LIST OF SYMBOLS}
    \newcommand{\listabbname}{LIST OF ACRONYMS AND ABBREVIATIONS}
    \renewcommand\indexname{INDEX}
    \renewcommand\partname{PART}
    \renewcommand\appendixname{APPENDIX}
    \renewcommand\abstractname{ABSTRACT}
    \renewcommand\listfigurename{LIST OF FIGURES}
    \renewcommand\listtablename{LIST OF TABLES}
    \renewcommand{\bibname}{BIBLIOGRAPHY}
    \newcommand{\bibncname}{REFERENCES NOT CITED}
    \renewcommand\figurename{Figure}
    \renewcommand\tablename{Table}
%
    \newcommand\downtitle{
      \vskip100pt
      A \ifnum\@thesistype=1 {project} \else {thesis} \fi submitted to \\
      the School of Graduate Studies of Kadir Has University \\
      in partial fulfilment of the requirements for the degree of \\
      \ifnum\@thesistype=3 {Master of Arts}
      \else 
           \ifnum\@thesistype=4 {Doctor of Philosophy}
           \else {Master of Science}
           \fi
      \fi
      in \\ \@program
      \vfill
      \.Istanbul, \@submonth, \@subyear \\ \null
    }
%
    \newcommand\thisthesistype{
      \unskip
      \ifnum\@thesistype=1 master's graduation project
      \else
        \ifnum\@thesistype=2 master's thesis
         \else Ph.D.\ thesis
        \fi
      \fi
      \unskip
    }
%
    \newcommand\makeapprovalpage{%
      \relaxtitlestuff
      \clearpage
      \pagestyle{fancy}
      \addtocounter{page}{1}
      \ifx\@dateofapproval\empty \@@warning{No \string\dateofapproval\space given}\fi
      \begin{center}
      {\large\bfseries APPROVAL} \par
      \end{center}
      This \ifnum\@thesistype=1{project} \else{thesis}\ titled \@title\ submitted by \@author,
      in partial fulfillment of the requirements for the degree of
      \ifnum\@thesistype=3{Master of Arts}
      \else
           \ifnum\@thesistype=4{Doctor of Philosophy}
           \else{Master of Science}
           \fi
      \fi
      in \@program\ is approved by \par
      \def\pmss{\vspace*{-0.3\baselineskip} \\ \mbox{}}    % \pmss: poor mans single spacing %\mbox prevents underfull hbox warning
      \ifx\@advisor\empty \@@warning{No \string\advisor\space given}
      \else \@advisor\ (Advisor) \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@advisoraff \\ \pmss \fi
      \ifx\@coadvisor\empty
      \else \@coadvisor\ (Co-Advisor) \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@coadvisoraff \\ \pmss \fi
      \ifx\@examineri\empty
      \else \@examineri \hfill \makebox[40mm]\dotfill \pmss \@examineriaff  \\ \pmss \fi
      \ifx\@examinerii\empty
      \else \@examinerii \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examineriiaff  \\ \pmss \fi
      \ifx\@examineriii\empty
      \else \@examineriii \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examineriiiaff \\ \pmss \fi
      \ifx\@examineriv\empty
      \else \@examineriv \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examinerivaff  \\ \pmss \fi
      \ifx\@examinerv\empty
      \else \@examinerv \hspace*{\fill} \makebox[40mm]\dotfill \pmss \@examinervaff  \\ \pmss \fi
      \pmss
      I confirm that the signatures above belong to the aforementioned faculty members.
      \vspace*{0.5\baselineskip} \\
      \hspace*{\fill} \makebox[40mm]\dotfill \\
      \hspace*{\fill} \@dean \\
      \hspace*{\fill} Dean of School of Graduate Studies \\
      \hspace*{\fill} Date of Approval:\hspace{0.3em}
      \ifx\@dateofapproval\empty \@@warning{No \string\dateofapproval\space given}
      \else \@dateofapproval \fi
    }
%
    \newcommand{\makedeclaration}{
      \clearpage
      \begin{center}
        \bf{DECLARATION ON RESEARCH ETHICS AND \\ PUBLISHING METHODS}
      \end{center}
      \noindent I, \@author; hereby declare
      \begin{itemize}
      \item that this
        \ifnum\@thesistype=1{Graduation Project}
        \else
             \ifnum\@thesistype=2{Master of Science Thesis}
             \else
                 \ifnum\@thesistype=3{Master of Arts Thesis}
                 \else {Ph.D.\ Thesis}
                 \fi
            \fi
        \fi
        that I have submitted is entirely
        my own work and I have cited and referenced all material and
        results that are not my own in accordance with the rules;
      \item that this
        \ifnum\@thesistype=1{Graduation Project}
        \else
             \ifnum\@thesistype=2{Master of Science Thesis}
             \else{Ph.D.\ Thesis}
             \fi
        \fi
        does not contain any material from
        any research submitted or accepted to obtain a degree or diploma
        at another educational institution;
      \item and that I commit and undertake to follow the ``Kadir Has
        University Academic Codes and Conduct" prepared in accordance with
        the ``Higher Education Council Codes of Conduct".
      \end{itemize} 
      In addition, I acknowledge that any claim of irregularity that may
      arise in relation to this work will result in a disciplinary action in
      accordance with university legislation.
      \par
      \vspace{\baselineskip}
      \noindent\@author \\
      \vspace*{0.5\baselineskip} \\
      \makebox[40mm]\dotfill \\
      \@dateofapproval
      \global\let\@author\@empty         \global\let\author\relax
      \global\let\@dateofapproval\@empty \global\let\dateofapproval\relax
      \global\let\@advisor\@empty        \global\let\advisor\relax
      \global\let\@coadvisor\@empty      \global\let\coadvisor\relax
      \global\let\@examineri\@empty      \global\let\examineri\relax
      \global\let\@examinerii\@empty     \global\let\examinerii\relax
      \global\let\@examineriii\@empty    \global\let\examineriii\relax
      \global\let\@examineriv\@empty     \global\let\examineriv\relax
      \global\let\@examinerv\@empty      \global\let\examinerv\relax
      \global\let\@advisoraff\@empty     \global\let\advisoraff\relax
      \global\let\@coadvisoraff\@empty   \global\let\coadvisoraff\relax
      \global\let\@examineriaff\@empty   \global\let\examineriaff\relax
      \global\let\@examineriiaff\@empty  \global\let\examineriiaff\relax
      \global\let\@examineriiiaff\@empty \global\let\examineriiiaff\relax
      \global\let\@examinerivaff\@empty  \global\let\examinerivaff\relax
      \global\let\@examinervaff\@empty   \global\let\examinervaff\relax
      \global\let\@dean\@empty           \global\let\dean\relax
    }

}
\DeclareOption*{\PackageError{Invalid Option}{Unknown option for the KHas_thesis style}{}}
\ProcessOptions
\typeout{Thesis style for L.E.E., Kadir Has University, Version 3.10}
\typeout{Prepared by Feza Kerestecioglu}
%
% Definitions for title and approval pages
%
\def\turkcebaslik#1{\gdef\@turkcebaslik{#1}}
\def\program#1{\gdef\@program{#1}}
\def\submonth#1{\gdef\@submonth{#1}}
\def\subyear#1{\gdef\@subyear{#1}}
\def\advisor#1{\gdef\@advisor{#1}}
\def\coadvisor#1{\gdef\@coadvisor{#1}}
\def\examineri#1{\gdef\@examineri{#1}}
\def\examinerii#1{\gdef\@examinerii{#1}}
\def\examineriii#1{\gdef\@examineriii{#1}}
\def\examineriv#1{\gdef\@examineriv{#1}}
\def\examinerv#1{\gdef\@examinerv{#1}}
\def\advisoraff#1{\gdef\@advisoraff{#1}}
\def\coadvisoraff#1{\gdef\@coadvisoraff{#1}}
\def\examineriaff#1{\gdef\@examineriaff{#1}}
\def\examineriiaff#1{\gdef\@examineriiaff{#1}}
\def\examineriiiaff#1{\gdef\@examineriiiaff{#1}}
\def\examinerivaff#1{\gdef\@examinerivaff{#1}}
\def\examinervaff#1{\gdef\@examinervaff{#1}}
\def\dateofapproval#1{\gdef\@dateofapproval{#1}}
\def\thesistype#1{\gdef\@thesistype{#1}}
\def\dean#1{\gdef\@dean{#1}}
%
\global\let\@turkcebaslik\empty
\global\let\@program\empty
\def\nyear{\number\year}
\global\let\@subyear\nyear
\global\let\@submonth\empty
\global\let\@advisor\empty
\global\let\@coadvisor\empty
\global\let\@examineri\empty
\global\let\@examinerii\empty
\global\let\@examineriii\empty
\global\let\@examineriv\empty
\global\let\@examinerv\empty
\global\let\@advisoraff\empty
\global\let\@coadvisoraff\empty
\global\let\@examineriaff\empty
\global\let\@examineriiaff\empty
\global\let\@examineriiiaff\empty
\global\let\@examinerivaff\empty
\global\let\@examinervaff\empty
\global\let\@dateofapproval\empty
\global\let\@thesistype\empty
\global\let\@dean\empty
%
% Other definitions
%
\xdef\@singlespaced{1}
\xdef\@onehalfspaced{1.5}
\xdef\@twothirdspaced{0.666667}
%
\newlength{\spv}
\newlength{\ei}
\newlength{\csi}
\newlength{\eii}
\newlength{\eiii}
\newlength{\eiv}
\newlength{\ev}
\let\@app\empty
\newcounter{thsfootcnt}
%
% Title page
%
\newcommand\uptitle{
  \vspace*{75pt}
  {\bf \Large \@title} \\%
  \vskip90pt
  \@author \\
  \vspace*{100pt}
}
%
\newcommand\relaxtitlestuff{
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@date\@empty
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax}
%
\newcommand\makemstitle{
   \thesistype{2}
   \begin{titlepage}
     \ifx\@author\empty \@@warning{No \string\author\space given} \fi
     \ifx\@title\empty \@@warning{No \string\title\space given} \fi
     \ifx\@program\empty \@@warning{No \string\program\space given} \fi
     \ifx\@submonth\empty \@@warning{No \string\submonth\space given} \fi
     \ifx\@subyear\empty \@@warning{No \string\subyear\space given} \fi
     \begin{center}
       \uptitle
       \downtitle
     \end{center}
  \end{titlepage}
}
%
\newcommand\makematitle{
   \thesistype{3}
   \begin{titlepage}
     \ifx\@author\empty \@@warning{No \string\author\space given} \fi
     \ifx\@title\empty \@@warning{No \string\title\space given} \fi
     \ifx\@program\empty \@@warning{No \string\program\space given} \fi
     \ifx\@submonth\empty \@@warning{No \string\submonth\space given} \fi
     \ifx\@subyear\empty \@@warning{No \string\subyear\space given} \fi
     \begin{center}
       \uptitle
       \downtitle
     \end{center}
  \end{titlepage}
}
%
\newcommand\makephdtitle{
  \thesistype{4}
    \begin{titlepage}
    \ifx\@author\empty \@@warning{No \string\author\space given} \fi
    \ifx\@title\empty \@@warning{No \string\title\space given} \fi
    \ifx\@program\empty \@@warning{No \string\program\space given} \fi
    \ifx\@submonth\empty \@@warning{No \string\submonth\space given} \fi
    \ifx\@subyear\empty \@@warning{No \string\subyear\space given} \fi
    \begin{center}
      \uptitle
      \downtitle
    \end{center}
  \end{titlepage}
}
%
\newcommand\makeprojecttitle{
  \thesistype{1}
  \begin{titlepage}
    \ifx\@author\empty \@@warning{No \string\author\space given} \fi
    \ifx\@title\empty \@@warning{No \string\title\space given} \fi
    \ifx\@program\empty \@@warning{No \string\program\space given} \fi
    \ifx\@submonth\empty \@@warning{No \string\submonth\space given} \fi
    \ifx\@subyear\empty \@@warning{No \string\subyear\space given} \fi
    \begin{center}
      \uptitle
      \downtitle
    \end{center}
  \end{titlepage}
}
%
% Abstract, Acknowledgements, Ozet, etc.
%
\renewenvironment{abstract}{%
  \clearpage
  \addtocontents{toc}{\bf  %
    \noindent
    \abstractname
      \nobreak\leaders
      \hbox{$\m@th \mkern \@dotsep mu.\mkern
            \@dotsep mu$}
      \hfill \nobreak
      \hb@xt@\@pnumwidth{\hss \thepage}\par
  }
  \begin{center}
  {\normalfont
   \interlinepenalty\@M \vskip-4pt
   \@title\par\nobreak
   }
   \end{center}
   \@makeschapterhead{\abstractname} \@afterheading
  }
  {\par\vfil\null}
%
\newenvironment{dedication}{\clearpage}{\par\vfil\null}
%
\newenvironment{acknowledgements}{\chapter*{\ackname}}
  {\par\vfil\null}
%
\newenvironment{preface}{\chapter*{\prefacename}}
  {\par\vfil\null}
%
\newenvironment{foreword}{\chapter*{\forewordname}}
  {\par\vfil\null}
%
\newenvironment{ozet}{%
  \clearpage
  \addtocontents{toc}{\bf  %
    \noindent
    \ozetname
    \nobreak\leaders
    \hbox{$\m@th \mkern \@dotsep mu.\mkern
          \@dotsep mu$}
    \hfill \nobreak
    \hb@xt@\@pnumwidth{\hss \thepage}\par
  }
  \begin{center}  % Thesis title in Turkish should appear in the abstract page.
  {\normalfont
   \interlinepenalty\@M \vskip-4pt
   \@turkcebaslik\par\nobreak
   }
   \end{center}
   \@makeschapterhead{\ozetname} \@afterheading
  }
  {\par\vfil\null}
%
\newenvironment{symbols}{%
    \clearpage
    \chapter*{\listsymbolname}
    \beginsymlist}
  {\closesymlist}
%
\newenvironment{abbreviations}{%
     \clearpage
     \chapter*{\listabbname}
     \beginsymlist}
  {\closesymlist}
%
\newcommand{\beginsymlist}{%
  \begin{tabbing}
  \hspace*{\symtabi}\=\hspace*{\symtabii}\=\kill}
%
\newcommand{\closesymlist}{\end{tabbing}}
%
\newcommand{\sym}[2]{\>#1 \>\parbox[t]{12.2cm}{#2} \\}
\newlength{\symtabi}
\newlength{\symtabii}
\setlength{\symtabi}{1em}
\setlength{\symtabii}{7em}
%
%
% Sectional Units
%
\renewcommand\chapter{\clearpage
                      \global\@topnum\z@
                      \@afterindenttrue
                      \secdef\@chapter\@schapter}
%
\renewcommand\@makechapterhead[1]{\begin{center}
  {\normalfont
   \ifnum \c@secnumdepth >\m@ne
   \vspace*{0.5cm}
   \ifx\@app\empty
       \large\bfseries \thechapter.\hspace{1ex}
   \else
       \large\bfseries \appendixname\ \thechapter:\hspace{1ex}
   \fi
   \fi
   \interlinepenalty\@M
   \large \bfseries #1\par\nobreak
  }\end{center}}
%
\renewcommand\@makeschapterhead[1]{\begin{center}
  {\normalfont
   \interlinepenalty\@M
   \large \bfseries  #1\par\nobreak
  }\end{center}}
%
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                    \refstepcounter{chapter}%
                    \typeout{\@chapapp\space\thechapter.}%
                    \ifx\@app\empty
                        \addcontentsline{toc}{chapter}%
                            {\protect\numberline{\chaptocapp}#1}%
                    \else
                       \addtocontents{toc}{\bf  %
                       \noindent
                       \appendixname\ \thechapter:\hspace{1.6ex}#1
                       \nobreak\leaders
                       \hbox{$\m@th \mkern \@dotsep mu.\mkern
                             \@dotsep mu$}
                       \hfill \nobreak
                       \hb@xt@\@pnumwidth{\hss \thepage}\par}
                    \fi
                    \else
                       \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                      \@makechapterhead{#2}%
                      \@afterheading
                   }
%
\renewcommand\@schapter[1]{\addcontentsline{toc}{chapter}{#1}%
     \@makeschapterhead{#1} \@afterheading}
%
\def\chaptocapp{\thechapter.}
%
\renewcommand\section{%
  \@startsection{section}{1}{\z@}
   {6pt}{0.1pt}{\bfseries\normalsize}
  }
\renewcommand\subsection{%
  \@startsection{subsection}{2}{\z@}
   {6pt}{0.1pt}{\bfseries\normalsize}
  }
\renewcommand\subsubsection{%
  \@startsection{subsubsection}{3}{\z@}
   {6pt}{-0.5em}{\bfseries\normalsize}
  }
\renewcommand\paragraph{%
  \@startsection{paragraph}{4}{\z@}
   {3.25ex \@plus1ex \@minus.2ex}{-0.5em}
   {\normalfont\normalsize\itshape\hskip\parindent}
  }
%
% The space between the section number and title are set to 0.5em
\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  \let\@svsec\@empty\else
  \refstepcounter{#1}
  \edef\@svsec{\csname the#1\endcsname\hskip 0.5em}
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
     \begingroup #6\relax
        \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}%
     \endgroup
     \csname #1mark\endcsname{#7}
     \addcontentsline{toc}{#1}
        {\ifnum #2>\c@secnumdepth
         \else  \protect\numberline{\csname the#1\endcsname}
         \fi
         #7}
  \else
     \def\@svsechd{#6\hskip #3\relax  %% \relax added 2 May 90
        \@svsec #8\ifnum #2>\c@secnumdepth.\fi
        \csname #1mark\endcsname{#7}
        \addcontentsline{toc}{#1}
          {\ifnum #2>\c@secnumdepth
           \else \protect\numberline{\csname the#1\endcsname}
           \fi
       #7}}
  \fi
  \@xsect{#5}}
%
%\addtocounter{secnumdepth}{1}
%\addtocounter{tocdepth}{1}
%
% Figures and Tables
%
\renewcommand\listoffigures{%       \ev is used for temporary strage of \parskip
  \clearpage
  \addtocontents{toc}{\bf  %
    \noindent
    \listfigurename
    \nobreak\leaders
    \hbox{$\m@th \mkern \@dotsep mu.\mkern
          \@dotsep mu$}
    \hfill \nobreak
    \hb@xt@\@pnumwidth{\hss \thepage}\par
  }
  \begin{center}
  {\normalfont
   \interlinepenalty\@M
   \large \bfseries  \listfigurename\par\nobreak
   \vskip21pt \vspace*{19pt}
  }
  \end{center}
  \@afterheading
  \setlength{\ev}{\parskip}
  \parskip-\baselineskip
  \@starttoc{lof}%
  \parskip\ev
  }
%
\renewcommand\listoftables{% \ev is used for temporary storage of \parskip
  \clearpage
  \addtocontents{toc}{\bf  %
    \noindent
    \listtablename
    \nobreak\leaders
    \hbox{$\m@th \mkern \@dotsep mu.\mkern
          \@dotsep mu$}
    \hfill \nobreak
    \hb@xt@\@pnumwidth{\hss \thepage}\par
  }  \begin{center}
  {\normalfont
   \interlinepenalty\@M
   \large \bfseries  \listtablename\par\nobreak
   \vskip21pt \vspace*{19pt}
  }
  \end{center}
  \@afterheading
  \setlength{\ev}{\parskip}
  \parskip-\baselineskip
  \@starttoc{lot}%
  \parskip\ev
  }
%
% The expressions 'FIGURE' and 'TABLE' also appear in the LOF and LOT.
% "Table", "Figure" and their numbers typeset in bold.
%
\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
  ext@#1\endcsname}{#1}
% Caution: The \csname command should follow immediately after {
  {\protect\numberline{\csname #1name\endcsname \space
  \csname the#1\endcsname}{\ignorespaces #2}\vspace\baselineskip}\begingroup
    \@parboxrestore
    \normalsize
    \@makecaption{{\bf \csname fnum@#1\endcsname}}{\ignorespaces #3}\par  %table and figure and their number typeset in bold.
  \endgroup}
%
% The space between the figure and caption is reduced from 10\p@ to 0\p@
% The value of \belowcaptionskip (0\p@) has not been changed.
\setlength\abovecaptionskip{0\p@}
%
% A period should appear after the caption number. Also captions are tyeset in singlespacing.
%
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
\baselineskip\@twothirdspaced\baselineskip %it did not work with \baselinestretch ??
  \centering{
  \sbox\@tempboxa{#1 #2}%
  \ifdim \wd\@tempboxa >\hsize
    #1 #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  } % closes centering
\baselineskip\@onehalfspaced\baselineskip
  \vskip\belowcaptionskip}
%
% The spaces between the figure or table number and the caption are redefined.
%
\renewcommand\l@figure{\@dottedtocline{1}{0em}{6em}}
\renewcommand\l@table{\@dottedtocline{1}{0em}{5.8em}}
%
% Table of Contents
%
\renewcommand\tableofcontents{% \ev is used for temporary storage of \parskip
  \setlength{\ev}{\parskip}
  \parskip0pt
% A line as 'TABLE OF CONTENTS' must not appear in the Table of Contents.
% Hence we reproduce the \chapter* here except that no entry is put into the toc file.
  \clearpage  \global\@topnum\z@
  \@afterindenttrue
  \begin{center}
  {\normalfont
   \interlinepenalty\@M
   \large \bfseries  \contentsname\par\nobreak
   \vskip0.8\baselineskip
  }
  \end{center}
  \@afterheading
  \@starttoc{toc}%
  \parskip\ev
}
% Borrowed from fbe_tez and added \bferies command.
\renewcommand\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \setlength\@tempdima{1.5em}%
    \begingroup \bfseries
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep
       mu$}\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
%
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{3.9em}{2.7em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{7em}{3.8em}}
\renewcommand*\l@paragraph{\@dottedtocline{4}{11.1em}{4.7em}}
\renewcommand*\l@subparagraph{\@dottedtocline{5}{16.1em}{5.7em}}
%
% Appendix
%
\renewcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \renewcommand\@chapapp{\appendixname}
  \renewcommand\thechapter{\@Alph\c@chapter}%
  \let\@app1
}
\newcommand\noappendix{\par  %used for generating figure and table entries of sample pages.
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \renewcommand\@chapapp{Chapter}
  \renewcommand\thechapter{\@arabic\c@chapter}%
  \let\@app\empty
}
%
% References
%
\def\@biblabel#1{[#1]\hfill}
%
\newenvironment{harvardbibliography}{%
     \chapter*{\bibname} \vskip0.5\baselineskip
     \baselineskip\@twothirdspaced\baselineskip %it did not work with \baselinestretch ??
     \begin{list}{}{\topsep0pt \leftmargin0cm \rightmargin0pt
                    \itemindent0cm \itemsep18pt \parsep0pt}
     }
     {\def\@noitemerr
       {\@latex@warning{Empty `harvardbibliography' environment}}
       \end{list}
       \baselineskip\@onehalfspaced\baselineskip
     }
%
\newenvironment{harvardbibnotcited}{%
     \chapter*{\bibncname} \vskip0.5\baselineskip
     \baselineskip\@twothirdspaced\baselineskip
     \begin{list}{}{\topsep0pt \leftmargin0cm \rightmargin0pt
                    \itemindent0cm \itemsep18pt \parsep0pt}
     }
     {\def\@noitemerr
       {\@latex@warning{Empty `harvardbibnotcited' environment}}%
     \end{list}
     \baselineskip\@onehalfspaced\baselineskip
     }
%  
\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname}  \vskip0.85\baselineskip
     \baselineskip\@twothirdspaced\baselineskip
     \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \topsep0pt
            \itemsep18pt
            \parskip0pt
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist
      \baselineskip\@onehalfspaced\baselineskip
      }
%
%
% Footnotes are numbered consecutively throughout the
% whole thesis and single line-spacing is invoked.
%
\def\footnote#1{%
   \@ifnextchar[{\@xfootnote}{%
\setcounter{footnote}{\value{thsfootcnt}}%
\addtocounter{thsfootcnt}{1}%
   \stepcounter{\@mpfn}%
     \begingroup\let\protect\noexpand
       \xdef\@thefnmark{\thempfn}\endgroup
\let\baselinestretch\@singlespaced 
     \@footnotemark\@footnotetext{\small #1} %instead of \footnotesize we use \small size.
\let\baselinestretch\@onehalfspaced}
}
%
% 1.5 line spacing is valid also in quotations.
%
\renewenvironment{quotation}{%
     \par
     \list{}{%
\let\baselinestretch\@singlespaced
      \listparindent 1.5em%
      \itemindent    \listparindent
      \rightmargin   \leftmargin
      \parsep        \z@ \@plus\p@}%
      \small
      \item\relax}
     {\par
\let\baselinestretch\@onehalfspaced
      \endlist}
      
\renewenvironment{quote}{%
      \par
\let\baselinestretch\@singlespaced
      \list{}{%
       \baselineskip0.67\baselineskip
       \listparindent 1.5em%
       \itemindent\listparindent
       \rightmargin\leftmargin}%
       \small
       \item\relax}
     {\par
\let\baselinestretch\@onehalfspaced
      \endlist}
%
% Spacing for displayed formulas and listings; within the text or
% footnotes
%
\renewcommand{\normalsize}{%
   \@setsize\normalsize{14.5pt}\xiipt\@xiipt
%   \abovedisplayskip 22pt
   \belowdisplayskip \abovedisplayskip
   \abovedisplayshortskip  \abovedisplayskip
   \belowdisplayshortskip  \abovedisplayskip
   \let\@listi\@listI
}
\renewcommand\footnotesize{%
   \@setfontsize\footnotesize\@xpt\@xiipt
%   \abovedisplayskip 12pt
   \belowdisplayskip \abovedisplayskip
   \abovedisplayshortskip  \abovedisplayskip
   \belowdisplayshortskip  \abovedisplayskip
   \def\@listi{\leftmargin\leftmargini
            \parsep 0pt
            \topsep 0pt
            \itemsep 0pt}
}
\setlength\leftmargini{1cm}
\def\@listI{\leftmargin\leftmargini
            \parsep 0pt
            \topsep 0pt
            \itemsep 0pt}
\def\@listii {\leftmargin\leftmarginii
              \labelwidth\leftmarginii
              \advance\labelwidth-\labelsep
              \parsep 0pt
              \topsep 0pt
              \itemsep 0pt}
\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep
              \parsep 0pt
              \topsep 0pt
              \partopsep 0pt
              \itemsep 0pt}
%
% Page style
%
\oddsidemargin14.6mm
\evensidemargin14.6mm
\topmargin-12.mm
\headheight20pt
\textwidth150mm
\textheight237mm
\footskip15mm
\parindent0cm
\renewcommand{\headrulewidth}{0pt}
\fancyhead{}
\fancyfoot{}
% The page number will appear in the right corner of the footer.
\fancyfoot[R]{\thepage}
% No pagenumber in the title page
\pagestyle{empty}
%
% Invoke 1.5 spacing
\renewcommand{\baselinestretch}{1.5}
\setlength{\parskip}{18pt}
%
% This is end of Khas_thesis.sty.
