

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{206499class}     %%%%%%%%%%%%%%%%%%%%%%%%% ชื่อ Class
%[1996/03/10 v1.1  Chulalongkorn University thesis class]
\newif\ifphd
\DeclareOption{phd}{\phdtrue}
\DeclareOption{master}{\phdfalse}
\ExecuteOptions{master}
\DeclareOption{10pt}{%
  \OptionNotUsed%
  \ClassWarningNoLine{chula}{Font size 10pt not allowed; using 12pt}%
}
\DeclareOption{11pt}{%
  \OptionNotUsed%
  \ClassWarningNoLine{myclass}{Font size 11pt not allowed; using 12pt}%
}
\DeclareOption{letterpaper}{%
  \OptionNotUsed%
  \ClassWarningNoLine{myclass}{Letter size paper not allowed; using A4 size}%
}
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{report}%
}
\ProcessOptions

\LoadClass[a4paper,12pt]{report}[1994/06/01]  %%%%%% ใช้ Class report เป็นตัวตั้ง

% Change the chapter head commands so that the chapter head is
% centered and the chapter number is printed in capital Roman
% numerals in the head. Also, reduce the vertical spacing in
% the chapter head and use a smaller font. For "starred" chapters,
% include an entry in the table of contents, and use even more
% economical spacing in the chapter head.


%%%%  การจัดการ Chapter Management  %%%%
\renewcommand\@makechapterhead[1]{%
  \vspace*{0\p@}
  %%% ระยะห่างจากขอบบนกับเลขบท
  {\parindent \z@ \centering \normalfont
    \ifnum \c@secnumdepth >\m@ne
		\large  	 	%   ขนาดอักษร Chapter และตัวเลข
        \bfseries \@chapapp\space \arabic{chapter} %ตัวเลขของchapter แบบเลข arabic, roman, Roman, alph, Alph
         \par\nobreak  \vskip 20\p@                                % คำสั่งขึ้นบรรทัดใหม่
    \fi
    \interlinepenalty\@M
   \large  										 %   ขนาดอักษร Chapter Title	
    \bfseries #1\par\nobreak
    \vskip 20\p@   										  %% ระยะห่างจากชื่อบทกับข้อความ
     \thispagestyle{empty}
  }}
\renewcommand\@makeschapterhead[1]{%
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \large\bfseries  #1\par\nobreak
    \vskip  20\p@
     \thispagestyle{empty}
  }}
\renewcommand\@schapter[1]{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi
         \addcontentsline{toc}{chapter}{#1}}
% Make the word "chapter" appear in all caps.



% Use a smaller font for section headings

\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\large\bfseries}}    %อักษรของ section

% Use better-looking symbols for the empty set and set minus.

\renewcommand{\emptyset}{\ensuremath{\varnothing}}
\renewcommand{\setminus}{\smallsetminus}

