renew 3.06

This commit is contained in:
EthanDeng
2019-02-25 00:55:40 +08:00
parent a6617a8259
commit baf92783b1
6 changed files with 270 additions and 163 deletions

View File

@@ -1,4 +1,4 @@
\documentclass[green,cn]{elegantbook}
\documentclass[cn]{elegantbook}
\title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作}
@@ -15,8 +15,10 @@
\begin{document}
\maketitle
%\pagenumbering{arabic}
\tableofcontents
\clearpage
\thispagestyle{empty}
\mainmatter
\hypersetup{pageanchor=true}
@@ -54,16 +56,15 @@
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的。默认编码为 UTF-8推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2018支持 \lstinline{PDFLaTeX} 以及 \lstinline{XeLaTeX} 编译。
\subsection[选择 PDFLaTeX 编译]{选择 \lstinline{PDFLaTeX} 编译}
如果你使用 \lstinline{PDFLaTeX} 编译,默认的 Computer Modern 字体被换成了 \lstinline{newtx} 系列字体,默认的字体字号是 11 pt。关于字体设置的宏包主要用到了
如果你使用 \lstinline{PDFLaTeX} 编译,默认的 Computer Modern 字体被换成了 \lstinline{newtx} 系列字体,默认的字体字号是 12 pt。关于字体设置的宏包主要用到了
\begin{itemize}
\item \lstinline{newtxtext} 用于文档正文字体,类似于 Times New Roman 字体。
\item \lstinline{newtxmath} 用于数学字体,搭配 \lstinline{newtxtext} 非常合适。
\item \lstinline{FiraMono} 用于打字机字体,并使用了 \lstinline{scale=0.8} 选项。
\item \lstinline{FiraMono} 用于打字机字体,并使用了 \lstinline{scale=0.7} 选项。
\item \lstinline{ctex} 用于中文字体设置,并使用了 \lstinline{scheme=plain} 选项。
\end{itemize}
一次完整的编译:\lstinline[breaklines]{PDFLaTeX -> BibTeX -> PDFLaTeX*2}
\subsection[选择 XeLaTeX 编译]{选择 \lstinline{XeLaTeX} 编译}
如果你选择 \lstinline{XeLaTeX} 编译的话,那么设置字体的宏包为 \lstinline{fontspec}\lstinline{xeCJK}。由于模板中使用的字体是 Windows 中的字体,所以如果你使用其他操作系统,比如 Linux 或者 Mac OS那么你需要把所用字体替换为你系统中的字体。设置字体的命令
@@ -72,12 +73,12 @@
\RequirePackage[no-math]{fontspec}
\setmainfont{Times New Roman}[NFSSFamily=ntxtlf]
\setsansfont{Arial}
%\setmonofont[Scale=0.9]{Courier New}
%\setmonofont[Scale=0.7]{Courier New}
\RequirePackage{xeCJK}
\RequirePackage{xunicode}
\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}
\setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi}
\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.9]{Microsoft YaHei}
\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.7]{Microsoft YaHei}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
\RequirePackage{newtxmath}
@@ -87,7 +88,8 @@
\section{语言模式}
本模板内含两套语言环境,改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
\begin{lstlisting}[frame=none]
\begin{lstlisting}[frame=single]
\documentclass[cn]{elegantbook}
\documentclass[lang=cn]{elegantbook}
\documentclass[en]{elegantbook}
@@ -107,7 +109,7 @@
\documentclass[color=green]{elegantbook}
\end{lstlisting}
其中 \textcolor{gray}{plain} 主题为全灰色。如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 main、second、third 颜色,具体方法如下:
其中 \textcolor{gray}{plain} 主题为全灰色。如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 main、second、third 颜色,具体方法如下:
\begin{lstlisting}[frame=single]
\definecolor{main}{RGB}{70,70,70}
@@ -116,7 +118,7 @@
\end{lstlisting}
\begin{table}[htp]
\caption{ElegantBook 模板中的三套颜色主题\label{tab:color thm}}
\caption{ElegantBook 模板中的颜色主题\label{tab:color thm}}
\centering
\begin{tabular}{ccccc}
\toprule
@@ -148,7 +150,7 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru
\item \textit{定理类环境},包含标题和内容两部分,全部定理类环境的编号均以章节编号。根据格式的不同分为 3 种
\begin{itemize}
\item \textcolor{main}{\textbf{definition}} 环境,颜色为 \textcolor{main}{main}
\item \textcolor{second}{\textbf{theorem、lemma、corollary}} 环境,颜色为主颜色 \textcolor{second} {second}
\item \textcolor{second}{\textbf{theorem、lemma、corollary}} 环境,颜色为 \textcolor{second} {second}
\item \textcolor{third}{\textbf{proposition}} 环境,颜色为 \textcolor{third}{third}
\end{itemize}
\item \textit{示例类环境},有 \textbf{example、exercise、problem} 环境(对应于例,练习,例题),自动编号,编号以章节为单位。
@@ -172,20 +174,31 @@ The content of theorem.
\end{theorem}
其他相同用法的定理类环境有:
\begin{itemize}
\item 定义definition环境前缀为\lstinline{def}
\item 定理theorem环境前缀为\lstinline{thm}
\item 引理lemma环境前缀为\lstinline{lem}
\item 推论corrlary环境前缀为\lstinline{cor}
\item 命题proposition环境前缀为\lstinline{pro}
\end{itemize}
\begin{table}[htbp]
\centering
\caption{定理类环境}
\begin{tabular}{llll}
\toprule
环境名 & 标签名 & 前缀 & 交叉引用 \\
\midrule
definition & label & def & \lstinline|\ref{def:label}| \\
theorem & label & thm & \lstinline|\ref{thm:label}| \\
lemma & label & lem & \lstinline|\ref{lem:label}| \\
corrlary & label & cor & \lstinline|\ref{cor:label}| \\
proposition & label & pro & \lstinline|\ref{pro:label}| \\
\bottomrule
\end{tabular}%
\label{tab:theorem-class}%
\end{table}%
\subsection{其他数学环境的使用}
其他三种数学环境因为没有选项,可以直接使用,比如 \lstinline{example} 环境的使用:
\begin{lstlisting}[frame=single]
\begin{example}
This is the content of example environment.
This is the content of example environment.
\end{example}
\end{lstlisting}
@@ -200,13 +213,13 @@ This is the content of example environment.
这几个都是同一类环境,区别在于
\begin{itemize}
\item 示例example环境、练习exercise与例题problem会自动以章节编号;
\item 示例环境example、练习exercise与例题problem章节自动编号;
\item 注意note环境有提醒引导符证明proof环境有证明结束符
\item 结论conclusion等环境都是普通段落环境除了引导词加粗没有其他格式
\item 结论conclusion等环境都是普通段落环境引导词加粗。
\end{itemize}
\section{关于图片}
\section{封面和徽标}
本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX{} 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.befunky.com/create/crop-photo/}{befunky.com}
@@ -245,7 +258,10 @@ This is the content of example environment.
\section{参考文献}
此模板使用了 Bib\TeX{} 来生成参考文献,默认使用的文献样式 aer 样式。参考文献示例:~\cite{Chen2018} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。你可以在谷歌学术MendeleyEndnote 中获得文献条目bib item然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候引用它们的键值bib key即可。注意需要在编译的过程中添加 Bib\TeX{} 编译。
此模板使用了 Bib\TeX{} 来生成参考文献,默认使用的文献样式bib style\lstinline{aer}。参考文献示例:~\cite{Chen2018} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。
你可以在谷歌学术MendeleyEndnote 中获得文献条目bib item然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候引用它们的键值bib key即可。注意需要在编译的过程中添加 Bib\TeX{} 编译。如果你想在参考文献中添加未引用的文献,可以使用
\section{添加序章}
@@ -332,7 +348,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
柯西列的性质
\begin{enumerate}
\item $\{x_k\}$ 是柯西列,则其子列 $\{x_k^i\}$ 也是柯西列。
\item $x_k\in \mathcal{R}^n$$\rho(x,y)$ 是欧几里得空间,则柯西列收敛$(\mathcal{R}^n,\rho)$ 空间是完备的。
\item $x_k\in \mathcal{R}^n$$\rho(x,y)$ 是欧几里得空间,则柯西列收敛,$(\mathcal{R}^n,\rho)$ 空间是完备的。
\end{enumerate}
\end{property}
@@ -357,4 +373,41 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n
\end{equation}
\chapter{最小示例}
\begin{lstlisting}[frame=single]
\documentclass{elegantbook}
% title info
\title{Title}
\subtitle{Subtitle is here}
% bio info
\author{Your Name}
\institute{XXX University}
\date{\today}
% extra info
\version{1.00}
\equote{Victory won\rq t come to us unless we go to it. --- M. Moore}
\logo{logo.png}
\cover{cover.jpg}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\hypersetup{pageanchor=true}
% add preface chapter here if needed
\chapter{Example Chapter Title}
The content of chapter one.
\bibliography{reference}
\appendix
\chapter{Appendix Chapter Title}
The content of appendix 1.
\end{document}
\end{lstlisting}
\end{document}