aboutsummaryrefslogtreecommitdiffstats
path: root/LaTex/source.tex
blob: 00b6e0ee397cc9dc451d6ae22dc40b78d0c12e18 (plain) (blame)
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
\documentclass{article}

%%%%%%%%%%%%%%%%% **# chinese setting #** %%%%%%%%%%%%%%%%%%
\usepackage{fontspec}
\usepackage{xeCJK}                  %讓中英文字體分開設置
\defaultCJKfontfeatures{AutoFakeBold=6,AutoFakeSlant=.4} %以後不用再設定粗斜
\XeTeXlinebreaklocale "zh"          %這兩行一定要加
\XeTeXlinebreakskip = 0pt plus 1pt  %中文才能自動換
\newCJKfontfamily{\Kai}{標楷體}
\newCJKfontfamily{\Hei}{微軟正黑體}
\newCJKfontfamily{\Wen}{文泉驛等寬正黑}
\setCJKmainfont{文泉驛等寬正黑}

%%%%%%%%%%%%%%%%%% **# border, indent #** %%%%%%%%%%%%%%%%%%
\usepackage{geometry}
\geometry{a4paper}
\geometry{left=1.7cm, right=1.7cm, top=2cm, bottom=2cm}
\linespread{1}
\setlength{\parskip   }{0.5em}
\setlength{\parindent }{  2em}

%%%%%%%%%%%%%%%%%% **# header, footer #** %%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}        % plain / empty / headings / myheadings / fancy
\pagenumbering{arabic}   % arabic / roman / Roman / alph / Alph
\fancyhead[LE,LO]{資工二}
\fancyhead[CE,CO]{B01902109}
\fancyhead[RE,RO]{洪湧}
\fancyfoot[LE,LO]{}
\fancyfoot[CE,CO]{Page~\thepage ~of~\pageref*{LastPage}}
\fancyfoot[RE,RO]{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}

%%%%%%%%%%%%%%% **# title format & spacing #** %%%%%%%%%%%%%
\usepackage[sf]{titlesec}
\titleformat{\section   }[hang]{\large}{\textbf{Problem\ \thesection}}{0em}{}{}
\titleformat{\subsection}[hang]{      }{\thesubsection .}{1em}{}{}

\usepackage{chngcntr}
\renewcommand{\thesubsection}{\alph{subsection}}

%%%%%%%%%%%%%%%%%% **# multi columns #** %%%%%%%%%%%%%%%%%%%
\usepackage{multicol}
\setlength{\columnsep    }{30pt}
\setlength{\columnseprule}{0.5pt}

%%%%%%%%%%%%%%%%%%% **# table of content #** %%%%%%%%%%%%%%%
\usepackage{tocloft}
\renewcommand{\cftsecleader }{\cftdotfill{\cftdotsep}}

%%%%%%%%%%%%%%%%%%%% **# mathematics #** %%%%%%%%%%%%%%%%%%%
\usepackage{amsmath, amsthm, amssymb}

\theoremstyle{definition}
\newtheorem*{defi}{Definition}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lemma}[thm]{Lemma}

%%%%%%%%%%%%%%%%%%%%% **# algorithm #** %%%%%%%%%%%%%%%%%%%%
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{algc}
\usepackage{algcompatible}
\usepackage[noend]{algpseudocode}

%%%%%%%%%%%%%%%%%%%%%%% **# etc #** %%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
    bookmarks   = true,
    unicode     = true,
    colorlinks  = true,
    linkcolor   = blue
    linkcolor   = blue,
    urlcolor    = blue,
    citecolor   = blue,
    anchorcolor = blue
}

%%%%%%%%%%%%%%%%%% **# custom commands #** %%%%%%%%%%%%%%%%%
\newcommand{\Indent}[2]{\parindent=#1 \leftskip=#2}
\newcommand{\Usesize}[2]{\fontsize{#1}{#2}\selectfont \fontsize{#1}{#2}\selectfont}
\newcommand{\lstsetCPP}[0]{\lstset{
    basicstyle=\small,       % font size
    breakatwhitespace=false, % automatic breaks only happen at whitespace
    breaklines=true,         % automatic line breaking
    captionpos=b,            % caption-position to bottom
    escapeinside={\%*}{*)},  % if you want to add LaTeX within your code
    extendedchars=true,      % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
    frame=single,            % adds a frame around the code
    keepspaces=true,         % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
    language=C++,            % the language of the code
    numbers=left,            % where to put the line-numbers; (none, left, right)
    numbersep=4pt,           % how far the line-numbers are from the code
    showspaces=false,        % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
    showstringspaces=false,  % underline spaces within strings only
    showtabs=false,          % show tabs within strings adding particular underscores
    stepnumber=1,            % the step between two line-numbers.
    tabsize=4,               % tabsize
}}
\newcommand{\LineIf}[2]{\State \algorithmicif\ {#1}\ \algorithmicthen\ {#2}}

%%%%%%%%%%%%%%%%%%%%%%%%% **# 本文 #** %%%%%%%%%%%%%%%%%%%

\begin{document}
\Indent{0em}{3em}
hi!
\Kai
啦啦\textbf{}

\Indent{0em}{5em}
啦啦\textbf{}aaaaaaaaaaaaa b c xxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
\\


\Indent{0em}{7em}
   \begin{itemize}
\Indent{0em}{7em}
       \itemsep = 0em
      \item b
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
   \end{itemize}




啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦 啦啦啦啦啦啦啦啦啦啦啦啦啦啦

啦啦\textbf{}aaaaaaaaaaaaa b c xxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
xxxxxxxxxxxx xxxx xxxx xxxx xxxx xxxx xxxx  xxxx xxxx xxxx
x
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \newtheorem{thm}{Theorm}                     定理
% \newtheorem{thm}{Theorm}[section]            加入節...?
% \newtheorem{lem}[thm]{Lemma}                 和定理一起編號
% \newtheorem*{mainthm}{Main Theorem}          不要編號
% \begin{thm}\label{T:major} ... \ref{T:major} 用label, 引用
% \begin{array}{clr}  ... & ... \\             矩陣用
% \begin{align}

%titleformat{command}[shape]{format}{label}{sep}{before}[after]
%    command: 要定義的標題
%    shape  : 形狀 hang|block|display
%    format : 標題外觀(至中對齊啦, 粗體啦...)
%    label  : 標籤(標號)
%    sep    : 標題標籤與內容之間的間隔
%    befor  : 內容之前
%    after  : 內容之後

%titlespacing{command}{left}{before}{after}
%    command: 要定義的標題
%    left   : 標題左邊偏移
%    before : 與前一段文字間隔
%    after  : 與後一段文字間隔

% \setcounter{secnumdepth}{3}                   自己定義要標號到多深
% -1 part, 0~5 ch, se, subse, subsubse, par, subpar

%%%%%%%%%%%%%%%%%%%% 筆記區 %%%%%%%%%%%%%%%%%%%%%%
% ~ &                                           空白 表格中的分隔
% \, \: \; \quad \qquad \hspace{2cm}            小中大空白
% \smallskip \medskip \bigskip \vspace{2cm}     垂直移動3, 6, 12, 自訂
% \hfill, \vfill                                平均的塞入 水平/垂直 空間
% \dotfill \hrulefill                           塞           點/線   進去
% \tiny \small \large \Large \LARGE \huge \Huge 字體大小
% \emph{} \bf{}                                 斜體, 粗體
% \title{} \author{} \date{} \maketitle         封面用
% $...$ \[...\]                                 數學 隨文/展示 模式
% \textbackslash  $\backslash%                  反除號
% \part \chapter \section \paragraph            section command
% \begin{itemize/enumerate/description} \item   item

%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
%\usepackage[Sonny]{fncychap}                   漂亮的chapter

%   \begin{raggedleft / flushright / center}  %靠左/右/中對齊(前者不切齊)
%   \linespread{0.5}

%   \begin{minipage}[t]{0.40\linewidth}
%   \end{minipage}

%   \begin{tabular}[t / b / c]{r|cc||l}
%       bla & x & y & bla    (\\ or \tabularnewline)
%       \hline
%       bla & x & y & bla    (\\ or \tabularnewline)
%   \end{tabular}

%   \begin{multicols}{2}
%   \end{multicols}

%   \begin{itemize}
%       \itemsep = 0em
%       \item ...
%   \end{itemize}

% \tableofcontents             %目錄
%\begin{algorithm}
%\begin{algorithmic}[1]
%    \caption{My algorithm}\label{euclid}
%    \Function{$BinSearch$}{$record array arr, integer len, integer value$}
%        \State{$left \gets 0, {right} \gets \mathrm{len}$}
%        \State ${ans} \gets -1$
%        \While{ $left < right$ }
%            \State $mid \gets ??$
%            \If{$arr[mid] = value$}
%                \State $ans \gets mid, left \gets mid+1$
%            \ElsIf{$arr[mid] > value$}
%                \State{$right \gets mid$}
%            \ElsIf{$arr[mid] < value$}
%                \State{$left  \gets mid+1$}
%            \EndIf
%        \EndWhile
%        \LineIf{$ans = -1$}{\Return $NOTFOUND$}
%        \State \Return $arr[ans]$
%    \EndFunction
%\end{algorithmic}
%\end{algorithm}