diff --git a/README.md b/README.md index 81bd0f4..ee36535 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantBook.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantBook.svg) -ElegantBook is designed for Books. Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues, pull requests or email us at elegantlatex2e@gmail.com. +ElegantBook is designed for Books. Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues, pull requests or contact us at elegantlatex2e@gmail.com. 如果你有其他问题、建议或者报告 bug,可以提交 issues 或者给我们发邮件:elegantlatex2e@gmail.com。 diff --git a/elegantbook-cn.pdf b/elegantbook-cn.pdf index d7f69cf..aa22cca 100644 Binary files a/elegantbook-cn.pdf and b/elegantbook-cn.pdf differ diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 32fe161..c047cd6 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -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 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 Bib\TeX{} 编译。 +此模板使用了 Bib\TeX{} 来生成参考文献,默认使用的文献样式(bib style)是 \lstinline{aer}。参考文献示例:~\cite{Chen2018} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 + +你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(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} diff --git a/elegantbook-en.pdf b/elegantbook-en.pdf index 3b9758a..41367dd 100644 Binary files a/elegantbook-en.pdf and b/elegantbook-en.pdf differ diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 00c3eff..a9af4e6 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -1,4 +1,4 @@ -\documentclass[green,en]{elegantbook} +\documentclass{elegantbook} \title{An Elegant \LaTeX{} Template for Books} \subtitle{Classic Elegant\LaTeX{} Template} @@ -15,19 +15,21 @@ \begin{document} \maketitle -%\pagenumbering{arabic} \tableofcontents +\clearpage +\thispagestyle{empty} \mainmatter \hypersetup{pageanchor=true} + \chapter{Elegant\LaTeX{} Templates} -on the occasion of this release, we, Elegant\LaTeX{} Program, want to reintroduce our work to you. We are committed to creating a series of beautiful, elegant, easy to use \LaTeX{} templates for users. The Elegant\LaTeX{} is currently composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} for typesetting notes, books, and working papers respectively. +On the occasion of this release, we, Elegant\LaTeX{} Program, want to reintroduce our work to you. We are committed to creating a series of beautiful, elegant, easy to use \LaTeX{} templates for users. The Elegant\LaTeX{} is currently composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} for typesetting notes, books, and working papers respectively. -The latest version is available on \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github: ElegantBook/releases}. This guide describes some of the settings for this template and how to use it. If you have any other questions, suggestions or comments, please feel free to contact us. +The latest version is available on \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Github:ElegantBook/releases}. This guide describes some settings of this template and how to use it. If you have any other questions, suggestions or comments, please feel free to contact us. -\section{ElegantBook 更新说明} +\section{ElegantBook Updates} Over these years, we've received a lot of feedback from users, with major issues related to font installation, coding support, theorem class environments floats, theorem cross-page, cross-references, and etc. We really think about these problems, it wasn't elegant to let the user install the font for visual beauty since users got into a lot of trouble, which went against the concept of our template. So we've removed that from the new version, users don't have to install any fonts. Let's take a look at the ElegantBook template 3.x updates: \begin{enumerate} @@ -40,7 +42,7 @@ Over these years, we've received a lot of feedback from users, with major issues \item New Elegant\LaTeX{} Logo; \item New cover and decorations, remove the watermark; \item Fix appendix; - \item Add gray theme: \lstinline{color=plain}; + \item Add gray theme: \lstinline{color=plain}; \item Add code highlighting; \item Beautify the list environment. \end{enumerate} @@ -57,11 +59,11 @@ If you choose \lstinline{PDFLaTeX} to process your book, the default article fon \begin{itemize} \item \lstinline{newtxtext} package for text fonts, similar to times new roman font. \item \lstinline{newtxmath} package for math fonts, close to \lstinline{times} package. - \item \lstinline{FiraMono} package for typewriter fonts, with option \lstinline{scale=0.8}. + \item \lstinline{FiraMono} package for typewriter fonts, with option \lstinline{scale=0.7}. \item \lstinline{ctex} package for Chinese fonts, with option \lstinline{scheme=plain}. \end{itemize} -A full compilation chain:\lstinline[breaklines]{PDFLaTeX -> BibTeX -> PDFLaTeX*2}。 +A full compilation chain:\lstinline[breaklines]{PDFLaTeX -> BibTeX -> PDFLaTeX*2}. \subsection[Compile with XeLaTeX]{Compile with \lstinline{XeLaTeX}} @@ -72,22 +74,22 @@ If you choose \lstinline{XeLaTeX} to process your book, we use \lstinline{fontsp \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} \end{lstlisting} -A full compilation chain:\lstinline[breaklines]{XeLaTeX -> BibTeX -> XeLaTeX*2}。 +A full compilation chain:\lstinline[breaklines]{XeLaTeX -> BibTeX -> XeLaTeX*2}. \section{Languages} -we defined one option named \lstinline{lang}, this option has two alternative values, \lstinline{lang=en} (default) or \lstinline{lang=cn}. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese, while \lstinline{lang=en} will keep all these stuff English, as the default article class sets. You can use this option as +We defined one option named \lstinline{lang}, this option has two alternative values, \lstinline{lang=en} (default) or \lstinline{lang=cn}. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese, while \lstinline{lang=en} will keep all these stuff English, as the default article class sets. You can use this option as \begin{lstlisting}[frame=none] \documentclass[cn]{elegantbook} @@ -102,15 +104,14 @@ You can input Chinese Character in either \lstinline{lang=en} or \lstinline{lang \section{Color Themes} -This template contains 4 color themes,they are \textcolor{main1}{\lstinline{green}} (default), \textcolor{main2}{\lstinline{cyan}}, \textcolor{main3}{\lstinline{blue}}, \textcolor{gray}{\lstinline{plain}}, and there is a customization color option \lstinline{nocolor}. You can choose \lstinline{green} as +This template contains 4 color themes,they are \textcolor{main1}{\lstinline{green}} (default), \textcolor{main2}{\lstinline{cyan}}, \textcolor{main3}{\lstinline{blue}}, \textcolor{gray}{\lstinline{plain}}, and there is a customization color option \lstinline{nocolor}. You can choose \lstinline{green} with \begin{lstlisting}[frame=single] \documentclass[green]{elegantbook} %or \documentclass[color=green]{elegantbook} \end{lstlisting} -其中 \textcolor{gray}{plain} 主题为全灰色。如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 main、second、third 颜色,具体的方法如下: - +where \textcolor{gray}{plain} theme is gray for all theorem class environments and paper structures. If you want to customize the colors, please select \lstinline{nocolor} or use \lstinline{color=none} , then define the main, second, and third colors in the preamble section as follows: \begin{lstlisting}[frame=single] \definecolor{main}{RGB}{70,70,70} \definecolor{second}{RGB}{115,45,2} @@ -118,11 +119,11 @@ This template contains 4 color themes,they are \textcolor{main1}{\lstinline{gr \end{lstlisting} \begin{table}[htp] -\caption{ElegantBook 模板中的三套颜色主题\label{tab:color thm}} +\caption{ElegantBook Themes\label{tab:color thm}} \centering \begin{tabular}{ccccc} \toprule - & \textcolor{main1}{green} & \textcolor{main2}{cyan} & \textcolor{main3}{blue} & 主要使用的环境\\ + & \textcolor{main1}{green} & \textcolor{main2}{cyan} & \textcolor{main3}{blue} & Main Environments\\ \midrule main & \makecell{{\color{main1}\rule{1cm}{1cm}}}& \makecell{{\color{main2}\rule{1cm}{1cm}}}&\makecell{ {\color{main3}\rule{1cm}{1cm}}}& definition \\ @@ -133,33 +134,35 @@ third &\makecell{ {\color{third1}\rule{1cm}{1cm}}}& \makecell{{\color{third2}\ru \end{tabular} \end{table} -\section{章标题显示风格} +\section{Chapter Title Display Styles} -本模板内置 2 套\textit{章标题显示风格},包含 \lstinline{hang}(默认)与 \lstinline{display} 两种风格,区别在于章标题单行显示(\lstinline{hang})与双行显示(\lstinline{display}),本说明使用了 \lstinline{hang}。调用方式为 +This template contains 2 sets of \textit{title display styles},which including \lstinline{hang}(default) and \lstinline{display} style, + +The difference is that the chapter heading is displayed on a single line (\lstinline{hang}) and on a double line (\lstinline{display}) , and this guide uses \lstinline{hang} . To change display style \begin{lstlisting}[frame=single] \documentclass[hang]{elegantbook} %or \documentclass[titlestyle=hang]{elegantbook} \end{lstlisting} -\section{数学环境简介} +\section{Theorem Class Environments} -在我们这个模板中,定义了四大类环境 +In this template, we defined four categories of theorem class environments \begin{itemize} -\item \textit{定理类环境},包含标题和内容两部分,全部定理类环境的编号均以章节编号。根据格式的不同分为 3 种 +\item \textit{Theorem Environment}, including title and contents, numbering within chapter. There are three types depending on the format \begin{itemize} - \item \textcolor{main}{\textbf{definition}} 环境,颜色为 \textcolor{main}{main}; - \item \textcolor{second}{\textbf{theorem、lemma、corollary}} 环境,颜色为主颜色 \textcolor{second} {second}; - \item \textcolor{third}{\textbf{proposition}} 环境,颜色为 \textcolor{third}{third}。 + \item \textcolor{main}{\textbf{definition}} environment, the color is \textcolor{main}{main}; + \item \textcolor{second}{\textbf{theorem, lemma, corollary}} environment, the color is \textcolor{second} {second}; + \item \textcolor{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}. \end{itemize} -\item \textit{示例类环境},有 \textbf{example、exercise、problem} 环境(对应于例,练习,例题),自动编号,编号以章节为单位。 -\item \textit{证明类环境},有 \textbf{proof、note} 环境,特点是,有引导符或者结尾符,\textbf{note} 环境有引导符号,\textbf{proof} 环境有证明完毕符号。 -\item \textit{结论类环境},有 \textbf{conclusion、assumption、property,remark、solution} 环境,三者均以粗体的引导词为开头,和普通段落格式一致。 +\item \textit{Example Environments}, including \textbf{example, exercise, problem} environment, auto numering within chapter. +\item \textit{Proof Environment}, including \textbf{proof, note} environment, they contain introductory symbol (\textbf{note} environment) or ending symbol (\textbf{proof} environment). +\item \textit{Conclusion Environments}, including \textbf{conclusion, assumption, property, remark, solution} environment, all of these begin with boldfaced words, and the contents are the same as a normal paragraph. \end{itemize} -\subsection{定理类环境的使用} -由于本模板使用了 \lstinline{tcolorbox} 宏包来定制定理类环境,所以和普通的定理环境的使用有些许区别,定理的使用方法如下: +\subsection{Theorem Class Environments} +The template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows: \begin{lstlisting}[frame=single] \begin{theorem}{}{