-
Notifications
You must be signed in to change notification settings - Fork 12
/
easy_slides.tex
170 lines (141 loc) · 4.65 KB
/
easy_slides.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
% !TeX root = ./easy_slides.tex
% !TeX program = xelatex
\documentclass[UTF8, zihao = 5]{article}
\input{./global_setup/packages}
\input{./global_setup/macros}
\input{./global_setup/settings}
\usepackage{textcomp}
\iffalse % Windows
\setCJKmainfont[Mapping = fullwidth-stop, ItalicFont = KaiTi, BoldFont = SimHei]
{SimSun}
\setCJKsansfont[Mapping = fullwidth-stop]
{SimHei}
\setCJKmonofont[Mapping = fullwidth-stop]
{FangSong}
\else % macOS
\setCJKmainfont[Mapping = fullwidth-stop,
BoldFont = HiraginoSansGB-W6, ItalicFont = STKaiti]
{HiraginoSansGB-W3}
\setCJKsansfont[Mapping = fullwidth-stop,
BoldFont = PingFangSC-Semibold]
{PingFangSC-Regular}
\setCJKmonofont[Mapping = fullwidth-stop]{STFangsong}
\fi
\title{标题}
\newcommand{\authorname}{作者}
\author{\authorname}
\date{\today}
\begin{document}
\makefrontpage
\FullPageBGPicture{book-bg.jpg} % 设置底图
\section{示例}
\subsection{表格示例}
\begin{tabu} to \linewidth{X[1,c]X[2,c]X[1.5,c]}
\toprule
部门 & 团队 & 职位 \\
\midrule
搜索事业部 & 引擎策略部 & 机器学习工程师 \\
\bottomrule
\end{tabu}
\clp % 换页
\subsection{算法伪代码示例}
假设弱学习器 $f$ 的一般形式记作 $f = h(\vx; \vec a)$,此处 $\vec a$ 是待确定的参数。
\begin{algorithm}[!htbp]
\scriptsize
\caption{Gradient and Line Search}\label{alg:GALS}
\begin{algorithmic}[1]
\Procedure{Gradient and Line Search}{$S = \{(\vec{x}, y)\}$, $N = \lvert S\rvert$, $m$}
\For{$i: 1 \to N$}
\Comment{Get Gradients for each sample point.}
\State{$g_i \gets \frac{\partial L\bigl(F_{m - 1}(\vx_i)\bigr)}{\partial F_{m - 1}(\vx_i)}$}
\EndFor
\State{$\vec g \gets \{g_1, g_2, \ldots, g_N\}$}
\State{$\vec a^* \gets \argmin_{\vec a} \sum_{i = 1}^{N}\bigl[l\bigl(-g_i, h(\vx_i; \vec a)\bigr)\bigr]$}
\State{$\rho^{*} \gets \argmin_{\rho}\bigl[L(F_{m - 1} + \rho\cdot h(\vx; \vec a^{*}))\bigr]$}
\State{\Return{$f\gets\rho^{*}\cdot h(\vx; \vec a^{*})$}}
\EndProcedure
\end{algorithmic}
\end{algorithm}
\clp % 换页
\subsection{程序代码示例}
\begin{lstlisting}[style = lcpp, caption = {快速排序主函数}]
template <typename RandomIt,
typename T = typename std::iterator_traits<RandomIt>::value_type,
typename Compare = std::less<T>>
void quick_sort(RandomIt first, RandomIt last, Compare comp = Compare()) {
for (auto size = std::distance(first, last); size > 1; size = std::distance(first, last)) {
T pivot = median(first, last - 1, first + size / 2, comp);
auto eq = inplace_partition(first, last, pivot, comp);
quick_sort(first, eq.first, comp);
first = eq.second; // Liam Huang: economize around half of recursive calling.
}
}
\end{lstlisting}
\clp % 换页
\subsection{\LaTeX{} 代码示例}
\begin{lstlisting}[style = lltx, caption = {MWE}]
\documentclass[UTF8]{ctexart}
\begin{document}
特可爱(\TeX{})排版!
\end{document}
\end{lstlisting}
\clp % 换页
\subsection{插图示例}
\begin{figure}[H]
\centering
\includegraphics[scale = 0.45]{l1-l2-sl.png}
\caption{$L_1$ 与 $L_2$ 范数等高线图}
\end{figure}
\clp % 换页
\subsection{分屏及罗列示例}
\begin{minipage}{0.5\linewidth}
\begin{itemize}
\item 无编号地罗列
\item 继续
\item 再继续
\begin{enumerate}
\item 嵌套中的有编号地罗列
\item 继续
\item 再继续
\end{enumerate}
\end{itemize}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\begin{enumerate}
\item 有编号地罗列
\item 继续
\begin{itemize}
\item 嵌套中的无编号地罗列
\item 继续
\item 再继续
\end{itemize}
\item 再继续
\end{enumerate}
\end{minipage}
\clp % 换页
\section{更多数学算符展示}
%\begin{enumerate}
% \item[微分算符] \fdif[2]{f}{x}, \fdif{f}{x}
%\end{enumerate}
\begin{table}[!h] \centering
\begin{tabular}{|c|c|c|}
\hline
符号名称 & 符号用法 & 符号展示 \\ \hline
导数算符 & \verb|\fdif[n]{f}{x}| & $\fdif[n]{f}{x}$ \\ \hline
& \verb|\fdif{f}{x}| & $\fdif{f}{x}$ \\ \hline
偏微分算符 & \verb|\pdif x| & $\pdif x$ \\ \hline
偏导算符 & \verb|\fpdif[n]{f}{x}| & $\fpdif[n]{f}{y}$ \\ \hline
混合偏导算符 & \verb|\mpdif{f}{5}{x}{2}{y}{3}| & $\mpdif{f}{5}{x}{2}{y}{3}$ \\ \hline
哈密顿量 & \verb|\Hamilton| & \Hamilton \\ \hline
拉格朗日量 & \verb|\Lagrange| & \Lagrange \\ \hline
\end{tabular}
\end{table}
\clp % 末页
\thispagestyle{empty}
\FullPageBGPicture{book-bg.jpg} % 设置底图
\null\vfill
\centering
\scalebox{3}{谢谢!}
\vfill\null
\clp
\end{document}