% author: Tz-Huan Huang [http://www.csie.ntu.edu.tw/~tzhuan]

% ----------------------------------------------------------------------------
% "THE CHOCOLATE-WARE LICENSE":
% Tz-Huan Huang wrote this file. As long as you retain this notice you
% can do whatever you want with this stuff. If we meet some day, and you think
% this stuff is worth it, you can buy me a chocolate in return Tz-Huan Huang
% ----------------------------------------------------------------------------

%\RequirePackage{tabular}
\RequirePackage{array}
\RequirePackage{graphicx}
\RequirePackage{CJKutf8}
\RequirePackage{CJKvert}
\RequirePackage{CJKfntef}
\RequirePackage[top=3cm,left=3cm,bottom=2cm,right=3cm]{geometry}

\newcommand\universityCH[1]{\newcommand{\theuniversityCH}{#1}}
\newcommand\collageCH[1]{\newcommand{\thecollageCH}{#1}}
\newcommand\instituteCH[1]{\newcommand{\theinstituteCH}{#1}}
\newcommand\thesisCH[1]{\newcommand{\thethesisCH}{#1}}
\newcommand\instituteEN[1]{\newcommand{\theinstituteEN}{#1}}
\newcommand\collageEN[1]{\newcommand{\thecollageEN}{#1}}
\newcommand\universityEN[1]{\newcommand{\theuniversityEN}{#1}}
\newcommand\thesisEN[1]{\newcommand{\thethesisEN}{#1}}
\newcommand\titleCH[1]{\newcommand{\thetitleCH}{#1}}
\newcommand\titleEN[1]{\newcommand{\thetitleEN}{#1}}
\newcommand\authorCH[1]{\newcommand{\theauthorCH}{#1}}
\newcommand\authorEN[1]{\newcommand{\theauthorEN}{#1}}
\newcommand\advisorCH[1]{\newcommand{\theadvisorCH}{#1}}
\newcommand\advisorEN[1]{\newcommand{\theadvisorEN}{#1}}
\newcommand\advisortitleCH[1]{\newcommand{\theadvisortitleCH}{#1}}
\newcommand\advisortitleEN[1]{\newcommand{\theadvisortitleEN}{#1}}
\newcommand\yearCH[1]{\newcommand{\theyearCH}{#1}}
\newcommand\yearEN[1]{\newcommand{\theyearEN}{#1}}
\newcommand\monthCH[1]{\newcommand{\themonthCH}{#1}}
\newcommand\monthEN[1]{\newcommand{\themonthEN}{#1}}
\newcommand\dateCH[1]{\newcommand{\thedateCH}{#1}}
\newcommand\datetitleCH[1]{\newcommand{\thedatetitleCH}{#1}}
\newcommand\yeartitleCH[1]{\newcommand{\theyeartitleCH}{#1}}
\newcommand\monthtitleCH[1]{\newcommand{\themonthtitleCH}{#1}}
\newcommand\writtenCH[1]{\newcommand{\thewrittenCH}{#1}}
\newcommand\abstractnameEN[1]{\newcommand{\theabstractnameEN}{#1}}
\newcommand\abstractnameCH[1]{\newcommand{\theabstractnameCH}{#1}}
\newcommand\studentID[1]{\newcommand{\thestudentID}{#1}}
\newcommand\acknowledgementsnameEN[1]{\newcommand{\theacknowledgementsnameEN}{#1}}
\newcommand\acknowledgementsnameCH[1]{\newcommand{\theacknowledgementsnameCH}{#1}}

% Command to generate the title page.
\renewcommand{\maketitle}{ % {{{
\begin{CJK}{UTF8}{nkai}
\CJKhorz
\begin{titlepage}
\begin{center}
\fontsize{18}{27}\selectfont
\vspace{1cm}
\theuniversityCH\thecollageCH\theinstituteCH\\
\thethesisCH

\fontsize{14}{21}\selectfont
\theinstituteEN\\
\thecollageEN\\
\fontsize{16}{24}\selectfont
\theuniversityEN\\
\thethesisEN

\vspace{2cm}
\parbox[c][150pt][c]{\textwidth}{
\centering
\thetitleCH\\
\thetitleEN
}

\vspace{4cm}
\theauthorCH\\
\theauthorEN

\vspace{1.5cm}
\theadvisortitleCH\theadvisorCH\\
\theadvisortitleEN{} \theadvisorEN

\vspace{1.5cm}
\thedatetitleCH{}
	\raisebox{1pt}{\theyearCH} \theyeartitleCH{}
	\raisebox{1pt}{\themonthCH} \themonthtitleCH\\
\themonthEN, \theyearEN
\end{center}
\end{titlepage}
\end{CJK}
} % }}}

% Command to generate the side page.
\newcommand{\makeside}{ %{{{
\begin{CJK}{UTF8}{nkai}
\CJKvert
\fontsize{12}{12}\selectfont
\noindent\rotatebox{-90}{
\begin{tabular}{%
	m{3.5cm}m{0.1cm}m{2cm}m{0.1cm}m{10cm}m{1cm}m{2.5cm}m{0.1cm}m{1.5cm}}
\fontsize{8}{6}\selectfont\begin{CJKfilltwosides}{2.8cm}\theuniversityCH\\
	\theinstituteCH\end{CJKfilltwosides} & &
\thethesisCH & &
{\fontsize{14}{14}\selectfont\thetitleCH} & &
{\fontsize{14}{14}\theauthorCH{} \thewrittenCH} & &
\rotatebox{90}{\theyearCH} \rotatebox{90}{\hspace{0.25em}\themonthCH}
\end{tabular}
}
\end{CJK}
\thispagestyle{empty}
\newpage
} % }}}

% Command to generate the certification page
\newcommand{\makecertification}{ % {{{
\begin{CJK}{UTF8}{nkai}\CJKhorz
\addcontentsline{toc}{chapter}{口試委員會審定書}
\begin{center}
\fontsize{24}{36}\selectfont國立臺灣大學碩士學位論文\\
口試委員會審定書

\vspace{0.5cm}

\fontsize{20}{30}\selectfont\thetitleCH\\
\thetitleEN
\end{center}

\vspace{1cm}

\fontsize{15}{24}\selectfont
本論文係\theauthorCH{}君 \raisebox{1pt}{(\thestudentID)}
在國立臺灣大學資訊工程學研究所完成之碩士學位論文，於民國 
\raisebox{1pt}{\theyearCH} 年 
\raisebox{1pt}{\themonthCH} 月 
\raisebox{1pt}{\thedateCH} 日承下列考試委員審查通過及口試及格，特此證明

\vspace{1.5cm}

\centering\begin{tabular}{cp{0.8\textwidth}}
口試委員： & \\
	& \\
	& \rule{0.75\textwidth}{1pt} \\
	& \\
	& \rule{0.75\textwidth}{1pt} \\
	& \\
	& \rule{0.75\textwidth}{1pt} \\
	& \\
	& \rule{0.75\textwidth}{1pt} \\
	& \\
	& \rule{0.75\textwidth}{1pt} \\
	& \\
所~主~任 & \rule{0.75\textwidth}{1pt}
\end{tabular}
\newpage
\end{CJK}
}
% }}}

% Environment to generate the english abstract page.
\newenvironment{abstractEN} % {{{
  {\chapter*{\centerline{\theabstractnameEN}}%
	\addcontentsline{toc}{chapter}{\theabstractnameEN}%
	\quotation}
  {\endquotation\newpage} % }}}

% Environment to generate the chinese abstract page.
\newenvironment{abstractCH} % {{{
  {\begin{CJK}{UTF8}{nkai}\CJKhorz%
	\chapter*{\centerline{\theabstractnameCH}}%
	\addcontentsline{toc}{chapter}{\theabstractnameCH}%
	\quotation}
  {\endquotation\end{CJK}\newpage} % }}}

% Environment to generate the english acknowledgements page.
\newenvironment{acknowledgementsEN} % {{{
  {\chapter*{\centerline{\theacknowledgementsnameEN}}%
	\addcontentsline{toc}{chapter}{\theacknowledgementsnameEN}%
	\quotation}
  {\endquotation\newpage} % }}}

% Environment to generate the chinese acknowledgements page.
\newenvironment{acknowledgementsCH} % {{{
  {\begin{CJK}{UTF8}{nkai}\CJKhorz%
	\chapter*{\centerline{\theacknowledgementsnameCH}}%
	\addcontentsline{toc}{chapter}{\theacknowledgementsnameCH}%
	\quotation}
  {\endquotation\end{CJK}\newpage} % }}}

\input{ntuvars}

% vim: filetype=tex softtabstop=4 shiftwidth=4 tabstop=4 foldmethod=marker:
