大學生數模競賽LaTeX模板分享
在LaTeX交流羣羣文件下載的模板,但編譯出現了一些問題,本人作了如下修改,由於是我作練習的模板,所以加了很多模板,讀者自己斟酌。
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{cumcmthesis}
[2015/08/22 v2.0
Standard LaTeX document class]
%% Inital Code
\newif\if@mcm@bwprint\@mcm@bwprintfalse
% tokens definition
%%%% 承諾書
\newcommand\mcm@tokens@keywords{}
\newcommand*\mcm@tokens@tihao{}
\newcommand*\mcm@tokens@baominghao{}
\newcommand*\mcm@tokens@schoolname{}
\newcommand*\mcm@tokens@membera{}
\newcommand*\mcm@tokens@memberb{}
\newcommand*\mcm@tokens@memberc{}
\newcommand*\mcm@tokens@supervisor{}
\newcommand*\mcm@tokens@yearinput{}
\newcommand*\mcm@tokens@monthinput{}
\newcommand*\mcm@tokens@dayinput{}
%%%% 編號專用頁
% 沒有
%% Declaration of Options
\DeclareOption{colorprint}{\@mcm@bwprintfalse}
\DeclareOption{bwprint}{\@mcm@bwprinttrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
%% Executing of Options
\ExecuteOptions{colorprint}
\ProcessOptions\relax
%% Loading Class
\LoadClass[a4paper,12pt]{article}
%% Loading Package
\RequirePackage{ifxetex}
\RequireXeTeX
\ifxetex\else
\ClassError{mcmthesis}{You must use the `xelatex' driver\MessageBreak Please choose `xelatex'}{%
Just choose `xelatex', no `pdflatex' or `latex' and so on.}
\fi
% 支持中文的 ctex 宏包
\RequirePackage{ctex}
% 頁面佈局
\RequirePackage{geometry}
% 數學宏包
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage{bm}
% 設置字體
\RequirePackage{fontspec}
% 設置顏色
\RequirePackage{xcolor}
% 插入圖片
\RequirePackage{graphicx}
% 表格
\RequirePackage{array}
%% 長表格
\RequirePackage{longtable}
%% booktabs 提供了\toprule 等命令.
\RequirePackage{booktabs}
%% multirow 支持在表格中跨行
\RequirePackage{multirow}
%% 調整間隔, 讓表格更好看些
\RequirePackage{bigstrut}
%% 在跨行表格中輸入定界符
\RequirePackage{bigdelim}
% 保護脆落命令
\RequirePackage{cprotect}
% 設置代碼環境
\RequirePackage{listings}
% 首行縮進
\RequirePackage{indentfirst}
% 設置浮動體的標題
\RequirePackage{caption}
% 定製列表環境
\RequirePackage{enumitem}
% 下劃線
\RequirePackage{ulem}
% 尺寸計算
\RequirePackage{calc}
% 超鏈接 hyperref 的設置
\RequirePackage{hyperref}
%% Document Layout
% 頁面佈局
\geometry{top=25mm,bottom=20mm,left=25mm,right=25mm}
\renewcommand*{\baselinestretch}{1.38}
% 修改tabular 環境, 設置表格中的行間距爲正文行間距.
\let\mcm@oldtabular\tabular
\let\mcm@endoldtabular\endtabular
\renewenvironment{tabular}%
{\bgroup%
\renewcommand{\arraystretch}{1.38}%
\mcm@oldtabular}%
{\mcm@endoldtabular\egroup}
% 每行縮進兩個漢字
\setlength\parindent{2em}
% 設置字體
\setmainfont{Times New Roman}
\setmonofont{Courier New}
\setsansfont{Arial}
\renewcommand\normalsize{%
\@setfontsize\normalsize{12.05}{14.45}%
\abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@}
% 數學環境, 定理等設置
\newtheorem{definition}{\mcm@cap@definition}
\newtheorem{theorem}{\mcm@cap@theorem}
\newtheorem{lemma}{\mcm@cap@lemma}
\newtheorem{corollary}{\mcm@cap@corollary}
\newtheorem{assumption}{\mcm@cap@assumption}
\newtheorem{conjecture}{\mcm@cap@conjecture}
\newtheorem{axiom}{\mcm@cap@axiom}
\newtheorem{principle}{\mcm@cap@principle}
\newtheorem{problem}{\mcm@cap@problem}
\newtheorem{example}{\mcm@cap@example}
\newtheorem{proof}{\mcm@cap@proof}
\newtheorem{solution}{\mcm@cap@solution}
% 浮動環境設置
% 默認情況下, \LaTeX{} 要求每頁的文字至少佔據 20%,否則該頁就只單獨放置一個浮動環境,
% 而這通常不是我們想要的, 我們將這個要求降低到 5%.
\renewcommand*{\textfraction}{0.05}
% 有時如果多個浮動環境連續放在一起, \LaTeX{}
% 會將它們分在幾個不同頁,即使它們可在同一頁放
% 得下. 我們可以通過修改 |\topfraction| 和 |\bottomfraction| 分別設置頂端和底端的浮
% 動環境的最大比例.
\renewcommand*{\topfraction}{0.9}
\renewcommand*{\bottomfraction}{0.8}
% 有時\LaTeX{}會把一個浮動環境單獨放在一頁,
% 我們要求這個環境至少要佔據 85% 才能單獨放在一頁.
% 注意: |\floatpagefraction| 的數值必須小於 |\topfraction|.
\renewcommand*{\floatpagefraction}{0.85}
% 關於圖片 graphicx
% 如果圖片沒有指定後綴, 依次按下列順序搜索
\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png}
% 設置圖表搜索路徑, 可以給圖表文件夾取如下名字
\graphicspath{{figures/}{figure/}{pictures/}%
{picture/}{pic/}{pics/}{image/}{images/}}
% 圖表標題
\DeclareCaptionFont{song}{\songti}
\DeclareCaptionFont{minusfour}{\zihao{-4}}
\captionsetup[figure]{%
format=hang, % 標題從第二行開始都有縮進, 應該和 justification=raggedright 的效果一樣.
labelsep=quad, % 分隔符是一個空格
font={song,minusfour,bf}, % 圖的字體, 宋體小四
position=bottom % position=bottom, 不代表標題放在下面, 標題仍放在你放\caption的位置.
}
\captionsetup[table]{%
format=hang, % 標題從第二行開始都有縮進, 應該和 justification=raggedright 的效果一樣.
labelsep=quad, % 分隔符是一個空格
font={song,minusfour,bf}, % 表的字體, 宋體小四
position=top % position=bottom, 不代表標題放在下面, 標題仍放在你放\caption的位置.
}
% 列表環境設置
\setlist{%
topsep=0.3em, % 列表頂端的垂直空白
partopsep=0pt, % 列表環境前面緊接着一個空白行時其頂端的額外垂直空白
itemsep=0ex plus 0.1ex, % 列表項之間的額外垂直空白
parsep=0pt, % 列表項內的段落之間的垂直空白
leftmargin=1.5em, % 環境的左邊界和列表之間的水平距離
rightmargin=0em, % 環境的右邊界和列表之間的水平距離
labelsep=0.5em, % 包含標籤的盒子與列表項的第一行文本之間的間隔
labelwidth=2em % 包含標籤的盒子的正常寬度;若實際寬度更寬,則使用實際寬度。
}
% 超鏈接
\AtBeginDocument{%
\hypersetup{%
% unicode=false, % hyperref 和 xetex 同時使用時不能開啓 Unicode 選項.
hyperfootnotes=true,
hyperindex=true,
colorlinks=true,
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksopenlevel=0,
breaklinks=true}%
}
\if@mcm@bwprint
\AtBeginDocument{\hypersetup{hidelinks}}
\else\relax\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Document Markup
% 生成封面, 使用\maketitle
\renewcommand{\maketitle}{\par
\begingroup
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\endgroup
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
\def\@maketitle{%
\newpage
\null
% 承諾書
\vskip2ex
\thispagestyle{empty}
{\zihao{4}\mcm@commit@string@headname\\[-3pt]
\noindent\rule{\textwidth-1.34em}{1pt}\par}
\begin{center}%
{\zihao{-3}\bfseries\heiti \mcm@commit@string@titlea \par}%
{\vskip1ex\zihao{3}\bfseries\songti \mcm@commit@string@titleb \par}
\end{center}
{\zihao{-4} \mcm@commit@string@contents \par}
{\vskip1ex\zihao{-4}
\renewcommand{\ULthickness}{0.4pt}\setlength{\ULdepth}{2pt}
\hspace*{2em}\mcm@commit@string@problemnum\uline{\hspace{1em}\mcm@tokens@tihao\hfill}\makebox[0.66em]{}\par
\mcm@commit@string@signupnum\uline{\hspace{1em}\mcm@tokens@baominghao\hfill}\makebox[0.66em]{}\par
\mcm@commit@string@schoolname\uline{\hfill\mcm@tokens@schoolname\hfill}\makebox[0.66em]{}\par
\newlength{\mcm@lenB}
\settowidth{\mcm@lenB}{\mcm@commit@string@membername\hspace{1em}1.}
\setlength{\mcm@lenB}{\textwidth-\mcm@lenB}
% 不這樣做右邊難以對齊!
\mcm@commit@string@membername
\begin{minipage}[t]{\mcm@lenB}
1.\uline{\hspace{1em}\mcm@tokens@membera\hfill} \makebox[0.46em]{}\par
2.\uline{\hspace{1em}\mcm@tokens@memberb\hfill} \makebox[0.46em]{}\par
3.\uline{\hspace{1em}\mcm@tokens@memberc\hfill} \makebox[0.46em]{}\par
\end{minipage}\par\vskip1ex
\mcm@commit@string@supervisorname\uline{\hspace{1em}\mcm@tokens@supervisor\hfill}\makebox[0.66em]{}
%{\kaishu\mcm@commit@string@inform\par}
\vskip2ex
\newlength{\mcm@lenA}
\settowidth{\mcm@lenA}{請仔細覈對,提交後將不再允許做任何修改。如}% 雖然"日期"剛好在"錯誤"下面, 但注意"日期"還會縮進, 所以要省去"填寫""兩字
\hspace*{\mcm@lenA}\mcm@commit@string@date\hspace{0.5em}\uline{\hfill\hspace{1em}\mcm@tokens@yearinput\hspace{1em}\hfill}%
\mcm@commit@string@year\uline{\hfill\mcm@tokens@monthinput\hfill}\mcm@commit@string@month%
\uline{\hfill\mcm@tokens@dayinput\hfill}\mcm@commit@string@day\makebox[1em]{}\par}
\vskip1ex
{\kaishu\bfseries\mcm@commit@string@inform\par}
\vfill
\null
% 編號專用頁
\makeothertitle
}
%% 定義 編號專用頁
\def\makeothertitle{%
\par
\newpage
\null
\thispagestyle{empty}
{\zihao{4}\mcm@numberpage@string@headname\\[-5pt]
\noindent\hspace*{0.67em}\rule{\textwidth-1.33em}{1pt}\par}
\begin{center}
{\zihao{4}\bfseries\heiti \mcm@numberpage@string@titlea\par}
{\vskip1ex\zihao{3}\bfseries\songti \mcm@numberpage@string@titleb\par}
\end{center}\par
{%
\zihao{4}
\vskip3em
\hspace*{2em}\mcm@numberpage@string@appraiselog
\par
\newlength{\mcm@lenC}
\setlength{\mcm@lenC}{\textwidth-8.72em}
\setlength{\mcm@lenC}{\mcm@lenC/6}
\newlength{\mcm@lenD}
\settoheight{\mcm@lenD}{\mcm@numberpage@string@reviewer}
\setlength{\mcm@lenD}{\mcm@lenD+2em}
\newlength{\mcm@lenF}
\settoheight{\mcm@lenF}{\mcm@numberpage@string@remarks}
\setlength{\mcm@lenF}{\mcm@lenF+2em}
\newcolumntype{P}{@{}p{\mcm@lenC}@{}}
\hspace*{1.5em}\begin{tabular}{|!{\hspace{4pt}}c!{\hspace{4pt}}|*{6}{P|}}
\hline
\rule{0pt}{\mcm@lenD}\raisebox{0.6em}[0pt][0pt]{\mcm@numberpage@string@reviewer} & & & & & & \\\cline{1-7}
\rule{0pt}{\mcm@lenF}\raisebox{0.6em}[0pt][0pt]{\mcm@numberpage@string@remarks} & & & & & & \\
\hline
\end{tabular}\par
\vskip5em
\hspace*{2em}\mcm@numberpage@string@unifiednum
\vskip7em
\hspace*{2em}\mcm@numberpage@string@countrynum}
\vskip7em
{\zihao{-4}\kaishu\bfseries\mcm@numberpage@string@inform\par}
\vfill
\null
\newpage
\null
\setcounter{page}{1}
{\centering \zihao{3}\bfseries \@title\par}
\vskip1ex
}
% 中文標題名稱設置
\renewcommand\contentsname{\mcm@cap@contentsname}
\renewcommand\listfigurename{\mcm@cap@listfigurename}
\renewcommand\listtablename{\mcm@cap@listtablename}
\renewcommand\refname{\mcm@cap@refname}
\renewcommand\indexname{\mcm@cap@indexname}
\renewcommand\figurename{\mcm@cap@figurename}
\renewcommand\tablename{\mcm@cap@tablename}
\renewcommand\appendixname{\mcm@cap@appendixname}
\renewcommand\abstractname{\mcm@cap@abstractname}
% 中文標題格式設置
% 目錄深度
\setcounter{secnumdepth}{2}
% 節標題格式, 居中, 使用\chinese命令修改計數器, \kern 使得數字和內容不至於太遠
\renewcommand\thesection{\chinese{section}、\kern-1em}
\renewcommand\thesubsection{\arabic{section}\thinspace.\thinspace\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection\thinspace.\thinspace\arabic{subsubsection}}
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\centering\normalfont\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define new environment and command
%% 摘要兩個字設置爲 4 號.
%% 定義摘要環境
\renewenvironment{abstract}{%
\if@twocolumn
\section*{\abstractname}%
\else
\begin{center}%
{\zihao{4}\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
\end{center}%
\quotation
\fi}
{\if@twocolumn\else\endquotation\newpage\null\fi}
\renewenvironment{quotation}
{\list{}{\listparindent 2em%
\itemindent \listparindent
\rightmargin\z@
\leftmargin\z@
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}
\newcommand\keywords[1]{%
\renewcommand{\mcm@tokens@keywords}{#1}
\par
\vskip1ex
{\noindent\zihao{-4}\heiti\mcm@cap@keywordsname:}~{\mcm@tokens@keywords}
}
% 定義附錄
\renewcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\gdef\thesection{\appendixname\@Alph\c@section}}
% 重定義參考文獻環境
\renewenvironment{thebibliography}[1]
{\section{\refname}%
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand*\tihao[1]{%
\renewcommand{\mcm@tokens@tihao}{#1}}
\newcommand*\baominghao[1]{%
\renewcommand{\mcm@tokens@baominghao}{#1}}
\newcommand*\schoolname[1]{%
\renewcommand{\mcm@tokens@schoolname}{#1}}
\newcommand*\membera[1]{%
\renewcommand{\mcm@tokens@membera}{#1}}
\newcommand*\memberb[1]{%
\renewcommand{\mcm@tokens@memberb}{#1}}
\newcommand*\memberc[1]{%
\renewcommand{\mcm@tokens@memberc}{#1}}
\newcommand*\supervisor[1]{%
\renewcommand{\mcm@tokens@supervisor}{#1}}
\newcommand*\yearinput[1]{%
\renewcommand{\mcm@tokens@yearinput}{#1}}
\newcommand*\monthinput[1]{%
\renewcommand{\mcm@tokens@monthinput}{#1}}
\newcommand*\dayinput[1]{%
\renewcommand{\mcm@tokens@dayinput}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Initialization
%%%數學定理相關的常量
\newcommand*{\mcm@cap@definition}{定義}
\newcommand*{\mcm@cap@theorem}{定理}
\newcommand*{\mcm@cap@lemma}{引理}
\newcommand*{\mcm@cap@corollary}{推論}
\newcommand*{\mcm@cap@assumption}{假設}
\newcommand*{\mcm@cap@conjecture}{猜想}
\newcommand*{\mcm@cap@axiom}{公理}
\newcommand*{\mcm@cap@principle}{定律}
\newcommand*{\mcm@cap@problem}{問題}
\newcommand*{\mcm@cap@example}{例}
\newcommand*{\mcm@cap@proof}{證明}
\newcommand*{\mcm@cap@solution}{解}
%%% 中文標題名稱
\newcommand*{\mcm@cap@contentsname}{目錄}
\newcommand*{\mcm@cap@listfigurename}{插圖清單}
\newcommand*{\mcm@cap@listtablename}{附表清單}
\newcommand*{\mcm@cap@refname}{參考文獻}
\newcommand*{\mcm@cap@indexname}{索引}
\newcommand*{\mcm@cap@figurename}{圖}
\newcommand*{\mcm@cap@tablename}{表}
\newcommand*{\mcm@cap@appendixname}{附錄}
\newcommand*{\mcm@cap@abstractname}{摘要}
%%% 中文關鍵字
\newcommand*{\mcm@cap@keywordsname}{關鍵字}
%%% 承諾書中的常量
\newcommand*\mcm@commit@string@headname{賽區評閱編號(由賽區組委會填寫):}
\newcommand*\mcm@commit@string@titlea{\the\year 高教社杯全國大學生數學建模競賽}
\newcommand*\mcm@commit@string@titleb{承\hspace{1em}諾\hspace{1em}書}
\newcommand\mcm@commit@string@contents{\quotation
我們仔細閱讀了《全國大學生數學建模競賽章程》和《全國大學生數學建模競賽參賽規則》%
\hspace*{-0.6em}(以下簡稱爲“競賽章程和參賽規則”,\hspace{-0.2em}可從全國大學生數學建模競賽網站下載)。
我們完全明白,在競賽開始後參賽隊員不能以任何方式(包括電話、電子郵件、網上諮詢等)%
與隊外的任何人(包括指導教師)研究、討論與賽題有關的問題。
我們知道,抄襲別人的成果是違反競賽章程和參賽規則的,如果引用別人的成果或其他公開的資料%
(包括網上查到的資料),必須按照規定的參考文獻的表述方式在正文引用處和參考文獻中明確列出。
我們鄭重承諾,嚴格遵守競賽章程和參賽規則,以保證競賽的公正、公平性。%
如有違反競賽章程和參賽規則的行爲,我們將受到嚴肅處理。
我們授權全國大學生數學建模競賽組委會,可將我們的論文以任何形式進行公開展示%
(包括進行網上公示,在書籍、期刊和其他媒體進行正式或非正式發表等)。
\endquotation
}
\newcommand*\mcm@commit@string@problemnum{我們參賽選擇的題號(從A/B/C/D中選擇一項填寫):}
\newcommand*\mcm@commit@string@signupnum{我們的報名參賽隊號(12位數字全國統一編號):}
\newcommand*\mcm@commit@string@schoolname{參賽學校(完整的學校全稱,不含院系名):}
\newcommand*\mcm@commit@string@membername{參賽隊員 (打印並簽名) :}
\newcommand*\mcm@commit@string@supervisorname{指導教師或指導教師組負責人 (打印並簽名):}
\newcommand\mcm@commit@string@inform{\quotation
\noindent(此承諾書打印簽名後作爲紙質論文的封面,注意電子版論文中不得出現此頁。%
以上內容請仔細覈對,如填寫錯誤,論文可能被取消評獎資格。)
\endquotation
}
\newcommand*\mcm@commit@string@date{日期:}
\newcommand*\mcm@commit@string@year{年}
\newcommand*\mcm@commit@string@month{月}
\newcommand*\mcm@commit@string@day{日}
\newcommand*\mcm@commit@string@appraisenum{賽區評閱編號(由賽區組委會評閱前進行編號):}
%%% 編號專用頁中的常量
\newcommand*\mcm@numberpage@string@headname{賽區評閱編號(由賽區組委會填寫):}
\newcommand*\mcm@numberpage@string@titlea{\the\year 高教社杯全國大學生數學建模競賽}
\newcommand*\mcm@numberpage@string@titleb{編\hspace{.5em}號\hspace{.5em}專\hspace{.5em}用\hspace{.5em}頁}
\newcommand*\mcm@numberpage@string@appraiselog{賽區評閱記錄(可供賽區評閱時使用):}
\newcommand\mcm@numberpage@string@reviewer{\shortstack{評\\ 閱\\ 人}}
\newcommand\mcm@numberpage@string@remarks{\shortstack{備\\ 注}}
\newcommand*\mcm@numberpage@string@unifiednum{送全國評閱統一編號(由賽區組委會填寫):}
\newcommand*\mcm@numberpage@string@countrynum{全國評閱隨機編號(由全國組委會填寫):}
\newcommand\mcm@numberpage@string@inform{\quotation
\noindent(此編號專用頁僅供賽區和全國評閱使用,參賽隊打印後裝訂到紙質論文的第二頁上。%
注意電子版論文中不得出現此頁,即電子版論文的第一頁爲標題、摘要和關鍵詞頁。)
\endquotation
}
\endinput
上面可以自行保存爲.cls。
下面是編譯塊:
% !Mode:: "TeX:UTF-8"
%!TEX program = xelatex
\documentclass[bwprint]{cumcmthesis}
%===================Package Area==================%
\usepackage{enumitem}
\usepackage{upgreek}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{bm}
%\usepackage{pxfonts}
%直立體pai打印 命令 \piup
\usepackage{enumerate}
\usepackage{mdwlist}
\usepackage{tikz,mathpazo}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage{flowchart}
\usepackage{python}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{array}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{lipsum}
\setlength{\parindent}{2em}
\usepackage[numbers,super,square,sort&compress]{natbib}
\setlength{\bibsep}{0.5ex} %vertical spacing between references
\setmainfont{Times New Roman}
\newcommand{\upcite}[1]{\cite{#1}}
\input{isomath}
%\
%參考文獻用\upcite{a}
\makeatletter
\def\@listi{%
\leftmargin\leftmargini
\parsep 0pt%
\topsep \parsep
\itemsep \parsep}
\let\@listI\@listi
\@listi
\def\@listii{%
\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\parsep 0pt%
\topsep \parsep
\itemsep \parsep}
\def\@listiii{%
\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\parsep 0pt%
\topsep \parsep
\itemsep \parsep
\partopsep \p@ \@plus\z@ \@minus\p@}
%浮動環境定製
\setlength{\@fptop}{5pt}
\setlength{\floatsep}{10pt \@plus3pt \@minus1pt}
\setlength{\intextsep}{10pt \@plus3pt \@minus2pt}
\setlength{\textfloatsep}{10pt \@plus3pt \@minus2pt}
\makeatother
\lstset{ %
extendedchars=false, % Shutdown no-ASCII compatible
language=Matlab, % choose the language of the code
basicstyle=\normalsize\tt, % the size of the fonts that are used for the code
tabsize=3, % sets default tabsize to 3 spaces
numbers=left, % where to put the line-numbers
numberstyle=\small, % the size of the fonts that are used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it's 1 each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code %
keywordstyle=\color[rgb]{0,0,1}\bfseries, % keywords
commentstyle=\color[rgb]{0.133,0.545,0.133}, % comments
stringstyle=\color[rgb]{0.627,0.126,0.941}, % strings
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
mathescape=true,escapechar=? % escape to latex with ?..?
escapeinside={\%*}{*)}, % if you want to add a comment within your code
%columns=fixed, % nice spacing
%morestring=[m]', % strings
%morekeywords={%,...},% % if you want to add more keywords to the set
% break,case,catch,continue,elseif,else,end,for,function,global,%
% if,otherwise,persistent,return,switch,try,while,...},%
} %代碼高亮
\hypersetup{pdfauthor={Emil Krøll}}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}} %三級標題
\newcommand{\deflabel}[1]{\bf #1\hfill}%
\newenvironment{myproblemlist}[1]%
{\begin{list}{}{\settowidth{\labelwidth}{\bf #1}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\renewcommand{\makelabel}{\deflabel}}}%
{\end{list}} %關鍵詞描述
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}} %重定義表格內容
%國際標準組織(ISO)公式:
%1.用斜體表示向量,例如
%===================end==Package Area==================%
\title{ATM交易狀態特徵分析與異常檢測}
\tihao{B}
\baominghao{11}
\schoolname{西安交通大學}
\membera{}
\memberb{}
\memberc{}
\supervisor{某老師}
\yearinput{2017}
\monthinput{8}
\dayinput{27}
\begin{document}
\maketitle
\begin{abstract}
%\begin{myproblemlist}{針對問題一}
%\item [針對問題一]
%\item [針對問題二]
%\item[針對問題三]
%\end{myproblemlist}
\keywords{ 特徵提取 }
\end{abstract}
\section{問題重述}
\subsection{問題背景}
\subsection{問題提出}
%%%%%%%%%%%%%%%%%%%%%%%%%%\begin{itemize}[itemindent=1em]
%\item 假設題中所給的數據獲取方式和來源具有可靠性和真實性且對模型穩定性無影響。\par
%%\item 假設題中一月部分數據(與二三四月數據波動趨勢明顯不符)對整體模型的構建影響不大。\par
%%\item 假設題中所有原始數據具有實時性。\par
%%%%%%%%%%%%%%%%%%%%%%%%%%\end{itemize}
\section{符號說明及名詞定義}
\begin{tabular}{cc}
\hline
\makebox[0.4\textwidth][c]{符號及名詞} & \makebox[0.5\textwidth][c]{意義} \\ \hline
$X(t)$ & 真實數據 \\ \hline
$Y(t)$ & 訓練樣本 \\ \hline
$M(t)$ & 殘差數據 \\ \hline
$n(t)$ & 趨勢數據 \\ \hline
$s(t)$ & 季節數據 \\ \hline
$o$ & 預測誤差 \\ \hline
$\alpha$ & 平滑參數一 \\ \hline
$\beta$ & 平滑參數二 \\ \hline
$\gamma$ & 平滑參數三 \\ \hline
$k$ & 週期 \\ \hline
\multicolumn{2}{p{15cm}}{
\begin{myproblemlist}{季節因子}
\item[季節因子] 觀測值與預測值的比值
\item[指數平滑] 通過計算指數平滑值,配合一定的時間序列預測模型對現象的未來進行預測
\item[閾值] 指一個效應能夠產生的最低值或最高值
\end{myproblemlist}}\\
\hline
\end{tabular}
\section{模型建立與求解}
%\begin{figure}[!htb]
% \centering
%\begin{tikzpicture}[font={\sf \small}]
%\def \smbwd{2cm}
%\thispagestyle{empty}
%定義流程圖的具體形狀
%\node (start) at (0,0) [draw, terminal,minimum width=\smbwd, minimum height=0.5cm] {原始數據}; % 定義開始
%\node (getdata1) at (0,-1.5) [draw, predproc, align=left,minimum width=\smbwd,minimum height=1cm] {數據預處理};
%\node (getdata2) at (0,-3.5) [draw, predproc, align=left,minimum width=\smbwd,minimum height=1cm] {特徵提取};
%\coordinate (point3) at (0,-4.75);
%\node (getdata3) at (0,-5.5) [draw, predproc, align=left,minimum width=\smbwd,minimum height=1cm] {模型設計};
%定義預處理過程,讀取數據
%\node (decide) at (0,-7.5) [draw, storage, minimum width=\smbwd, minimum height=1cm] {預測器}; %定義判斷條件
%\node (storage) at (0,-9.5) [draw, storage, minimum width=\smbwd, minimum height=1cm] {比較器}; %定義數據存儲
%\node (process) at (4,-7.5) [draw, process, minimum width=\smbwd, minimum height=1cm] {真實數據}; %定義處理過程
%\coordinate (point1) at (0,-10.75);
%\node (end) at (0,-11.75) [draw, terminal,minimum width=\smbwd,minimum height=0.5cm] {結束}; %定義結束
%連接定義的形狀,繪製流程圖--表示垂直線,|表示箭頭方向
%\draw[->] (start) -- (getdata1);
%\draw[->] (getdata1) -- (getdata2);
%\draw[->] (getdata2) -- (getdata3);
%\draw[->] (getdata3) -- node[right]{$X_t$} (decide);
%\draw[->] (decide) -- node[right]{$X_t^{'}$} (storage);
%\draw[->] (decide) -- (storage);
%\draw[->] (point3) -| node[above]{$Y_t$} (process);
%\draw[->] (process) |- (storage);
%\draw[->] (storage) -- (end);
%\end{tikzpicture}
%\caption{模型結構}\label{fig:one}
%\end{figure}
\subsection{數據預處理}
這是書籍的參考\cite{name1}
aaa\cite{plain:myArticle}
\lipsum[5]
\bibliographystyle{plain}
\bibliography{bibtex-example}
\newpage
\appendix
\section{我的 MATLAB 源程序}
%\begin{lstlisting}
%\end{lstlisting}
\end{document}