Debian Codegraph @

texmf-dist/doc/latex/elegantnote/elegantnote-cn.tex

raw
1 \documentclass[cn,hazy,blue,14pt,screen]{elegantnote}
2 \title{ElegantNote:一个优美的 \LaTeX{} 笔记模板}
3
4 \author{作者}
5 \institute{Elegant\LaTeX{} Program}
6
7 \version{2.60}
8 \date{\zhdate{2026/2/27}}
9
10 \usepackage{array}
11
12 \begin{document}
13
14 \maketitle
15
16 \centerline{
17 \includegraphics[width=0.2\textwidth]{logo-blue.png}
18 }
19
20 \section{ElegantNote 使用说明}
21
22 \textbf{\textcolor{red}{\bfseries 本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}}
23
24 新版 ElegantNote 是基于标准的 \LaTeX{} 文类 article 重新设计的,格式更加简化的笔记模板!本模板支持两种编译方式,\hologo{pdfLaTeX} 和 \hologo{XeLaTeX},英文模式下请使用 \hologo{pdfLaTeX} 进行编译,中文模式下务必使用 \hologo{XeLaTeX}。
25
26 新模板有下面几个特性:
27
28 \begin{itemize}
29 \item 纸张模式:护眼模式(geye)和朦胧模式(hazy);
30 \item 适配不同设备,包括 Pad(默认),Screen(幻灯片),Kindle,PC(双页),通用(A4 纸张);
31 \item 5 套颜色主题,分别是:\textcolor{eblue}{blue}(默认)、\textcolor{egreen}{green}、\textcolor{ecyan}{cyan}、 \textcolor{sakura}{sakura} 和 \textcolor{black}{black};
32 \item 语言支持:中文(默认),英文;
33 \item 支持 \hologo{pdfLaTeX} 和 \hologo{XeLaTeX} 编译;
34 \item 更加美观的图表标题格式,列表环境,数学字体等;
35 \item 全局字体大小支持:8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 和 20pt;
36 \item 支持 \lstinline{newtx} 以及 \lstinline{mtpro2} 数学字体设置;
37 \item 中文字体支持方正字体或者自定义字体;
38 \item 英文模式通过 \lstinline{bibstyle} 选项(默认为 \lstinline{apalike})支持参考文献格式修改;
39 \item 支持参考格式显示格式修改 \lstinline{cite} 可选为 \lstinline{authoryear}、\lstinline{numbers} (默认)和 \lstinline{super}。
40 \end{itemize}
41
42 \subsection{模板模式}
43
44 本模板增加了模式选项,分别有护眼模式(\lstinline{mode=geye})和朦胧模式(\lstinline{mode=hazy})。其中护眼模式设置纸张底色为绿豆沙颜色,而朦胧模式为淡蓝色,开启的方法如下:
45 \begin{lstlisting}[frame=none]
46 \documentclass[geye]{elegantnote} % or
47 \documentclass[mode=geye]{elegantnote}
48 \documentclass[hazy]{elegantnote} % or
49 \documentclass[mode=hazy]{elegantnote}
50 \end{lstlisting}
51
52 \begin{remark}
53 如果你想为自己的文档添加底色,可以在导言区添加下面设置:
54 \begin{lstlisting}
55 \definecolor{geyecolor}{RGB}{199,237,204}
56 \pagecolor{geyecolor}
57 \end{lstlisting}
58 \end{remark}
59
60
61 \subsection{设备选择}
62
63 为了让笔记方便在不同设备上阅读,免去切边,缩放等操作,本模板适配不同的设备,分别为 Pad(默认),Kindle,PC,A4。
64
65 \textcolor{red}{\kaishu 新增}:为了方便展示笔记,2.20 版本新增了 \lstinline{device=screen} 设备选项,大小为 MS Powerpoint 的纸张大小,比例为 4:3(2019/12/06)。
66
67 不同屏幕的选择为
68 \begin{lstlisting}[frame=none]
69 \documentclass[device=pad]{elegantnote} % ipad screen size
70 \documentclass[device=kindle]{elegantnote} % kindle screen size
71 \documentclass[device=pc]{elegantnote} % double pages for pc
72 \documentclass[device=normal]{elegantnote} % a4 normal page
73 \documentclass[device=screen]{elegantnote} % 4:3 PPT size
74 \end{lstlisting}
75 \begin{note}
76 也可以采取直接赋值的方法选择屏幕,比如:
77 \end{note}
78 \begin{lstlisting}[frame=none]
79 \documentclass[pad]{elegantnote}
80 \documentclass[kindle]{elegantnote}
81 \documentclass[pc]{elegantnote}
82 \documentclass[normal]{elegantnote}
83 \documentclass[screen]{elegantnote}
84 \end{lstlisting}
85
86 \begin{note}
87 如果想要正常的 A4 大小的 PDF,需要选择 \lstinline{device=normal}。
88 \end{note}
89
90
91 \subsection{数学字体选项}
92
93 本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个:
94 \begin{enumerate}
95 \item \lstinline{math=cm}(默认),使用 \LaTeX{} 默认数学字体(推荐,无需声明);
96 \item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。
97 \item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。
98 \end{enumerate}
99
100
101 \subsection{中文字体选项}
102 模板提供中文字体选项 \lstinline{chinesefont},可选项有
103 \begin{enumerate}
104 \item \lstinline{ctexfont}:默认选项,使用 \lstinline{ctex} 宏包根据系统自行选择字体,可能存在字体缺失的问题,更多内容参考 \lstinline{ctex} 宏包\href{https://ctan.org/pkg/ctex}{官方文档}\footnote{可以使用命令提示符,输入 \lstinline{texdoc ctex} 调出本地 \lstinline{ctex} 宏包文档}。
105 \item \lstinline{founder}:方正字体选项(需要用户安装字体),调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,然后设置字体为方正四款免费字体,方正字体下载注意事项见后文。
106 \item \lstinline{nofont}:调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
107 \end{enumerate}
108
109 \noindent \textbf{注意:} 使用 \lstinline{founder} 选项或者 \lstinline{nofont} 时,必须使用 \hologo{XeLaTeX} 进行编译。
110
111 \subsubsection{方正字体选项}
112 由于使用 \lstinline{ctex} 宏包默认调用系统已有的字体,部分系统字体缺失严重,因此,用户希望能够使用其它字体,我们推荐使用方正字体。方正的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}、{\fangsong 方正仿宋}四款字体均可免费试用,且可用于商业用途。用户可以自行从\href{http://www.foundertype.com/}{方正字体官网}下载此四款字体,在下载的时候请\textbf{务必}注意选择 GBK 字符集,也可以使用 \href{https://www.latexstudio.net/}{\LaTeX{} 工作室}提供的\href{https://pan.baidu.com/s/1BgbQM7LoinY7m8yeP25Y7Q}{方正字体,提取码为:njy9} 进行安装。安装时,{\kaishu Win 10 用户请右键选择为全部用户安装,否则会找不到字体。}
113
114 \begin{figure}[!htb]
115 \centering
116 \includegraphics[width=0.9\textwidth]{founder.png}
117 \end{figure}
118
119 \subsubsection{其他中文字体}
120 如果你想完全自定义字体\footnote{这里仍然以方正字体为例。},你可以选择 \lstinline{chinesefont=nofont},然后在导言区设置,参考代码如下:
121 \begin{lstlisting}
122 \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
123 \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
124 \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
125 \setCJKfamilyfont{zhsong}{FZShuSong-Z01}
126 \setCJKfamilyfont{zhhei}{FZHei-B01}
127 \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
128 \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
129 \newcommand*{\songti}{\CJKfamily{zhsong}}
130 \newcommand*{\heiti}{\CJKfamily{zhhei}}
131 \newcommand*{\kaishu}{\CJKfamily{zhkai}}
132 \newcommand*{\fangsong}{\CJKfamily{zhfs}}
133 \end{lstlisting}
134
135
136 \subsection[颜色主题]{颜色主题\footnote{测试章节脚注。}}
137
138 本模板内置 5 套颜色主题,分别是 \textcolor{eblue}{blue}(默认),\textcolor{egreen}{green}, \textcolor{ecyan}{cyan}, \textcolor{sakura}{sakura} 和 \textcolor{black}{black}。如果不需要颜色,可以选择黑色(black)主题。颜色主题的设置方法:
139 \begin{lstlisting}[frame=none]
140 \documentclass[green]{elegantnote}
141 \documentclass[color=green]{elegantnote}
142 ...
143 \documentclass[black]{elegantnote}
144 \documentclass[color=black]{elegantnote}
145 \end{lstlisting}
146
147
148 \subsection{语言模式}
149
150 本模板内含两套语言环境,改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
151 \begin{lstlisting}[frame=none]
152 \documentclass[cn]{elegantnote}
153 \documentclass[lang=cn]{elegantnote}
154 \documentclass[en]{elegantnote}
155 \documentclass[lang=en]{elegantnote}
156 \end{lstlisting}
157
158 \begin{note}
159 只有中文模式才可输入中文,如果需要在英文模式下输入中文,可以自行添加 \lstinline{ctex} 宏包\footnote{需要使用 \lstinline{scheme=plain} 选项才不会把标题改为中文。}或者使用 \lstinline{xeCJK} 宏包设置字体。另外如果在笔记中使用了抄录环境(\lstinline{lstlisting}),并且里面有中文字符,请务必使用 \hologo{XeLaTeX} 编译。
160 \end{note}
161
162
163 \subsection{定理类环境}
164
165 此模板采用了 \lstinline{amsthm} 中的定理样式,使用了 4 类定理样式,所包含的环境分别为
166 \begin{itemize}
167 \item \textbf{定理类}:theorem,lemma,proposition,corollary;
168 \item \textbf{定义类}:definition,conjecture,example;
169 \item \textbf{备注类}:remark,note,case;
170 \item \textbf{证明类}:proof。
171 \end{itemize}
172
173 \begin{remark}
174 在选用 \lstinline{lang=cn} 时,定理类环境的引导词全部会改为中文。
175 \end{remark}
176
177
178 \section{写作示例}
179
180 我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$ 是 $\mathcal{R}^n$ 中的可测集。
181
182 \begin{definition}[可积性]
183 设 $ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$ 是 $E$ 上的非负简单函数,其中 $\{A_1,A_2,\ldots$, $A_k\}$ 是 $E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$ 在 $E$ 上的积分为 1. 3
184 \begin{equation}
185 \label{inter}
186 \int_{E} f dx = \sum_{i=1}^k a_i m(A_i).
187 \end{equation}
188 一般情况下 $0 \leq \int_{E} f dx \leq \infty$。若 $\int_{E} f dx < \infty$,则称 $f$ 在 $E$ 上可积。
189 \end{definition}
190
191 一个自然的问题是,Lebesgue 积分与我们所熟悉的 Riemann 积分有什么联系和区别?之后我们将详细讨论 Riemann 积分与 Lebesgue 积分的关系。这里只看一个简单的例子。设 $D(x)$ 是区间 $[0,1]$ 上的 Dirichlet 函数。即 $D(x)=\chi_{Q_0}(x)$,其中 $Q_0$ 表示 $[0,1]$ 中的有理数的全体。根据非负简单函数积分的定义,$D(x)$ 在 $[0,1]$ 上的 Lebesgue 积分为
192 \begin{equation}\label{inter2}
193 \int_0^1 D(x)dx = \int_0^1 \chi_{Q_0} (x) dx = m(Q_0) = 0
194 \end{equation}
195 即 $D(x)$ 在 $[0,1]$ 上是 Lebesgue 可积的并且积分值为零。但 $D(x)$ 在 $[0,1]$ 上不是 Riemann 可积的。
196
197 \begin{table}[htbp]
198 \centering
199 \small
200 \caption{燃油效率与汽车价格}
201 \begin{tabular}{lcc}
202 \toprule
203 & (1) & (2) \\
204 \midrule
205 燃油效率 & -238.90*** & -49.51 \\
206 & (53.08) & (86.16) \\
207 汽车重量 & & 1.75*** \\
208 & & (0.641) \\
209 常数项 & 11253.00*** & 1946.00 \\
210 & (1171.00) & (3597.00) \\
211 观测数 & 74 & 74 \\
212 $R^2$ & 0.220 & 0.293 \\
213 \bottomrule
214 \end{tabular}%
215 \label{tab:reg}%
216 \end{table}%
217
218 \begin{theorem}[Fubini 定理]\label{thm:fubi}
219 若 $f(x,y)$ 是 $\mathcal{R}^p\times\mathcal{R}^q$ 上的非负可测函数,则对几乎处处的 $x\in \mathcal{R}^p$,$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的非负可测函数,$g(x)=\int_{\mathcal{R}^q}f(x,y) dy$ 是 $\mathcal{R}^p$ 上的非负可测函数。并且
220 \begin{equation}\label{eq:461}
221 \int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx.
222 \end{equation}
223 \end{theorem}
224
225 \begin{proof}
226 Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and $z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh = z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$, and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required.
227 \end{proof}
228
229
230 回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。根据定理~\ref{thm:fubi},其运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。
231
232
233 \section{致谢}
234
235 特别感谢 \href{https://github.com/sikouhjw}{sikouhjw} 和 \href{https://github.com/syvshc}{syvshc} 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 Elegant\LaTeX{} 相关问题的回复。特别感谢 China\TeX{} 以及 \href{http://www.latexstudio.net/}{\LaTeX{} 工作室} 对于本系列模板的宣传与推广。
236
237 如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。
238
239 \section{常见问题 FAQ}
240
241 \begin{enumerate}[label=\arabic*).]
242 \item \textit{如何删除版本信息?}\\
243 导言区不写 \lstinline|\version{x.xx}| 即可。
244 \item \textit{如何删除日期?}\\
245 与版本 \lstinline{\version} 不同的是,导言区不写或注释 \lstinline{\date} 的话,仍然会打印出当日日期,原因是 \lstinline{\date} 有默认参数。如果不需要日期的话,日期可以留空即可,也即 \lstinline|\date{}|。
246 \item \textit{如何获得中文日期?}\\
247 为了获得中文日期,必须在中文模式下,使用 \lstinline|\date{\zhdate{2019/12/09}}|,如果需要当天的汉化日期,可以使用 \lstinline|\date{\zhtoday}|,这两个命令都来源于 \href{https://ctan.org/pkg/zhnumber}{\lstinline{zhnumber}} 宏包。
248 \item \textit{如何添加多个作者?}\\
249 在 \lstinline{\author} 里面使用 \lstinline{\and},作者单位可以用 \lstinline{\\} 换行。
250 \begin{lstlisting}
251 \author{author 1\\ org. 1 \and author 2 \\ org. 2 }
252 \end{lstlisting}
253 \end{enumerate}
254
255 %\printbibliography[heading=bibintoc, title=\ebibname]
256
257 \end{document}