-
Notifications
You must be signed in to change notification settings - Fork 3
/
thesis.tex
189 lines (152 loc) · 4.2 KB
/
thesis.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
\documentclass{ntuthesis}
\usepackage{times}
\usepackage{verbatim}
\usepackage{color}
\usepackage{url}
\usepackage{graphicx}
\usepackage{array}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{algorithm}
%\usepackage{algorithmic}
\usepackage{algpseudocode}
% Format the refs
\usepackage[sort,comma]{natbib}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{etoolbox}
% Centering the ToC's title
\usepackage{tocloft}
% Include ToC/LoF/LoT into ToC
\usepackage[notbib]{tocbibind}
% Include outside .pdf
\usepackage{pdfpages}
% Add wallpaper
\usepackage{wallpaper}
% 2 words indent in first line for Chinese
\usepackage{indentfirst}
\setlength{\parindent}{2em}
% Using the tex-text mapping for ligatures etc.
\defaultfontfeatures{Mapping=tex-text}
% Set the default fonts
\setmainfont{Times New Roman}
%\setCJKmainfont{楷體-繁}
\setCJKmainfont{標楷體}
% value > 0
\def\xeCJKembold{0.4}
% hack into xeCJK, you don't need to understand it
\def\saveCJKnode{\dimen255\lastkern}
\def\restoreCJKnode{\kern-\dimen255\kern\dimen255}
% save old definition of \CJKsymbol and \CJKpunctsymbol for CJK output
\let\CJKoldsymbol\CJKsymbol
\let\CJKoldpunctsymbol\CJKpunctsymbol
% apply pdf literal fake bold
\def\CJKfakeboldsymbol#1{%
\special{pdf:literal direct 2 Tr \xeCJKembold\space w}%
\CJKoldsymbol{#1}%
\saveCJKnode
\special{pdf:literal direct 0 Tr}%
\restoreCJKnode}
\def\CJKfakeboldpunctsymbol#1{%
\special{pdf:literal direct 2 Tr \xeCJKembold\space w}%
\CJKoldpunctsymbol{#1}%
\saveCJKnode
\special{pdf:literal direct 0 Tr}%
\restoreCJKnode}
\newcommand\CJKfakebold[1]{%
\let\CJKsymbol\CJKfakeboldsymbol
\let\CJKpunctsymbol\CJKfakeboldpunctsymbol
#1%
\let\CJKsymbol\CJKoldsymbol
\let\CJKpunctsymbol\CJKoldpunctsymbol}
\newcommand\zhbf[1]{\CJKfakebold{#1}}
% Very Naive Chinese Number
\newcommand\naiveZhNum[1]{
\ifnum #1 = 1
一
\else \ifnum #1 = 2
二
\else \ifnum #1 = 3
三
\else \ifnum #1 = 4
四
\else \ifnum #1 = 5
五
\else \ifnum #1 = 6
六
\else \ifnum #1 = 7
七
\else \ifnum #1 = 8
八
\else \ifnum #1 = 9
九
\else
#1
\fi\fi\fi\fi\fi\fi\fi\fi\fi
}
% ToC, LoF, LoT centering settings with package tocloft
\renewcommand{\cftloftitlefont}{\hfill \Huge}
\renewcommand{\cftafterloftitle}{\hfill}
\renewcommand{\cfttoctitlefont}{\hfil \Huge}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftlottitlefont}{\hfill \Huge}
\renewcommand{\cftafterlottitle}{\hfill}
\titleformat{\chapter}{\centering\Huge\bfseries}{第\naiveZhNum{\thechapter}章}{1em}{}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % dots for chapters
\titlecontents{chapter}[0em]{}{\makebox[4.1em][l]{第\naiveZhNum{\thecontentslabel}章}}{}{\cftdotfill{\cftdotsep}\contentspage}
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}
\makeatother
% Your information goes here
\input{ntuvars}
% Modify some default titles for Chinese
\renewcommand{\contentsname}{目錄}
\renewcommand{\listfigurename}{圖目錄}
\renewcommand{\listtablename}{表目錄}
\renewcommand{\tablename}{表}
\renewcommand{\figurename}{圖}
\renewcommand{\bibname}{參考文獻}
\floatname{algorithm}{演算法}
\renewcommand{\algorithmicrequire}{\textbf{輸入:}}
\renewcommand{\algorithmicensure}{\textbf{輸出:}}
\begin{document}
% 臺大論文浮水印
\input{watermark.tex}
\frontmatter
\makecover
% 口試委員會審定書
% 以 \makecertification 產生
%\makecertification
% 或匯入外部.pdf檔
\addcontentsline{toc}{chapter}{口試委員會審定書}
\includepdf[pages={1}]{pdfs/cert.pdf}
% 誌謝
\input{acknowledgements}
% 摘要
\input{abstract}
% Table of Content
\clearpage
\tableofcontents
% List of Figures
\clearpage
\renewcommand{\numberline}[1]{\figurename~#1\hspace*{1em}}
\listoffigures
% List of Tables
\clearpage
\renewcommand{\numberline}[1]{\tablename~#1\hspace*{1em}}
\listoftables
\mainmatter
% Your thesis goes here
\input{chapters/introduction}
\input{chapters/related}
\input{chapters/method}
\input{chapters/experiment}
\input{chapters/conclusion}
\appendix
\backmatter
\addcontentsline{toc}{chapter}{\bibname}
\bibliographystyle{apa}
% Your bibliography goes here
\bibliography{thesis}
\end{document}