├── .gitignore
├── LICENSE
├── README.md
├── easy_slides.tex
├── figures
└── l1-l2-sl.png
├── global_figures
└── book-bg.jpg
└── global_setup
├── macros.tex
├── packages.tex
└── settings.tex
/.gitignore:
--------------------------------------------------------------------------------
1 | ## easy_slides
2 | /*.pdf
3 |
4 | ## Core latex/pdflatex auxiliary files:
5 | *.aux
6 | *.lof
7 | *.log
8 | *.lot
9 | *.fls
10 | *.out
11 | *.toc
12 | *.fmt
13 | *.fot
14 | *.cb
15 | *.cb2
16 | .*.lb
17 |
18 | ## Intermediate documents:
19 | *.dvi
20 | *.xdv
21 | *-converted-to.*
22 | # these rules might exclude image files for figures etc.
23 | # *.ps
24 | # *.eps
25 | # *.pdf
26 |
27 | ## Generated if empty string is given at "Please type another file name for output:"
28 | .pdf
29 |
30 | ## Bibliography auxiliary files (bibtex/biblatex/biber):
31 | *.bbl
32 | *.bcf
33 | *.blg
34 | *-blx.aux
35 | *-blx.bib
36 | *.run.xml
37 |
38 | ## Build tool auxiliary files:
39 | *.fdb_latexmk
40 | *.synctex
41 | *.synctex(busy)
42 | *.synctex.gz
43 | *.synctex.gz(busy)
44 | *.pdfsync
45 |
46 | ## Auxiliary and intermediate files from other packages:
47 | # algorithms
48 | *.alg
49 | *.loa
50 |
51 | # achemso
52 | acs-*.bib
53 |
54 | # amsthm
55 | *.thm
56 |
57 | # beamer
58 | *.nav
59 | *.pre
60 | *.snm
61 | *.vrb
62 |
63 | # changes
64 | *.soc
65 |
66 | # cprotect
67 | *.cpt
68 |
69 | # elsarticle (documentclass of Elsevier journals)
70 | *.spl
71 |
72 | # endnotes
73 | *.ent
74 |
75 | # fixme
76 | *.lox
77 |
78 | # feynmf/feynmp
79 | *.mf
80 | *.mp
81 | *.t[1-9]
82 | *.t[1-9][0-9]
83 | *.tfm
84 |
85 | #(r)(e)ledmac/(r)(e)ledpar
86 | *.end
87 | *.?end
88 | *.[1-9]
89 | *.[1-9][0-9]
90 | *.[1-9][0-9][0-9]
91 | *.[1-9]R
92 | *.[1-9][0-9]R
93 | *.[1-9][0-9][0-9]R
94 | *.eledsec[1-9]
95 | *.eledsec[1-9]R
96 | *.eledsec[1-9][0-9]
97 | *.eledsec[1-9][0-9]R
98 | *.eledsec[1-9][0-9][0-9]
99 | *.eledsec[1-9][0-9][0-9]R
100 |
101 | # glossaries
102 | *.acn
103 | *.acr
104 | *.glg
105 | *.glo
106 | *.gls
107 | *.glsdefs
108 |
109 | # gnuplottex
110 | *-gnuplottex-*
111 |
112 | # gregoriotex
113 | *.gaux
114 | *.gtex
115 |
116 | # htlatex
117 | *.4ct
118 | *.4tc
119 | *.idv
120 | *.lg
121 | *.trc
122 | *.xref
123 |
124 | # hyperref
125 | *.brf
126 |
127 | # knitr
128 | *-concordance.tex
129 | # TODO Comment the next line if you want to keep your tikz graphics files
130 | *.tikz
131 | *-tikzDictionary
132 |
133 | # listings
134 | *.lol
135 |
136 | # makeidx
137 | *.idx
138 | *.ilg
139 | *.ind
140 | *.ist
141 |
142 | # minitoc
143 | *.maf
144 | *.mlf
145 | *.mlt
146 | *.mtc[0-9]*
147 | *.slf[0-9]*
148 | *.slt[0-9]*
149 | *.stc[0-9]*
150 |
151 | # minted
152 | _minted*
153 | *.pyg
154 |
155 | # morewrites
156 | *.mw
157 |
158 | # nomencl
159 | *.nlg
160 | *.nlo
161 | *.nls
162 |
163 | # pax
164 | *.pax
165 |
166 | # pdfpcnotes
167 | *.pdfpc
168 |
169 | # sagetex
170 | *.sagetex.sage
171 | *.sagetex.py
172 | *.sagetex.scmd
173 |
174 | # scrwfile
175 | *.wrt
176 |
177 | # sympy
178 | *.sout
179 | *.sympy
180 | sympy-plots-for-*.tex/
181 |
182 | # pdfcomment
183 | *.upa
184 | *.upb
185 |
186 | # pythontex
187 | *.pytxcode
188 | pythontex-files-*/
189 |
190 | # thmtools
191 | *.loe
192 |
193 | # TikZ & PGF
194 | *.dpth
195 | *.md5
196 | *.auxlock
197 |
198 | # todonotes
199 | *.tdo
200 |
201 | # easy-todo
202 | *.lod
203 |
204 | # xmpincl
205 | *.xmpi
206 |
207 | # xindy
208 | *.xdy
209 |
210 | # xypic precompiled matrices
211 | *.xyc
212 |
213 | # endfloat
214 | *.ttt
215 | *.fff
216 |
217 | # Latexian
218 | TSWLatexianTemp*
219 |
220 | ## Editors:
221 | # WinEdt
222 | *.bak
223 | *.sav
224 |
225 | # Texpad
226 | .texpadtmp
227 |
228 | # Kile
229 | *.backup
230 |
231 | # KBibTeX
232 | *~[0-9]*
233 |
234 | # auto folder when using emacs and auctex
235 | ./auto/*
236 | *.el
237 |
238 | # expex forward references with \gathertags
239 | *-tags.tex
240 |
241 | # standalone packages
242 | *.sta
243 |
244 | # generated if using elsarticle.cls
245 | *.spl
246 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # easy\_slides
2 |
3 | Easy slides template for LaTeX users, based on the article class.
4 |
5 | Introduction (in Chinese):
6 |
--------------------------------------------------------------------------------
/easy_slides.tex:
--------------------------------------------------------------------------------
1 | % !TeX root = ./easy_slides.tex
2 | % !TeX program = xelatex
3 | \documentclass[UTF8, zihao = 5]{article}
4 |
5 | \input{./global_setup/packages}
6 | \input{./global_setup/macros}
7 | \input{./global_setup/settings}
8 | \usepackage{textcomp}
9 |
10 | \iffalse % Windows
11 | \setCJKmainfont[Mapping = fullwidth-stop, ItalicFont = KaiTi, BoldFont = SimHei]
12 | {SimSun}
13 | \setCJKsansfont[Mapping = fullwidth-stop]
14 | {SimHei}
15 | \setCJKmonofont[Mapping = fullwidth-stop]
16 | {FangSong}
17 | \else % macOS
18 | \setCJKmainfont[Mapping = fullwidth-stop,
19 | BoldFont = HiraginoSansGB-W6, ItalicFont = STKaiti]
20 | {HiraginoSansGB-W3}
21 | \setCJKsansfont[Mapping = fullwidth-stop,
22 | BoldFont = PingFangSC-Semibold]
23 | {PingFangSC-Regular}
24 | \setCJKmonofont[Mapping = fullwidth-stop]{STFangsong}
25 | \fi
26 |
27 | \title{标题}
28 | \newcommand{\authorname}{作者}
29 | \author{\authorname}
30 | \date{\today}
31 |
32 | \begin{document}
33 | \makefrontpage
34 | \FullPageBGPicture{book-bg.jpg} % 设置底图
35 |
36 | \section{示例}
37 | \subsection{表格示例}
38 |
39 | \begin{tabu} to \linewidth{X[1,c]X[2,c]X[1.5,c]}
40 | \toprule
41 | 部门 & 团队 & 职位 \\
42 | \midrule
43 | 搜索事业部 & 引擎策略部 & 机器学习工程师 \\
44 | \bottomrule
45 | \end{tabu}
46 |
47 | \clp % 换页
48 |
49 | \subsection{算法伪代码示例}
50 |
51 | 假设弱学习器 $f$ 的一般形式记作 $f = h(\vx; \vec a)$,此处 $\vec a$ 是待确定的参数。
52 |
53 | \begin{algorithm}[!htbp]
54 | \scriptsize
55 | \caption{Gradient and Line Search}\label{alg:GALS}
56 | \begin{algorithmic}[1]
57 | \Procedure{Gradient and Line Search}{$S = \{(\vec{x}, y)\}$, $N = \lvert S\rvert$, $m$}
58 | \For{$i: 1 \to N$}
59 | \Comment{Get Gradients for each sample point.}
60 | \State{$g_i \gets \frac{\partial L\bigl(F_{m - 1}(\vx_i)\bigr)}{\partial F_{m - 1}(\vx_i)}$}
61 | \EndFor
62 | \State{$\vec g \gets \{g_1, g_2, \ldots, g_N\}$}
63 | \State{$\vec a^* \gets \argmin_{\vec a} \sum_{i = 1}^{N}\bigl[l\bigl(-g_i, h(\vx_i; \vec a)\bigr)\bigr]$}
64 | \State{$\rho^{*} \gets \argmin_{\rho}\bigl[L(F_{m - 1} + \rho\cdot h(\vx; \vec a^{*}))\bigr]$}
65 | \State{\Return{$f\gets\rho^{*}\cdot h(\vx; \vec a^{*})$}}
66 | \EndProcedure
67 | \end{algorithmic}
68 | \end{algorithm}
69 |
70 | \clp % 换页
71 |
72 | \subsection{程序代码示例}
73 |
74 | \begin{lstlisting}[style = lcpp, caption = {快速排序主函数}]
75 | template ::value_type,
77 | typename Compare = std::less>
78 | void quick_sort(RandomIt first, RandomIt last, Compare comp = Compare()) {
79 | for (auto size = std::distance(first, last); size > 1; size = std::distance(first, last)) {
80 | T pivot = median(first, last - 1, first + size / 2, comp);
81 | auto eq = inplace_partition(first, last, pivot, comp);
82 | quick_sort(first, eq.first, comp);
83 | first = eq.second; // Liam Huang: economize around half of recursive calling.
84 | }
85 | }
86 | \end{lstlisting}
87 |
88 | \clp % 换页
89 |
90 | \subsection{\LaTeX{} 代码示例}
91 |
92 | \begin{lstlisting}[style = lltx, caption = {MWE}]
93 | \documentclass[UTF8]{ctexart}
94 | \begin{document}
95 | 特可爱(\TeX{})排版!
96 | \end{document}
97 | \end{lstlisting}
98 |
99 | \clp % 换页
100 |
101 | \subsection{插图示例}
102 |
103 | \begin{figure}[H]
104 | \centering
105 | \includegraphics[scale = 0.45]{l1-l2-sl.png}
106 | \caption{$L_1$ 与 $L_2$ 范数等高线图}
107 | \end{figure}
108 |
109 | \clp % 换页
110 |
111 | \subsection{分屏及罗列示例}
112 |
113 | \begin{minipage}{0.5\linewidth}
114 | \begin{itemize}
115 | \item 无编号地罗列
116 | \item 继续
117 | \item 再继续
118 | \begin{enumerate}
119 | \item 嵌套中的有编号地罗列
120 | \item 继续
121 | \item 再继续
122 | \end{enumerate}
123 | \end{itemize}
124 | \end{minipage}%
125 | \begin{minipage}{0.5\linewidth}
126 | \begin{enumerate}
127 | \item 有编号地罗列
128 | \item 继续
129 | \begin{itemize}
130 | \item 嵌套中的无编号地罗列
131 | \item 继续
132 | \item 再继续
133 | \end{itemize}
134 | \item 再继续
135 | \end{enumerate}
136 | \end{minipage}
137 |
138 | \clp % 换页
139 |
140 | \section{更多数学算符展示}
141 | %\begin{enumerate}
142 | % \item[微分算符] \fdif[2]{f}{x}, \fdif{f}{x}
143 | %\end{enumerate}
144 | \begin{table}[!h] \centering
145 | \begin{tabular}{|c|c|c|}
146 | \hline
147 | 符号名称 & 符号用法 & 符号展示 \\ \hline
148 | 导数算符 & \verb|\fdif[n]{f}{x}| & $\fdif[n]{f}{x}$ \\ \hline
149 | & \verb|\fdif{f}{x}| & $\fdif{f}{x}$ \\ \hline
150 | 偏微分算符 & \verb|\pdif x| & $\pdif x$ \\ \hline
151 | 偏导算符 & \verb|\fpdif[n]{f}{x}| & $\fpdif[n]{f}{y}$ \\ \hline
152 | 混合偏导算符 & \verb|\mpdif{f}{5}{x}{2}{y}{3}| & $\mpdif{f}{5}{x}{2}{y}{3}$ \\ \hline
153 | 哈密顿量 & \verb|\Hamilton| & \Hamilton \\ \hline
154 | 拉格朗日量 & \verb|\Lagrange| & \Lagrange \\ \hline
155 | \end{tabular}
156 | \end{table}
157 |
158 |
159 | \clp % 末页
160 | \thispagestyle{empty}
161 | \FullPageBGPicture{book-bg.jpg} % 设置底图
162 | \null\vfill
163 |
164 | \centering
165 | \scalebox{3}{谢谢!}
166 |
167 | \vfill\null
168 |
169 | \clp
170 | \end{document}
171 |
--------------------------------------------------------------------------------
/figures/l1-l2-sl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Liam0205/easy_slides/189aa2071dd88216412c5f3d0384b0e1e47e7f6d/figures/l1-l2-sl.png
--------------------------------------------------------------------------------
/global_figures/book-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Liam0205/easy_slides/189aa2071dd88216412c5f3d0384b0e1e47e7f6d/global_figures/book-bg.jpg
--------------------------------------------------------------------------------
/global_setup/macros.tex:
--------------------------------------------------------------------------------
1 | %%% --->
2 | % general macros
3 | %%% <---
4 | \newcommand{\email}[1]{\href{mailto:#1}{#1}}
5 |
6 | %%% --->
7 | % water mark and background picture
8 | %%% <---
9 |
10 | \newcommand{\watermark}[3]{\AddToShipoutPictureBG{%
11 | \parbox[b][\paperheight]{\paperwidth}{%
12 | \vfill%
13 | \centering%
14 | \tikz[remember picture, overlay]%
15 | \node [rotate = #1, scale = #2] at (current page.center)%
16 | {\textcolor{gray!80!cyan!30!white!50}{#3}};
17 | \vfill}%
18 | }%
19 | }
20 |
21 | \newcommand*{\FullPageBGPicture}[1]{%
22 | \clearpage
23 | \watermark{0}{1}{\includegraphics[width=\paperwidth]{#1}}}
24 |
25 | %%% --->
26 | % math defines and shortcuts
27 | %%% <---
28 |
29 | \DeclareMathOperator*{\argmin}{arg\,min}
30 | \DeclareMathOperator*{\argmax}{arg\,max}
31 | \DeclareMathOperator*{\avg}{avg}
32 | \newcommand{\dif}{\mathop{}\!\mathrm{d}}
33 | \newcommand{\defeq}{%
34 | \mathrel{\overset{\makebox[0pt]{\mbox{\normalfont\tiny\sffamily def}}}{=}}}
35 |
36 | \newcommand{\Fstar}{F^{*}}
37 | \newcommand{\vx}{\vec{x}}
38 | \newcommand{\vp}{\vec{p}}
39 |
40 | %%% --->
41 | % more math operators added by Ionizing
42 | % partially copied (with modification) from commath.sty
43 | %%% <---
44 |
45 | % derivative in fractional form, i.e. $\frac{\dif }{\dif x}$
46 | \newcommand{\fdif}[3][] { %
47 | \ensuremath{ %
48 | \ifinner
49 | \tfrac{\dif{^{#1}} #2}{\dif{#3^{#1}}}
50 | \else
51 | \dfrac{\dif{^{#1}} #2}{\dif{#3^{#1}}}
52 | \fi
53 | }}
54 |
55 | % partial derivative (in higher order)
56 | \newcommand{\pdif}{\mathop{}\!\partial}
57 |
58 | % partial derivative in fractional form
59 | \newcommand{\fpdif}[3][] { %
60 | \ensuremath{ %
61 | \ifinner
62 | \tfrac{\pdif{^{#1}} #2}{\pdif{#3^{#1}}}
63 | \else
64 | \dfrac{\pdif{^{#1}} #2}{\pdif{#3^{#1}}}
65 | \fi
66 | }}
67 |
68 | % mixed partial derivative
69 | \newcommand{\mpdif}[6]{ %
70 | \ensuremath{ %
71 | \ifinner
72 | \tfrac{\pdif{^{#2}} #1}{\partial{#3^{#4}}\partial{#5^{#6}}}
73 | \else
74 | \dfrac{\pdif{^{#2}} #1}{\partial{#3^{#4}}\partial{#5^{#6}}}
75 | \fi
76 | }}
77 |
78 | % Hamiltonian and Lagrange operators
79 | \newcommand{\Hamilton}{ %
80 | \ensuremath{ %
81 | \mathscr{H}
82 | }}
83 |
84 | \newcommand{\Lagrange}{ %
85 | \ensuremath{ %
86 | \mathscr{L}
87 | }}
88 |
89 |
90 | %%% --->
91 | % text defines and shortcuts
92 | %%% <---
93 |
94 | \newcommand{\func}{\texttt}
95 | \newcommand{\file}{\textsf}
96 | \newcommand{\cmd}[1]{\texttt{\string#1}}
97 | % \newcommand{\clp}{\relax}
98 | \newcommand{\clp}{\clearpage}
99 |
100 | %%% --->
101 | % frontpage
102 | %%% <---
103 | \newcommand{\makefrontpage}{%
104 | \FullPageBGPicture{book-bg.jpg}%
105 | \pagestyle{fancy}%
106 | {\maketitle}%
107 | \thispagestyle{empty}%
108 | \clearpage
109 | \setcounter{page}{1}
110 | }
111 |
--------------------------------------------------------------------------------
/global_setup/packages.tex:
--------------------------------------------------------------------------------
1 | \usepackage[scheme = chinese, linespread = 1, heading = true]{ctex}
2 | \usepackage[OT1]{fontenc}
3 | \usepackage{lxfonts}
4 | \usepackage{hyperref}
5 | \usepackage[inline]{enumitem}
6 | \usepackage{amsmath}
7 | \usepackage{amsthm}
8 | \usepackage{bm}
9 | \usepackage{mathtools}
10 | \usepackage{amssymb}
11 | \usepackage{xfrac}
12 | \usepackage{array}
13 | \usepackage{booktabs}
14 | \usepackage{tabu}
15 | \usepackage{colortbl}
16 | \usepackage{makecell}
17 | \usepackage{geometry}
18 | \usepackage{tikz}
19 | \usepackage{xcolor}
20 | \usepackage{eso-pic}
21 | \usepackage{mwe}
22 | \usepackage{mathdots}
23 | \usepackage{graphicx}
24 | \usepackage{animate}
25 | \usepackage{caption}
26 | \usepackage{algorithm}
27 | \usepackage{algpseudocode}
28 | \usepackage{xfrac}
29 | \usepackage{xpatch}
30 | \usepackage{listings}
31 | \usepackage{etoolbox}
32 | \usepackage{fancyhdr}
33 |
34 | % added by Ionizing
35 | \usepackage{mathrsfs} % \mathscr{H} & \mathscr{L}
36 |
--------------------------------------------------------------------------------
/global_setup/settings.tex:
--------------------------------------------------------------------------------
1 | %%% --->
2 | % listings settings
3 | %%% <---
4 | \makeatletter
5 | \renewcommand{\ALG@name}{伪代码}
6 | \makeatother
7 |
8 | % \renewcommand{\lstlistingname}{Code Snippet}
9 | \renewcommand{\lstlistingname}{代码片段}
10 | \lstdefinestyle{lfonts}{
11 | basicstyle = \scriptsize\ttfamily,
12 | stringstyle = \color{purple},
13 | keywordstyle = \color{blue!60!black}\bfseries,
14 | commentstyle = \color{olive}\scshape,
15 | }
16 | \lstdefinestyle{lnumbers}{
17 | numbers = left,
18 | numberstyle = \tiny,
19 | numbersep = 1em,
20 | firstnumber = 1,
21 | stepnumber = 1,
22 | }
23 | \lstdefinestyle{llayout}{
24 | breaklines = true,
25 | tabsize = 2,
26 | columns = spacefixed,
27 | }
28 | \lstdefinestyle{lgeometry}{
29 | xleftmargin = 20pt,
30 | xrightmargin = 0pt,
31 | frame = tb,
32 | framesep = \fboxsep,
33 | framexleftmargin = 20pt,
34 | }
35 | \lstdefinestyle{lgeneral}{
36 | style = lfonts,
37 | style = lnumbers,
38 | style = llayout,
39 | style = lgeometry,
40 | }
41 | \lstdefinestyle{lmathescape}{
42 | mathescape = true,
43 | escapechar = \%,
44 | }
45 | \lstdefinestyle{lcpp}{
46 | language = {C++},
47 | style = {lgeneral},
48 | morekeywords = {constexpr, noexcept, nullptr, override}
49 | }
50 | \lstdefinestyle{lltx}{
51 | language = {[LaTeX]TeX},
52 | style = {lgeneral},
53 | }
54 | \lstdefinestyle{lpy}{
55 | language = {Python},
56 | style = {lgeneral},
57 | }
58 | \lstdefinestyle{lsh}{
59 | language = {sh},
60 | style = {lgeneral},
61 | }
62 | \lstdefinestyle{ljava}{
63 | language = {Java},
64 | style = {lgeneral},
65 | }
66 |
67 | %%% --->
68 | % list environment settings
69 | %%% <---
70 | \setlist{nosep}
71 | \setlist[description]{itemsep = 0.5ex}
72 |
73 | %%% --->
74 | % figure and TikZ settings
75 | %%% <---
76 | \graphicspath{{./figures/}{./global_figures/}}
77 |
78 | \usetikzlibrary{arrows.meta}
79 | \usetikzlibrary{shapes, arrows}
80 | \usetikzlibrary{positioning}
81 | \tikzstyle{decision} = [diamond, draw, fill=blue!20,
82 | text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
83 | \tikzstyle{block} = [rectangle, draw, fill=blue!20,
84 | text width = 4pc, text centered, rounded corners, minimum height = 2pc]
85 | \tikzstyle{line} = [draw, -latex']
86 | \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
87 | minimum height=2em]
88 | \tikzstyle{autocircle} = [circle, draw = black, fill = gray!30, inner sep = 5pt, minimum size = 0.4cm]
89 | \tikzset{global scale/.style={
90 | scale=#1,
91 | every node/.append style={scale=#1}
92 | }
93 | }
94 | \tikzset{global xscale/.style={
95 | xscale=#1,
96 | every node/.append style={xscale=#1}
97 | }
98 | }
99 | \tikzset{global yslant/.style={
100 | yslant=#1,
101 | every node/.append style={yslant=#1}
102 | }
103 | }
104 |
105 | %%% --->
106 | % sectioning settings
107 | %%% <---
108 | \AtBeginDocument{\setcounter{secnumdepth}{0}}
109 | \ctexset{section/format += \raggedright}
110 |
111 | %%% --->
112 | % geometry and layout settings
113 | %%% <---
114 | \setlength{\parindent}{0pt}
115 | \addtolength{\parskip}{1ex}
116 | % \geometry{margin = 1in}
117 | \geometry{papersize={14.4cm, 10.8cm}, margin = 0.65in}
118 |
119 | %%% --->
120 | % hyperreference settings
121 | %%% <---
122 | \hypersetup{hidelinks}
123 |
124 | %%% --->
125 | % theorem environment settings
126 | %%% <---
127 | \newtheorem{note}{提示}
128 | \newtheorem*{note*}{提示}
129 |
130 | %%% --->
131 | % sectioning settings
132 | %%% <---
133 | \ctexset{paragraph/beforeskip = {0pt}}
134 |
135 | %%% --->
136 | % header & footer settings
137 | %%% <---
138 | \lhead{\relax}
139 | % \lhead{\raisebox{-.5ex}{\textcolor{black}{\large\bfseries\leftmark}}}
140 | \chead{\relax}
141 | \rhead{\relax}
142 | % \rhead{\raisebox{-.5ex}{\makebox[0pt][l]{\quad\large\textcolor{black}{\thepage}}}}
143 | \lfoot{\relax}
144 | \cfoot{\relax}
145 | \rfoot{\relax}
146 | \renewcommand{\headrulewidth}{0pt}
147 |
--------------------------------------------------------------------------------