version 3.09

This commit is contained in:
EthanDeng
2019-08-18 18:25:37 +08:00
parent a6830816e4
commit e8cc07a13e
4 changed files with 268 additions and 100 deletions

View File

@@ -1,4 +1,4 @@
\documentclass[cn,11pt]{elegantbook}
\documentclass[cn,11pt,twocol]{elegantbook}
\title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作}
@@ -28,7 +28,8 @@
Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。强烈推荐使用最新正式版本!本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 Github 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。
我们的相关联系方式:
我们的联系方式:
\begin{itemize}
\item 官网:\href{https://elegantlatex.org/}{https://elegantlatex.org/}
\item Github 网址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}
@@ -48,10 +49,13 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模
\begin{enumerate}
\item 删除 \lstinline{\elegantpar} 命令;
\item 修复符号字体设置;
\item 增加双栏目录选项;
\item 修改脚注格式;
\item 其他。
\end{enumerate}
\begin{note}
由于新版本进行了重构3.x 版本并不兼容 2.x 版本,并且在 3.06 版本更新过封面,如果你想把 3.06 版本(包括 2.x 版本)之前的文件转为最新版本兼容的文件,请仔细查看\href{https://github.com/ElegantLaTeX/ElegantBook/wiki/convert}{跨版本转换}今后不再回答关于 2.x 版本的问题。
2.x 版本的用户请仔细查看\href{https://github.com/ElegantLaTeX/ElegantBook/wiki/convert}{跨版本转换}
\end{note}
\section{模板安装与更新}
@@ -83,13 +87,16 @@ Overleaf 上,中文需要使用 \lstinline{XeLaTeX} 进行编译,英文可
\section{用户作品计划}
Elegant\LaTeX{} 系列模板从创立至今已经有 8 年了,我们的模板也受到了很多用户的喜爱,在此,为了促进模板用户之间的交流,了解用户需求,完善本模板,我们将建立一个区域专门展示用户的文档,包括但不限于 Github 和官网等。如果你愿意将自己的作品展示出来,请邮件或者其他方式联系我们。如果自己代码已经传到 Github 或者 Gitee 等网站,可以提供对应网址。
\centerline{\textcolor{red}{\bfseries 广告位招租!}}
\section{关于提交}
出于某些因素的考虑Elegant\LaTeX{} 项目自 2019 年 5 月 20 日开始,\textbf{不再接受任何非作者预约性质的提交}pull request)!如果你想改进模板,你可以给我们提交 issues或者可以在遵循协议LPPL-1.3c)的情况下,克隆到自己仓库下进行修改。
\section{协作人员招募}
招募 Elegant\LaTeX{} 的协作人员,没有工资。工作内容:翻译 Elegant\LaTeX{} 系列模板相关的文稿(中文->英文),维护模板的 wiki主要涉及 Markdown 语法),如果有公众号文稿写作经历的话,也可以帮忙写微信稿。本公告长期有效。
目前 ElegantLaTeX 共有 3 名协作人员,分别是
目前 ElegantLaTeX 共有 4 名协作人员,分别是
\begin{itemize}
\item 官方文档翻译: \href{https://github.com/peggy2006xzyz}{YPY};
\item Github 维基维护: \href{https://github.com/izinngo}{Ingo Zinngo}\href{https://github.com/xiaohao890809}{追寻原风景};
@@ -99,11 +106,9 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 8 年了,我们的模板
在此感谢他们无私的奉献!
\section{致谢}
2019 年 5 月 20 日ElegantBook 模板在 Github 上的 star达到了 100,并且 21 日上了 Github 网站 \TeX{} 语言的\href{https://github.com/trending/tex?since=daily}{日趋势榜单}。这对于 Elegant\LaTeX{} 系列模板都是一个里程碑!
2019 年 5 月 20 日ElegantBook 模板在 Github 上的收藏数(star达到了 100\footnote{截止 2019 年 8 月 18 日 3.09 版本正式发布star 数为 189。}
在此特别感谢 China\TeX{} 以及 \href{http://www.latexstudio.net/}{\LaTeX{} 工作室}对于本系列模板的大力宣传与推广。\LaTeX{} 工作室网站上有很多精彩的帖子和精致的模板,欢迎大家去挖掘里面的宝藏。这也是国内最全面的 \LaTeX{} 相关的网站。
特别感谢 \href{https://github.com/muzimuzhi}{muzimuzhi} 对于模板的完善。
在此特别感谢 China\TeX{} 以及 \href{http://www.latexstudio.net/}{\LaTeX{} 工作室}对于本系列模板的大力宣传与推广。\LaTeX{} 工作室网站上有很多精彩的帖子和精致的模板,欢迎大家去挖掘里面的宝藏。这也是国内最全面的 \LaTeX{} 相关的网站。也非常感谢 \href{https://github.com/muzimuzhi}{muzimuzhi} 对于模板的完善。
如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。
\begin{figure}[htbp]
@@ -112,7 +117,14 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 8 年了,我们的模板
\caption{一键三连求赞}
\end{figure}
之前我们模板从未发布过捐赠/打赏信息,近期有用户反映他们对我们模板非常喜爱,想打赏没有支付码,不禁感叹,这世道变了啊,还有主动打赏的,那么我们就“勉为其难”地发布我们的打赏二维码吧!
\begin{figure}[htbp]
\centering
\includegraphics[width=0.618\textwidth]{star-history.png}
\caption{Elegant\LaTeX{} 系列模板上线 Github 之后上每周 Star 数变化}
\end{figure}
\section{捐赠}
如果您非常喜爱我们的模板或者我,你还可以选择捐赠以表达您对我们模板和我的支持。本模板自 3.08 版本发布了捐赠信息之后,收到了近千元的捐赠(四舍五入就是一个亿),非常感谢!
\begin{figure}[htbp]
\centering
@@ -139,10 +151,9 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 8 年了,我们的模板
\end{tabular}%
\end{table}%
再次感谢大家对于模板的喜爱!
\chapter{ElegantBook 设置说明}
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的。默认编码为 UTF-8推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2019支持 \lstinline{PDFLaTeX} 以及 \lstinline{XeLaTeX} 编译。
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2019支持 \lstinline{PDFLaTeX} 以及 \lstinline{XeLaTeX} 编译。
\section{语言模式}
@@ -163,10 +174,6 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 8 年了,我们的模板
\documentclass[device=pad]{elegantbook}
\end{lstlisting}
\begin{equation}
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
\end{equation}
\section{颜色主题}
本模板内置 5 组颜色主题,分别为 \textcolor{structure1}{\lstinline{green}}\footnote{为原先默认主题。}\textcolor{structure2}{\lstinline{cyan}}\textcolor{structure3}{\lstinline{blue}}(默认)、\textcolor{structure4}{\lstinline{gray}}\textcolor{structure5}{\lstinline{black}}。另外还有一个自定义的选项 \lstinline{nocolor}。调用颜色主题 \lstinline{green} 的方法为
\begin{lstlisting}
@@ -309,7 +316,7 @@ This is the content of example environment.
\section{装饰物}
本模板为章节后的装饰物base添加了隐藏选项\lstinline{show}\lstinline{hide} 两个选项。
本模板为章节后和页面下方的装饰物base添加了隐藏选项\lstinline{show}\lstinline{hide} 两个选项。
\begin{lstlisting}
\documentclass[hide]{elegantbook} %or
\documentclass[base=hide]{elegantbook}
@@ -317,7 +324,7 @@ This is the content of example environment.
\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}
本模板使用的封面图片来源于 \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.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用
本文用到的 Logo 比例为 1:1也即正方形图片在更换图片的时候请选择合适的图片进行替换。
@@ -362,9 +369,11 @@ This is the content of example environment.
\nocite{*} %include all the bibitems
\end{lstlisting}
本模板还添加了 \lstinline{cite=numbers}\lstinline{cite=authoryear} 个参考文献选项,用于设置参考文献格式的设置,默认为 \lstinline{numbers}。据我们所知,理工科类一般使用 \lstinline{numbers},而文科类使用 \lstinline{authoryear} 比较多,所以我们将 \lstinline{numbers} 作为默认格式。如果需要改为 \lstinline{authoryear} ,可以使用
本模板还添加了 \lstinline{cite=numbers}\lstinline{cite=super}\lstinline{cite=authoryear} 个参考文献选项,用于设置参考文献格式的设置,默认为 \lstinline{numbers}。据我们所知,理工科类一般使用数字形式 \lstinline{numbers} 或者上标形式 \lstinline{super},而文科类使用作者--年份 \lstinline{authoryear} 比较多,所以我们将 \lstinline{numbers} 作为默认格式。如果需要改为 \lstinline{cite=super} 或者 \lstinline{authoryear} ,可以使用
\begin{lstlisting}
\documentclass[cite=authoryear]{elegantbook} %or
\documentclass[cite=super]{elegantbook} % set cite for super style ref style
\documentclass[super]{elegantbook}
\documentclass[cite=authoryear]{elegantbook} % set cite for author year ref style
\documentclass[authoryear]{elegantbook}
\end{lstlisting}
@@ -425,21 +434,70 @@ The content of introduction.
\end{problemset}
\begin{remark}
如果你想把 \lstinline{problemset} 环境的标题改为其他文字,你可以类似于 introduction 环境修改 problemset 的可选参数。
如果你想把 \lstinline{problemset} 环境的标题改为其他文字,你可以类似于 introduction 环境修改 problemset 的可选参数。另外,目前这个环境会自动出现在目录中,但是不会出现在页眉页脚信息中(待解决)。
\end{remark}
\section{旁注}
在 3.08 版本中,我们引入了 旁注设置选项 \lstinline{marginpar=margintrue} 以及测试命令 \lstinline{\elegantpar} ,但是由此带来一堆问题。我们决定在 3.09 版本中将其删除,并且,在旁注命令得到大幅度优化之前,不会将此命令再次引入书籍模板中。对此造成各位用户的不方便,非常抱歉!
在 3.08 版本中,我们引入了 旁注设置选项 \lstinline{marginpar=margintrue} 以及测试命令 \lstinline{\elegantpar} ,但是由此带来一堆问题。我们决定在 3.09 版本中将其删除,并且,在旁注命令得到大幅度优化之前,不会将此命令再次引入书籍模板中。对此造成各位用户的不方便,非常抱歉!不过我们保留了 \lstinline{marginpar} 这个选项,你可以使用 \lstinline{marginpar=margintrue} 获得保留右侧旁注的版面设计。然后使用系统自带的 \lstinline{\marginpar} 或者 \lstinline{marginnote} 宏包的 \lstinline{\marginnote} 命令。
\section{其他}
\begin{remark}
在使用旁注的时候,需要注意的是,文本和公式可以直接在旁注中使用。
\begin{lstlisting}
% text
\marginpar{margin paragraph text}
% equation
\marginpar{
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
}
\end{lstlisting}
但是浮动体(表格、图片)需要注意,不能用浮动体环境,需要使用直接插图命令或者表格命令环境。然后使用 \lstinline{\captionof} 为其设置标题。为了得到居中的图表,可以使用 \lstinline{\centerline} 命令或者 \lstinline{center} 环境。更多详情请参考:\href{https://tex.stackexchange.com/questions/5583/caption-of-figure-in-marginpar-and-caption-of-wrapfigure-in-margin}{Caption of Figure in Marginpar}
\begin{lstlisting}
% graph with centerline command
\marginpar{
\centerline{
\includegraphics[width=0.2\textwidth]{logo.png}
}
\captionof{figure}{your figure caption}
}
% graph with center environment
\marginpar{
\begin{center}
\includegraphics[width=0.2\textwidth]{logo.png}
\captionof{figure}{your figure caption}
\end{center}
}
\end{lstlisting}
\end{remark}
\section{连字符}
由于模板使用了 \lstinline{newtx} 系列字体宏包,所以在使用本模板的时候,需要注意下连字符的问题。
\begin{equation}
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
\end{equation}
的代码为
\begin{lstlisting}
\begin{equation}
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
\end{equation}
\end{lstlisting}
\section{符号字体}
在 3.08 版本中,用户反馈模板在和 \lstinline{yhmath} 以及 \lstinline{esvect} 等宏包搭配使用的时候会出现报错:
\begin{lstlisting}
LaTeX Error:
Too many symbol fonts declared.
\end{lstlisting}
根据 \href{https://github.com/muzimuzhi}{muzimuzhi} 的解释是,模板重新定义了数学字体,达到了 {\heiti 最多 16 个数学字体} 的上限,在调用其他宏包的时候,无法新增数学字体。为了减少调用非常用宏包,在此给出如何调用 \lstinline{yhmath} 以及 \lstinline{esvect} 宏包的方法。
原因是模板重新定义了数学字体,达到了 {\heiti 最多 16 个数学字体} 的上限,在调用其他宏包的时候,无法新增数学字体。为了减少调用非常用宏包,在此给出如何调用 \lstinline{yhmath} 以及 \lstinline{esvect} 宏包的方法。
请在 \lstinline{elegantbook.cls} 内搜索 \lstinline{yhmath} 或者 \lstinline{esvect},将你所需要的宏包加载语句取消注释即可。
\begin{lstlisting}
@@ -454,6 +512,7 @@ LaTeX Error:
\end{lstlisting}
\chapter{ElegantBook 写作示例}
\begin{introduction}
@@ -475,8 +534,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$$\mathcal{R}^n$ 中的可测集。
\begin{itemize}
\item 名词解释
\begin{definition}{可积性}{int}
$ 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$ 上的积分为 $\int_{a}^b f(x)$
\begin{equation}
@@ -485,9 +542,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\end{equation}
一般情况下 $0 \leq \int_{E} f dx \leq \infty$。若 $\int_{E} f dx < \infty$,则称 $f$$E$ 上可积。
\end{definition}
\item 测试 2
\end{itemize}
一个自然的问题是Lebesgue 积分与我们所熟悉的 Riemann 积分有什么联系和区别?在 4.4 在我们将详细讨论 Riemann 积分与 Lebesgue 积分的关系。这里只看一个简单的例子。设 $D(x)$ 是区间 $[0,1]$ 上的 Dirichlet 函数。即 $D(x)=\chi_{Q_0}(x)$,其中 $Q_0$ 表示 $[0,1]$ 中的有理数的全体。根据非负简单函数积分的定义,$D(x)$$[0,1]$ 上的 Lebesgue 积分为
@@ -589,7 +643,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\end{custom}
\begin{solution}
3.07 中在 \lstinline{gbt7714} 宏包使用时,加入了 \lstinline{authoryear} 选项,这个使得 \lstinline{natbib} 设置了 \lstinline{numbers} 也无法生效。3.08 版本中,模板增加了 \lstinline{numbers}\lstinline{authoryear} 文献选项,你可以参考前文设置说明。
3.07 中在 \lstinline{gbt7714} 宏包使用时,加入了 \lstinline{authoryear} 选项,这个使得 \lstinline{natbib} 设置了 \lstinline{numbers} 也无法生效。3.08 和 3.09 版本中,模板增加了 \lstinline{numbers}\lstinline{super}\lstinline{authoryear} 文献选项,你可以参考前文设置说明。
\end{solution}
\begin{custom}{问题}
@@ -600,6 +654,14 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
页面颜色可以使用 \lstinline{\pagecolor} 命令设置,文本命令可以参考\href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{这里}进行设置。
\end{solution}
\begin{custom}{问题}
\lstinline[breaklines]{Package ctex Error: CTeX fontset `Mac' is unavailable.}
\end{custom}
\begin{solution}
在 Mac 系统下,中文编译请使用 \lstinline{XeLaTeX}
\end{solution}
\begin{custom}{问题}
\lstinline{! LaTeX Error: Unknown option `scheme=plain' for package `ctex'.}
\end{custom}
@@ -673,7 +735,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\end{custom}
\begin{solution}
可以的ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境之后加上语言,全局语言修改请使用 \lstinline{\lstset} 命令,更多信息请参考宏包文档。
可以的ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{\lstset} 命令,更多信息请参考宏包文档。
\end{solution}
@@ -685,14 +747,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
这个问题问的人比较多,我这里给个明确的答案。由于 Beamer 中有一个很优秀的主题 \href{https://github.com/matze/mtheme}{Metropolis}。我觉得在我们找到非常好的创意之前不会发布正式的 Beamer 主题,如果你非常希望得到 Elegant\LaTeX{} “官方”的主题,请在用户 QQ 群内下载我们测试主题 PreElegantSlide未来不一定按照这个制作。正式版制作计划在 2020 年之后。
\end{solution}
\begin{custom}{问题}
群主好棒,想嫁!
\end{custom}
\begin{solution}
我取向正常!
\end{solution}
\nocite{*}
@@ -711,11 +765,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\sum_{i=1}^n x_i \equiv x_1 + x_2 +\cdots + x_n
\end{equation}
\begin{lstlisting}[language=Python]
if x==0:
print(x)
\end{lstlisting}
\chapter{最小示例}
\begin{lstlisting}