<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
% !TEX program  = LuaLaTeX
%
% hustthesis.dtx
%
% Copyright (C) 2013-2014 by Xu Cheng &lt;xucheng@me.com&gt;
%               2014-2016 by hust-latex &lt;https://github.com/hust-latex&gt;
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is hust-latex Organization.
%
% This work consists of the files hustthesis.bst, hustthesis.dtx,
% hustthesis.ins and the derived file hustthesis.cls
% along with its document and example files.
%
% \fi
%
% \iffalse
%&lt;*driver&gt;
\ProvidesFile{hustthesis.dtx}
%&lt;/driver&gt;
%&lt;class&gt;\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%&lt;class&gt;\ProvidesClass{hustthesis}
%&lt;*class&gt;
[2016/11/17 v1.4 A Thesis Template for Huazhong University of Science and Technology]
%&lt;/class&gt;
%
%&lt;*driver&gt;
\documentclass[12pt,a4paper,numbered,full]{l3doc}

\usepackage{fontspec}
\setmainfont[Ligatures={Common,TeX}]{Tex Gyre Pagella}
\setsansfont[Ligatures={Common,TeX}]{Droid Sans}
\setmonofont{CMU Typewriter Text}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}

\usepackage{luatexja-fontspec}
\setmainjfont[BoldFont={AdobeHeitiStd-Regular},ItalicFont={AdobeKaitiStd-Regular}]{AdobeSongStd-Light}
\setsansjfont{AdobeKaitiStd-Regular}
\defaultjfontfeatures{JFM=kaiming}
\newjfontfamily\KAI{AdobeKaitiStd-Regular}
\newjfontfamily\FANGSONG{AdobeFangsongStd-Regular}

\linespread{1.2}\selectfont

\usepackage[top=1.2in,bottom=1.2in,left=1.5in,right=1in]{geometry}
\pagewidth=\paperwidth
\pageheight=\paperheight

\usepackage{color}
\usepackage[table]{xcolor}

\definecolor{hyperreflinkred}{RGB}{128,23,31}
\hypersetup{
  unicode,
  bookmarksnumbered=true,
  bookmarksopen=true,
  bookmarksopenlevel=0,
  breaklinks=true,
  colorlinks=true,
  allcolors=hyperreflinkred,
  linktoc=page,
  plainpages=false,
  pdfpagelabels=true,
  pdfstartview={XYZ null null 1}
}
\usepackage{indentfirst}
\setlength{\parindent}{2em}

\usepackage{titlesec,titletoc}
\usepackage[titles]{tocloft}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}

\usepackage{enumitem}
\setlist{noitemsep,partopsep=0pt,topsep=.8ex}
\setlist[1]{labelindent=\parindent}
\setlist[enumerate,1]{label=\arabic*.,ref=\arabic*}
\setlist[enumerate,2]{label*=\arabic*,ref=\theenumi.\arabic*}
\setlist[enumerate,3]{label=\emph{\alph*}),ref=\theenumii\emph{\alph*}}

\usepackage{listings}
\definecolor{lstgreen}{rgb}{0,0.6,0}
\definecolor{lstgray}{rgb}{0.5,0.5,0.5}
\definecolor{lstmauve}{rgb}{0.58,0,0.82}
\lstset{
  basicstyle=\footnotesize\ttfamily\FANGSONG,
  keywordstyle=\color{blue}\bfseries,
  commentstyle=\color{lstgreen}\itshape\KAI,
  stringstyle=\color{lstmauve},
  showspaces=false,
  showstringspaces=false,
  showtabs=false,
  numbers=left,
  numberstyle=\tiny\color{lstgray},
  frame=lines,
  rulecolor=\color{black},
  breaklines=true
}

\AtBeginEnvironment{verbatim}{\small}
\let\AltMacroFont\MacroFont

\usepackage{metalogo}
\usepackage{notes}
\usepackage{tabularx}

\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\setlength{\cftsecindent}{2em}
\setlength{\cftsubsecindent}{4em}
\makeatletter
\newskip\HUST@oldcftbeforepartskip
\HUST@oldcftbeforepartskip=\cftbeforepartskip
\newskip\HUST@oldcftbeforesecskip
\HUST@oldcftbeforesecskip=\cftbeforesecskip
\let\HUST@oldl@part\l@part
\let\HUST@oldl@section\l@section
\let\HUST@oldl@subsection\l@subsection
\def\l@part#1#2{\HUST@oldl@part{#1}{#2}\cftbeforepartskip=3pt}
\def\l@section#1#2{\HUST@oldl@section{#1}{#2}\cftbeforepartskip=\HUST@oldcftbeforepartskip\cftbeforesecskip=3pt}
\def\l@subsection#1#2{\HUST@oldl@subsection{#1}{#2}\cftbeforesecskip=\HUST@oldcftbeforesecskip}
\makeatother

\titleformat{\part}
  {
    \bfseries
    \centering
    \fontsize{18pt}{23.4pt}\selectfont
  }
  {\thepart}
  {1em}
  {}
\let\oldpart\part
\def\part#1{\newpage\oldpart{#1}}

\def\orvar{\textnormal{|}}

\IndexPrologue
 {
  \part{Index}
  The~italic~numbers~denote~the~pages~where~the~
  corresponding~entry~is~described,~
  numbers~underlined~point~to~the~definition,~
  all~others~indicate~the~places~where~it~is~used.
 }

\GlossaryPrologue
 {
  \part{Change History}
 }

\EnableCrossrefs
\CodelineIndex
\RecordChanges

\def\email#1{
  \href{mailto:#1}{\texttt{#1}}
}

