-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathNTOU_thesis.cls
More file actions
81 lines (70 loc) · 2.8 KB
/
Copy pathNTOU_thesis.cls
File metadata and controls
81 lines (70 loc) · 2.8 KB
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
% This class is a patch to base class.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{NTOU_thesis}[2018/05/27 by sppmg]
% pass no defined option to book class.
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{thesis_base}}
% terminates the option processing.
\ProcessOptions\relax
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX tools (before base class)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ifthen}
\RequirePackage{xparse}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load config.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\undefined\configured
% --------- Define option for config.tex ----------
\provideboolean{publish} % publish ? Set true before publish. 發怖前設true
\provideboolean{disableChinese} % Disable chinese, for English user.
\provideboolean{printcopyright} % print copyright text on titlepage or cover.
\provideboolean{pdfLinkBoxDisplay} % Draw box on link in the pdf viewer.
\provideboolean{bibStyleNameYear} % bibliography use name,year to sort and cite.
\provideboolean{reallyBlankPage} % Really blank pages between chapters
\provideboolean{tocEntryToToc} % Add TOC entry to TOC
\provideboolean{lofEntryToToc} % Add LOF entry to TOC
\provideboolean{lotEntryToToc} % Add LOT entry to TOC
% --------- Load config.tex ----------
\IfFileExists{./config.tex}{\input{./config.tex}\gdef\configured{}}{} % search only in the current directory use ./file
% Easy check Chinese sitting. It will not disable Chinese font.
% Usage: \ifzh{zh}{non-zh} or \ifzh{zh}
\ProvideDocumentCommand{\ifzh}{+m +G{}}{
\ifthenelse{\NOT \boolean{disableChinese} \AND \equal{\lang}{zh}}{#1}{#2}
}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Presetting for NTU
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifzh{ % TOC 章級標號形式設定
\gdef\thecontentslabel@chapter{第\zhnumber{\thecontentslabel}章}
\gdef\thecontentslabel@chapter@app{\appendixname\thecontentslabel}
}{
\gdef\thecontentslabel@chapter{\thecontentslabel}
\gdef\thecontentslabel@chapter@app{\thecontentslabel}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load base class
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\LoadClass{thesis_base}
%%%%% Load additional packages and commands.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Change setting for NTU
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ---------------------- Chapter title style ---------------------------
\ifzh{
\patchcmd{\@makechapterhead}
{\zhnumber{\thechapter}、\makebox[0.5em]{}}
{第\zhnumber{\thechapter}章\makebox[0.5em]{}}{}{}
}
% ---------------------- Page header ---------------------------
\ifzh{
% \mainmatter
\patchcmd{\chaptermark}
{\zhnumber{\thechapter}、}
{第\zhnumber{\thechapter}章}{}{}
% \appendix
\patchcmd{\chaptermark}
{\thechapter、}
{附錄\thechapter\enspace}{}{}
}
\endinput % this must be the last command.