diff --git a/elegantbook-cn.pdf b/elegantbook-cn.pdf index ea564b0..7eff96b 100644 Binary files a/elegantbook-cn.pdf and b/elegantbook-cn.pdf differ diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 43ee994..7f6fc62 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,4 +1,4 @@ -\documentclass[cn,fancy,blue,11pt]{elegantbook} +\documentclass[cn,11pt,fancy]{elegantbook} \title{ElegantBook:优美的 \LaTeX{} 书籍模板} @@ -14,7 +14,7 @@ \logo{logo.png} \cover{cover.jpg} -\usepackage[authoryear]{gbt7714} + \begin{document} \maketitle @@ -26,9 +26,7 @@ \hypersetup{pageanchor=true} \chapter{Elegant\LaTeX{} 系列模板介绍} -Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。Elegant\LaTeX{} 系列模板目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。如果你在使用本模板,推荐最新版本!最新正式版下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github}。本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 Github 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件\footnote{\email{elegantlatex2e@gmail.com}.}联系我们。 - - +Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。如果你在使用本模板,推荐最新版本!最新正式版下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github}。本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 Github 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件\footnote{\email{elegantlatex2e@gmail.com}.}联系我们。最近我们新建了一个 QQ 用户交流群(Q 群:692108391),欢迎加入。 \section{ElegantBook 更新说明} 在这几年间,我们收到了很多用户的反馈,主要的问题涉及到字体安装,编码支持,定理浮动,定理跨页,交叉引用等等。我们思前想后,原先让用户安装字体以追求视觉上的美观并不完美,用户陷入了巨大的麻烦,这违背了我们的模板初衷。因此我们在新版中删除了这部分,用户无需安装任何字体。ElegantBook 3.x 版本更新的主要内容有: @@ -73,6 +71,7 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \end{remark} + \section{颜色主题} 本模板内置 5 组颜色主题,分别为 \textcolor{main1}{\lstinline{green}}\footnote{为原先默认主题}、\textcolor{main2}{\lstinline{cyan}}、\textcolor{main3}{\lstinline{blue}}(默认)、\textcolor{main4}{\lstinline{gray}}、\textcolor{main5}{\lstinline{black}}。另外还有一个自定义的选项 \lstinline{nocolor}。调用颜色主题 \lstinline{green} 的方法为 \begin{lstlisting} @@ -85,11 +84,11 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \centering \begin{tabular}{ccccccc} \toprule - & \textcolor{main1}{green} - & \textcolor{main2}{cyan} - & \textcolor{main3}{blue} - & \textcolor{main4}{gray} - & \textcolor{main5}{black} + & \textcolor{structure1}{green} + & \textcolor{structure2}{cyan} + & \textcolor{structure3}{blue} + & \textcolor{structure4}{gray} + & \textcolor{structure5}{black} & 主要使用的环境\\ \midrule structure & \makecell{{\color{structure1}\rule{1cm}{1cm}}} @@ -104,7 +103,7 @@ main & \makecell{{\color{main1}\rule{1cm}{1cm}}} & \makecell{{\color{main3}\rule{1cm}{1cm}}} & \makecell{{\color{main4}\rule{1cm}{1cm}}} & \makecell{{\color{main5}\rule{1cm}{1cm}}} - & definition \ exercise \ problem \ solution \\ + & definition \ exercise \ problem \\ second & \makecell{{\color{second1}\rule{1cm}{1cm}}} & \makecell{{\color{second2}\rule{1cm}{1cm}}} @@ -204,6 +203,7 @@ The content of theorem. This is the content of example environment. \end{example} + 这几个都是同一类环境,区别在于 \begin{itemize} @@ -259,9 +259,9 @@ This is the content of example environment. \section{参考文献} -此模板使用了 \BibTeX{} 来生成参考文献,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:~\cite{en1} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 +此模板使用了 \hologo{BibTeX} 来生成参考文献,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:~\cite{en1} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 -你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \BibTeX{} 编译。如果你想在参考文献中添加未引用的文献,可以使用 +你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \hologo{BibTeX} 编译。如果你想添加未引用的文献,可以使用 \begin{lstlisting}[frame=single] \nocite{EINAV2010,Havrylchyk2018} %or include some bibitems \nocite{*} %include all the bibitems @@ -269,7 +269,7 @@ This is the content of example environment. \section{添加序章} -如果你想在第一章前面添序章,不改变原本章节序号,你可以在第一章内容前面使用 +如果你想在第一章前面添序章,不改变原本章节序号,可以在第一章内容前面使用 \begin{lstlisting} \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction} @@ -369,6 +369,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。 \end{conclusion} + \nocite{*} \bibliography{reference} @@ -419,4 +420,5 @@ The content of chapter one. \end{document} \end{lstlisting} + \end{document} diff --git a/elegantbook-en.pdf b/elegantbook-en.pdf index bc39d44..7b4889d 100644 Binary files a/elegantbook-en.pdf and b/elegantbook-en.pdf differ diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 8676f6d..e565c69 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -73,7 +73,7 @@ You can input Chinese Characters in either \lstinline{lang=en} or \lstinline{lan \section{Color Themes} -This template contains 5 color themes,they are \textcolor{main1}{\lstinline{green}}\footnote{original default theme.}、\textcolor{main2}{\lstinline{cyan}}、\textcolor{main3}{\lstinline{blue}}(default)、\textcolor{main4}{\lstinline{gray}}、\textcolor{main5}{\lstinline{black}}. You can choose \lstinline{green} with +This template contains 5 color themes,they are \textcolor{main1}{\lstinline{green}}\footnote{original default theme.}, \textcolor{main2}{\lstinline{cyan}}, \textcolor{main3}{\lstinline{blue}}(default), \textcolor{main4}{\lstinline{gray}}, \textcolor{main5}{\lstinline{black}}. You can choose \lstinline{green} with \begin{lstlisting} \documentclass[green]{elegantbook} %or \documentclass[color=green]{elegantbook} @@ -81,7 +81,7 @@ This template contains 5 color themes,they are \textcolor{main1}{\lstinline{gre \begin{table}[htbp] -\caption{ElegantBook Themes\label{tab:color thm}\label{tab:color thm}} +\caption{ElegantBook Themes\label{tab:color thm}} \centering \begin{tabular}{ccccccc} \toprule @@ -97,22 +97,19 @@ structure & \makecell{{\color{structure1}\rule{1cm}{1cm}}} & \makecell{{\color{structure3}\rule{1cm}{1cm}}} & \makecell{{\color{structure4}\rule{1cm}{1cm}}} & \makecell{{\color{structure5}\rule{1cm}{1cm}}} - & chapter \ section \ subsection \\ - + & chapter section subsection \\ main & \makecell{{\color{main1}\rule{1cm}{1cm}}} & \makecell{{\color{main2}\rule{1cm}{1cm}}} & \makecell{{\color{main3}\rule{1cm}{1cm}}} & \makecell{{\color{main4}\rule{1cm}{1cm}}} & \makecell{{\color{main5}\rule{1cm}{1cm}}} - & definition \ exercise \ problem \ solution \\ - + & definition exercise problem \\ second & \makecell{{\color{second1}\rule{1cm}{1cm}}} & \makecell{{\color{second2}\rule{1cm}{1cm}}} & \makecell{{\color{second3}\rule{1cm}{1cm}}} & \makecell{{\color{second4}\rule{1cm}{1cm}}} & \makecell{{\color{second5}\rule{1cm}{1cm}}} - & theorem \ lemma \ corollary\\ - + & theorem lemma corollary\\ third & \makecell{{\color{third1}\rule{1cm}{1cm}}} & \makecell{{\color{third2}\rule{1cm}{1cm}}} & \makecell{{\color{third3}\rule{1cm}{1cm}}} @@ -262,9 +259,9 @@ This template uses \lstinline{tikz} to customize \lstinline{itemize} and \lstinl \section{Bibliography} -This template uses \BibTeX{} to generate the bibliography, the default bibliography style is \lstinline{aer}. Let's take a glance at the citation effect, ~\cite{en1} use data from a major peer-to-peer lending marketplace in China to study whether female and male investors evaluate loan performance differently. +This template uses \hologo{BibTeX} to generate the bibliography, the default bibliography style is \lstinline{aer}. Let's take a glance at the citation effect, ~\cite{en1} use data from a major peer-to-peer lending marketplace in China to study whether female and male investors evaluate loan performance differently. -If you want to use \BibTeX{}, you must create a file named \lstinline{reference.bib}, and add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, and cite the bibkey in the \lstinline{tex} file. The Bib\TeX{} will automatically generate the bibliography for you for the reference you cited. If you want to add some noncited reference to the bibliography, you can use +If you want to use \hologo{BibTeX}, you must create a file named \lstinline{reference.bib}, and add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, and cite the bibkey in the \lstinline{tex} file. The Bib\TeX{} will automatically generate the bibliography for you for the reference you cited. If you want to add some noncited reference to the bibliography, you can use \begin{lstlisting} \nocite{EINAV2010, Havrylchyk2018} \end{lstlisting} @@ -359,7 +356,6 @@ Let's continue using our application training example. In this case, we'd want t \nocite{en1,en2,en3} - \bibliography{reference} \appendix @@ -369,7 +365,7 @@ This appendix covers some of the basic mathematics used in econometrics. We brie \section{Summation Operator and Description Statistics} -\textbf{Summation Operator} is an abbreviation used to express the summation of numbers, it plays an important role in statistics and econometrics analysis. If $\{x_i: i=1, 2, \ldots, n\}$ is a sequence of $n$ numbers, the summation of the $n$ numbers is: +\textbf{Summation Operator} is an abbreviation used to express the summation of numbers, it plays an important role in statistics and econometrics analysis. If $\{x_i: i=1, 2, \ldots, n\}$ is a sequence of $n$ numbers, the summation of the $n$ numbers is: \begin{equation} \sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n @@ -406,5 +402,5 @@ The content of chapter one. \end{document} \end{lstlisting} -\bibliographystyle{aer} + \end{document} diff --git a/elegantbook.cls b/elegantbook.cls index 9dbcc18..6219e44 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -4,12 +4,11 @@ %% %% This work may be distributed and/or modified freely %% available at https://github.com/ElegantLaTeX/ElegantBook -% % -%% Last Modification 2019-04-12 +% %%%%%%%%%%%%%%%%%%%%% % % !Mode:: "TeX:UTF-8" \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantbook}[2019/04/03 v3.07 ElegantBook document class] +\ProvidesClass{elegantbook}[2019/04/25 v3.07 ElegantBook document class] \RequirePackage{kvoptions} \RequirePackage{etoolbox} @@ -65,7 +64,9 @@ % fontsetting \PassOptionsToPackage{no-math}{fontspec} -\RequirePackage[UTF8, scheme=plain,punct=kaiming]{ctex} +\ifdefstring{\ELEGANT@lang}{cn}{ +\RequirePackage[UTF8, scheme=plain]{ctex} +} \RequirePackage{ifxetex} @@ -199,6 +200,11 @@ \newtoks\institute \newtoks\subtitle +\RequirePackage{natbib} +\setlength{\bibsep}{0.0pt} +\def\bibfont{\footnotesize} + + \RequirePackage{enumerate} % list/itemize/enumerate setting @@ -221,15 +227,10 @@ \RequirePackage{multicol} \RequirePackage{xcolor} \RequirePackage{fancyvrb} -\RequirePackage{makecell,lipsum,bxtexlogo,setspace} +\RequirePackage{makecell,lipsum,hologo,setspace} %%中文结构名字 -\ifdefstring{\ELEGANT@lang}{en}{ -\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} -\newcommand\tabref[1]{\textbf{Table}~\ref{#1}} -\renewcommand{\chaptername}{Chapter \thechapter} -}{\relax} \ifdefstring{\ELEGANT@lang}{cn}{ \renewcommand{\contentsname}{目\hspace{2em}录} \renewcommand{\figurename}{图} @@ -243,8 +244,15 @@ \newcommand\figref[1]{\textbf{图}~\ref{#1}} \newcommand\tabref[1]{\textbf{表}~\ref{#1}} \renewcommand{\chaptername}{第 \thechapter\;章} +\RequirePackage[authoryear]{gbt7714} +% \bibliographystyle{aer} +}{\relax} +\ifdefstring{\ELEGANT@lang}{en}{ +\newcommand\figref[1]{\textbf{Figure}~\ref{#1}} +\newcommand\tabref[1]{\textbf{Table}~\ref{#1}} +\renewcommand{\chaptername}{Chapter \thechapter} +\bibliographystyle{aer} }{\relax} - \graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} @@ -264,10 +272,6 @@ \setlist[itemize,2]{label={\eitemii}} \setlist[itemize,3]{label={\eitemiii}} -\RequirePackage{natbib} -\setlength{\bibsep}{0.0pt} -\def\bibfont{\footnotesize} - %% device settings @@ -410,9 +414,9 @@ {\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu}}% Body font {}% Indent amount {\bfseries\color{main}}% Theorem head font -{.}% Punctuation after theorem head -{.5em}% Space after theorem head -{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) +{}% Punctuation after theorem head +{0.5em}% Space after theorem head +{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) % -------------------------------------------------% \newtheoremstyle{ethmstyle}% {3pt}% Space above @@ -420,9 +424,9 @@ {\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu}}% Body font {}% Indent amount {\bfseries\color{second}}% Theorem head font -{.}% Punctuation after theorem head +{}% Punctuation after theorem head {.5em}% Space after theorem head -{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) +{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) % -------------------------------------------------% \newtheoremstyle{eprostyle}% {3pt}% Space above @@ -430,9 +434,9 @@ {\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\upshape\kaishu}}% Body font {}% Indent amount {\bfseries\color{third}}% Theorem head font -{.}% Punctuation after theorem head +{}% Punctuation after theorem head {.5em}% Space after theorem head -{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) +{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}% Theorem head spec (can be left empty, meaning ‘normal’) \theoremstyle{edefstyle} \newtheorem{edefinition}{\ifdefstring{\ELEGANT@lang}{en}{Definition}{定义}}[chapter] @@ -477,7 +481,7 @@ \newenvironment{example}[1][]{ \refstepcounter{exam}\par\noindent\textbf{\color{main}{ \ifdefstring{\ELEGANT@lang}{en}{Example}{例} - }~\theexam #1: }\rmfamily % + }\theexam #1 }\rmfamily % }{ \par\medskip\ignorespacesafterend % } @@ -489,7 +493,7 @@ \newenvironment{exercise}[1][]{ \refstepcounter{exer}\par\noindent\makebox[-3pt][r]{\scriptsize\color{red!90}\HandPencilLeft\quad}\textbf{\color{main}{ \ifdefstring{\ELEGANT@lang}{en}{Exercise}{练习} - }~\theexer #1: }\rmfamily % + }\theexer #1 }\rmfamily % }{ \par\medskip\ignorespacesafterend % } @@ -501,7 +505,7 @@ \newenvironment{problem}[1][]{ \refstepcounter{prob}\par\noindent\textbf{\color{main}{% \ifdefstring{\ELEGANT@lang}{en}{Problem}{例题} - }~\theprob #1: }\rmfamily % + }\theprob #1 }\rmfamily % }{ \par\medskip\ignorespacesafterend % } @@ -509,31 +513,31 @@ \newenvironment{note}{\par\noindent{\makebox[0pt][r]{\scriptsize\color{red!90}\textdbend\quad}\textbf{\color{second} - \ifdefstring{\ELEGANT@lang}{en}{Note:}{注意:} + \ifdefstring{\ELEGANT@lang}{en}{Note}{注意} }}\ifdefstring{\ELEGANT@lang}{en}{\itshape}{\kaishu}}{\par} \newenvironment{proof}{\par\noindent\textbf{\color{second} - \ifdefstring{\ELEGANT@lang}{en}{Proof:}{证明:} + \ifdefstring{\ELEGANT@lang}{en}{Proof}{证明} }\color{black!90}\small}{ %\hfill$\Box$\quad \par} \newenvironment{remark}{\noindent\textbf{\color{second} - \ifdefstring{\ELEGANT@lang}{en}{Remark:}{注:} + \ifdefstring{\ELEGANT@lang}{en}{Remark}{注} }}{\par} \newenvironment{assumption}{\par\noindent\textbf{\color{third} - \ifdefstring{\ELEGANT@lang}{en}{Assumption:}{假设:} + \ifdefstring{\ELEGANT@lang}{en}{Assumption}{假设} }}{\par} \newenvironment{conclusion}{\par\noindent\textbf{\color{third} - \ifdefstring{\ELEGANT@lang}{en}{Conclusion:}{结论:} + \ifdefstring{\ELEGANT@lang}{en}{Conclusion}{结论} }}{\par} \newenvironment{solution}{\par\noindent\textbf{\color{main} - \ifdefstring{\ELEGANT@lang}{en}{Solution:}{解:} + \ifdefstring{\ELEGANT@lang}{en}{Solution}{解} }}{\par} \newenvironment{property}{\par\noindent\textbf{\color{third} - \ifdefstring{\ELEGANT@lang}{en}{Property:}{性质:} + \ifdefstring{\ELEGANT@lang}{en}{Property}{性质} }}{\par} \newenvironment{custom}[1]{\par\noindent\textbf{\color{third} - \ifdefstring{\ELEGANT@lang}{en}{#1:}{#1:} + \ifdefstring{\ELEGANT@lang}{en}{#1}{#1} }}{\par} \ifdefstring{\ELEGANT@result}{noanswer}{ @@ -607,15 +611,15 @@ \vspace{-1.0cm} \setstretch{2.5} \hspace{2.5em} - \begin{minipage}[c]{0.68\linewidth} + \begin{minipage}[c]{0.67\linewidth} {\color{darkgray}\bfseries\Large \the\subtitle\\[2ex]} - \color{gray}\kaishu\normalsize + \color{gray}\normalsize {\renewcommand{\arraystretch}{0.618} \begin{tabular}{l} - \ifdefstring{\ELEGANT@lang}{en}{\textbf{Author: }}{\textbf{作者:}} \@author \\ - \ifdefstring{\ELEGANT@lang}{en}{\textbf{Institute: }}{\textbf{组织:}} \the\institute\\ - \ifdefstring{\ELEGANT@lang}{en}{\textbf{Date: }}{\textbf{时间:}} \@date\\ - \ifdefstring{\ELEGANT@lang}{en}{\textbf{Version: }}{\textbf{版本:}} \the\version\\ + \ifdefstring{\ELEGANT@lang}{en}{\textbf{Author: }}{\kaishu 作者:} \@author \\ + \ifdefstring{\ELEGANT@lang}{en}{\textbf{Institute: }}{\kaishu 组织:} \the\institute\\ + \ifdefstring{\ELEGANT@lang}{en}{\textbf{Date: }}{\kaishu 时间:} \@date\\ + \ifdefstring{\ELEGANT@lang}{en}{\textbf{Version: }}{\kaishu 版本:} \the\version\\ \end{tabular}} \end{minipage} \begin{minipage}[c]{0.27\linewidth} @@ -663,7 +667,4 @@ framerule=0.2pt, columns=flexible, % backgroundcolor=\color{lightgrey} -} - - - +} \ No newline at end of file diff --git a/reference.bib b/reference.bib index fd2c119..c487039 100644 --- a/reference.bib +++ b/reference.bib @@ -34,6 +34,7 @@ @article{cn1, author = {方军雄}, + key = {fang1 jun1 xiong2}, title = {{所有制、制度环境与信贷资金配置}}, journal = {经济研究}, number = {12}, @@ -45,6 +46,7 @@ @article{cn2, author = {刘凤良 and 章潇萌 and 于泽}, + key = {liu2 feng4 liang2 zhang1 xiao1 meng2 yu2 ze2}, title = {{高投资、结构失衡与价格指数二元分化}}, journal = {金融研究}, number = {02}, @@ -56,6 +58,7 @@ @article{cn3, author = {吕捷 and 王高望}, + key = {lv3 jie2 wang2 gao1 wang4}, title = {{CPI 与 PPI “背离”的结构性解释}}, journal = {经济研究}, volume = {50},