\usepackage{xparse}
\ExplSyntaxOn
\DeclareDocumentCommand\pkgurl{o m}
{
    \IfNoValueTF{#1}
    {
        \href
        {
        http://mirrors.ctan.org/help/Catalogue/entries/
        \str_fold_case:n {#2} .html
        }
        { \textsf{#2} }
    }
    {
        \href
        {
        http://mirrors.ctan.org/help/Catalogue/entries/
        \str_fold_case:n {#1} .html
        }
        { \textsf{#2} }
    }
}
\ExplSyntaxOff

\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}

\begin{document}
\DocInput{hustthesis.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
%
% \CheckSum{1568}
%
% \iffalse
%&lt;*!(example-bib)&gt;
% \fi
%% \CharacterTable
%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%  Digits        \0\1\2\3\4\5\6\7\8\9
%%  Exclamation   \!     Double quote  \"     Hash (number) \#
%%  Dollar        \$     Percent       \%     Ampersand     \&amp;
%%  Acute accent  \'     Left paren    \(     Right paren   \)
%%  Asterisk      \*     Plus          \+     Comma         \,
%%  Minus         \-     Point         \.     Solidus       \/
%%  Colon         \:     Semicolon     \;     Less than     \&lt;
%%  Equals        \=     Greater than  \&gt;     Question mark \?
%%  Commercial at \@     Left bracket  \[     Backslash     \\
%%  Right bracket \]     Circumflex    \^     Underscore    \_
%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
%%  Right brace   \}     Tilde         \~}
% \iffalse
%&lt;/!(example-bib)&gt;
% \fi
%
% \changes{v1.0}{2013/06/01}{Initial version}
% \changes{v1.1}{2013/07/01}{Pack template using dtx and ins file}
% \changes{v1.1}{2013/07/01}{Add language option}
% \changes{v1.2}{2016/06/01}{Fix for TeXLive 2016. Remove \texttt{interfaces} and other problematic package}
% \changes{v1.3}{2016/07/05}{Fix for \XeLaTeX}
% \changes{v1.4}{2016/11/17}{Minor update to fulfill school requirement.}
% \changes{v1.4}{2016/11/17}{Add command to custom apply name field.}
%
% \GetFileInfo{hustthesis.dtx}
%
% \DoNotIndex{\#,\$,\%,\&amp;,\@,\\,\{,\},\^,\_,\~,\ ,\,}
% \DoNotIndex{\def,\if,\else,\fi,\gdef,\long,\let}
% \DoNotIndex{\@ne,\@nil}
% \DoNotIndex{\begingroup,\endgroup,\advance}
% \DoNotIndex{\newcommand,\renewcommand}
% \DoNotIndex{\newenvironment,\renewenvironment}
% \DoNotIndex{\RequirePackage}
%
% \title{A Thesis Template for Huazhong University of Science and Technology: the \textsf{hustthesis} class
% \thanks{This document corresponds to \textsf{hustthesis.cls}~\fileversion, dated \filedate.}}
% \author{Xu Cheng \\ \email{xucheng@me.com}}
% \date{\today}
%
% \begingroup
% \hypersetup{allcolors=black}
% \maketitle
% \endgroup
% \tableofcontents
%
% \part{Introduction}
%
% This is a thesis template for \href{http://www.hust.edu.cn/}{Huazhong University of Science \&amp; Technology}. This template is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%
% The whole project is published under LPPL v1.3 License at \href{https://github.com/hust-latex/hustthesis}{GitHub}.
%
% ���������������������\autoref{part:������������������}���
%
% English version instruction is in \autoref{part:English Version Instruction}.
%
% \part{������������������}\label{part:������������������}
%
% \section{������������������}
%
% \begin{enumerate}
%     \item ���������������������\href{http://www.tug.org/texlive/}{\texttt{TeXLive}}���������������\href{http://miktex.org/}{\texttt{MiKTeX}}���������������������������������������������������������bug���������������������������������������������
%     \item ������������������������\footnote{���������������������������������\textsf{Tex Gyre Termes}���\textsf{Droid Sans}���\textsf{CMU Typewriter Text}������������������\textsf{TeXLive}���\textsf{MiKTeX}������}���
%     \begin{enumerate}[label=\emph{\alph*})]
%         \item \textsf{AdobeSongStd-Light}
%         \item \textsf{AdobeKaitiStd-Regular}
%         \item \textsf{AdobeHeitiStd-Regular}
%         \item \textsf{AdobeFangsongStd-Regular}
%     \end{enumerate}
%     \begin{informationnote}
%     ������������\textnormal{\LuaTeX}������������������������������������\verb+mkluatexfontdb+���������������������
%     \end{informationnote}
% \end{enumerate}
%
% \section{������}
%
% \subsection{���������������}
%
% ���������������������������������������������������
% \begin{verbatim}
%     make install
% \end{verbatim}
% ���������������������������������������
% \begin{verbatim}
%     make uninstall
% \end{verbatim}
%
% ������������������\verb+Make+���Windows������������������������������������������������
% \begin{verbatim}
%     makewin32.bat install
% \end{verbatim}
% ���������������������������������������
% \begin{verbatim}
%     makewin32.bat uninstall
% \end{verbatim}
% ������\verb+makewin32.bat+���������\verb+Makefile+������������������������������������������������\verb+Make+���������Windows���������������\href{http://gnuwin32.sourceforge.net/packages/make.htm}{������}���������
%
% \subsection{���������������}
%
% ���������������������������������������������������������������������������������������������������������������������
% \begin{verbatim}
%     make unpack
% \end{verbatim}
% ������������������\verb+Make+���Windows���������������������������������������������
% \begin{verbatim}
%     makewin32.bat unpack
% \end{verbatim}
%
% ������\verb+hustthesis+������������������������������������\TeX{}���������������������������
% \begin{itemize}
%     \item \verb+hustthesis.bst+
%     \item \verb+hustthesis.cls+
%     \item \verb+hust-title.eps+
%     \item \verb+hust-title.pdf+
% \end{itemize}
%
% \section{������������}
%
% \begin{importantnote}
% ���������������������\textnormal{\XeLaTeX}���\textnormal{\LuaLaTeX}���������������������
% \end{importantnote}
%
% ������������������������������������������������������������������������������������������
% \begin{verbatim}
%     \documentclass{hustthesis}
% \end{verbatim}
%
% \subsection{������������������}
%
% ���������������������������������������������������������������
%
% \begin{function}{format}
%     \begin{syntax}
%         format = \meta{draft\orvar{}\textbf{final}}
%     \end{syntax}
%     ������������������\verb+draft+���������������������������\verb+final+������������������������������������������������������������������\verb+xx+������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������\verb+final+���
% \end{function}
%
% \begin{function}{degree}
%     \begin{syntax}
%         degree = \meta{\textbf{none}\orvar{}fyp\orvar{}bachelor\orvar{}master\orvar{}phd}
%     \end{syntax}
%     ���������������������������������������������\verb+\HUST@zhapplyname+���\verb+\HUST@enapplyname+������������������������������������������������������������������\verb+format+������\verb+draft+������������������������������������������������\ref{tab:optdegree-zh}������������������������������������\verb+none+���������������������������������������������\href{doc/function//applyname}{\texttt{\textbackslash{}zhapplyname},\texttt{\textbackslash{}enapplyname},\texttt{\textbackslash{}applyname}}������������������������
% \end{function}
%
% \begin{function}[updated=2013-07-01]{language}
%     \begin{syntax}
%         language = \meta{\textbf{chinese}\orvar{}english\orvar{}english-draft}
%     \end{syntax}
%     ������������������������������������������������\verb+english-draft+������������������������������������������������������������������������������������������������������������������������������������������\verb+chinese+���
% \end{function}
%
% \begin{table}[ht]
%     \centering
%     \caption{\texttt{degree}���������������}\label{tab:optdegree-zh}
%     \begin{tabularx}{\textwidth}{|c|X|X|}
%     \hline
%     \textbf{������} &amp; \tabincell{c}{\textbf{������������}\\���������\verb+\HUST+\verb+@zhapplyname+���} &amp; \tabincell{c}{\textbf{������������}\\���������\verb+\HUST+\verb+@enapplyname+���} \\
%     \hline
%     \verb+none+ &amp; ������������ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree \\ \hline
%     \verb+fyp+ &amp; ������������ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project \\ \hline
%     \verb+bachelor+ &amp; ������������������ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor \\ \hline
%     \verb+master+ &amp; ������������������ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master \\ \hline
%     \verb+phd+ &amp; ������������������ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy \\ \hline
%     \end{tabularx}
% \end{table}
%
% \subsection{������������������}
%
% ���������������������������������������������������������������������������������������\verb+\zhX{&lt;Chinese var&gt;}+���\verb+\enX{&lt;English var&gt;}+���\verb+\X{&lt;Chinese var&gt;}{&lt;English var&gt;}+���������������������������������������������������\verb+X+������������������������������������������������
%
% \begin{function}{\zhtitle,\entitle,\title}
%     \begin{syntax}
%     \cs{zhtitle}\Arg{Chinese title}
%     \cs{entitle}\Arg{English title}
%     \cs{title}\Arg{Chinese title}\Arg{English title}
%     \end{syntax}
%     ������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhauthor,\enauthor,\author}
%     \begin{syntax}
%     \cs{zhauthor}\Arg{Chinese author}
%     \cs{enauthor}\Arg{English author}
%     \cs{author}\Arg{Chinese author}\Arg{English author}
%     \end{syntax}
%     ���������������������������������������������������������
% \end{function}
%
% \begin{function}{\date}
%     \begin{syntax}
%     \cs{date}\Arg{Year}\Arg{Month}\Arg{Day}
%     \end{syntax}
%     ������������������������������������������������������������������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhschoolname,\enschoolname,\schoolname}
%     \begin{syntax}
%     \cs{zhschoolname}\Arg{Chinese school name}
%     \cs{enschoolname}\Arg{English school name}
%     \cs{schoolname}\Arg{Chinese school name}\Arg{English school name}
%     \end{syntax}
%     ������������������������������������������������������������������������������������������������\verb+\schoolname{������������������}{Huazhong University of Science \&amp; Technology}+������������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhaddress,\enaddress,\address}
%     \begin{syntax}
%     \cs{zhaddress}\Arg{Chinese address}
%     \cs{enaddress}\Arg{English address}
%     \cs{address}\Arg{Chinese address}\Arg{English address}
%     \end{syntax}
%     ���������������������������������������������������������������������������������������������������\verb+\address{������������������430074}{Wuhan~430074, P.~R.~China}+���������������������������������������������������������������
% \end{function}
%
% \begin{function}[updated=2016-11-17]{\zhapplyname,\enapplyname,\applyname}
%     \begin{syntax}
%     \cs{zhapplyname}\Arg{Chinese apply name}
%     \cs{enapplyname}\Arg{English apply name}
%     \cs{applyname}\Arg{Chinese apply name}\Arg{English apply name}
%     \end{syntax}
%     ������������������������������������������������������������������������������������������~\href{doc/function//degree}{\texttt{degree} ������������������}���
% \end{function}
%
% \begin{function}{\zhmajor,\enmajor,\major}
%     \begin{syntax}
%     \cs{zhmajor}\Arg{Chinese major}
%     \cs{enmajor}\Arg{English major}
%     \cs{major}\Arg{Chinese major}\Arg{English major}
%     \end{syntax}
%     ���������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhsupervisor,\ensupervisor,\supervisor}
%     \begin{syntax}
%     \cs{zhsupervisor}\Arg{Chinese supervisor}
%     \cs{ensupervisor}\Arg{English supervisor}
%     \cs{supervisor}\Arg{Chinese supervisor}\Arg{English supervisor}
%     \end{syntax}
%     ������������������������������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhasssupervisor,\enasssupervisor,\asssupervisor}
%     \begin{syntax}
%     \cs{zhasssupervisor}\Arg{Chinese asssupervisor}
%     \cs{enasssupervisor}\Arg{English asssupervisor}
%     \cs{asssupervisor}\Arg{Chinese asssupervisor}\Arg{English asssupervisor}
%     \end{syntax}
%     ������������������������������������������������������������������������������������������������������������������������������������������������������������������
% \end{function}
%
% \begin{function}{\schoolcode}
%     \begin{syntax}
%     \cs{schoolcode}\Arg{school code}
%     \end{syntax}
%     ���������������������������
% \end{function}
%
% \begin{function}{\stuno}
%     \begin{syntax}
%     \cs{stuno}\Arg{student number}
%     \end{syntax}
%     ���������������������
% \end{function}
%
% \begin{function}{\classno}
%     \begin{syntax}
%     \cs{classno}\Arg{classify number}
%     \end{syntax}
%     ������������������������
% \end{function}
%
% \begin{function}{\secretlevel}
%     \begin{syntax}
%     \cs{secretlevel}\Arg{secret level}
%     \end{syntax}
%     ���������������������
% \end{function}
%
% \begin{function}{\zhabstract,\enabstract,\abstract}
%     \begin{syntax}
%     \cs{zhabstract}\Arg{Chinese abstract}
%     \cs{enabstract}\Arg{English abstract}
%     \cs{abstract}\Arg{Chinese abstract}\Arg{English abstract}
%     \end{syntax}
%     ������������������������������������������������������
% \end{function}
%
% \begin{function}{\zhkeywords,\enkeywords,\keywords}
%     \begin{syntax}
%     \cs{zhkeywords}\Arg{Chinese keywords}
%     \cs{enkeywords}\Arg{English keywords}
%     \cs{keywords}\Arg{Chinese keywords}\Arg{English keywords}
%     \end{syntax}
%     ���������������������������������������������������������
% \end{function}
%
% \subsection{������������������}
%
% ������������������������������������
%
% \begin{function}{\frontmatter,\mainmatter,\backmatter}
%     ������������������������������������������������������������������������������\nameref{sec:������������}���\verb+\frontmatter+���������������������������������������������������������������������������������������������������\verb+\mainmatter+������������������������������\verb+\backmatter+������������������������������
% \end{function}
%
% \begin{function}{\maketitle,\makecover}
%     \verb+\maketitle+���\verb+\makecover+���������������������������������������������������
% \end{function}
%
% \begin{function}{\makeabstract}
%     ������������������������������������
% \end{function}
%
% \begin{function}{\tableofcontents}
%     ���������������������
% \end{function}
%
% \begin{function}{\zhdateformat,\endateformat}
%     ������������������������������
% \end{function}
%
% \vskip 1ex\DescribeEnv{ack}
%     \verb+ack+������������������������������������������������
%     \begin{verbatim}
%     \begin{ack}
%         &lt;content&gt;
%     \end{ack}
%     \end{verbatim}
%
% \begin{function}{\bibliography}
%     \begin{syntax}
%     \cs{bibliography}\Arg{.bib file}
%     \end{syntax}
%     ���������������������������
% \end{function}
%
% \vskip 1ex\DescribeEnv{appendix}
%     \verb+appendix+���������������������������������������������������\verb+appendix+������������������
%     \begin{verbatim}
%     \begin{appendix}
%         &lt;content&gt;
%     \end{appendix}
%     \end{verbatim}
% \begin{function}{\appendix}
%     ������������\verb+\appendix+���������������������������������
%     \begin{verbatim}
%     \appendix
%     &lt;content&gt;
%     \end{verbatim}
% \end{function}
%
% \begin{function}{\listoffigures,\listoftables}
%     ������������������������������������������������������������������������������������������������������������������������
% \end{function}
%
% \vskip 1ex\DescribeEnv{publications}
%     \verb+publications+������������������������������������������������������������������������\verb+enumerate+������������������
%     \begin{verbatim}
%     \begin{publications}
%         \item &lt;thesis&gt;
%         &lt;...&gt;
%     \end{publications}
%     \end{verbatim}
%
% \begin{function}{\TurnOffTabFontSetting,\TurnOnTabFontSetting}
%     ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
%     \begin{verbatim}
%     \begingroup
%     \TurnOffTabFontSetting
%     \footnotesize % ������������
%     \begin{tabular}{...}
%         &lt;content&gt;
%     \end{tabular}
%     \TurnOnTabFontSetting
%     \endgroup
%     \end{verbatim}
% \end{function}
%
% \begin{function}{\email}
%     \begin{syntax}
%     \cs{email}\Arg{Email Address}
%     \end{syntax}
%     ������������������������������\verb+\email{name@example.com}+���������������������������������\email{name@example.com}���
% \end{function}
%
% \section{������������}\label{sec:������������}
% ������������������������������������������������������������������������\texttt{hustthesis-zh-example.tex}���������������������\href{https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-zh-example.pdf}{\texttt{hustthesis-zh-example.pdf}}���
%
% \iffalse
%&lt;*driver&gt;
% \fi
\begin{lstlisting}[language={[LaTeX]TeX}]
\documentclass[degree=phd,language=chinese]{hustthesis}

\stuno{������������}
\schoolcode{10487}
\title{������������}{������������}
\author{���������}{���������������}
\major{������������}{������������}
\supervisor{������������������}{������������������}
\date{2013}{7}{1} % ������������

\zhabstract{������������}
\zhkeywords{���������������}
\enabstract{������������}
\enkeywords{���������������}

\begin{document}

\frontmatter
\maketitle
\makeabstract
\tableofcontents
\listoffigures
\listoftables
\mainmatter

%% ������

\backmatter

\begin{ack}
%% ������
\end{ack}
\bibliography{������������.bib������}

\appendix

\begin{publications}
%% ������������������������
\end{publications}

%% ������������������

\end{document}
\end{lstlisting}
% \iffalse
%&lt;/driver&gt;
% \fi
%
% \section{������������������}
%
% ���������������������������������������������������������������������
%
% \begin{itemize}
%     \item \pkgurl{algorithm2e} ���������������
%     \item \pkgurl{enumitem} ���������������������������������
%     \item \pkgurl{fancynum} ���������������������������������
%     \item \pkgurl{listings} ������������������������������������������������������\pkgurl{minted}���������
%     \item \pkgurl{longtable} ������������������������������
%     \item \pkgurl{ltxtable} \textsf{longtable}���������\textsf{tabularx}������������������
%     \item \pkgurl{multirow} ���������������������������
%     \item \pkgurl{overpic} ���������������������������������������
%     \item \pkgurl{tabularx} ������������������������
%     \item \pkgurl{zhnumber} ���������������������������
% \end{itemize}
%
% \section{������������}
%
% \subsection{������������}
%
% ������������������������������\textsf{AdobeSongStd-Light}���������������������������������������������������������
%
% \begin{function}{\HEI,\hei}
%     \begin{syntax}
%     \{\cs{HEI} \meta{content}\}
%     \cs{hei}\Arg{content}
%     \end{syntax}
%     ������������������������\textsf{AdobeHeitiStd-Regular}������
% \end{function}
%
% \begin{function}{\KAI,\kai}
%     \begin{syntax}
%     \{\cs{KAI} \meta{content}\}
%     \cs{kai}\Arg{content}
%     \end{syntax}
%     ������������������������\textsf{AdobeKaitiStd-Regular}������
% \end{function}
%
% \begin{function}{\FANGSONG,\fangsong}
%     \begin{syntax}
%     \{\cs{FANGSONG} \meta{content}\}
%     \cs{fangsong}\Arg{content}
%     \end{syntax}
%     ������������������������\textsf{AdobeFangsongStd-Regular}������
% \end{function}
%
% ������������������������������������������������\pkgurl{fontspec}���������\pkgurl{xeCJK}���������\XeLaTeX{}������������\pkgurl[luatexja]{luatex-ja}���������\LuaLaTeX{}���������������
%
% \subsection{������������������}
%
% ���������������������������������������������������������\autoref{sec:Localization}���������������������������������������������������������������������
%
% \part{English Version Instruction}\label{part:English Version Instruction}
%
% \section{Requirement}
% Install the latest version of \href{http://www.tug.org/texlive/}{\texttt{TeXLive}}(Recommend) or \href{http://miktex.org/}{\texttt{MiKTeX}}. Please ensure that all the packages are up-to-date.
%
% If you need to produce the final format of thesis (see \autoref{subsec:Option} for more details), you should also need to install following Chinese fonts:
% \begin{itemize}
%   \item \textsf{AdobeSongStd-Light}
%   \item \textsf{AdobeKaitiStd-Regular}
%   \item \textsf{AdobeHeitiStd-Regular}
%   \item \textsf{AdobeFangsongStd-Regular}
% \end{itemize}
% \begin{informationnote}
% If you use \textnormal{\LuaTeX}, you need to run the command \verb+mkluatexfontdb+ to refresh font database index after installing the fonts.
% \end{informationnote}
%
% \section{Installation}
%
% \subsection{Install into local}
%
% Use the command below to install this template into local.
% \begin{verbatim}
%    make install
% \end{verbatim}
% If you need uninstall it, use the command below.
% \begin{verbatim}
%    make uninstall
% \end{verbatim}
%
% For Windows User who don't install \texttt{Make}, use the command below to install.
% \begin{verbatim}
%     makewin32.bat install
% \end{verbatim}
% If you need uninstall it, use the command below.
% \begin{verbatim}
%     makewin32.bat uninstall
% \end{verbatim}
% Although \texttt{makewin32.bat} behaves much like \texttt{Makefile}, I still
% recommend you install \texttt{Make} into your Windows. You can download
% it from \href{http://gnuwin32.sourceforge.net/packages/make.htm}{here}.
%
% \subsection{Use without installation}
%
% If you want to use this template temporary rather than installing it into local for long term use. Run below command to unpack the package.
% \begin{verbatim}
%     make unpack
% \end{verbatim}
% For Windows User who don't install \texttt{Make}, use the command below to unpack the package.
% \begin{verbatim}
%     makewin32.bat unpack
% \end{verbatim}
% Then copy the following files from directory \texttt{hustthesis} into your \TeX{} project root directory.
% \begin{itemize}
%     \item \verb+hustthesis.bst+
%     \item \verb+hustthesis.cls+
%     \item \verb+hust-title.eps+
%     \item \verb+hust-title.pdf+
% \end{itemize}
%
% \section{Usage}
% \begin{importantnote}
% This template can only be compiled by \\
% \hskip 10pt \textnormal{\XeLaTeX} or\textnormal{\LuaLaTeX}(Recommend).
% \end{importantnote}
%
% Insert below code in the top of source code to use this template:
% \begin{verbatim}
%     \documentclass[language=english]{hustthesis}
% \end{verbatim}
%
% \subsection{Option} \label{subsec:Option}
%
% There're three options available when use this template.
%
% % \begin{function}{format}
%     \begin{syntax}
%         format = \meta{draft\orvar{}\textbf{final}}
%     \end{syntax}
%     If \verb+format+ is set to \verb+final+, the header will be removed. This option is only valid if \verb+language+ is not set to \verb+english-draft+. The default value is \verb+final+.
% \end{function}
%
% \begin{function}[updated=2013-07-01]{language}
%     \begin{syntax}
%         language = \meta{\textbf{chinese}\orvar{}english\orvar{}english-draft}
%     \end{syntax}
%     Set what language is used in the document. Specially, if it's set to \verb+english-draft+, all the Chinese characters will be removed in the document. This is extremely helpful when you don't install Chinese fonts. The default value is \verb+chinese+.
% \end{function}
%
% \begin{function}{degree}
%     \begin{syntax}
%         degree = \meta{\textbf{none}\orvar{}fyp\orvar{}bachelor\orvar{}master\orvar{}phd}
%     \end{syntax}
%     Set the category of thesis. It will influence the title of document, see Table~\ref{tab:optdegree-en}. The default value is \verb+none+. Noted that the apply name field in the title page can be further customized through \href{doc/function//applyname}{\texttt{\textbackslash{}applyname}} command.
% \end{function}
%
% \begin{table}[ht]
%     \centering
%     \caption{Title under different \texttt{degree}}\label{tab:optdegree-en}
%     \begin{tabularx}{\textwidth}{|c|X|}
%     \hline
%     \textbf{Option} &amp; \textbf{Title}\\
%     \hline
%     \verb+none+  &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree \\ \hline
%     \verb+fyp+ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project \\ \hline
%     \verb+bachelor+ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor \\ \hline
%     \verb+master+ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master \\ \hline
%     \verb+phd+ &amp; A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy \\ \hline
%     \end{tabularx}
% \end{table}
%
% \subsection{Variables setting}
%
% There're some commands which are used to set the variables for the thesis.
%
% \begin{function}{\title}
%     \begin{syntax}
%     \cs{title}\Arg{title}
%     \end{syntax}
%     Set title.
% \end{function}
%
% \begin{function}{\author}
%     \begin{syntax}
%     \cs{author}\Arg{author}
%     \end{syntax}
%     Set author.
% \end{function}
%
% \begin{function}{\date}
%     \begin{syntax}
%     \cs{date}\Arg{Year}\Arg{Month}\Arg{Day}
%     \end{syntax}
%     Set date. If you don't set it, template will use current date.
% \end{function}
%
% \begin{function}{\schoolname}
%     \begin{syntax}
%     \cs{schoolname}\Arg{school name}
%     \end{syntax}
%     Set the name of school which has been set as \\*\hbox{\verb+\schoolname{Huazhong University of Science \&amp; Technology}+} by default. So unless you want to change the name, you don't need to use this command.
% \end{function}
%
% \begin{function}{\address}
%     \begin{syntax}
%     \cs{address}\Arg{address}
%     \end{syntax}
%     Set the address of school which has been set as \\*\hbox{\verb+\address{Wuhan~430074, P.~R.~China}+} by default. So unless you want to change the address, you don't need to use this command.
% \end{function}
%
% \begin{function}[updated=2016-11-17]{\applyname}
%     \begin{syntax}
%     \cs{applyname}\Arg{apply name}
%     \end{syntax}
%     Custom the apply name which affects English title page. See more detail at~\href{doc/function//degree}{\texttt{degree} option}.
% \end{function}
%
% \begin{function}{\major}
%     \begin{syntax}
%     \cs{major}\Arg{major}
%     \end{syntax}
%     Set your major.
% \end{function}
%
% \begin{function}{\supervisor}
%     \begin{syntax}
%     \cs{supervisor}\Arg{supervisor}
%     \end{syntax}
%     Set your supervisor.
% \end{function}
%
% \begin{function}{\asssupervisor}
%     \begin{syntax}
%     \cs{asssupervisor}\Arg{ass-supervisor}
%     \end{syntax}
%     Set your ass-supervisor if you have.
% \end{function}
%
% \begin{function}{\abstract}
%     \begin{syntax}
%     \cs{abstract}\Arg{abstract}
%     \end{syntax}
%     Put your abstract.
% \end{function}
%
% \begin{function}{\keywords}
%     \begin{syntax}
%     \cs{keywords}\Arg{keywords}
%     \end{syntax}
%     Put your keywords.
% \end{function}
%
% \subsection{Other commands}
%
% \begin{function}{\frontmatter,\mainmatter,\backmatter}
%     Used to determine the different part of document. You can see the example at \autoref{sec:simple-example}.
% \end{function}
%
% \begin{function}{\maketitle,\makecover}
%     \verb+\maketitle+ and \verb+\makecover+ are the same. Used to create the title page.
% \end{function}
%
% \begin{function}{\makeabstract}
%     Used to create abstract page.
% \end{function}
%
% \begin{function}{\tableofcontents}
%     Used to create table of contents.
% \end{function}
%
% \begin{function}{\endateformat}
%     Used to print the date.
% \end{function}
%
% \vskip 1ex\DescribeEnv{ack}
%     The \verb+ack+ environment is used to create acknowledge page.
%     \begin{verbatim}
%     \begin{ack}
%         &lt;content&gt;
%     \end{ack}
%     \end{verbatim}
%
% \begin{function}{\bibliography}
%     \begin{syntax}
%     \cs{bibliography}\Arg{.bib file}
%     \end{syntax}
%     Used to create bibliography page.
% \end{function}
%
% \vskip 1ex\DescribeEnv{appendix}
%     The \verb+appendix+ environment is for appendix of course. Used like this:
%     \begin{verbatim}
%     \begin{appendix}
%         &lt;content&gt;
%     \end{appendix}
%     \end{verbatim}
% \begin{function}{\appendix}
%     Or simple use \verb+\appendix+ to indicate that the rest of document are all in appendix, like this:
%     \begin{verbatim}
%     \appendix
%     &lt;content&gt;
%     \end{verbatim}
% \end{function}
%
% \begin{function}{\listoffigures,\listoftables}
%     Create the index for all the figures and tables separately.
% \end{function}
%
% \vskip 1ex\DescribeEnv{publications}
%     The \verb+publications+ environment is where you list all of your published thesises. It's usually putted in appendix.
%     \begin{verbatim}
%     \begin{publications}
%         \item &lt;thesis&gt;
%         &lt;...&gt;
%     \end{publications}
%     \end{verbatim}
%
% \begin{function}{\TurnOffTabFontSetting,\TurnOnTabFontSetting}
%     This template has set the font size and line spread for all the tables which makes it's impossible to change font format temporary in one table.  So it provides these to command to temporary disable or enable default font setting in table. For example, if you want to change table font size, you can use the code like this:
%     \begin{verbatim}
%     \begingroup
%     \TurnOffTabFontSetting
%     \footnotesize % Set your font format as you like.
%     \begin{tabular}{...}
%         &lt;content&gt;
%     \end{tabular}
%     \TurnOnTabFontSetting
%     \endgroup
%     \end{verbatim}
% \end{function}
%
% \begin{function}{\email}
%     \begin{syntax}
%     \cs{email}\Arg{Email Address}
%     \end{syntax}
%     A command to display email address. For example, \verb+\email{name@example.com}+ would look like this: \email{name@example.com}.
% \end{function}
%
% \section{Simple example}\label{sec:simple-example}
% Below is a simple example of using this template. For a complete example see \texttt{hustthesis-en-example.tex} which will generate \href{https://github.com/hust-latex/hustthesis/raw/master/hustthesis/hustthesis-en-example.pdf}{\texttt{hustthesis-en-example.pdf}}.
%
% \iffalse
%&lt;*driver&gt;
% \fi
\begin{lstlisting}[language={[LaTeX]TeX}]
\documentclass[degree=phd,language=english]{hustthesis}

\title{your title}
\author{your name}
\major{your major}
\supervisor{your supervisor}
\date{2013}{7}{1}

\abstract{the abstract}
\keywords{the keywords}

\begin{document}

\frontmatter
\maketitle
\makeabstract
\tableofcontents
\listoffigures
\listoftables
\mainmatter

%% main body

\backmatter

\begin{ack}
%% acknowledge
\end{ack}
\bibliography{.bib file}

\appendix

\begin{publications}
%% your publications
\end{publications}

%% rest of appendix

\end{document}
\end{lstlisting}
% \iffalse
%&lt;/driver&gt;
% \fi
%
%
% \section{Introduction to some packages used in the template}
%
% Here's a list of some packages used in the template.
%
% \begin{itemize}
%     \item \pkgurl{algorithm2e} For display algorithm.
%     \item \pkgurl{enumitem} For set the style of enumerate, itemize and description environment.
%     \item \pkgurl{fancynum} Display the really big number.
%     \item \pkgurl{listings} For display the highlighted code. If you need better quality, use the package \pkgurl{minted}.
%     \item \pkgurl{longtable} Create a very long table.
%     \item \pkgurl{ltxtable} Combine the features of \textsf{longtable} anb \textsf{tabularx}.
%     \item \pkgurl{multirow} Combine multi-rows in table.
%     \item \pkgurl{overpic} Put something over a picture,
%     \item \pkgurl{tabularx} A better table environment.
% \end{itemize}
%
% \StopEventually{
%  \PrintIndex
%  \PrintChanges
% }
%
% \part{Implementation}\label{part:Implementation}
%
%    \begin{macrocode}
%&lt;*class&gt;
\RequirePackage{ifthen}
%    \end{macrocode}
%
% \section{Process Options}
% Use \pkgurl{xkeyval} to process options.
%    \begin{macrocode}
\RequirePackage{xkeyval}
%    \end{macrocode}
%
% Option |format|.
%    \begin{macrocode}
\newif\ifHUST@finalformat
\HUST@finalformattrue
\DeclareOptionX{format}[final]{
  \ifthenelse{\equal{#1}{final}}{
    \HUST@finalformattrue
  }{
    \ifthenelse{\equal{#1}{draft}}{
      \HUST@finalformatfalse
    }{
      \ClassError{hustthesis}
      {Option format can only be 'final' or 'draft'}
      {Try to remove option format^^J}
    }
  }
}
%    \end{macrocode}
%
% Option |language|.
%    \begin{macrocode}
\gdef\HUST@language{chinese}
\DeclareOptionX{language}[chinese]{
  \ifthenelse{\equal{#1}{chinese} \OR \equal{#1}{english} \OR \equal{#1}{english-draft}}{
    \gdef\HUST@language{#1}
  }{
    \ClassError{hustthesis}
    {Option language can only be 'chinese', 'english' or 'english-draft'}
    {Try to remove option language^^J}
  }
}
%    \end{macrocode}
%
% Option |degree|.
%    \begin{macrocode}
\gdef\HUST@degree{none}
\DeclareOptionX{degree}[none]{
  \ifthenelse{\equal{#1}{none} \OR \equal{#1}{fyp} \OR \equal{#1}{bachelor} \OR \equal{#1}{master} \OR \equal{#1}{phd}}{
    \gdef\HUST@degree{#1}
  }{
     \ClassError{hustthesis}
      {Option degree can only be 'none', 'fyp', 'bachelor', 'master' or 'phd'}
      {Try to remove option degree^^J}
  }
}
%    \end{macrocode}
%
% Process options and load class |book|.
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptionsX
\LoadClass[12pt, a4paper, openany]{book}
%    \end{macrocode}
%
% \section{Check Engine}
% Check engine, only \XeLaTeX{} and \LuaLaTeX{} are supported.
%    \begin{macrocode}
\RequirePackage{iftex}
\ifXeTeX\else
  \ifLuaTeX\else
    \begingroup
      \errorcontextlines=-1\relax
      \newlinechar=10\relax
      \errmessage{^^J
      *******************************************************^^J
      * XeTeX or LuaTeX is required to compile this document.^^J
      * Sorry!^^J
      *******************************************************^^J
      }%
    \endgroup
  \fi
\fi
%    \end{macrocode}
%
% \section{Font Setting}
% Set font used in document. Firstly, it's font setting for English font under |english-draft| mode. We use \pkgurl{fontspec} package to handle font. We choose \textsf{Tex Gyre Termes}, \textsf{Droid Sans} and \textsf{CMU Typewriter Text} as document main font, sans font and mono font.
%    \begin{macrocode}
\ifthenelse{\equal{\HUST@language}{english-draft}}{
    \RequirePackage{fontspec}
    \setmainfont[
      Ligatures={Common,TeX},
      Extension=.otf,
      UprightFont=*-regular,
      BoldFont=*-bold,
      ItalicFont=*-italic,
      BoldItalicFont=*-bolditalic]{texgyretermes}
    \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
    \setmonofont{CMU Typewriter Text}
    \defaultfontfeatures{Mapping=tex-text}
%    \end{macrocode}
%
% Now let's set the Chinese font commands into empty, when document is under |english-draft| mode.
%    \begin{macrocode}
    \let\HEI\relax
    \let\KAI\relax
    \let\FANGSONG\relax
    \newcommand{\hei}[1]{#1}
    \newcommand{\kai}[1]{#1}
    \newcommand{\fangsong}[1]{#1}
}{}
%    \end{macrocode}
%
% Below is the font setting under |chinese| or |english| mode. We chooses the same English font as under |english-draft| mode. We use \pkgurl{xecjk} package (for \XeLaTeX) or \pkgurl[luatexja]{luatex-ja} package (for \LuaLaTeX, recommend) to handle Chinese font. We will use font: \textsf{AdobeSongStd-Light}, \textsf{AdobeKaitiStd-Regular}, \textsf{AdobeHeitiStd-Regular} and \textsf{AdobeFangsongStd-Regular}.
%    \begin{macrocode}
\ifthenelse{\equal{\HUST@language}{english-draft}}{}{
    \ifXeTeX  % XeTeX���������fontspec + xeCJK������������
      % ������������
      \RequirePackage{fontspec}
      \RequirePackage{xunicode}
      \setmainfont[
        Ligatures={Common,TeX},
        Extension=.otf,
        UprightFont=*-regular,
        BoldFont=*-bold,
        ItalicFont=*-italic,
        BoldItalicFont=*-bolditalic]{texgyretermes}
      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
      \setmonofont{CMU Typewriter Text}
      \defaultfontfeatures{Mapping=tex-text}
      % ������������
      \RequirePackage[CJKmath]{xeCJK}
      \setCJKmainfont[
       BoldFont={Adobe Heiti Std},
       ItalicFont={Adobe Kaiti Std}]{Adobe Song Std}
      \setCJKsansfont{Adobe Kaiti Std}
      \setCJKmonofont{Adobe Fangsong Std}
      \xeCJKsetup{PunctStyle=kaiming}

      \newcommand\ziju[2]{{\renewcommand{\CJKglue}{\hskip #1} #2}}
%    \end{macrocode}
%
% \begin{macro}{\HEI}
%    \begin{macrocode}
      \newCJKfontfamily\HEI{Adobe Heiti Std}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\KAI}
%    \begin{macrocode}
      \newCJKfontfamily\KAI{Adobe Kaiti Std}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FANGSONG}
%    \begin{macrocode}
      \newCJKfontfamily\FANGSONG{Adobe Fangsong Std}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hei}
%    \begin{macrocode}
      \newcommand{\hei}[1]{{\HEI #1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\kai}
%    \begin{macrocode}
      \newcommand{\kai}[1]{{\KAI #1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fangsong}
%    \begin{macrocode}
      \newcommand{\fangsong}[1]{{\FANGSONG #1}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
    \else\fi
    \ifLuaTeX  % LuaTeX���������luatex-ja������������ [������]
      \RequirePackage{luatexja-fontspec}
      % ������������
      \setmainfont[Ligatures={Common,TeX}]{Tex Gyre Termes}
      \setsansfont[Ligatures={Common,TeX}]{Droid Sans}
      \setmonofont{CMU Typewriter Text}
      \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
      % ������������
      \setmainjfont[
       BoldFont={AdobeHeitiStd-Regular},
       ItalicFont={AdobeKaitiStd-Regular}]{AdobeSongStd-Light}
      \setsansjfont{AdobeKaitiStd-Regular}
      \defaultjfontfeatures{JFM=kaiming}

      \newcommand\ziju[2]{\vbox{\ltjsetparameter{kanjiskip=#1} #2}}
%    \end{macrocode}
%
% \begin{macro}{\HEI}
%    \begin{macrocode}
      \newjfontfamily\HEI{AdobeHeitiStd-Regular}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\KAI}
%    \begin{macrocode}
      \newjfontfamily\KAI{AdobeKaitiStd-Regular}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FANGSONG}
%    \begin{macrocode}
      \newjfontfamily\FANGSONG{AdobeFangsongStd-Regular}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hei}
%    \begin{macrocode}
      \newcommand{\hei}[1]{{\jfontspec{AdobeHeitiStd-Regular} #1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\kai}
%    \begin{macrocode}
      \newcommand{\kai}[1]{{\jfontspec{AdobeKaitiStd-Regular} #1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fangsong}
%    \begin{macrocode}
      \newcommand{\fangsong}[1]{{\jfontspec{AdobeFangsongStd-Regular} #1}}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
    \else\fi
%    \end{macrocode}
%
% Generate Chinese number using \pkgurl{zhnumber}.
%    \begin{macrocode}
    \RequirePackage{zhnumber}
    \def\CJKnumber#1{\zhnumber{#1}} % ������CJKnumb
}
%    \end{macrocode}
%
% \section{Basic Format}
% We set global line spread to 1.3.
%    \begin{macrocode}
\linespread{1.3}\selectfont
%    \end{macrocode}
%
% Use \pkgurl{geometry} package to handle paper page.
%    \begin{macrocode}
\RequirePackage{geometry}
\geometry{
  top=1.77in,
  bottom=0.8in,
  left=1.1in,
  right=1.1in,
  includefoot
}
\ifthenelse{\isundefined{\pagewidth}}{
  \pdfpagewidth=\paperwidth
  \pdfpageheight=\paperheight
}{
  \pagewidth=\paperwidth
  \pageheight=\paperheight
}
%    \end{macrocode}
%
% Indent of paragraph and skip between paragraphs.
%    \begin{macrocode}
\RequirePackage{indentfirst}
\setlength{\parindent}{2em}
\setlength{\parskip}{0pt plus 2pt minus 1pt}
%    \end{macrocode}
%
% Packages to handle color.
%    \begin{macrocode}
\RequirePackage{color}
\RequirePackage[table]{xcolor}
%    \end{macrocode}
%
% Use \pkgurl{hyperref} package to generate cross-reference link.
%    \begin{macrocode}
\RequirePackage[unicode]{hyperref}
\hypersetup{
  bookmarksnumbered=true,
  bookmarksopen=true,
  bookmarksopenlevel=1,
  breaklinks=true,
  colorlinks=true,
  allcolors=black,
  linktoc=all,
  plainpages=false,
  pdfpagelabels=true,
  pdfstartview={XYZ null null 1},
  pdfinfo={Template.Info={hustthesis.cls v1.1 2013/07/01, Copyright (C) 2013-2014 by Xu Cheng 2014 by hust-latex, https://github.com/hust-latex/hustthesis}}
}
%    \end{macrocode}
%
% \section{Load Packages}
% Load packages for math.
%    \begin{macrocode}
\RequirePackage{amsmath,amssymb,amsfonts}
\RequirePackage[amsmath,amsthm,thmmarks,hyperref,thref]{ntheorem}
\RequirePackage{fancynum}
\setfnumgsym{\,}
\RequirePackage[lined,boxed,linesnumbered,ruled,vlined,algochapter]{algorithm2e}
%    \end{macrocode}
%
% Load packages for picture.
%    \begin{macrocode}
\RequirePackage{overpic}
\RequirePackage{graphicx,caption,subcaption}
%    \end{macrocode}
%
% Load packages for table.
%    \begin{macrocode}
\RequirePackage{array}
\RequirePackage{multirow,tabularx,ltxtable}
%    \end{macrocode}
%
% Load package for code highlight. Here we use \pkgurl{listings} to highlight the code. But if you need more features, use \pkgurl{minted}.
%    \begin{macrocode}
\RequirePackage{listings}
%    \end{macrocode}
%
% Load package for bibliography cite style.
%    \begin{macrocode}
\RequirePackage[numbers,square,comma,super,sort&amp;compress]{natbib}
%    \end{macrocode}
%
% Other packages for style setting.
%    \begin{macrocode}
\RequirePackage{titlesec}
\RequirePackage{titletoc}
\RequirePackage{tocvsec2}
\RequirePackage[inline]{enumitem}
\RequirePackage{fancyhdr}
\RequirePackage{afterpage}
\RequirePackage{datenumber}
\RequirePackage{etoolbox}
\RequirePackage{appendix}
\RequirePackage[titles]{tocloft}
\RequirePackage{xstring}
\RequirePackage{perpage}
%    \end{macrocode}
%
% \section{Variables Setting}
% \begin{macro}{\zhtitle,\entitle,\title}
% Commands to set the title.
%    \begin{macrocode}
\def\zhtitle#1{\gdef\HUST@zhtitle{#1}\hypersetup{pdftitle={#1}}}
\def\entitle#1{\gdef\HUST@entitle{#1}}
\DeclareDocumentCommand\title{m g}
{
  \IfNoValueTF{#2}{
    \zhtitle{#1}\entitle{#1}
  }{
    \zhtitle{#1}\entitle{#2}
  }
}
\title{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhauthor,\enauthor,\author}
% Commands to set the author.
%    \begin{macrocode}
\def\zhauthor#1{\gdef\HUST@zhauthor{#1}\hypersetup{pdfauthor={#1}}}
\def\enauthor#1{\gdef\HUST@enauthor{#1}}
\DeclareDocumentCommand\author{m g}
{
  \IfNoValueTF{#2}{
    \zhauthor{#1}\enauthor{#1}
  }{
    \zhauthor{#1}\enauthor{#2}
  }
}
\author{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\date,\zhdateformat,\endateformat,\dateformat}
% A command to set the date and several commands to display date.
%    \begin{macrocode}
\def\date#1#2#3{
  \setdate{#1}{#2}{#3}
}
\setdatetoday
\def\zhdateformat{~\thedateyear~���~\thedatemonth~���~\thedateday~���}
\def\endateformat{\datedate}
\ifthenelse{\equal{\HUST@language}{chinese}}{
  \let\dateformat\zhdateformat
}{
  \let\dateformat\endateformat
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhschoolname,\enschoolname,\schoolname}
% Commands to set the school name.
%    \begin{macrocode}
\def\zhschoolname#1{\gdef\HUST@zhschoolname{#1}}
\def\enschoolname#1{\gdef\HUST@enschoolname{#1}}
\DeclareDocumentCommand\schoolname{m g}
{
  \IfNoValueTF{#2}{
    \zhschoolname{#1}\enschoolname{#1}
  }{
    \zhschoolname{#1}\enschoolname{#2}
  }
}
\schoolname{������������������}{Huazhong University of Science~\char38~Technology}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhaddress,\enaddress,\address}
% Commands to set the address.
%    \begin{macrocode}
\def\zhaddress#1{\gdef\HUST@zhaddress{#1}}
\def\enaddress#1{\gdef\HUST@enaddress{#1}}
\DeclareDocumentCommand\address{m g}
{
  \IfNoValueTF{#2}{
    \zhaddress{#1}\enaddress{#1}
  }{
    \zhaddress{#1}\enaddress{#2}
  }
}
\address{������������������430074}{Wuhan~430074, P.~R.~China}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhapplyname,\enapplyname,\applyname}
% Commands to custom apply name.
%    \begin{macrocode}
\def\zhapplyname#1{\def\HUST@zhapplyname{#1}}
\def\enapplyname#1{\def\HUST@enapplyname{#1}}
\DeclareDocumentCommand\applyname{m g}
{
  \IfNoValueTF{#2}{
    \enapplyname{#1}
  }{
    \zhapplyname{#1}\enapplyname{#2}
  }
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhmajor,\enmajor,\major}
% Commands to set the major.
%    \begin{macrocode}
\def\zhmajor#1{\gdef\HUST@zhmajor{#1}}
\def\enmajor#1{\gdef\HUST@enmajor{#1}}
\DeclareDocumentCommand\major{m g}
{
  \IfNoValueTF{#2}{
    \zhmajor{#1}\enmajor{#1}
  }{
    \zhmajor{#1}\enmajor{#2}
  }
}
\major{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhsupervisor,\ensupervisor,\supervisor}
% Commands to set the supervisor.
%    \begin{macrocode}
\def\zhsupervisor#1{\gdef\HUST@zhsupervisor{#1}}
\def\ensupervisor#1{\gdef\HUST@ensupervisor{#1}}
\DeclareDocumentCommand\supervisor{m g}
{
  \IfNoValueTF{#2}{
    \zhsupervisor{#1}\ensupervisor{#1}
  }{
    \zhsupervisor{#1}\ensupervisor{#2}
  }
}
\supervisor{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhasssupervisor,\enasssupervisor,\asssupervisor}
% Commands to set the asssupervisor.
%    \begin{macrocode}
\def\zhasssupervisor#1{\gdef\HUST@zhasssupervisor{#1}}
\def\enasssupervisor#1{\gdef\HUST@enasssupervisor{#1}}
\DeclareDocumentCommand\asssupervisor{m g}
{
  \IfNoValueTF{#2}{
    \zhasssupervisor{#1}\enasssupervisor{#1}
  }{
    \zhasssupervisor{#1}\enasssupervisor{#2}
  }
}
\asssupervisor{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\schoolcode}
% A command to set school code.
%    \begin{macrocode}
\def\schoolcode#1{\gdef\HUST@schoolcode{#1}}
\schoolcode{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\stuno}
% A command to set student number.
%    \begin{macrocode}
\def\stuno#1{\gdef\HUST@stuno{#1}}
\stuno{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\classno}
% A command to set classification number.
%    \begin{macrocode}
\def\classno#1{\gdef\HUST@classno{#1}}
\classno{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\secretlevel}
% A command to set secret level.
%    \begin{macrocode}
\def\secretlevel#1{\gdef\HUST@secretlevel{#1}}
\secretlevel{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhabstract,\enabstract,\abstract}
% Commands to set the abstract.
%    \begin{macrocode}
\long\def\zhabstract#1{\long\gdef\HUST@zhabstract{#1}}
\long\def\enabstract#1{\long\gdef\HUST@enabstract{#1}}
\DeclareDocumentCommand\abstract{+m +g}
{
  \IfNoValueTF{#2}{
    \zhabstract{#1}\enabstract{#1}
  }{
    \zhabstract{#1}\enabstract{#2}
  }
}
\abstract{}{}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\zhkeywords,\enkeywords,\keywords}
% Commands to set the keywords.
%    \begin{macrocode}
\def\zhkeywords#1{\gdef\HUST@zhkeywords{#1}\hypersetup{pdfkeywords={#1}}}
\def\enkeywords#1{\gdef\HUST@enkeywords{#1}}
\DeclareDocumentCommand\keywords{m g}
{
  \IfNoValueTF{#2}{
    \zhkeywords{#1}\enkeywords{#1}
  }{
    \zhkeywords{#1}\enkeywords{#2}
  }
}
\keywords{}{}
%    \end{macrocode}
% \end{macro}
%
% \section{Localization}\label{sec:Localization}
% Chinese localization.
% \footnote{The |autorefname| Reference:\url{http://tex.stackexchange.com/questions/52410/how-to-use-the-command-autoref-to-implement-the-same-effect-when-use-the-comman}}
%    \begin{macrocode}
\ifthenelse{\equal{\HUST@language}{chinese}}{
    \def\indexname{������}
    \def\figurename{���}
    \def\tablename{���}
    \AtBeginDocument{\def\listingscaption{������}}
    \def\bibname{������������}
    \def\contentsname{���\hspace{1em}���}
    \def\contentsnamenospace{������}
    \def\appendixname{������}
    \def\HUST@listfigurename{������������}
    \def\HUST@listtablename{������������}
    \def\equationautorefname{������}
    \def\footnoteautorefname{������}
    \def\itemautorefname~#1\null{���~#1~���\null}
    \def\figureautorefname{���}
    \def\tableautorefname{���}
    \def\appendixautorefname{������}
    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
    \def\chapterautorefname~#1\null{���\zhnumber{#1}���\null}
    \def\sectionautorefname~#1\null{#1~������\null}
    \def\subsectionautorefname~#1\null{#1~������\null}
    \def\subsubsectionautorefname~#1\null{#1~������\null}
    \def\FancyVerbLineautorefname~#1\null{���~#1~���\null}
    \def\pageautorefname~#1\null{���~#1~���\null}
    \def\lstlistingautorefname{������}
    \def\definitionautorefname{������}
    \def\propositionautorefname{������}
    \def\lemmaautorefname{������}
    \def\theoremautorefname{������}
    \def\axiomautorefname{������}
    \def\corollaryautorefname{������}
    \def\exerciseautorefname{������}
    \def\exampleautorefname{���}
    \def\proofautorefname{������}
    \SetAlgorithmName{������}{������}{������������}
    \SetAlgoProcName{������}{������}
    \SetAlgoFuncName{������}{������}
    \def\AlgoLineautorefname~#1\null{���~#1~���\null}
}{}
%    \end{macrocode}
%
% English localization.
%    \begin{macrocode}
\ifthenelse{\equal{\HUST@language}{chinese}}{}{
    \def\HUST@listfigurename{List of Figures}
    \def\HUST@listtablename{List of Tables}
    \def\equationautorefname{Equation}
    \def\footnoteautorefname{Footnote}
    \def\itemautorefname{Item}
    \def\figureautorefname{Figure}
    \def\tableautorefname{Table}
    \def\appendixautorefname{Appendix}
    \expandafter\def\csname\appendixname autorefname\endcsname{\appendixname}
    \def\chapterautorefname{Chapter}
    \def\sectionautorefname{Section}
    \def\subsectionautorefname{Subsection}
    \def\subsubsectionautorefname{Sub-subsection}
    \def\FancyVerbLineautorefname{Line}
    \def\pageautorefname{Page}
    \def\lstlistingautorefname{Code Fragment}
    \def\definitionautorefname{Definition}
    \def\propositionautorefname{Proposition}
    \def\lemmaautorefname{Lemma}
    \def\theoremautorefname{Theorem}
    \def\axiomautorefname{Axiom}
    \def\corollaryautorefname{Corollary}
    \def\exerciseautorefname{Exercise}
    \def\exampleautorefname{Example}
    \def\proofautorefname{Proof}
    \SetAlgorithmName{Algorithm}{Algorithm}{List of Algorithms}
    \SetAlgoProcName{Procedure}{Procedure}
    \SetAlgoFuncName{Function}{Function}
    \def\AlgoLineautorefname{Line}
}
%    \end{macrocode}
%
% Internal variables.
%    \begin{macrocode}
\def\HUST@classnotitle{{���}\hfill{���}\hfill{���}}
\def\HUST@stunotitle{������}
\def\HUST@schoolcodetitle{������������}
\def\HUST@secrettile{������}
\def\HUST@zhauthortitle{{���}\hfill{���}\hfill{���}\hfill{���}\hfill{���}}
\def\HUST@zhmajortitle{{���}\hfill{���}\hfill{���}\hfill{���}}
\def\HUST@zhsupervisortitle{{���}\hfill{���}\hfill{���}\hfill{���}}
\def\HUST@zhasssupervisortitle{{���}\hfill{���}\hfill{���}\hfill{���}\hfill{���}}
\def\HUST@zhdatetitle{{���}\hfill{���}\hfill{���}\hfill{���}}

\def\HUST@enauthortitle{Student}
\def\HUST@enmajortitle{Major}
\def\HUST@ensupervisortitle{Supervisor}
\def\HUST@enasssupervisortitle{Co-Supervisor}

\def\HUST@originaldeclare{���������������}
\long\def\HUST@originaldeclaretext{
  ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
}
\def\HUST@zhauthorsig{���������������������������}
\def\HUST@zhdatefield{���������\hspace{2em}���\hspace{2em}���\hspace{2em}���}

\def\HUST@authtitle{���������������������������������}
\long\def\HUST@authorizationtext{
  ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
}
\long\def\HUST@authorizationaddon{
 ���������������
 \tabincell{l}{
  ������$\square$������~\makebox[2em]{\hrulefill} ���������������������������������\\
  ���������~$\square$���
 }
}
\def\HUST@authorizationcheck{������������������������������$\surd$������}
\def\HUST@zhteachersig{���������������������}

\def\HUST@zhabstractname{���\hspace{1em}���}
\def\HUST@zhabstractnamenospace{������}
\def\HUST@zhkeywordstitle{������������}
\def\HUST@enabstractname{Abstract}
\def\HUST@enkeywordstitle{Key words:}

\ifthenelse{\equal{\HUST@language}{chinese}}{
  \def\HUST@ackname{���\hspace{1em}���}
  \def\HUST@acknamenospace{������}
  \def\HUST@publicationtitle{���������������������������������������}
}{
  \def\HUST@ackname{Acknowledge}
  \def\HUST@acknamenospace{Acknowledge}
  \def\HUST@publicationtitle{Publication}
}

\ifthenelse{\equal{\HUST@degree}{none}}{
  \def\HUST@zhapplyname{������������}
  \def\HUST@enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree}
}{}

\ifthenelse{\equal{\HUST@degree}{fyp}}{
  \def\HUST@zhapplyname{������������������}
  \def\HUST@enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for Final Year Project}
}{}

\ifthenelse{\equal{\HUST@degree}{bachelor}}{
  \def\HUST@zhapplyname{������������������}
  \def\HUST@enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Bachelor}
}{}

\ifthenelse{\equal{\HUST@degree}{master}}{
  \def\HUST@zhapplyname{������������������}
  \def\HUST@enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master}
}{}

\ifthenelse{\equal{\HUST@degree}{phd}}{
  \def\HUST@zhapplyname{������������������}
  \def\HUST@enapplyname{A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Philosophy}
}{}

\ifthenelse{\equal{\HUST@language}{chinese}}{
  \hypersetup{pdfsubject={\HUST@zhschoolname\HUST@zhapplyname}}
}{
  \hypersetup{pdfsubject={\HUST@enapplyname}}
}
%    \end{macrocode}
%
% Set |\listfigurename| and |\listtablename|.
%    \begin{macrocode}
\def\listfigurename{\HUST@listfigurename}
\def\listtablename{\HUST@listtablename}
%    \end{macrocode}
%
% \section{Style Setting}
% \subsection{Equation Style}
% Allow long equation breaking between lines or pages.
%    \begin{macrocode}
\allowdisplaybreaks[4]
%    \end{macrocode}
%
% Set skip between equation and context.
%    \begin{macrocode}
\abovedisplayskip=10bp plus 2bp minus 2bp
\abovedisplayshortskip=10bp plus 2bp minus 2bp
\belowdisplayskip=\abovedisplayskip
\belowdisplayshortskip=\abovedisplayshortskip
%    \end{macrocode}
%
% Set equation numbering style.
%    \begin{macrocode}
\numberwithin{equation}{chapter}
%    \end{macrocode}
%
% \subsection{Theorem Style}
% We use \pkgurl{amsthm} to handle the proof environment and use \pkgurl{ntheorem} to handle other theorem environments.
%    \begin{macrocode}
\theoremnumbering{arabic}
\ifthenelse{\equal{\HUST@language}{chinese}}{
  \theoremseparator{���}
}{
  \theoremseparator{:}
}
\theorempreskip{1.2ex plus 0ex minus 1ex}
\theorempostskip{1.2ex plus 0ex minus 1ex}
\theoremheaderfont{\normalfont\bfseries\HEI}
\theoremsymbol{}

\theoremstyle{definition}
\theorembodyfont{\normalfont}
\ifthenelse{\equal{\HUST@language}{chinese}}{
  \newtheorem{definition}{������}[chapter]
}{
  \newtheorem{definition}{Definition}[chapter]
}

\theoremstyle{plain}
\theorembodyfont{\itshape}
\ifthenelse{\equal{\HUST@language}{chinese}}{
  \newtheorem{proposition}{������}[chapter]
  \newtheorem{lemma}{������}[chapter]
  \newtheorem{theorem}{������}[chapter]
  \newtheorem{axiom}{������}[chapter]
  \newtheorem{corollary}{������}[chapter]
  \newtheorem{exercise}{������}[chapter]
  \newtheorem{example}{���}[chapter]
  \def\proofname{\hei{������}}
}{
  \newtheorem{proposition}{Proposition}[chapter]
  \newtheorem{lemma}{Lemma}[chapter]
  \newtheorem{theorem}{Theorem}[chapter]
  \newtheorem{axiom}{Axiom}[chapter]
  \newtheorem{corollary}{Corollary}[chapter]
  \newtheorem{exercise}{Exercise}[chapter]
  \newtheorem{example}{Example}[chapter]
  \def\proofname{\textbf{Proof}}
}
%    \end{macrocode}
%
% \subsection{Floating Objects Style}
% Set the skip to the context for floating object with argument `h'.
%    \begin{macrocode}
\setlength{\intextsep}{0.7\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip}
%    \end{macrocode}
%
% Set the skip to the context for top or bottom floating object.
%    \begin{macrocode}
\setlength{\textfloatsep}{0.8\baselineskip plus 0.1\baselineskip minus 0.2\baselineskip}
%    \end{macrocode}
%
% Set the fraction of floating object. Make the fraction less crowded than default value to prevent floating object occupying too much space.
%    \begin{macrocode}
\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}
%    \end{macrocode}
%
% \subsection{Table Style}
%
% \begin{macro}{\tabincell}
% A command make it easier to insert a new table into an existing cell.
%    \begin{macrocode}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
%    \end{macrocode}
% \end{macro}
%
% To prevent |\cline| breaking page in \pkgurl{longtable} environment, use in this way:
% \meta{table content} |\\* \nopagebreak \cline{i-j}|
% \footnote{Reference:\url{http://tex.stackexchange.com/questions/52100/longtable-multirow-problem-with-cline-and-nopagebreak}}
%    \begin{macrocode}
\def\@cline#1-#2\@nil{%
  \omit
  \@multicnt#1%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&amp;\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  \leaders\hrule\@height\arrayrulewidth\hfill
  \cr
  \noalign{\nobreak\vskip-\arrayrulewidth}}
%    \end{macrocode}
%
% Here we set the global font setting (font size: 11pt and line spread: 1.4) for tables. But first we will declare a variable to determine whether table global font setting is activated.
%    \begin{macrocode}
\newif\ifHUST@useoldtabular
\HUST@useoldtabularfalse
%    \end{macrocode}
%
% \begin{macro}{\TurnOffTabFontSetting}
% Use |\TurnOffTabFontSetting| to deactivate global font setting.
%    \begin{macrocode}
\def\TurnOffTabFontSetting{\HUST@useoldtabulartrue}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\TurnOnTabFontSetting}
% Use |\TurnOnTabFontSetting| to activate global font setting.
%    \begin{macrocode}
\def\TurnOnTabFontSetting{\HUST@useoldtabularfalse}
%    \end{macrocode}
% \end{macro}
%
% Hook the \pkgurl{tabular}, \pkgurl{tabularx} and \pkgurl{longtable} environment to imply the global font setting.
%    \begin{macrocode}
\AtBeginEnvironment{tabular}{
  \ifHUST@useoldtabular\else
    \fontsize{11pt}{15.4pt}\selectfont
  \fi
}
\AtBeginEnvironment{tabularx}{
  \ifHUST@useoldtabular\else
    \fontsize{11pt}{15.4pt}\selectfont
  \fi
}
\AtBeginEnvironment{longtable}{
  \ifHUST@useoldtabular\else
    \fontsize{11pt}{15.4pt}\selectfont
  \fi
}
%    \end{macrocode}
%
% \subsection{Caption Style}
% Set caption font size as 11pt, use hang format, remove `:' after number and set the skip between context as 12pt.
%    \begin{macrocode}
\DeclareCaptionFont{HUST@captionfont}{\fontsize{11pt}{14.3pt}\selectfont}
\DeclareCaptionLabelFormat{HUST@caplabel}{#1~#2}
\captionsetup{
  font=HUST@captionfont,
  labelformat=HUST@caplabel,
  format=hang,
  labelsep=quad,
  skip=12pt
}
%    \end{macrocode}
%
% Set figure and table numbering style.
%    \begin{macrocode}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}}
%    \end{macrocode}
%
% \subsection{Code Highlight Style}
%    \begin{macrocode}
\definecolor{HUST@lstgreen}{rgb}{0,0.6,0}
\definecolor{HUST@lstmauve}{rgb}{0.58,0,0.82}

\lstset{
  basicstyle=\footnotesize\ttfamily\linespread{1}\selectfont\FANGSONG,
  keywordstyle=\color{blue}\bfseries,
  commentstyle=\color{HUST@lstgreen}\itshape\KAI,
  stringstyle=\color{HUST@lstmauve},
  showspaces=false,
  showstringspaces=false,
  showtabs=false,
  numbers=left,
  numberstyle=\tiny\color{black},
  frame=lines,
  rulecolor=\color{black},
  breaklines=true
}
%    \end{macrocode}
%
% \subsection{Section Title Style}
% Set the numbering depth for section.
%    \begin{macrocode}
\setcounter{secnumdepth}{3}
%    \end{macrocode}
%
% Chapter tilte format and spacing setting.
%    \begin{macrocode}
\titleformat{\chapter}
  {
    \bfseries
    \HEI
    \centering
    \fontsize{18pt}{23.4pt}\selectfont
  }
  {
    \ifthenelse{\equal{\HUST@language}{chinese}}
    {\zhnumber{\thechapter}}
    {Chapter~\thechapter}
  }
  {1em}
  {}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
%    \end{macrocode}
%
% Section tilte format and spacing setting.
%    \begin{macrocode}
\titleformat*{\section}{\bfseries\HEI\fontsize{16pt}{20.8pt}\selectfont}
\titlespacing*{\section}{0pt}{18pt}{6pt}
%    \end{macrocode}
%
% Subsection tilte format and spacing setting.
%    \begin{macrocode}
\titleformat*{\subsection}{\bfseries\HEI\fontsize{14pt}{18.2pt}\selectfont}
\titlespacing*{\subsection}{0pt}{12pt}{6pt}
%    \end{macrocode}
%
% Subsubsection tilte format and spacing setting.
%    \begin{macrocode}
\titleformat*{\subsubsection}{\bfseries\HEI\fontsize{13pt}{16.9pt}\selectfont}
\titlespacing*{\subsubsection}{0pt}{12pt}{6pt}
%    \end{macrocode}
%
% \subsection{TOC Style}
% TOC depth.
%    \begin{macrocode}
\setcounter{tocdepth}{1}
%    \end{macrocode}
%
% TOC right margin.
%    \begin{macrocode}
\contentsmargin{2.0em}
%    \end{macrocode}
%
% Remove vertical space between two continues chapter entries.
% \footnote{Reference:\url{http://tex.stackexchange.com/questions/89103/remove-vertical-space-between-two-chapters-in-table-of-contents-in-latex}}
%    \begin{macrocode}
\newskip\HUST@oldcftbeforechapskip
\HUST@oldcftbeforechapskip=\cftbeforechapskip
\newskip\HUST@oldcftbeforesecskip
\HUST@oldcftbeforesecskip=\cftbeforesecskip
\let\HUST@oldl@chapter\l@chapter
\let\HUST@oldl@section\l@section
\let\HUST@oldl@subsection\l@subsection
\def\l@chapter#1#2{\HUST@oldl@chapter{#1}{#2}\cftbeforechapskip=3pt}
\def\l@section#1#2{\HUST@oldl@section{#1}{#2}\cftbeforechapskip=\HUST@oldcftbeforechapskip\cftbeforesecskip=3pt}
\def\l@subsection#1#2{\HUST@oldl@subsection{#1}{#2}\cftbeforesecskip=\HUST@oldcftbeforesecskip}
%    \end{macrocode}
%
% Set LOF LOT style.
% \footnote{Reference:\url{http://www.latex-community.org/viewtopic.php?f=5&amp;t=1838}}
%    \begin{macrocode}
\renewcommand*\cftfigpresnum{\figurename~}
\newlength{\HUST@cftfignumwidth@tmp}
\settowidth{\HUST@cftfignumwidth@tmp}{\cftfigpresnum}
\addtolength{\cftfignumwidth}{\HUST@cftfignumwidth@tmp}
\renewcommand{\cftfigaftersnumb}{\quad~}
\renewcommand*\cfttabpresnum{\tablename~}
\newlength{\HUST@cfttabnumwidth@tmp}
\settowidth{\HUST@cfttabnumwidth@tmp}{\cfttabpresnum}
\addtolength{\cfttabnumwidth}{\HUST@cfttabnumwidth@tmp}
\renewcommand{\cfttabaftersnumb}{\quad~}
%    \end{macrocode}
%
% \subsection{Head \&amp; Foot Style}
%    \begin{macrocode}
\let\ps@plain\ps@fancy
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\ifthenelse{\equal{\HUST@degree}{fyp}}{
  \fancyfoot[R]{\thepage}
}{
  \fancyfoot[C]{\thepage}
}

\ifthenelse{\equal{\HUST@language}{english-draft}}{}{
  \ifHUST@finalformat\else
    \fancyhead[C]{
      \ziju{1em}{\kai{\fontsize{14pt}{18.2pt}\selectfont\HUST@zhschoolname\HUST@zhapplyname}}
      \vskip -5pt
      \vbox{
        \hrule width \textwidth height 2pt
      }
    }
  \fi
}
%    \end{macrocode}
%
% \subsection{List Environment Style}
%    \begin{macrocode}
\setlist{noitemsep,partopsep=0pt,topsep=.8ex}
\setlist[1]{labelindent=\parindent}
\setlist[enumerate,1]{label=\arabic*.,ref=\arabic*}
\setlist[enumerate,2]{label*=\arabic*,ref=\theenumi.\arabic*}
\setlist[enumerate,3]{label=\emph{\alph*}),ref=\theenumii\emph{\alph*}}
\setlist[description]{font=\bfseries\HEI}
%    \end{macrocode}
%
% \subsection{Footnote Style}
%    \begin{macrocode}
\MakePerPage{footnote}
%    \end{macrocode}
%
% \section{Specical Page}
% \begin{macro}{\frontmatter,\mainmatter,\backmatter}
%    \begin{macrocode}
\def\frontmatter{
  \clearpage
  \@mainmatterfalse
  \pagenumbering{Roman}
}
\def\mainmatter{
  \clearpage
  \@mainmattertrue
  \pagenumbering{arabic}
}
\def\backmatter{
  \clearpage
  \@mainmatterfalse
  \settocdepth{chapter}
  \hypersetup{bookmarksopenlevel=0}
}
%    \end{macrocode}
% \end{macro}
%
% Chinese title page.
%    \begin{macrocode}
\def\HUST@zhtitlepage{
  \begin{center}
  \vspace*{-1.0cm}
  \parbox[t][2.2cm][t]{\textwidth}{
    \begin{center}
      \setlength{\tabcolsep}{0pt}
      \setlength{\extrarowheight}{12pt}
      \TurnOffTabFontSetting
      \fontsize{14pt}{16.8pt}\selectfont
      \begin{tabularx}{\textwidth}{p{4em}p{5em}Xp{2em}p{12em}}
        \HUST@classnotitle    &amp; \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST@classno}\hfill} &amp; &amp;
        \HUST@stunotitle      &amp; \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST@stuno}\hfill} \\
        \HUST@schoolcodetitle &amp; \makebox[5em][l]{\rule[-2.0pt]{5em}{1pt}\hspace{-5em}\hfill\texttt{\HUST@schoolcode}\hfill} &amp; &amp;
        \HUST@secrettile      &amp; \makebox[12em][l]{\rule[-2.0pt]{12em}{1pt}\hspace{-12em}\hfill\texttt{\HUST@secretlevel}\hfill}
      \end{tabularx}
      \TurnOnTabFontSetting
    \end{center}
    }
  \parbox[t][6cm][t]{\textwidth}{
    \vspace{1.0cm}
    \begin{center}
    \includegraphics[scale=1.1]{hust-title.pdf}\\[0.8cm]
    \ziju{10bp}{\fontsize{42pt}{54.6pt}\selectfont\HEI\HUST@zhapplyname}
    \end{center}
  }
  \parbox[t][4.8cm][t]{.8\textwidth}{
    \vspace{1.4cm}
    \begin{center}
    \fontsize{22pt}{35.2pt}\selectfont\hei{\HUST@zhtitle}
    \end{center}
  }
  \parbox[t][7.4cm][t]{\textwidth}{
    \vspace{1.2cm}
    \begin{center}
    \fontsize{18pt}{27.0pt}\selectfont
    \setlength{\extrarowheight}{0pt}
    \TurnOffTabFontSetting
    \begin{tabular}{p{5em}@{{���\hspace{1em}}}l}
    \HUST@zhauthortitle       &amp; {\HUST@zhauthor} \\
    \HUST@zhmajortitle      &amp; {\HUST@zhmajor} \\
    \HUST@zhsupervisortitle &amp; {\HUST@zhsupervisor} \\
    \ifthenelse{\equal{\HUST@zhasssupervisor}{}}{}{
      \HUST@zhasssupervisortitle &amp; {\HUST@zhasssupervisor} \\
    }
    \HUST@zhdatetitle &amp; \zhdateformat
    \end{tabular}
    \TurnOnTabFontSetting
    \end{center}
  }
  \end{center}
}
%    \end{macrocode}
%
% English title page.
%    \begin{macrocode}
\def\HUST@entitlepage{
  \begin{center}
    \parbox[t][4.5cm][t]{.9\textwidth}{
      \begin{center}
        \fontsize{16pt}{17.6pt}\selectfont
        \HUST@enapplyname
      \end{center}
    }
    \parbox[t][5.7cm][t]{\textwidth}{
      \begin{center}
        \fontsize{18pt}{23.4pt}\selectfont
        \textbf{\textsf{\HUST@entitle}}
      \end{center}
    }
    \parbox[t][5cm][t]{.8\textwidth}{
      \begin{center}
      \setlength{\extrarowheight}{5pt}
      \fontsize{16pt}{24.0pt}\selectfont
      \TurnOffTabFontSetting
      \begin{tabular}{l@{~:~}p{18em}}
        \HUST@enauthortitle     &amp; {\HUST@enauthor} \\
        \HUST@enmajortitle      &amp; {\HUST@enmajor} \\
        \HUST@ensupervisortitle &amp; {\HUST@ensupervisor}
        \ifthenelse{\equal{\HUST@enasssupervisor}{}}{}{
          \\ \HUST@enasssupervisortitle &amp; {\HUST@enasssupervisor}
        }
      \end{tabular}
      \TurnOnTabFontSetting
      \end{center}
    }
    \parbox[t][7cm][b]{.8\textwidth}{
      \begin{center}
      \bfseries
      \fontsize{14pt}{28.0pt}\selectfont
      \HUST@enschoolname \\
      \HUST@enaddress \\
      \endateformat
    \end{center}
    }
  \end{center}
}
%    \end{macrocode}
%
% Copyright page.
%    \begin{macrocode}
\def\HUST@authorization{
  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST@originaldeclare}
  \vspace{1cm}
  {
    \fontsize{12pt}{24.0pt}\selectfont
    \indent\HUST@originaldeclaretext
  }
  \\[1.9cm]
  \parbox[t]{\textwidth}{
    \fontsize{12pt}{18.0pt}\selectfont
    \TurnOffTabFontSetting
    \hfill\begin{tabular}{ll}
        \HUST@zhauthorsig &amp; \hspace{2em}\\
        \HUST@zhdatefield &amp; \hspace{2em}\\
    \end{tabular}
    \TurnOnTabFontSetting
  }
  \\[1.9cm]
  \centerline{\fontsize{16pt}{20.8pt}\selectfont \HEI \HUST@authtitle}
  \\[1cm]
  {
    \fontsize{12pt}{24.0pt}\selectfont
    \indent\HUST@authorizationtext \\
    \indent\HUST@authorizationaddon \\
    \indent\HUST@authorizationcheck
  }
  \\[1.9cm]
  \hspace{2em}\parbox[t]{.9\textwidth}{
    \fontsize{12pt}{18.0pt}\selectfont
    \TurnOffTabFontSetting
    \begin{tabular}{ll}
        \HUST@zhauthorsig &amp; \hspace{2em}\\
        \HUST@zhdatefield &amp; \hspace{2em}\\
    \end{tabular}
    \hfill
    \begin{tabular}{ll}
        \HUST@zhteachersig &amp; \hspace{2em}\\
        \HUST@zhdatefield &amp; \hspace{2em}\\
    \end{tabular}
    \TurnOnTabFontSetting
  }
  \vfill
}
%    \end{macrocode}
%
% \begin{macro}{\maketitle,\makecover}
% Commands to generate title page.
%    \begin{macrocode}
\def\maketitle{
  \newgeometry{
    top=1.2in,
    bottom=1.2in,
    left=1in,
    right=1in,
  }
  \let\HUST@oldthepage\thepage
  \ifthenelse{\equal{\HUST@language}{english-draft}}
  {\def\thepage{Titlepage}}
  {\def\thepage{������}}
  \begin{titlepage}
    \ifthenelse{\equal{\HUST@language}{english-draft}}{}{
      \thispagestyle{empty}
      \HUST@zhtitlepage
      \clearpage
    }
    \thispagestyle{empty}
    \HUST@entitlepage
  \end{titlepage}
  \ifthenelse{\equal{\HUST@language}{english-draft}}{}{
    \def\thepage{���������}
    \thispagestyle{empty}
    \HUST@authorization
    \clearpage
  }
  \restoregeometry
  \let\thepage\HUST@oldthepage
  \setcounter{page}{1}
}
\let\makecover\maketitle
%    \end{macrocode}
% \end{macro}
%
% Chinese abstract page.
%    \begin{macrocode}
\def\HUST@zhabstractpage{
  \chapter*{\HUST@zhabstractname}
  \begingroup
  \fontsize{10.5pt}{13.7pt}\selectfont
  \HUST@zhabstract \par
  \vskip 1.2ex
  \noindent\hei{\HUST@zhkeywordstitle}\hspace{.8em} \HUST@zhkeywords
  \endgroup
}
%    \end{macrocode}
%
% English abstract page.
%    \begin{macrocode}
\def\HUST@enabstractpage{
  \chapter*{\textsf{\HUST@enabstractname}}
  \begingroup
  \fontsize{10.5pt}{13.7pt}\selectfont
  \HUST@enabstract \par
  \vskip 1.2ex
  \noindent\textbf{\HUST@enkeywordstitle}\hspace{.8em} \HUST@enkeywords
  \endgroup
}
%    \end{macrocode}
%
% \begin{macro}{\makeabstract}
% A command to generate abstract page.
%    \begin{macrocode}
\def\makeabstract{
  \phantomsection
  \ifthenelse{\equal{\HUST@language}{chinese}}{
    \addcontentsline{toc}{chapter}{\HUST@zhabstractnamenospace}
  }{
    \addcontentsline{toc}{chapter}{\HUST@enabstractname}
  }
  \ifthenelse{\equal{\HUST@language}{english-draft}}{}{
    \HUST@zhabstractpage
    \clearpage
  }
  \HUST@enabstractpage
  \clearpage
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tableofcontents}
% A command to generate table of contents.
%    \begin{macrocode}
\let\HUST@tableofcontents\tableofcontents
\def\tableofcontents{
  \ifthenelse{\equal{\HUST@language}{chinese}}{
    \pdfbookmark{\contentsnamenospace}{\contentsnamenospace}
  }{
    \pdfbookmark{\contentsname}{\contentsname}
  }
  \HUST@tableofcontents
  \clearpage
}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{ack}
% A command to generate acknowledge page.
%    \begin{macrocode}
\newenvironment{ack}{
  \clearpage
  \phantomsection
  \addcontentsline{toc}{chapter}{\HUST@acknamenospace}
  \chapter*{\HUST@ackname}
  \begingroup
  \fontsize{10.5pt}{13.7pt}\selectfont
}{
  \endgroup
}
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{publications}
% A command to generate publications page.
%    \begin{macrocode}
\newenvironment{publications}{
  \clearpage
  \ifHUST@inappendix
    \chapter{\HUST@publicationtitle}
  \else
    \phantomsection
    \addcontentsline{toc}{chapter}{\HUST@publicationtitle}
    \chapter*{\HUST@publicationtitle}
  \fi
  \begin{enumerate}[labelindent=0pt,label={[\arabic*]},itemsep=0.5ex]
  \fontsize{10.5pt}{10.5pt}\selectfont
}{
  \end{enumerate}
}
%    \end{macrocode}
% \end{environment}
%
% \begin{macro}{\bibliography}
% A command to generate bibliography page.
%    \begin{macrocode}
\bibliographystyle{hustthesis}
\let\HUST@bibliography\bibliography
\def\bibliography#1{
  \clearpage
  \phantomsection
  \addcontentsline{toc}{chapter}{\bibname}
  \begingroup
  \fontsize{10.5pt}{10.5pt}\selectfont
  \setlength\bibsep{0.5ex}
  \HUST@bibliography{#1}
  \endgroup
}
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{appendix}
% The appendix environment.
%    \begin{macrocode}
\newif\ifHUST@inappendix
\HUST@inappendixfalse
\newif\ifHUST@appendix@resetmainmatter
\HUST@appendix@resetmainmatterfalse
\renewenvironment{appendix}{
  \if@mainmatter
    \HUST@appendix@resetmainmatterfalse
  \else
    \HUST@appendix@resetmainmattertrue
    \@mainmattertrue
  \fi
  \appendixtitletocon
  \appendices
  \titleformat{\chapter}
  {
    \bfseries\HEI
    \centering
    \fontsize{18pt}{23.4pt}\selectfont
  }
  {\appendixname\,\thechapter}
  {1em}
  {}
  \HUST@inappendixtrue
}{
  \endappendices
  \HUST@inappendixfalse
  \ifHUST@appendix@resetmainmatter
    \HUST@appendix@resetmainmatterfalse
    \@mainmatterfalse
  \else\fi
}
%    \end{macrocode}
% \end{environment}
%
% \begin{macro}{\listoffigures}
% A command to generate list of figures.
%    \begin{macrocode}
\let\HUST@listoffigures\listoffigures
\def\listoffigures{
  \clearpage
  \ifHUST@inappendix
    \addtocounter{chapter}{1}
    \def\listfigurename{\appendixname\,\thechapter\hspace{1em}\HUST@listfigurename}
  \else
    \def\listfigurename{\HUST@listfigurename}
  \fi
  \phantomsection
  \ifHUST@inappendix
    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST@listfigurename}
  \else
    \addcontentsline{toc}{chapter}{\listfigurename}
  \fi
  \HUST@listoffigures
  \def\listfigurename{\HUST@listfigurename}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\listoftables}
% A command to generate list of tables.
%    \begin{macrocode}
\let\HUST@listoftables\listoftables
\def\listoftables{
  \clearpage
  \ifHUST@inappendix
    \addtocounter{chapter}{1}
    \def\listtablename{\appendixname\,\thechapter\hspace{1em}\HUST@listtablename}
  \else
    \def\listtablename{\HUST@listtablename}
  \fi
  \phantomsection
  \ifHUST@inappendix
    \addcontentsline{toc}{chapter}{\thechapter\hspace{1em}\HUST@listtablename}
  \else
    \addcontentsline{toc}{chapter}{\listtablename}
  \fi
  \HUST@listoftables
  \def\listtablename{\HUST@listtablename}
}
%    \end{macrocode}
% \end{macro}
%
% \section{Other Command}
% \begin{macro}{\email}
%    \begin{macrocode}
\def\email#1{
  \href{mailto:#1}{\texttt{#1}}
}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class&gt;
%    \end{macrocode}
%
% \Finale
%
% ^^A Other files
% \iffalse
%
%&lt;*example-zh|example-en&gt;
%&lt;example-zh&gt;\documentclass[format=draft,language=chinese,degree=bachelor]{hustthesis}
%&lt;example-en&gt;\documentclass[format=draft,language=english,degree=bachelor]{hustthesis}

\stuno{U2009xxxxx}
\schoolcode{10487}
%&lt;example-zh&gt;\title{\LaTeX ������������������}{An Example of Using hustthesis \LaTeX{} Template}
%&lt;example-en&gt;\title{An Example of Using hustthesis \LaTeX{} Template}
\author
%&lt;example-zh&gt;{������}{Xu Cheng}
%&lt;example-en&gt;{}
\major
%&lt;example-zh&gt;{������������������}{Electronic and Information Engineering}
%&lt;example-en&gt;{}
\supervisor
%&lt;example-zh&gt;{���������\hspace{1em}���������}{Ass. Prof. Xiaojun Hei}
%&lt;example-en&gt;{}
\date{2013}{7}{1}

%&lt;*example-zh&gt;
\zhabstract{
    ���������������\LaTeX{}���������������������������������������������������������������������������������������������������������������������������������

    ���������������LPPL v1.3���������

}
\zhkeywords{\LaTeX{}���������������������������������������}
%&lt;/example-zh&gt;

%&lt;example-zh&gt;\enabstract
%&lt;example-en&gt;\abstract
{
    This is a \LaTeX{} template example file. This template is used in written thesis for Huazhong Univ. of Sci. \&amp; Tech.

    This template is published under LPPL v1.3 License.

}
%&lt;example-zh&gt;\enkeywords
%&lt;example-en&gt;\keywords
{\LaTeX{}, Huazhong Univ. of Sci. \&amp; Tech., Thesis, Template}

\begin{document}

\frontmatter
\maketitle
\makeabstract
\tableofcontents
\listoffigures
\listoftables
\mainmatter

%&lt;*example-zh&gt;
\chapter{������������������}\label{chapter:1}

\section{���������}\label{sec:1}
\subsection{���������}\label{sec:2}
\subsubsection{���������}\label{sec:3}
���������������������������������������������������������������������������
\footnote{\label{footnote:1}������}

\section{������}

������\textbf{������}\emph{������}

\hei{������}\kai{������}\fangsong{������}

\section{������}

������������������������������\autoref{eq:1}���
\begin{equation}
 c^2 = a^2 + b^2 \label{eq:1}
\end{equation}

������������������������������\autoref{eq:2}���\autoref{eq:3}���

\begin{subequations}
\begin{equation}
  F = ma \label{eq:2}
\end{equation}
\begin{equation}
  E = mc^2 \label{eq:3}
\end{equation}
\end{subequations}

\section{������������}

\begin{enumerate}
    \item ���������\label{item:1}
    \item ���������
    \begin{enumerate}
        \item ���������\label{item:2}
        \item ���������
        \begin{enumerate}
            \item ���������\label{item:3}
            \item ���������
        \end{enumerate}
    \end{enumerate}
\end{enumerate}

\begin{description}
    \item[������������]  ������������
\end{description}

\chapter{������������������}

\section{������������}

\begin{lstlisting}[language=python]
import os

def main():
    '''
    doc here
    '''
    print 'hello, world' # Abc
    print 'hello, ������' # ������
\end{lstlisting}

\section{������������������}

\begin{definition}\label{def:1}
���������������������
\end{definition}
\begin{proposition}\label{proposition:1}
���������������������
\end{proposition}
\begin{axiom}\label{axiom:1}
���������������������
\end{axiom}
\begin{lemma}\label{lemma:1}
���������������������
\end{lemma}
\begin{theorem}\label{theorem:1}
���������������������
\end{theorem}
\begin{proof}\label{proof:1}
���������������������
\end{proof}

\section{������������}

\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;\label{alg_line:1}
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}\label{alg:1}
\end{algorithm}

\section{������}
���������\autoref{tab:1}���

\begin{table}[!h]
\centering
\caption{������������}\label{tab:1}
\begin{tabular}{|c|c|}
\hline
a &amp; b \\
\hline
c &amp; d \\
\hline
\end{tabular}
\end{table}
\section{������}
���������\autoref{fig:1}���������������������eps���png���pdf���������������������\autoref{fig:2}������������������\autoref{fig:2-1}���\autoref{fig:2-2}���

\begin{figure}[!h]
\centering
\includegraphics[width=.4\textwidth]{fig-example.pdf}
\caption{������������}\label{fig:1}
\end{figure}

\begin{figure}[!h]
\centering
  \begin{subfigure}[b]{0.3\textwidth}
  \includegraphics[width=\textwidth]{fig-example.pdf}
  \caption{������1}\label{fig:2-1}
  \end{subfigure}
  ~
  \begin{subfigure}[b]{0.3\textwidth}
  \includegraphics[width=\textwidth]{fig-example.pdf}
  \caption{������2}\label{fig:2-2}
  \end{subfigure}
\caption{������������}\label{fig:2}
\end{figure}

\section{������������������}
������������������������������\cite{TEXGURU99}���������������������������������\cite{knuth}���������������\cite{TEXGURU99,knuth}���

\section[\textbackslash{}autoref ������]{\texttt{\textbackslash{}autoref} ������}

\begin{description}
  \item[������] \autoref{eq:1}
  \item[������] \autoref{footnote:1}
  \item[���] \autoref{item:1},\autoref{item:2},\autoref{item:3}
  \item[���] \autoref{fig:1}
  \item[���] \autoref{tab:1}
  \item[������] \autoref{appendix:1}
  \item[���] \autoref{chapter:1}
  \item[������] \autoref{sec:1},\autoref{sec:2},\autoref{sec:3}
  \item[������] \autoref{alg:1},\autoref{alg_line:1}
  \item[������������] \autoref{def:1},\autoref{proposition:1},\autoref{axiom:1},\autoref{lemma:1},\autoref{theorem:1},\autoref{proof:1}
\end{description}


\backmatter

\begin{ack}
���������������
\end{ack}

\bibliography{ref-example}

\appendix

\begin{publications}
    \item ������1
    \item ������2
\end{publications}

\chapter{������������������}\label{appendix:1}
���������������

%&lt;/example-zh&gt;
%&lt;*example-en&gt;
\chapter{Simple Test}\label{chapter:1}

\section{Level 1}\label{sec:1}
\subsection{Level 2}\label{sec:2}
\subsubsection{Level 3}\label{sec:3}
Content
\footnote{\label{footnote:1}A footnote.}

\section{Font}

Normal \textbf{Bold} \emph{Italic} \textsf{Sans}

The quick brown fox jumps over the lazy dog.

\section{Equation}

Single equation, see \autoref{eq:1}.
\begin{equation}
  c^2 = a^2 + b^2 \label{eq:1}
\end{equation}

Multi-equations, see \autoref{eq:2} and \autoref{eq:3}.

\begin{subequations}
\begin{equation}
  F = ma \label{eq:2}
\end{equation}
\begin{equation}
  E = mc^2 \label{eq:3}
\end{equation}
\end{subequations}

\section{List Environment}

\begin{enumerate}
    \item Level 1\label{item:1}
    \item Level 1
    \begin{enumerate}
        \item Level 2\label{item:2}
        \item Level 2
        \begin{enumerate}
            \item Level 3\label{item:3}
            \item Level 3
        \end{enumerate}
    \end{enumerate}
\end{enumerate}

\begin{description}
    \item[Discription]  Content
\end{description}

\chapter{Other Test}

\section{Code Highlight}

\begin{lstlisting}[language=python]
import os

def main():
    '''
    doc here
    '''
    print 'hello, world' # Abc
\end{lstlisting}

\section{Theorem}

\begin{definition}\label{def:1}
This is a definition.
\end{definition}
\begin{proposition}\label{proposition:1}
This is a proposition.
\end{proposition}
\begin{axiom}\label{axiom:1}
This is an axiom.
\end{axiom}
\begin{lemma}\label{lemma:1}
This is a lemma.
\end{lemma}
\begin{theorem}\label{theorem:1}
This is a theorem.
\end{theorem}
\begin{proof}\label{proof:1}
This is a proof.
\end{proof}

\section{Algorithm}

\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;\label{alg_line:1}
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}\label{alg:1}
\end{algorithm}

\section{Table}
See \autoref{tab:1}.

\begin{table}[!h]
\centering
\caption{A table}\label{tab:1}
\begin{tabular}{|c|c|}
\hline
a &amp; b \\
\hline
c &amp; d \\
\hline
\end{tabular}
\end{table}

\section{Figure}
See \autoref{fig:1}.Figure supports format in eps, png, pdf and so on. Multi-figures, see \autoref{fig:2}. Reference separately: \autoref{fig:2-1}, \autoref{fig:2-2}.

\begin{figure}[!h]
\centering
\includegraphics[width=.4\textwidth]{fig-example.pdf}
\caption{A figure}\label{fig:1}
\end{figure}

\begin{figure}[!h]
\centering
  \begin{subfigure}[b]{0.3\textwidth}
  \includegraphics[width=\textwidth]{fig-example.pdf}
  \caption{Figure A}\label{fig:2-1}
  \end{subfigure}
  ~
  \begin{subfigure}[b]{0.3\textwidth}
  \includegraphics[width=\textwidth]{fig-example.pdf}
  \caption{Figure B}\label{fig:2-2}
  \end{subfigure}
\caption{Multi-figures}\label{fig:2}
\end{figure}

\section{Bibliography}
Cite one bib\cite{knuth}, cite two\cite{TEXGURU99,knuth}.

\section[\textbackslash{}autoref Test]{\texttt{\textbackslash{}autoref} Test}

\begin{description}
  \item[Equation] \autoref{eq:1}
  \item[Footnote] \autoref{footnote:1}
  \item[Item] \autoref{item:1},\autoref{item:2},\autoref{item:3}
  \item[Figure] \autoref{fig:1}
  \item[Table] \autoref{tab:1}
  \item[Appendix] \autoref{appendix:1}
  \item[Chapter] \autoref{chapter:1}
  \item[Section] \autoref{sec:1},\autoref{sec:2},\autoref{sec:3}
  \item[Algorithm] \autoref{alg:1},\autoref{alg_line:1}
  \item[Theorem] \autoref{def:1},\autoref{proposition:1},\autoref{axiom:1},\autoref{lemma:1},\autoref{theorem:1},\autoref{proof:1}
\end{description}

\backmatter

\begin{ack}
Acknowledge
\end{ack}

\bibliography{ref-example}

\appendix

\begin{publications}
    \item Thesis 1
    \item Thesis 2
\end{publications}

\chapter{This is an appendix}\label{appendix:1}
Content.

%&lt;/example-en&gt;

\end{document}

%&lt;/example-zh|example-en&gt;
%
%&lt;*example-bib&gt;
@BOOK{TEXGURU99,
  AUTHOR        = "{\TeX}Guru",
  TITLE         = "{\LaTeXe} Manual",
  YEAR          = "1999"
}

@BOOK{knuth,
  AUTHOR        = "{Donald E. Knuth}",
  TITLE         = "The \TeX{}book",
  publisher     = "Addison���Wesley Pub. Co.",
  address       = "MA",
  YEAR          = "1984"
}
%&lt;/example-bib&gt;
%
%&lt;*bst&gt;
%&lt;&lt;BSTFILE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PREDEFINED STRING MACROS %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

MACRO {jan} {"January"}
MACRO {feb} {"February"}
MACRO {mar} {"March"}
MACRO {apr} {"April"}
MACRO {may} {"May"}
MACRO {jun} {"June"}
MACRO {jul} {"July"}
MACRO {aug} {"August"}
MACRO {sep} {"September"}
MACRO {oct} {"October"}
MACRO {nov} {"November"}
MACRO {dec} {"December"}


MACRO {IEEE_J_MTT} {"{IEEE} Trans. Microwave Theory Tech."}


%%%%%%%%%%%%%%%%%%
%% ENTRY FIELDS %%
%%%%%%%%%%%%%%%%%%

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    editor
    howpublished
    institution
    journal
    key
    lang
    month
    note
    number
    organization
    pages
    publisher
    school
    series
    title
    type
    volume
    year
    url
    nationality
  }
  {}
  { label }


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% INTEGER VARIABLES, STRING VARIABLES and FUNCTIONS %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

INTEGERS { output.state before.all mid.sentence after.sentence after.block }

INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames }



FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

FUNCTION {and}
{   'skip$
    { pop$ #0 }
  if$
}

FUNCTION {or}
{   { pop$ #1 }
    'skip$
  if$
}

FUNCTION {is.num}
{ chr.to.int$
  duplicate$ "0" chr.to.int$ &lt; not
  swap$ "9" chr.to.int$ &gt; not and
}

FUNCTION {init.state.consts}
{ #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
}

STRINGS { s t }

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ", " * write$ }
    { output.state after.block =
    { add.period$ write$
      newline$
      "\newblock " write$
    }
    { output.state before.all =
        'write$
        { add.period$ " " * write$ }
      if$
    }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

STRINGS {z}
FUNCTION {remove.dots}
{ 'z :=
  ""
  { z empty$ not}
  { z #1 #1 substring$
    z #2 global.max$ substring$ 'z :=
    duplicate$ "." = 'pop$
      { * }
    if$
  }
  while$
  %z
}

FUNCTION {bibinfo.check}
{ swap$
  duplicate$ missing$
    {
      pop$ pop$
      ""
    }
    { duplicate$ empty$
        {
          swap$ pop$
        }
        { swap$
          pop$
        }
      if$
    }
  if$
}

FUNCTION {bibinfo.warn}
{ swap$
  duplicate$ missing$
    {
      swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
      ""
    }
    { duplicate$ empty$
        {
          swap$ "empty " swap$ * " in " * cite$ * warning$
        }
        { swap$
          pop$
        }
      if$
    }
  if$
}

% IEEE separates large numbers with more than 4 digits into groups of
% three. IEEE uses a small space to separate these number groups.
% Typical applications include patent and page numbers.

% number of consecutive digits required to trigger the group separation.
FUNCTION {large.number.trigger}{ #5 }

% For numbers longer than the trigger, this is the blocksize of the groups.
% The blocksize must be less than the trigger threshold, and 2 * blocksize
% must be greater than the trigger threshold (can't do more than one
% separation on the initial trigger).
FUNCTION {large.number.blocksize}{ #3 }

% What is actually inserted between the number groups.
FUNCTION {large.number.separator}{ "\," }

% So as to save on integer variables by reusing existing ones, numnames
% holds the current number of consecutive digits read and nameptr holds
% the number that will trigger an inserted space.
FUNCTION {large.number.separate}
{ 't :=
  ""
  #0 'numnames :=
  large.number.trigger 'nameptr :=
  { t empty$ not }
  { t #-1 #1 substring$ is.num
      { numnames #1 + 'numnames := }
      { #0 'numnames :=
        large.number.trigger 'nameptr :=
      }
    if$
    t #-1 #1 substring$ swap$ *
    t #-2 global.max$ substring$ 't :=
    numnames nameptr =
      { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$
        nameptr large.number.blocksize - #1 + global.max$ substring$
        large.number.separator swap$ * *
        nameptr large.number.blocksize - 'numnames :=
        large.number.blocksize #1 + 'nameptr :=
      }
      { skip$ }
    if$
  }
  while$
}

FUNCTION {format.note}
{
 note empty$
    { "" }
    { note #1 #1 substring$
      duplicate$ "{" =
        'skip$
        { output.state mid.sentence =
          { "l" }
          { "u" }
        if$
        change.case$
        }
      if$
      note #2 global.max$ substring$ * "note" bibinfo.check
    }
  if$
}

FUNCTION {output}
{ duplicate$ empty$
    'pop$
    'output.nonnull
  if$
}

FUNCTION {output.check}
{ 't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull
  if$
}

FUNCTION {output.bibitem}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

FUNCTION {fin.entry}
{ add.period$
  write$
  newline$
}

FUNCTION {new.block}
{ output.state before.all =
    'skip$
    { after.block 'output.state := }
  if$
}

FUNCTION {new.sentence}
{ output.state after.block =
    'skip$
    { output.state before.all =
    'skip$
    { after.sentence 'output.state := }
      if$
    }
  if$
}


FUNCTION {new.block.checka}
{ empty$
    'skip$
    'new.block
  if$
}

FUNCTION {new.block.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.block
  if$
}

FUNCTION {new.sentence.checka}
{ empty$
    'skip$
    'new.sentence
  if$
}

FUNCTION {new.sentence.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.sentence
  if$
}

FUNCTION {field.or.null}
{ duplicate$ empty$
    { pop$ "" }
    'skip$
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
    { pop$ "" }
    { "{\em " swap$ * "}" * }
  if$
}

FUNCTION {bbl.etal}
{ "et~al." }

FUNCTION {bbl.cn.etal}
{ "���." }

FUNCTION {format.lang}
{ lang empty$
    'skip$
    'skip$
  if$
 }

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 &gt; }
    { s nameptr
      "{ll}{ f{~}}"
      format.name$
      %remove.dots
      %bibinfo bibinfo.check
      't :=
      nameptr #1 &gt;
        {
          nameptr #3
          #1 + =
          numnames #3
          &gt; and
            { "others" 't :=
              #1 'namesleft := }
            'skip$
          if$
          namesleft #1 &gt;
            { ", " * t * }
            { numnames #2 &gt;
              { "" * }
              'skip$
              if$
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
              t "others" =
                {
                  lang empty$
                    { ", " * bbl.etal * }
                    { lang "chinese" =
                       { ", " * bbl.cn.etal * }
                       'skip$
                      if$
                    }
                  if$
                }
                {
                  lang empty$
                    { ", " * t * }
                    { lang "chinese" =
                       { ", " * t * }
                       'skip$
                     if$
                    }
                  if$
                }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {format.authors}
{ author empty$
    { "" }
    { author format.names }
  if$
}

%FUNCTION {format.editors}
%{ editor empty$
%    { "" }
%    { editor format.names
%      editor num.names$ #1 &gt;
%    { ", editors" * }
%    { ", editor" * }
%      if$
%    }
%  if$
%}

FUNCTION {format.editors}
{ editor empty$
    { "" }
    { lang empty$
    { editor format.names
      editor num.names$ #1 &gt;
    { ", editors" * }
    { ", editor" * }
      if$
    }
    { editor format.names * ", " }
    if$
    }
  if$
}

FUNCTION {format.title}
{ title empty$
    { "" }
    { title }
  if$
}

FUNCTION {n.dashify}
{ 't :=
  ""
    { t empty$ not }
    { t #1 #1 substring$ "-" =
    { t #1 #2 substring$ "--" = not
        { "--" *
          t #2 global.max$ substring$ 't :=
        }
        {   { t #1 #1 substring$ "-" = }
        { "-" *
          t #2 global.max$ substring$ 't :=
        }
          while$
        }
      if$
    }
    { t #1 #1 substring$ *
      t #2 global.max$ substring$ 't :=
    }
      if$
    }
  while$
}

FUNCTION {format.date}
{ year empty$
    { month empty$
    { "" }
    { "there's a month but no year in " cite$ * warning$
      month
    }
      if$
    }
    { month empty$
    'year
    { month ", " * year * }
      if$
    }
  if$
}

FUNCTION {format.btitle}
{ edition empty$
  { title }
  { title empty$
    { title }
    {
      lang empty$
        { " " title * ", " * edition * " ed." * }
        { lang "chinese" =
          { " " title * ", ���~" * edition * " ���" * }
          'skip$
          if$
        }
      if$
    }
    if$
  }
  if$
}

FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 &lt;
    { "~" }
    { " " }
  if$
  swap$ * *
}

FUNCTION {either.or.check}
{ empty$
    'pop$
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  if$
}

FUNCTION {format.bvolume}
{ volume empty$
    { "" }
    { "volume" volume tie.or.space.connect
      series empty$
    'skip$
    { " of " * series emphasize * }
      if$
      "volume and number" number either.or.check
    }
  if$
}

FUNCTION {format.number.series}
{ volume empty$
    { number empty$
    { series field.or.null }
    { output.state mid.sentence =
        { "number" }
        { "Number" }
      if$
      number tie.or.space.connect
      series empty$
        { "there's a number but no series in " cite$ * warning$ }
        { " in " * series * }
      if$
    }
      if$
    }
    { "" }
  if$
}

FUNCTION {format.url}
{ url empty$
    { "" }
    { new.block " {\url{" url * "}}" * }
  if$
}



FUNCTION {multi.page.check}
{ 't :=
  #0 'multiresult :=
    { multiresult not
      t empty$ not
      and
    }
    { t #1 #1 substring$
      duplicate$ "-" =
      swap$ duplicate$ "," =
      swap$ "+" =
      or or
    { #1 'multiresult := }
    { t #2 global.max$ substring$ 't := }
      if$
    }
  while$
  multiresult
}

FUNCTION {format.pages}
{ pages empty$
    { "" }
    { pages multi.page.check
    {  lang empty$
         {"pages" pages n.dashify tie.or.space.connect }
         { lang "chinese" =
         { "" pages n.dashify tie.or.space.connect }
         'skip$
         if$
         }
       if$
    }
       { "page" pages tie.or.space.connect }
      if$
    }
  if$
}

FUNCTION {format.vol.num.pages}
{ volume field.or.null
  number empty$
    'skip$
    { "(" number * ")" * *
      volume empty$
    { "there's a number but no volume in " cite$ * warning$ }
    'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
    { pop$ format.pages }
    { ":" * pages n.dashify * }
      if$
    }
  if$
}

FUNCTION {format.chapter.pages}
{ chapter empty$
    'format.pages
    { type empty$
    { "chapter" }
    { type "l" change.case$ }
      if$
      chapter tie.or.space.connect
      pages empty$
    'skip$
    { ", " * format.pages * }
      if$
    }
  if$
}

FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
    { "" }
    { editor empty$
    { lang empty$
        { "in: Proceedings of " booktitle * }
        { "���: " booktitle * }
      if$
    }
    { lang empty$
        { "in: " format.editors * ", Proceedings of " * booktitle * }
        { ". ���: " * format.editors * booktitle * }
      if$
    }
      if$
    }
  if$
}

FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
  month empty$ year empty$ note empty$
  and and and and and
    { "all relevant fields are empty in " cite$ * warning$ }
    'skip$
  if$
}

FUNCTION {format.thesis.type}
{ type empty$
    'skip$
    { pop$
      type "t" change.case$
    }
  if$
}

FUNCTION {format.tr.number}
{ type empty$
    { "Technical Report" }
    'type
  if$
  number empty$
    { "t" change.case$ }
    { number tie.or.space.connect }
  if$
}

FUNCTION {format.article.crossref}
{ key empty$
    { journal empty$
    { "need key or journal for " cite$ * " to crossref " * crossref *
      warning$
      ""
    }
    { "In {\em " journal * "\/}" * }
      if$
    }
    { "In " key * }
  if$
  " \cite{" * crossref * "}" *
}

FUNCTION {format.crossref.editor}
{ editor #1 "{ll }{f{~}}" format.name$
  editor num.names$ duplicate$
  #2 &gt;
    { pop$ " et~al." * }
    { #2 &lt;
    'skip$
    { editor #2 "{ll }{f{~}}" format.name$ "others" =
        { " et~al." * }
        { " and " * editor #2 "{ll }{f{~}}" format.name$ * }
      if$
    }
      if$
    }
  if$
}

FUNCTION {format.book.crossref}
{ volume empty$
    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
      "In "
    }
    { "Volume" volume tie.or.space.connect
      " of " *
    }
  if$
  editor empty$
  editor field.or.null author field.or.null =
  or
    { key empty$
    { series empty$
        { "need editor, key, or series for " cite$ * " to crossref " *
          crossref * warning$
          "" *
        }
        { "{\em " * series * "\/}" * }
      if$
    }
    { key * }
      if$
    }
    { format.crossref.editor * }
  if$
  " \cite{" * crossref * "}" *
}

FUNCTION {format.incoll.inproc.crossref}
{ editor empty$
  editor field.or.null author field.or.null =
  or
    { key empty$
    { booktitle empty$
        { "need editor, key, or booktitle for " cite$ * " to crossref " *
          crossref * warning$
          ""
        }
        { "In {\em " booktitle * "\/}" * }
      if$
    }
    { "In " key * }
      if$
    }
    { "In " format.crossref.editor * }
  if$
  " \cite{" * crossref * "}" *
}

FUNCTION {format.patent.nationality.type.number}
{
  nationality duplicate$ empty$
    { "nationality" bibinfo.warn pop$ "" }
    { "nationality" bibinfo.check
      duplicate$ "l" change.case$ "china" =
        { pop$ "������" }
        { skip$ }
      if$
      " " *
    }
  if$
  type empty$
    { "Patent" "type" bibinfo.check }
    { type "type" bibinfo.check }
  if$
  *
  number duplicate$ empty$
    { "number" bibinfo.warn pop$ }
    { "number" bibinfo.check
      large.number.separate
      swap$ " " * swap$ *
    }
  if$
}

FUNCTION {format.address.publisher}
{ address empty$
    { publisher empty$
    { "" }
    { "there's a publisher but no address in " cite$ * warning$
      publisher
    }
      if$
    }
    { publisher empty$
    'address
    { address ": " * publisher * }
      if$
    }
  if$
}

FUNCTION {format.address.school}
{ address empty$
    { school empty$
    { "" }
    { "there's a school but no address in " cite$ * warning$
      school
    }
      if$
    }
    { school empty$
    'address
    { address ": " * school * }
      if$
    }
  if$
}


FUNCTION {format.title.type}
{ title empty$
    { type empty$
        { "" }
        { "there's a type but no title in " cite$ * warning$
          type
        }
      if$
    }
    { type empty$
        'title
        { title ": " * type * }
      if$
    }
  if$
}

FUNCTION {book} { output.bibitem
  author empty$
    { format.editors "author and editor" output.check }
    { format.authors output.nonnull
      crossref missing$
    { "author and editor" editor either.or.check }
    'skip$
      if$
    }
  if$
  new.block
  format.btitle
  "title" output.check
  crossref missing$
    { format.bvolume output
      new.block
      format.number.series output
      new.sentence
    }
    { new.block
      format.book.crossref output.nonnull
    }
  if$
  %format.edition output
  format.address.publisher output
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { %journal emphasize "journal" output.check
      journal "journal" output.check
      %format.date "year" output.check
      %new.block
      year output
      format.vol.num.pages output
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  format.note output
  fin.entry
}

FUNCTION {booklet}
{ output.bibitem
  format.authors output
  new.block
  format.title "title" output.check
  howpublished address new.block.checkb
  howpublished output
  address output
  format.date output
  new.block
  note output
  fin.entry
}

FUNCTION {inbook} { output.bibitem
  author empty$
    { format.editors "author and editor" output.check }
    { format.authors output.nonnull
      crossref missing$
    { "author and editor" editor either.or.check }
    'skip$
      if$
    }
  if$
  new.block
  format.btitle "title" output.check
  crossref missing$
    { format.bvolume output
      new.block
      format.number.series output
      new.sentence
    }
    { new.block
      format.book.crossref output.nonnull
    }
  if$
  %format.edition output
  format.address.publisher output
  format.date "year" output.check
  format.chapter.pages "chapter and pages" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      new.sentence
      publisher "publisher" output.check
      address output
      %format.edition output
      format.date "year" output.check
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      %format.bvolume output
      %format.number.series output
      %format.pages output
      address empty$
    { organization publisher new.sentence.checkb
      organization output
      publisher output
      format.date "year" output.check
      %year output
    }
    { %address output.nonnull
      format.address.publisher output
      format.date "year" output.check
      %year output
      %new.sentence
      organization output
    }
      if$
      %new.block
      pages output
      %remove.dots
    }
    { format.incoll.inproc.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {conference} { inproceedings }

FUNCTION {manual}
{ output.bibitem
  author empty$
    { organization empty$
    'skip$
    { organization output.nonnull
      address output
    }
      if$
    }
    { format.authors output.nonnull }
  if$
  new.block
  format.btitle "title" output.check
  author empty$
    { organization empty$
    { address new.block.checka
      address output
    }
    'skip$
      if$
    }
    { organization address new.block.checkb
      organization output
      address output
    }
  if$
  %format.edition output
  format.date output
  new.block
  note output
  fin.entry
}

FUNCTION {masterthesis.type}
{ lang empty$
    { "[Master Thesis]" }
    { "[������������������]" }
  if$
}

FUNCTION {mastersthesis}
{ output.bibitem
  format.authors "author" add.period$ output.check
  new.block
  format.title remove.dots ": " * masterthesis.type * output
  new.block
  format.address.school output
  %format.madd "address" output.check
  %school "school" output.check
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {misc}
{ output.bibitem
  format.authors output
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
  format.date output
  format.url output
  new.block
  note output
  fin.entry
  empty.misc.check
}

FUNCTION {phdthesis.type}
{ lang empty$
    { "[PhD Dissertation]" }
    { "[������������������]" }
  if$
}

FUNCTION {phdthesis}
{ output.bibitem
  format.authors "author" add.period$ output.check
  new.block
  format.title remove.dots ": " * phdthesis.type * output
  new.block
  format.address.school output
  %address output
  %school "school" output.check
  format.date "year" output.check
  new.block
  note output
  fin.entry
}

FUNCTION {proceedings}
{ output.bibitem
  editor empty$
    { organization output }
    { format.editors output.nonnull }
  if$
  new.block
  format.btitle "title" output.check
  format.bvolume output
  format.number.series output
  address empty$
    { editor empty$
    { publisher new.sentence.checka }
    { organization publisher new.sentence.checkb
      organization output
    }
      if$
      publisher output
      format.date "year" output.check
    }
    { address output.nonnull
      format.date "year" output.check
      new.sentence
      editor empty$
    'skip$
    { organization output }
      if$
      publisher output
    }
  if$
  new.block
  note output
  fin.entry
}

FUNCTION {techreport}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  format.tr.number output.nonnull
  institution "institution" output.check
  address output
  format.date "year" output.check
  format.url output
  new.block
  note output
  fin.entry
}

FUNCTION {patent} { output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  format.patent.nationality.type.number output
  format.date "year" output.check
  format.pages output
  new.block
  note output
  fin.entry
}

FUNCTION {unpublished}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  note "note" output.check
  format.date output
  fin.entry
}

FUNCTION {default.type} { misc }


%%%%%%%%%%%%%%%%%%
%% MAIN PROGRAM %%
%%%%%%%%%%%%%%%%%%

READ

STRINGS { longest.label }

FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
  #1 'number.label :=
  #0 'longest.label.width :=
}

FUNCTION {longest.label.pass}
{ number.label int.to.str$ 'label :=
  number.label #1 + 'number.label :=
  label width$ longest.label.width &gt;
    { label 'longest.label :=
      label width$ 'longest.label.width :=
    }
    'skip$
  if$
}

EXECUTE {initialize.longest.label}

ITERATE {longest.label.pass}

FUNCTION {begin.bib}
{ preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
}

EXECUTE {begin.bib}

EXECUTE {init.state.consts}

ITERATE {call.type$}

FUNCTION {end.bib}
{ newline$
  "\end{thebibliography}" write$ newline$
}

EXECUTE {end.bib}

%BSTFILE
%&lt;\bst&gt;
%
% \fi
%
\endinput
</pre></body></html>