~xdavidwu/cskloudv3-thesis

cskloudv3-thesis/covers/toc_var.tex -rw-r--r-- 4.7 KiB
b4127bf2Pinghao Wu appendix: survey: describe design 4 months ago
                                                                                
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
\doublespacing

% 縮小目錄、標題上方的空白處
\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{}{0pt}{\centering}
\titlespacing*{\chapter}{0pt}{-40pt}{40pt}


\iftoggle{toc-use-cn}
{ % true section. 使用中文

% 下面這些是要在目錄上加入...的符號與頁碼
\titlecontents{chapter}[0em]{}{\CJKnumber{\thecontentslabel}\hspace{0.5em}}{}{\hspace{0.5em}\titlerule*[0.75em]{.}\contentspage}[]
\titlecontents{section}[1.5em]{}{\thecontentslabel \hspace{1em}}{}{\hspace{0.5em}\titlerule*[0.75em]{.}\contentspage}[]
\titlecontents{subsection}[3em]{}{\thecontentslabel \hspace{1em}}{}{\hspace{0.5em}\titlerule*[0.75em]{.}\contentspage}[]

% 6. 致謝 Acknowledgement
%\phantomsection
%\addcontentsline{toc}{chapter}{誌謝}
%\input{Sections/0.1.Acknowledgement}
%\newpage

% 7 中文摘要 chinese abstract
\phantomsection
\addcontentsline{toc}{chapter}{摘要}
\input{Sections/0.2.Abstract_chinese}
\newpage

% 8. 英文摘要
\phantomsection
\addcontentsline{toc}{chapter}{Abstract}
\input{Sections/0.3.Abstract}
\newpage

% 9. 目錄 中文版
\renewcommand{\contentsname}{目錄} % 使用中文目錄
\phantomsection
\addcontentsline{toc}{chapter}{目錄}
\tableofcontents
\newpage


% 10. 圖片目錄 中文版
\renewcommand{\figurename}{} % 把caption的Figure改成"圖"
\renewcommand{\listfigurename}{圖目錄}
\renewcommand{\numberline}[1]{圖~#1\hspace*{1em}}
\phantomsection
\addcontentsline{toc}{chapter}{圖目錄}
\listoffigures
\newpage

% 11. 表格目錄 中文版, 有需要再打開
\renewcommand{\tablename}{} % 把caption的Table改成"表"
\renewcommand{\listtablename}{表目錄}
\renewcommand{\numberline}[1]{表~#1\hspace*{1em}}
\phantomsection
\addcontentsline{toc}{chapter}{表目錄}
\listoftables
\newpage

% 把Chapter改成 第X章
% 如果想要章節標題置中, 可在\normalfont前面加上\centering
\titleformat{\chapter}{\normalfont\huge\bfseries}{\CJKnumber{\thechapter}\hspace{0.5em}}{0em}{}
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}

} % true end. 中文目錄設定結束
% --------------------------------------------
% --------------------------------------------
{ % false section. 使用英文目錄
% 下面這些是要在目錄上加入...的符號與頁碼


\newcommand\entableofcontents{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{%
    \encontentsname
    \@mkboth{\MakeUppercase\encontentsname}
            {\MakeUppercase\encontentsname}%
  }%
  \@starttoc{entoc}%
  \if@restonecol\twocolumn\fi
}
\newcommand{\enchapapp}{Chapter}
\apptocmd{\appendix}{\renewcommand{\enchapapp}{Appendix}}{}{}
\newcommand{\addentoc}[2]{%
  \ifstrequal{#1}{chapter}{%
  \addcontentsline{entoc}{#1}{\setlength\@tempdima{\widthof{\textbf{Appendix\space{M}\space}}}\protect\numberline{\enchapapp\space\thechapter}#2}}%
  {\addcontentsline{entoc}{#1}{\protect\numberline{\csname the#1\endcsname}#2}}%
}
\makeatother


\titlecontents{chapter}[0em]{}{\thecontentslabel \hspace{1em}}{}{\titlerule*{.}\contentspage}[\addvspace{1em}]
\titlecontents{section}[1.5em]{\addvspace{-0.5em}}{\thecontentslabel \hspace{1em}}{}{\titlerule*{.}\contentspage}[\addvspace{0.5em}]
\titlecontents{subsection}[3em]{}{\thecontentslabel \hspace{1em}}{}{\titlerule*{.}\contentspage}[\addvspace{0.5em}]

% 6. 致謝 Acknowledgement
\addcontentsline{toc}{chapter}{Acknowledgement} 
\input{Sections/0.1.Acknowledgement}\newpage

% 7 中文摘要 chinese abstract
\addcontentsline{toc}{chapter}{Chinese Abstract} \input{Sections/0.2.Abstract_chinese} \newpage

% 8. english abstract
\addcontentsline{toc}{chapter}{English Abstract} \input{Sections/0.3.Abstract} \newpage

% 9. 目錄 English version
\renewcommand{\contentsname}{Contents}
\addcontentsline{toc}{chapter}{Contents} \tableofcontents \newpage

% 10. 圖片目錄 English version
\renewcommand{\listfigurename}{List of Figures}
\renewcommand{\numberline}[1]{Figure~#1\hspace*{1em}}
\addcontentsline{toc}{chapter}{List of Figures} \listoffigures \newpage

% 11. 表格目錄 English version, 有需要再打開
\renewcommand{\listtablename}{List of Tables}
\renewcommand{\numberline}[1]{Table~#1\hspace*{1em}}
\addcontentsline{toc}{chapter}{List of Tables} \listoftables \newpage

% 調整內文的chapter, section, subection的顯示方式, 改成靠左對齊+沒有換行
% 如果想要章節標題置中, 可在\normalfont前面加上\centering
\titleformat{\chapter}{\normalfont\huge\bfseries}{Chapter {\thechapter}.}{1em}{}



\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}

} % false end. 使用英文