forked from NCTU-PCCA/NCTU_Fox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codebook.tex
112 lines (97 loc) · 3.81 KB
/
codebook.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
\documentclass[10pt,twocolumn,oneside,a4paper]{article}
\setlength{\columnsep}{10pt} %兩欄模式的間距
\setlength{\columnseprule}{0pt} %兩欄模式間格線粗細
\usepackage{amsthm} %定義,例題
\usepackage{amssymb}
\usepackage{fontspec} %設定字體
\usepackage{color}
\usepackage[x11names]{xcolor}
\usepackage{listings} %顯示code用的
\usepackage{fancyhdr} %設定頁首頁尾
\usepackage{graphicx} %Graphic
\usepackage{enumerate}
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage[CheckSingle, CJKmath]{xeCJK}
\usepackage{CJKulem}
\usepackage{tikz} % Used for draw Finite Automata
\usepackage{amsmath, courier, listings, fancyhdr, graphicx}
\topmargin=0pt
\headsep=5pt
\textheight=780pt
\footskip=0pt
\voffset=-50pt
\textwidth=545pt
\marginparsep=0pt
\marginparwidth=0pt
\marginparpush=0pt
\oddsidemargin=0pt
\evensidemargin=0pt
\hoffset=-42pt
%\renewcommand\listfigurename{圖目錄}
%\renewcommand\listtablename{表目錄}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setmainfont{Consolas}
\setmonofont{Consolas}
\setCJKmainfont{Noto Sans CJK TC}
\XeTeXlinebreaklocale "zh" %中文自動換行
\XeTeXlinebreakskip = 0pt plus 1pt %設定段落之間的距離
\setcounter{secnumdepth}{3} %目錄顯示第三層
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
\@empty\z@\@empty
\makeatother
\lstset{ % Code顯示
language=C++, % the language of the code
basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
%numbers=left, % where to put the line-numbers
numberstyle=\footnotesize, % 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
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=false, % adds a frame around the code
tabsize=2, % sets default tabsize to 2 spaces
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
escapeinside={\%*}{*)}, % if you want to add a comment within your code
morekeywords={*}, % if you want to add more keywords to the set
keywordstyle=\bfseries\color{Blue1},
commentstyle=\itshape\color{Red4},
stringstyle=\itshape\color{Green4},
}
%----------------------------------------------------------------------------------------
% 設定 section 行距
%----------------------------------------------------------------------------------------
\makeatletter
\let\origsection\section
\renewcommand\section{\@ifstar{\starsection}{\nostarsection}}
\newcommand\nostarsection[1]
{\sectionprelude\origsection{#1}\sectionpostlude}
\newcommand\starsection[1]
{\sectionprelude\origsection*{#1}\sectionpostlude}
\newcommand\sectionprelude{%
\vspace{-10pt} % 改這個數字
}
\newcommand\sectionpostlude{%
\vspace{-10pt} % 改這個數字
}
\makeatother
% ---------------------------------------------------------------------------------------
\begin{document}
\pagestyle{fancy}
\fancyfoot{}
\fancyhead[C]{National Chiao Tung University}
\fancyhead[L]{NCTU\_Fox }
\fancyhead[R]{(\today) \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\contentsname}{Contents}
\scriptsize
\tableofcontents
\newpage
\input{content.tex}
\end{document}