%%勿更改這裡，這裡是定義\advisor這指令，並插入到title page
\makeatletter
\newcommand{\advisor}{\@dblarg\beamer@advisor}
\long\def\beamer@advisor[#1]#2{%
  \def\insertadvisor{#2}%
  \def\beamer@shortadvisor{#1}%
  }
\advisor{}
\setbeamertemplate{title page}
{
  \vbox{}
  \vfill
  \begin{centering}
    \begin{beamercolorbox}[sep=8pt,center]{title}
      \usebeamerfont{title}\inserttitle\par%
      \ifx\insertsubtitle\@empty%
      \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
      \fi%
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center]{author}
      \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}\vskip1em
    \begin{beamercolorbox}[sep=8pt,center]{advisor}
      \usebeamerfont{institute}{指導教授: \insertadvisor}
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{institute}
      \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center]{date}
      \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em
    {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
  \end{centering}
  \vfill
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%封面設定%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title[\thetitleCH]{\thetitleCH}%論文名稱，若要換英文就改成 \thetitleEN。假如要中英文標題都顯示就輸入\thetitleCH\\ \thetitleEN
\author[\theauthorCH]{\theauthorCH}%名字，若要換英文就改成「\theauthorEN  」
\advisor{\def\guavaAstring{\theadvisorAFN} \StrLen{\guavaAstring}[\guavaAslen]% 有指導教授A教授，並判斷名字的長度
		\def\guavaAthresh{2}%名字是三個字
		\ifthenelse{\guavaAslen = \guavaAthresh}{\hskip -.6em \theadvisorALN\theadvisorAFN\quad \theadvisorDegreeA{}}{
			\def\guavaAstring{\theadvisorAFN} \StrLen{\guavaAstring}[\guavaAslen]
			\def\guavaAthresh{1}%名字是兩個字
			\ifthenelse{\guavaAslen = \guavaAthresh}{\hskip -.6em \theadvisorALN \quad \theadvisorAFN\quad \theadvisorDegreeA{}}{
				\def\guavaAstring{\theadvisorAFN} \StrLen{\guavaAstring}[\guavaAslen]
				\def\guavaAthresh{3}%名字是四個字
				\ifthenelse{\guavaAslen = \guavaAthresh}{\hskip -.6em \theadvisorALN\theadvisorAFN\theadvisorDegreeA{}}{}}}
		\par
		%\theadvisorALN\theadvisorAFN\quad \theadvisorDegreeA \vspace{7pt}\\
		% 判斷是否有共同指導的教授 B
		\ifx \theadvisorBLN  \itsempty
		\relax % 沒有共同指導B教授，就不佔版面，顯示空白
		\else
		% 有共同指導的B教授，並判斷名字的長度
		\def\guavaBstring{\theadvisorBFN} \StrLen{\guavaBstring}[\guavaBslen]
		\def\guavaBthresh{2}%名字是三個字
		\ifthenelse{\guavaBslen = \guavaBthresh}{\qquad\qquad\quad\theadvisorBLN\theadvisorBFN\quad{}\theadvisorDegreeB{}}{
			\def\guavaBstring{\theadvisorBFN} \StrLen{\guavaBstring}[\guavaBslen]
			\def\guavaBthresh{1}%名字是兩個字
			\ifthenelse{\guavaBslen = \guavaBthresh}{\qquad\qquad\quad\theadvisorBLN{}\quad{}\theadvisorBFN\quad{}\theadvisorDegreeB{}}{
				\def\guavaBstring{\theadvisorBFN} \StrLen{\guavaBstring}[\guavaBslen]
				\def\guavaBthresh{3}%名字是四個字
				\ifthenelse{\guavaBslen = \guavaBthresh}{\qquad\qquad\quad\theadvisorBLN\theadvisorBFN\theadvisorDegreeB{}}{}}}
		\fi
		%
}%指導教授
\institute[\theinstituteCH]{\theuniversityCH\\ 
  \theinstituteCH}%系所\theinstituteCH；校名\theuniversityCH。若要換英文就分別改成「\theinstituteEN 」、「 \theuniversityEN 」

\date{\theyearEN 年 \themonthCH 月 \thedateCH 日}%{年月日}口試日期
%\date[\tdtime]{\today}%日期自動
%\date[\initclock \hhmmss\tdtime]{\today}
%假如想要顯示時間，可以加上\initclock 這指令，也就是\date[ \initclock \tdtime]{\today}，但最好還是不要，以免電腦lag。