% Force loading of the package `amsthm' at this point, so we can
% change the word "Proof" that starts a proof environment to be
% upright and boldface.

\RequirePackage{amsthm}
%\renewcommand{\proofname}{\emph{\bfseries Proof}}
%{\upshape\bfseries Proof}
%{{\textbf{\emph{Proof}}}


\RequirePackage{ifthen}

\renewcommand{\footnotesize}{\normalsize}
\renewcommand{\@makefntext}[1]{%
  \parindent 1em%
  \noindent
  \footnotespacing
  \hbox to 1.8em{\hss\@makefnmark}#1
  \par\normalspacing
}  %% ฟุ๊ตโน๊ต
\renewcommand{\defaultscriptratio}{.75}
\renewcommand{\defaultscriptscriptratio}{.6}
\setlength\topmargin{0\p@}
\setlength\headheight{12\p@}
\setlength\headsep{25\p@}
\setlength\textwidth\paperwidth
\addtolength\textwidth{-2.52in}
\setlength\textheight\paperheight
\addtolength\textheight{-2.52in}
\setlength\oddsidemargin{.51in}
\setlength\evensidemargin{.51in}



%%%%%%%%%%% ใส่หัวกระดาษ ใช้ package fancy  แล้ว
\pagestyle{myheadings}
\markboth{}{}
\raggedbottom
%%%%%%%%%
% A special environment for the front part of the thesis, such
% as the abstract, table of contents, etc.

\newenvironment{frontmatter}{%
  \pagenumbering{roman}\addtocounter{page}{1}%
  \singlespacing
  \maketitle
  \makesignaturepage
  \addtocontents{toc}%
    {\protect\contentsline{chapter}{Abstract in Thai}{\roman{page}}}%
  \addtocounter{page}{1}%
  \addtocontents{toc}%
    {\protect\contentsline{chapter}{Abstract in English}{\roman{page}}}%
  \addtocounter{page}{1}%
}{%
  \tableofcontents
  \clearpage
  \pagenumbering{arabic}%
  \normalspacing}







%%%%%%%%% เริ่มทำปก

\newcommand{\@titlesize}{\large}
\newcommand{\@subtitlesize}{\normalsize}
\newcommand{\@authorsize}{\normalsize} % No Pharaoh he.
\newcommand{\@conferralyear}{xxxx}
\newcommand{\@isbn}{xxxx}
\newcommand{\@advisor}{xxxx}
\newcommand{\@coadvisor}{xxxx}
\newcommand{\@gradschdean}{xxxx}
\newcommand{\@examchair}{xxxx}
\newcommand{\@exammember}{xxxx}
\newcommand{\@prevdegree}{xxxx}
\newcommand{\@prevdegreeuniv}{xxxx}
\newcommand{\@prevdegreecity}{xxxx}
\newcommand{\@othervita}{}

\newcommand{\titlesize}[1]{\renewcommand{\@titlesize}{#1}}
\newcommand{\subtitlesize}[1]{\renewcommand{\@subtitlesize}{#1}}
\newcommand{\authorsize}[1]{\renewcommand{\@authorsize}{#1}}
\newcommand{\conferralyear}[1]{\renewcommand{\@conferralyear}{#1}}
\newcommand{\isbn}[1]{\renewcommand{\@isbn}{#1}}
\newcommand{\@degreefield}{Master of Science in Mathematics}
\newcommand{\degreefield}[1]{\renewcommand{\@degreefield}{#1}}
\newcommand{\advisor}[1]{\renewcommand{\@advisor}{#1}}
\newcommand{\coadvisor}[1]{\renewcommand{\@coadvisor}{#1}}
\newcommand{\gradschdean}[1]{\renewcommand{\@gradschdean}{#1}}
\newcommand{\examchair}[1]{\renewcommand{\@examchair}{#1}}
\newcommand{\exammember}[1]{\renewcommand{\@exammember}{#1}}
\newcommand{\prevdegree}[3]{\renewcommand{\@prevdegree}{#1}%
  \renewcommand{\@prevdegreeuniv}{#2}%
  \renewcommand{\@prevdegreecity}{#3}}
\newcommand{\addvitaline}[2]{\edef\@othervita{\@othervita\cr#1&#2}}

\renewcommand{\maketitle}{%
  \begin{titlepage}%
    \begin{center}%
      \@titlesize \expandafter\uppercase\expandafter{\@title}
    \end{center}
    \vfill
    \begin{center}
      \@authorsize
      \@author
    \end{center}
    \vfill
    \begin{center}
      \@subtitlesize
      A \ifphd Dissertation \else Thesis \fi
      Submitted in Partial Fulfillment of the Requirements \\
      for the Degree of \ifphd Doctor of Philosophy \else \@degreefield \fi \\
      Department of Mathematics \\
      Graduate School \\
      Chulalongkorn University \\
      Academic Year  \@conferralyear \\
      ISBN \@isbn
    \end{center}
  \end{titlepage}
}

\renewenvironment{titlepage}{%
  \typeout{Title page}
  \thispagestyle{empty}
}{%
  \clearpage
}

\newcommand{\signatureline}{\leaders\hbox to 0.5em{\hss.\hss}\hskip 2in}
\newcommand{\Asignature}[2]{%
  \hbox{\indent\signatureline\ #1}\hbox{\indent(#2)}}
\newcommand{\makesignaturepage}{%
  \normalsize\doublespacing
  \halign{##\hfil&\hskip 0.5em: ##\hfil\cr
    Thesis Title&\@title\cr
    By&\@author\cr
    Department&Mathematics\cr
    Thesis Advisor&\@advisor
    \ifthenelse{\equal{\@coadvisor}{xxxx}}{}{%
      \cr Thesis Coadvisor&\@coadvisor}\cr}
  \vskip 12\p@
  \hrule
  \vskip 1.5\baselineskip
  \singlespacing
  \indent Accepted by the Graduate School, Chulalongkorn
    University, in Partial Fulfillment of the Requirements
    for the Master's Degree.
  \vskip 40\p@
  \Asignature{Dean of Graduate School}{\@gradschdean}
  \vskip 30\p@
  \hbox{Thesis Committee}
  \vskip 40\p@
  \Asignature{Chairman}{\@examchair}
  \vskip 40\p@
  \Asignature{Thesis Advisor}{\@advisor}
  \ifthenelse{\equal{\@coadvisor}{xxxx}}{}{%
    \vskip 40\p@
    \Asignature{Thesis Coadvisor}{\@coadvisor}}
  \vskip 40\p@
  \Asignature{Member}{\@exammember}
  \clearpage
}

\newenvironment{acknowledgment}{%
  \typeout{Acknowledgement page}
  \chapter*{Acknowledgement}
  \thispagestyle{myheadings}
}{%
  \clearpage}


%%%  สารบัญแล้ว

\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\l@figure}{\@dottedtocline{1}{1.5em}{2.6em}}
\let\l@table\l@figure

\renewcommand\tableofcontents{%
  \clearpage
  \global\@topnum\z@
  \@makeschapterhead{\contentsname   
    \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
     \@afterheading
  \@starttoc{toc}%
  
}






 

\newcommand\makevita{%
  \typeout{Vita}
  \thispagestyle{plain}
  \chapter*{Vita}
  \singlespacing
  \let\\=\cr
  \halign{##\hfil&\quad##\hfil\cr
    Name&\@author\cr
    Degree&\@prevdegree\cr
    &\@prevdegreeuniv\cr
    &\@prevdegreecity\@othervita\cr}%
  \clearpage}

\newcommand{\tablelistpage}{%
  \singlespacing
  \label{lot}
  \prelim@contents{\listtablename}
  \listoftables
  \normalspacing
  \clearpage
}

\newcommand{\figurelistpage}{%
  \singlespacing
  \label{lof}
  \prelim@contents{\listfigurename}
  \listoffigures
  \normalspacing
  \clearpage
}
\newcommand{\abbrlist}{%
  \singlespacing
  \prelim@contents{List of Abbreviations}
  \chapter*{List of Abbreviations}
}

\newcommand{\symlist}{%
  \singlespacing
  \prelim@contents{List of Symbols}
  \chapter*{List of Symbols}
}




%%%% ช่วงห่างของบรรทัด ปกติของ Report เป็น 1 หมด %%%%%%%%%%%%%%%%
\newcommand{\singlespacing}{%
  \let\CS=\@currsize\renewcommand{\baselinestretch}{1.4}\tiny\CS}
\newcommand{\singlespacingplus}{%
  \let\CS=\@currsize\renewcommand{\baselinestretch}{1.4}\tiny\CS}
\newcommand{\doublespacing}{%
  \let\CS=\@currsize\renewcommand{\baselinestretch}{1.4}\tiny\CS}
\newcommand{\realdoublespacing}{%
  \let\CS=\@currsize\renewcommand{\baselinestretch}{1.4}\tiny\CS}
\newcommand{\normalspacing}{\doublespacing}
\newcommand{\footnotespacing}{\singlespacing}
\newcommand{\changespacing}[2]{%
  \renewcommand{#1}{%
    \let\CS=\@currsize\renewcommand{\baselinestretch}{#2}\tiny\CS}%
}
\newcommand{\changenormalspacing}[1]{\renewcommand{\normalspacing}{#1}}
\normalspacing

 

 
\endinput
