11 Commits
v0.09 ... v0.11

Author SHA1 Message Date
EthanDeng
06c958ed9b final version 2022-12-31 11:22:48 +08:00
EthanDeng
d8e407917e brackets problem 2022-09-18 20:01:29 +08:00
EthanDeng
3f2c2b8bea move reference file outside of cls file 2022-09-18 19:58:18 +08:00
EthanDeng
162aad7ece remove comma 2022-09-18 19:55:49 +08:00
EthanDeng
39cbb4e9fc fix typos 2022-09-18 19:53:50 +08:00
EthanDeng
631a317450 Merge branch 'master' of github.com:ElegantLaTeX/ElegantPaper 2022-04-21 12:54:30 +08:00
EthanDeng
101c422b0c remove defbib 2022-04-21 12:54:11 +08:00
EthanDeng
c1625852b7 remove redundant images 2022-04-09 15:25:35 +08:00
EthanDeng
041a986646 0.10 2022-04-09 14:13:29 +08:00
Dongsheng Deng
ceca68fa25 Merge pull request #68 from syvshc/hotfix
patch for newtx v1.7 or later
2022-01-15 09:59:51 +08:00
syvshc
8e4cf483c5 patch for newtx v1.7 or later 2022-01-15 01:03:18 +08:00
8 changed files with 219 additions and 318 deletions

9
.gitignore vendored
View File

@@ -11,10 +11,11 @@
*.cb *.cb
*.cb2 *.cb2
.*.lb .*.lb
delete-temp-files.bat .DS_Store
elegantpaper-cn.pdf clean.bat
elegantpaper-en.pdf elegant*-cn.pdf
*clean.bat elegant*-en.pdf
*.dates
## Intermediate documents: ## Intermediate documents:
*.dvi *.dvi

View File

@@ -10,7 +10,9 @@
![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantPaper.svg) ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantPaper.svg)
![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantPaper.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantPaper.svg)
**Caution: This template will no longer be maintained since January 1st, 2023.**
**注意:本模板自 2023 年 1 月 1 日开始,不再维护,不建议使用本系列模板!**
ElegantPaper is designed for writing a working paper, especially for economics students. This template is based on the standard LaTeX article class. The goal of this template is to make the writing process easier and more comfortable. You can get rid of all the worries about the format. Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues or email us at elegantlatex2e@gmail.com. ElegantPaper is designed for writing a working paper, especially for economics students. This template is based on the standard LaTeX article class. The goal of this template is to make the writing process easier and more comfortable. You can get rid of all the worries about the format. Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues or email us at elegantlatex2e@gmail.com.

View File

@@ -1,18 +1,18 @@
%!TEX program = xelatex %!TEX program = xelatex
% 完整编译: xelatex -> bibtex -> xelatex -> xelatex % 完整编译: xelatex -> biber/bibtex -> xelatex -> xelatex
\documentclass[lang=cn,11pt,a4paper,cite=authoryear]{elegantpaper} \documentclass[lang=cn,a4paper,newtx]{elegantpaper}
\title{ElegantPaper: 一个优美的 \LaTeX{} 工作论文模板} \title{ElegantPaper: 一个优美的 \LaTeX{} 工作论文模板}
\author{Ethan DENG \\ Fudan University \and Dongsheng DENG \\ PA Technology} \author{作者1 \\ 某某大学/机构 \and 作者2 \\ 某某大学/机构}
\institute{\href{https://elegantlatex.org/}{Elegant\LaTeX{} 项目组}} \institute{\href{https://elegantlatex.org/}{Elegant\LaTeX{} 项目组}}
\version{0.09} \version{0.11}
\date{\zhtoday} \date{\zhdate{2022/12/31}}
% 本文档命令 % 本文档命令
\usepackage{array} \usepackage{array}
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}} \newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
\addbibresource[location=local]{reference.bib} % 参考文献,不要删除
\begin{document} \begin{document}
@@ -23,13 +23,20 @@
\keywords{Elegant\LaTeX{},工作论文,模板} \keywords{Elegant\LaTeX{},工作论文,模板}
\end{abstract} \end{abstract}
\section{模板使用须知} \section{模板使用须知}
\textcolor{red}{\bfseries 本模板自 2023 年 1 月 1 日开始,不再维护,不建议使用本系列模板!为了保证之前版本的用户仍然能查到说明文档,本说明文档仍然保留过去的信息。}
\subsection{注意事项}
\textbf{文献部分}:我们将 bibtex 的默认文献编译方式改为 biblatex不过我们也提供了两个后端\lstinline{bibend=biber}\lstinline{bibend=bibtex}。特别需要注意的是从 0.10 开始,文献文件改为 \lstinline{reference.bib},与 ElegantBook 保持一致,而参考文献的引文样式等更多格式,请参考后文参考文献部分,更多样式可以参考 biblatex 文档。
\textbf{字体部分},我们将 newtxtext 宏包的支持方式改为了字体名称设定方式,设定英文字体为 TeX Gyre Terms/Heros英文字体部分根据编译方式选择不同字体。对于一般用户而言不太需要关心这部分内容。
另外,中文请务必使用 \hologo{XeLaTeX} 编译。
\subsection{模板介绍} \subsection{模板介绍}
此模板基于 \LaTeX{} 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。本模板支持 \hologo{pdfLaTeX}\hologo{XeLaTeX} 编译。 此模板基于 \LaTeX{} 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。
\begin{lstlisting} \begin{lstlisting}
\documentclass[a4paper,11pt]{elegantpaper} \documentclass[a4paper,11pt]{elegantpaper}
@@ -42,7 +49,7 @@
此模板定义了一个语言选项 \lstinline{lang},可以选择英文模式 \lstinline{lang=en}(默认)或者中文模式 \lstinline{lang=cn}。当选择中文模式时,图表的标题引导词以及参考文献,定理引导词等信息会变成中文。你可以通过下面两种方式来选择语言模式: 此模板定义了一个语言选项 \lstinline{lang},可以选择英文模式 \lstinline{lang=en}(默认)或者中文模式 \lstinline{lang=cn}。当选择中文模式时,图表的标题引导词以及参考文献,定理引导词等信息会变成中文。你可以通过下面两种方式来选择语言模式:
\begin{lstlisting} \begin{lstlisting}
\documentclass[lang=cn]{elegantpaper} % or \documentclass[lang=cn]{elegantpaper} % or
\documentclass{cn}{elegantpaper} \documentclass[cn]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\textbf{注意:} 英文模式下,由于没有添加中文宏包,无法输入中文。如果需要输入中文,可以通过在导言区引入中文宏包 \lstinline{ctex} 或者加入 \lstinline{xeCJK} 宏包后自行设置字体。 \textbf{注意:} 英文模式下,由于没有添加中文宏包,无法输入中文。如果需要输入中文,可以通过在导言区引入中文宏包 \lstinline{ctex} 或者加入 \lstinline{xeCJK} 宏包后自行设置字体。
@@ -60,15 +67,14 @@
\end{enumerate} \end{enumerate}
\subsection{中文字体选项} \subsection{中文字体选项}
模板提供中文字体选项 \lstinline{chinesefont},可选项有 模板提供中文字体选项 \lstinline{chinesefont},可选项有
\begin{enumerate} \begin{enumerate}
\item \lstinline{ctexfont}:默认选项,使用 \lstinline{ctex} 宏包根据系统自行选择字体,可能存在字体缺失的问题,更多内容参考 \lstinline{ctex} 宏包\href{https://ctan.org/pkg/ctex}{官方文档}\footnote{可以使用命令提示符,输入 \lstinline{texdoc ctex} 调出本地 \lstinline{ctex} 宏包文档} \item \lstinline{ctexfont}:默认选项,使用 \lstinline{ctex} 宏包根据系统自行选择字体,可能存在字体缺失的问题,更多内容参考 \lstinline{ctex} 宏包\href{https://ctan.org/pkg/ctex}{官方文档}\footnote{可以使用命令提示符,输入 \lstinline{texdoc ctex} 调出本地 \lstinline{ctex} 宏包文档}
\item \lstinline{founder}:方正字体选项调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,然后设置字体为方正四款免费字体,方正字体下载注意事项见后文。 \item \lstinline{founder}:方正字体选项\textbf{需要安装方正字体}),后台调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,然后设置字体为方正四款免费字体,方正字体下载注意事项见后文,用户只需要安装方正字体即可使用该选项
\item \lstinline{nofont}:调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。 \item \lstinline{nofont}后台会调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
\end{enumerate} \end{enumerate}
\noindent \textbf{注意:} 使用 \lstinline{founder} 选项或者 \lstinline{nofont} 时,必须使用 \hologo{XeLaTeX} 进行编译。
\subsubsection{方正字体选项} \subsubsection{方正字体选项}
由于使用 \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 用户请右键选择为全部用户安装,否则会找不到字体。} 由于使用 \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 用户请右键选择为全部用户安装,否则会找不到字体。}
@@ -78,15 +84,15 @@
\end{figure} \end{figure}
\subsubsection{其他中文字体} \subsubsection{其他中文字体}
如果你想完全自定义字体\footnote{这里仍然以方正字体为例。},你可以选择 \lstinline{chinesefont=nofont},然后在导言区设置 如果你想完全自定义字体\footnote{这里仍然以方正字体为例。},你可以选择 \lstinline{chinesefont=nofont},然后在导言区设置即可,可以参考下方代码:
\begin{lstlisting} \begin{lstlisting}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01} \setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01} \setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02} \setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01} \setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01} \setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}{FZKai-Z03} \setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKfamilyfont{zhfs}{FZFangSong-Z02} \setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}} \newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}} \newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}} \newcommand*{\kaishu}{\CJKfamily{zhkai}}
@@ -94,141 +100,48 @@
\end{lstlisting} \end{lstlisting}
\subsection{自定义命令} \subsection{自定义命令}
此模板并没有修改任何默认的 \LaTeX{} 命令或者环境\footnote{目的是保证代码的可复用性,请用户关注内容,不要太在意格式,这才是本工作论文模板的意义。}。另外,我自定义了 4 个命令: 此模板并没有修改任何默认的 \LaTeX{} 命令或者环境\footnote{目的是保证代码的可复用性,请用户关注内容,不要太在意格式,这才是本工作论文模板的意义。}。另外,本模板可以使用的 4 个额外命令:
\begin{enumerate} \begin{enumerate}
\item \lstinline{\email}:创建邮箱地址的链接,比如 \email{ddswhu@outlook.com} \item \lstinline{\email}:创建邮箱地址的链接,比如 \email{xxx@outlook.com}
\item \lstinline{\figref}:用法和 \lstinline{\ref} 类似,但是会在插图的标题前添加 <\textbf{图 n}> \item \lstinline{\figref}:用法和 \lstinline{\ref} 类似,但是会在插图的标题前添加 <\textbf{图 n}>
\item \lstinline{\tabref}:用法和 \lstinline{\ref} 类似,但是会在表格的标题前添加 <\textbf{表 n}> \item \lstinline{\tabref}:用法和 \lstinline{\ref} 类似,但是会在表格的标题前添加 <\textbf{表 n}>
\item \lstinline{\keywords}:为摘要环境添加关键词。 \item \lstinline{\keywords}:为摘要环境添加关键词。
\end{enumerate} \end{enumerate}
\subsection{参考文献} \subsection{参考文献}
此模板使用 \hologo{BibTeX} 来生成参考文献中文模式下默认使用的文献样式bib style\lstinline{GB/T 7714-2015}\footnote{通过调用 \href{https://ctan.org/pkg/gbt7714}{\lstinline{gbt7714}} 宏包}。参考文献示例:~\cite{en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。
你可以在谷歌学术MendeleyEndnote 中获得文献条目bib item然后把它们添加到 \lstinline{wpref.bib} 中。在文中引用的时候引用它们的键值bib key即可。注意需要在编译的过程中添加 \hologo{BibTeX} 编译。 文献部分,本模板调用了 biblatex 宏包,并提供了 biber默认 和 bibtex 两个后端选项,可以使用 \lstinline{bibend} 进行修改:
本模板还添加了 \lstinline{cite=numbers}\lstinline{cite=super}\lstinline{cite=authoryear} 三个参考文献选项,用于设置参考文献格式的设置,默认为 \lstinline{numbers}。理工科类一般使用数字形式 \lstinline{numbers} 或者上标形式 \lstinline{super},而文科类多使用作者-年份 \lstinline{authoryear} 比较多。如果需要改为 \lstinline{cite=numbers} 或者 \lstinline{authoryear} ,可以使用
\begin{lstlisting} \begin{lstlisting}
\documentclass[cite=super]{elegantpaper} % super style ref style \documentclass[bibtex]{elegantpaper}
\documentclass[super]{elegantpaper} \documentclass[bibend=bibtex]{elegantpaper}
\documentclass[cite=authoryear]{elegantpaper} % author-year ref style
\documentclass[authoryear]{elegantpaper}
\end{lstlisting} \end{lstlisting}
关于文献条目bib item你可以在谷歌学术MendeleyEndnote 中取,然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候引用它们的键值bib key即可。
\section{协作人员招募} 为了方便文献样式修改,模板引入了 \lstinline{bibstyle}\lstinline{citestyle} 选项默认均为数字格式numeric参考文献示例\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。
招募 Elegant\LaTeX{} 的协作人员,没有工资。工作内容:翻译 Elegant\LaTeX{} 系列模板相关的文稿(中翻英),维护模板的 wiki主要涉及 Markdown如果有公众号文稿写作经历的话也可以帮忙写微信稿。本公告长期有效。
目前 ElegantLaTeX 共有 4 名协作人员,分别是 如果需要设置为国标 GB7714-2015需要使用
\begin{itemize} \begin{lstlisting}
\item 官方文档翻译: \href{https://github.com/peggy2006xzyz}{YPY}; \documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantpaper}
\item GitHub 维基维护: \href{https://github.com/izinngo}{Ingo Zinngo}\href{https://github.com/xiaohao890809}{追寻原风景};
\item QQ 群管理员: \href{https://github.com/sikouhjw}{Sikouhjw}.
\end{itemize}
在此感谢他们无私的奉献!
\section{致谢}
截止到 2020 年 04 月 12 日ElegantPaper v0.09 版本发布ElegantPaper 模板在 GitHub 上的收藏数star达到了 277。在此特别感谢 China\TeX{} 以及 \href{http://www.latexstudio.net/}{\LaTeX{} 工作室}对于本系列模板的大力宣传与推广。如果你喜欢我们的模板,你可以在 GitHub 上收藏Star我们的模板。
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{star.png}
\caption{一键三连求赞}
\end{figure}
\section{捐赠}
如果您非常喜爱我们的模板,你还可以选择捐赠以表达您对我们模板和我的支持!
\begin{figure}[htbp]
\centering
\includegraphics[width=0.5\textwidth]{donate.jpg}
\end{figure}
\textbf{赞赏费用的使用解释权归 Elegant\LaTeX{} 所有,并且不接受监督,请自愿理性打赏}。10 元以上的赞赏,我们将列入捐赠榜,谢谢各位金主!
\begin{table}[!htb]
\centering
\caption{Elegant\LaTeX{} 系列模板捐赠榜}
\begin{tabular}{*{4}{>{\scriptsize}c}|*{4}{>{\scriptsize}c}}
\hline
\textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} & \textbf{捐赠者} & \textbf{金额} & \textbf{时间} & \textbf{渠道} \\
\hline
Lerh & 10 RMB & 2019/05/15 & 微信 & 越过地平线 & 10 RMB & 2019/05/15 & 微信 \\
银桑 & 20 RMB & 2019/05/27 & 微信 & *空 & 10 RMB & 2019/05/30 & 微信 \\
latexstudio.net & 666 RMB & 2019/06/05 & 支付宝 & A*n & 40 RMB & 2019/06/15 & 微信 \\
* 夏 & 22 RMB & 2019/06/15 & 微信 & * 倩 & 21 RMB & 2019/06/15 & 微信 \\
Cassis & 11 RMB & 2019/06/30 & 微信 & *君 & 10 RMB & 2019/07/23 & 微信 \\
P*u & 50 RMB & 2019/07/30 & 微信 & *萌 & 19 RMB & 2019/08/28 & 微信 \\
曲豆豆 & 10 RMB & 2019/08/28 & 微信 & 李博 & 100 RMB & 2019/10/06 & 微信 \\
Njustsll & 10 RMB & 2019/10/11 & 微信 & 刘志阔 & 99.99 RMB & 2019/10/15 & 支付宝 \\
* 韬 & 16 RMB & 2019/10/17 & 微信 & 赤霓 & 12 RMB & 2019/10/17 & 支付宝 \\
追寻原风景 & 10 RMB & 2019/10/28 & 微信 & 郭德良 & 88 RMB & 2019/11/03 & 微信 \\
自强不息 & 20 RMB & 2019/11/04 & 支付宝 & 读书之虫 & 20 RMB & 2019/11/18 & 微信 \\
*等 & 10 RMB & 2019/11/18 & 微信 & *哲 & 20 RMB & 2019/11/18 & 微信 \\
佚名 & 10 RMB & 2019/11/24 & 微信 & Jiye Qian & 66 RMB & 2019/12/04 & 微信 \\
* 阳 & 20 RMB & 2019/12/05 & 微信 & Catcher & 11 RMB & 2019/12/08 & 支付宝 \\
希尔波特门徒 & 10 RMB & 2019/12/09 & 支付宝 & * 伟 & 10 RMB & 2019/12/09 & 微信 \\
Simon & 20 RMB & 2019/12/11 & 支付宝 & 流殇丶浅忆 & 66.60 RMB & 2019/12/18 & 支付宝 \\
& 10 RMB & 2019/12/20 & 支付宝 & * 琛 & 15 RMB & 2019/12/20 & 微信 \\
随风 & 20 RMB & 2019/12/27 & 支付宝 & Ws & 23.30 RMB & 2019/12/28 & 微信 \\
初八 & 100 RMB & 2020/01/02 & 支付宝 & p*e & 20 RMB & 2020/01/03 & 微信 \\
Shunmx & 100 RMB & 2020/01/03 & 微信 & hj & 10 RMB & 2020/01/03 & 微信 \\
F*5 & 10 RMB & 2020/01/03 & 微信 & S*m & 20.20 RMB & 2020/01/03 & 微信 \\
二代青雉 & 13 RMB & 2020/01/14 & 支付宝 & *? & 66 RMB & 2020/01/15 & 微信 \\
Mr. Xiong & 20 RMB & 2020/01/17 & 微信 & *博 & 15 RMB & 2020/01/18 & 微信 \\
* 者 & 10 RMB & 2020/02/02 & 微信 & Jackie & 88.80 RMB & 2020/02/09 & 微信 \\
Henry\_Sun、 & 50 RMB & 2020/02/14 & 支付宝 & * 桥 & 50 RMB & 2020/02/21 & 微信 \\
昀琏 & 10 RMB & 2020/03/02 & 支付宝 & S*y & 10 RMB & 2020/03/15 & 微信 \\
* 哥 & 66.66 RMB & 2020/03/17 & 微信 & K*e & 30 RMB & 2020/03/30 & 微信\\
* 阳 & 20 RMB & 2020/04/02 & 微信 & 士*n & 30 RMB & 2020/04/11 & 微信 \\
\hline
\end{tabular}%
\label{tab:donation}%
\end{table}%
\section{常见问题 FAQ}
\begin{enumerate}[label=\arabic*).]
\item \textit{如何删除版本信息?}\\
导言区不写 \lstinline|\version{x.xx}| 即可。
\item \textit{如何删除日期?}\\
需要注意的是,与版本 \lstinline{\version} 不同的是,导言区不写或注释 \lstinline{\date} 的话,仍然会打印出当日日期,原因是 \lstinline{\date} 有默认参数。如果不需要日期的话,日期可以留空即可,也即 \lstinline|\date{}|。
\item \textit{如何获得中文日期?}\\
为了获得中文日期,必须在中文模式下\footnote{英文模式下,由于未加载中文宏包,无法输入中文。},使用 \lstinline|\date{\zhdate{2019/10/11}}|,如果需要当天的汉化日期,可以使用 \lstinline|\date{\zhtoday}|,这两个命令都来源于 \href{https://ctan.org/pkg/zhnumber}{\lstinline{zhnumber}} 宏包。
\item \textit{如何添加多个作者?}\\
\lstinline{\author} 里面使用 \lstinline{\and},作者单位可以用 \lstinline{\\} 换行。\begin{lstlisting}
\author{author 1\\ org. 1 \and author 2 \\ org. 2 }
\end{lstlisting} \end{lstlisting}
\item \textit{如何添加中英文摘要?}\\
请参考 \href{https://github.com/ElegantLaTeX/ElegantPaper/issues/5}{GitHub::ElegantPaper/issues/5}
\end{enumerate}
\section{示例} 如果需要添加排序方式,可以在导言区加入
\begin{lstlisting}
\ExecuteBibliographyOptions{sorting=ynt}
\end{lstlisting}
为了让大家更加清楚最终的论文效果,如下给出两篇使用 ElegantPaper 模板排版的工作论文示例,也欢迎大家“投稿”! 启用国标之后,可以加入 \lstinline{sorting=gb7714-2015}
\begin{enumerate}
\item \href{https://github.com/EthanDeng/bank-custody}{银行存管、投资者决策与 P2P 网络借贷规范发展}
\item \href{https://github.com/EthanDeng/risk-awareness}{互联网金融风险与投资者风险意识 —— 来自网贷平台交易数据的证据}
\end{enumerate}
\nocite{*}
\bibliography{wpref}
\appendix
%\appendixpage
\addappheadtotoc
\section{使用 newtx 系列字体} \section{使用 newtx 系列字体}
如果需要使用原先版本的 \lstinline{newtx} 系列字体,可以通过显示声明数学字体: 如果需要使用原先版本的 \lstinline{newtx} 系列字体,可以通过显示声明数学字体:
\begin{lstlisting} \begin{lstlisting}
\documentclass[math=newtx]{elegantbook} \documentclass[math=newtx]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\subsection{连字符} \subsection{连字符}
@@ -237,7 +150,7 @@
\begin{equation} \begin{equation}
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
\end{equation} \end{equation}
的代码为
\begin{lstlisting} \begin{lstlisting}
\begin{equation} \begin{equation}
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f} \int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
@@ -246,7 +159,7 @@
\subsection{宏包冲突} \subsection{宏包冲突}
另外在 ElegantBook 模板中,有用户反馈模板在使用 \lstinline{yhmath} 以及 \lstinline{esvect} 等宏包时会报错: 有用户反馈模板在使用 \lstinline{yhmath} 以及 \lstinline{esvect} 等宏包时会报错:
\begin{lstlisting} \begin{lstlisting}
LaTeX Error: LaTeX Error:
Too many symbol fonts declared. Too many symbol fonts declared.
@@ -255,16 +168,38 @@ LaTeX Error:
原因是在使用 \lstinline{newtxmath} 宏包时,重新定义了数学字体用于大型操作符,达到了 {\heiti 最多 16 个数学字体} 的上限,在调用其他宏包的时候,无法新增数学字体。为了减少调用非常用宏包,在此给出如何调用 \lstinline{yhmath} 以及 \lstinline{esvect} 宏包的方法。 原因是在使用 \lstinline{newtxmath} 宏包时,重新定义了数学字体用于大型操作符,达到了 {\heiti 最多 16 个数学字体} 的上限,在调用其他宏包的时候,无法新增数学字体。为了减少调用非常用宏包,在此给出如何调用 \lstinline{yhmath} 以及 \lstinline{esvect} 宏包的方法。
请在 \lstinline{elegantpaper.cls} 内搜索 \lstinline{yhmath} 或者 \lstinline{esvect},将你所需要的宏包加载语句\textit{取消注释}即可。 请在 \lstinline{elegantpaper.cls} 内搜索 \lstinline{yhmath} 或者 \lstinline{esvect},将你所需要的宏包加载语句\textit{取消注释}即可。
\begin{lstlisting}
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
%%% use esvect pkg, uncomment following code
% \RequirePackage{esvect}
\end{lstlisting}
\section{常见问题 FAQ}
\begin{enumerate}[label=\arabic*).]
\item \textit{如何删除版本信息?}\\
导言区不写 \lstinline|\version{x.xx}| 即可。
\item \textit{如何删除日期?}\\
需要注意的是,与版本 \lstinline{\version} 不同的是,导言区不写或注释 \lstinline{\date} 的话,仍然会打印出当日日期,原因是 \lstinline{\date} 有默认参数。如果不需要日期的话,日期可以留空即可,也即 \lstinline|\date{}|。
\item \textit{如何获得中文日期?}\\
为了获得中文日期,必须在中文模式下\footnote{英文模式下,由于未加载中文宏包,无法输入中文。},使用 \lstinline|\date{\zhdate{2019/10/11}}|,如果需要当天的汉化日期,可以使用 \lstinline|\date{\zhtoday}|,这两个命令都来源于 \href{https://ctan.org/pkg/zhnumber}{\lstinline{zhnumber}} 宏包。
\item \textit{如何添加多个作者?}\\
\lstinline{\author} 里面使用 \lstinline{\and},作者单位可以用 \lstinline{\\} 换行。
\begin{lstlisting}
\author{author 1\\ org. 1 \and author 2 \\ org. 2 }
\end{lstlisting}
\item \textit{如何添加中英文摘要?}\\
请参考 \href{https://github.com/ElegantLaTeX/ElegantPaper/issues/5}{GitHub::ElegantPaper/issues/5}
\end{enumerate}
\section{致谢}
特别感谢 \href{https://github.com/sikouhjw}{sikouhjw}\href{https://github.com/syvshc}{syvshc} 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 ElegantLaTeX 相关问题的回复。特别感谢 ChinaTeX 以及 \href{http://www.latexstudio.net/}{LaTeX 工作室} 对于本系列模板的大力宣传与推广。
如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。
\nocite{*}
\printbibliography[heading=bibintoc, title=\ebibname]
\appendix
%\appendixpage
\addappheadtotoc
\end{document} \end{document}

View File

@@ -1,18 +1,19 @@
%!TEX program = pdflatex %!TEX program = pdflatex
% Full chain: pdflatex -> bibtex -> pdflatex -> pdflatex % Full chain: pdflatex -> biber/bibtex -> pdflatex -> pdflatex
\documentclass[11pt,en,cite=authoryear]{elegantpaper} \documentclass[11pt,en]{elegantpaper}
\title{ElegantPaper: An Elegant \LaTeX{} Template for Working Papers} \title{ElegantPaper: An Elegant \LaTeX{} Template for Working Papers}
\author{Ethan DENG \\ Fudan University \and Dongsheng DENG \\ PA Technology} \author{Author1 \\ Institute1 \and Author2 \\ Institute2}
\institute{\href{https://github.com/ElegantLaTeX}{Elegant\LaTeX{} Program}} \institute{\href{https://github.com/ElegantLaTeX}{Elegant\LaTeX{} Program}}
\version{0.09} \version{0.11}
\date{\today} \date{Dec. 31, 2022}
% cmd for this doc % cmd for this doc
\usepackage{array} \usepackage{array}
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}} \newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
\addbibresource[location=local]{reference.bib} % reference file
\begin{document} \begin{document}
\maketitle \maketitle
@@ -22,6 +23,15 @@ This documentation illustrates the usage of the \href{https://github.com/Elegant
\keywords{Elegant\LaTeX{}, Working Paper, Template} \keywords{Elegant\LaTeX{}, Working Paper, Template}
\end{abstract} \end{abstract}
\textcolor{red}{\bfseries Caution: This template will no longer be maintained since January 1st, 2023.}
\section*{Update Notes}
This version changes two important parts: fonts and bibliography.
\textbf{Fonts}: Due to the newtx package updates, we change the font settings for all the templates of ElegantLaTeX. Under \hologo{XeLaTeX}, we use \lstinline{fontspec} package to set the font to TeX Gyre Terms/Heros.
\textbf{Bibliography}: The bib file is no longer \lstinline{wpref.bib}, it's same with ElegantBook bibfile, \lstinline{reference.bib}. Besides, we use biblatex/biber rather than bibtex to handler bibliography, you can use bibstyle and citestyle to set the styles. For convenience, we offer a \lstinline{bibend} option, which can take values of \lstinline{biber} (default) and \lstinline{bibtex}, please refer to Bibliography section and biblatex package document for more information.
\section{Introduction} \section{Introduction}
@@ -36,7 +46,7 @@ This template is based on the standard \LaTeX{} article class, hence the argumen
Language mode option \lstinline{lang} allows two alternative inputs, \lstinline{lang=en} (default) for English or \lstinline{lang=cn} for Chinese. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese. You can use this option as Language mode option \lstinline{lang} allows two alternative inputs, \lstinline{lang=en} (default) for English or \lstinline{lang=cn} for Chinese. \lstinline{lang=cn} will make the caption of figure/table, abstract name, refname etc. Chinese. You can use this option as
\begin{lstlisting} \begin{lstlisting}
\documentclass[lang=cn]{elegantpaper} % or \documentclass[lang=cn]{elegantpaper} % or
\documentclass{cn}{elegantpaper} \documentclass[cn]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\textbf{Note:} Under the English mode \lstinline{lang=en}, Chinese characters are not allowed. To type in Chinese, please load \lstinline{ctex} or \lstinline{xeCJK} package at the preamble as: \textbf{Note:} Under the English mode \lstinline{lang=en}, Chinese characters are not allowed. To type in Chinese, please load \lstinline{ctex} or \lstinline{xeCJK} package at the preamble as:
\begin{lstlisting} \begin{lstlisting}
@@ -58,132 +68,42 @@ This template defines a new option (\lstinline{math}), with three options:
Default \LaTeX{} commands and environments are all the same in this template\footnote{To ensure the codes are replicatable. We recommend users pay more attention to the contents other than formats. This is the meaning of the existence of the template.}. We created four new commands: Default \LaTeX{} commands and environments are all the same in this template\footnote{To ensure the codes are replicatable. We recommend users pay more attention to the contents other than formats. This is the meaning of the existence of the template.}. We created four new commands:
\begin{enumerate} \begin{enumerate}
\item \lstinline{\email}: create the hyperlink to email address. \item \lstinline{\email}: create the hyperlink to email address.
\item \lstinline{\figref}: same usage as \lstinline{\ref}, but start with label text <\textbf{Figure n}>. \item \lstinline{\figref}: same usage as \lstinline{\ref}, but start with label text \textbf{Figure n}.
\item \lstinline{\tabref}: same usage as \lstinline{\ref}, but start with label text <\textbf{Table n}>. \item \lstinline{\tabref}: same usage as \lstinline{\ref}, but start with label text \textbf{Table n}.
\item \lstinline{\keywords}: create the keywords in the abstract section. \item \lstinline{\keywords}: create the keywords in the abstract section.
\end{enumerate} \end{enumerate}
\subsection{Bibliography} \subsection{Bibliography}
This template used \hologo{BibTeX} to generate the bibliography, the default bibliography style is \lstinline{aer} under the option \lstinline{lang=en}. Citation example: ~\citep{en1,en2,en3} used 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 \hologo{BibTeX}, you must create a file named \lstinline{wpref.bib}, and add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{wpref.bib} file, and cite the bibkey in the \lstinline{tex} file. Note that \hologo{BibTeX} has to be added. This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are both \lstinline{numeric}. Let's take a glance at the citation effect. ~\cite{en1} use data from a major peer-to-peer lending \cite{en3} marketplace in China to study whether female and male investors evaluate loan performance differently \parencite{en2}.
If you want to use biblatex, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The biber will automatically generate the bibliography for the reference you cited.
To change the bibliography style, this version introduces two options: \lstinline{citestyle} and \lstinline{bibstyle}, please refer to \href{https://ctan.org/pkg/biblatex}{CTAN:biblatex} for more detail about these options. You can change your bibliography style as
Three options for the references, \lstinline{cite=numbers} (default), \lstinline{cite=super} and \lstinline{cite=authoryear}. Those who major in science and engineering use \lstinline{numbers} and \lstinline{super} more often, while those who major in arts use \lstinline{authoryear} more frequently. To switch different options, use
\begin{lstlisting} \begin{lstlisting}
\documentclass[cite=super]{elegantpaper} % super style ref style \documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantpaper}
\documentclass[super]{elegantpaper}
\documentclass[cite=authoryear]{elegantpaper} % author-year ref style
\documentclass[authoryear]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\section{Recruit Support Members} We also add the \lstinline{bibend} option to this template, you can choose \lstinline{biber} (default) or \lstinline{bibtex} as you like, \lstinline{biber} is recommended.
Recruit support members for Elegant\LaTeX{} to translate template official guide, maintain wiki entries(Markdown), update Wechat articles. No deadline for this recruitment.
So far, Elegant\LaTeX{} has four support members:
\begin{itemize}
\item OG Translator: \href{https://github.com/peggy2006xzyz}{YPY};
\item Wiki Maintainer: \href{https://github.com/izinngo}{Ingo Zinngo}, \href{https://github.com/xiaohao890809}{Xiaohao890809};
\item QQ Group Manager: \href{https://github.com/sikouhjw}{Sikouhjw}.
\end{itemize}
Thank them all!!!
\section{Acknowledgement}
The number of stars on GitHub for ElegantPaper reached 277 on April 12, 2020 at the release of ElegantPaper v0.09. Thank China\TeX{} and \href{http://www.latexstudio.net/}{\LaTeX{} studio} for their promotion. If you like our templates, you can star it on GitHub.
\begin{figure}[!ht]
\centering
\includegraphics[width=\textwidth]{star.png}
\caption{Twinkle, Twinkle, Little Star}
\end{figure}
\section{Donation}
To express your love for our templates and/or our developers, please do not hesitate to tip us.
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.4\textwidth]{donate.jpg}
\end{figure}
\textbf{The explanation right of the tip usage belongs to Elegant\LaTeX{} with no supervision. Feel free to tip us.} Those who donate more than 10 RMB will be recorded in the donation list. Thank all the tippers!
\begin{table}[!htb]
\centering
\caption{Donation List}
\begin{tabular}{*{4}{>{\scriptsize}c}|*{4}{>{\scriptsize}c}}
\toprule
\textbf{Tipper} & \textbf{Amount} & \textbf{Date} & \textbf{Channel} & \textbf{Tipper} & \textbf{Amount} & \textbf{Date} & \textbf{Channel} \\
\midrule
Lerh & 10 RMB & 2019/05/15 & Wechat & yueguodipingxian & 10 RMB & 2019/05/15 & Wechat \\
yinsang & 20 RMB & 2019/05/27 & Wechat & *kong & 10 RMB & 2019/05/30 & Wechat \\
latexstudio.net & 666 RMB & 2019/06/05 & Alipay & A*n & 40 RMB & 2019/06/15 & Wechat \\
* xia & 22 RMB & 2019/06/15 & Wechat & * qian & 21 RMB & 2019/06/15 & Wechat \\
Cassis & 11 RMB & 2019/06/30 & Wechat & * jun & 10 RMB & 2019/07/23 & Wechat \\
P*u & 50 RMB & 2019/07/30 & Wechat & * meng & 19 RMB & 2019/08/28 & Wechat \\
Qu Doudou & 10 RMB & 2019/08/28 & Wechat & Li Bo & 100 RMB & 2019/10/06 & Wechat \\
Njustsll & 10 RMB & 2019/10/11 & Wechat & Liu Zhikuo & 99.99 RMB & 2019/10/15 & Alipay \\
* tao & 16 RMB & 2019/10/17 & Wechat & Chini & 12 RMB & 2019/10/17 & Alipay \\
yuanfengjing & 10 RMB & 2019/10/28 & Wechat & Guo Deliang & 88 RMB & 2019/11/03 & Wechat \\
ziqiangbuxi & 20 RMB & 2019/11/04 & Alipay & dushuzhichong & 20 RMB & 2019/11/18 & Wechat \\
* deng & 10 RMB & 2019/11/18 & Wechat & * zhe & 20 RMB & 2019/11/18 & Wechat \\
anonymous & 10 RMB & 2019/11/24 & Wechat & Jiye Qian & 66 RMB & 2019/12/04 & Wechat \\
* yang & 20 RMB & 2019/12/05 & Wechat & Catcher & 11 RMB & 2019/12/08 & Alipay \\
xierbotementu & 10 RMB & 2019/12/09 & Alipay & * wei & 10 RMB & 2019/12/09 & Wechat \\
Simon & 20 RMB & 2019/12/11 & Alipay & liushangqianyi & 66.60 RMB & 2019/12/18 & Alipay \\
yu & 10 RMB & 2019/12/20 & Alipay & *chen & 15 RMB & 2019/12/20 & Wechat \\
suifeng & 20 RMB & 2019/12/27 & Alipay & Ws & 23.30 RMB & 2019/12/28 & Wechat \\
chuba & 100 RMB & 2020/01/02 & Alipay & p*e & 20 RMB & 2020/01/03 & Wechat \\
Shunmx & 100 RMB & 2020/01/03 & Wechat & hj & 10 RMB & 2020/01/03 & Wechat \\
F*5 & 10 RMB & 2020/01/03 & Wechat & S*m & 20.20 RMB & 2020/01/03 & Wechat \\
erdaiqingzhi & 13 RMB & 2020/01/14 & Alipay & *? & 66 RMB & 2020/01/15 & Wechat \\
Mr. Xiong & 20 RMB & 2020/01/17 & Wechat & *bo & 15 RMB & 2020/01/18 & Wechat \\
*Zhe & 10 RMB & 2020/02/02 & Wechat & Jackie & 88.80 RMB & 2020/02/09 & Wechat \\
Henry\_Sun & 50 RMB & 2020/02/14 & Alipay & * Qiao & 50 RMB & 2020/02/21 & Wechat \\
YunLian & 10 RMB & 2020/03/02 & Alipay & S*y & 10 RMB & 2020/03/15 & Wechat \\
* Ge & 66.66 RMB & 2020/03/17 & Wechat & K*e & 30 RMB & 2020/03/30 & Wechat\\
* Yang & 20 RMB & 2020/04/02 & Wechat & Shi*n & 30 RMB & 2020/04/11 & Wechat \\
\bottomrule
\end{tabular}%
\label{tab:donation}%
\end{table}%
\section{FAQ}
\begin{enumerate}[label=\arabic*).]
\item \textit{How to remove the information of version?}\\
Please comment \lstinline|\version{x.xx}|.
\item \textit{How to remove the information of date?}\\
Please type in \lstinline|\date{}|.
\item \textit{How to add several authors?}\\
Use \lstinline{\and} in \lstinline{\author} and use \lstinline{\\} to start a new line.
\begin{lstlisting}
\author{author 1\\ org. 1 \and author 2 \\ org. 2 }
\end{lstlisting}
\item \textit{How to display bilingual abstracts?}\\
Please refer to \href{https://github.com/ElegantLaTeX/ElegantPaper/issues/5}{GitHub::ElegantPaper/issues/5}
\end{enumerate}
\nocite{en1,en2}
\bibliography{wpref}
\appendix
%\appendixpage
\addappheadtotoc
\section{Use newtx fonts}
If you use \lstinline{newtx} fonts, type in:
\begin{lstlisting} \begin{lstlisting}
\documentclass[math=newtx]{elegantbook} \documentclass[bibtex]{elegantpaper} % or
\documentclass[bibend=bibtex]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\subsection{Hyphens}
\subsection{Use newtx fonts}
If you use \lstinline{newtx} fonts, you can use the \lstinline{math} option as
\begin{lstlisting}
\documentclass[math=newtx]{elegantpaper}
\end{lstlisting}
\subsubsection{Hyphens}
Since the template uses \lstinline{newtx}, please pay attention to the hyphens. For instance, Since the template uses \lstinline{newtx}, please pay attention to the hyphens. For instance,
\begin{equation} \begin{equation}
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
@@ -196,7 +116,7 @@ The corresponding code is:
\end{equation} \end{equation}
\end{lstlisting} \end{lstlisting}
\subsection{Symbol Fonts} \subsubsection{Symbol Fonts}
Feedback from ElegantBook users claims that error occurs when using our templates with \lstinline{yhmath}, \lstinline{esvect} and other packages. Feedback from ElegantBook users claims that error occurs when using our templates with \lstinline{yhmath}, \lstinline{esvect} and other packages.
\begin{lstlisting} \begin{lstlisting}
LaTeX Error: LaTeX Error:
@@ -205,15 +125,34 @@ Too many symbol fonts declared.
The reason is that the template redefines font for math so that no new math font is allowed to be added. To use \lstinline{yhmath} and/or \lstinline{esvect}, please locate \lstinline{yhmath} or \lstinline{esvect} in \lstinline{elegantpaper.cls}, uncomment corresponding related code. The reason is that the template redefines font for math so that no new math font is allowed to be added. To use \lstinline{yhmath} and/or \lstinline{esvect}, please locate \lstinline{yhmath} or \lstinline{esvect} in \lstinline{elegantpaper.cls}, uncomment corresponding related code.
\begin{lstlisting}
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
%%% use esvect pkg, uncomment following code \section{FAQ}
% \RequirePackage{esvect}
\end{lstlisting} \begin{enumerate}[label=\arabic*).]
\item \textit{How to remove the information of version?}\\
Please comment \lstinline|\version{x.xx}|.
\item \textit{How to remove the information of date?}\\
Please type in \lstinline|\date{}|.
\item \textit{How to add several authors?}\\
Use \lstinline{\and} in \lstinline{\author} and use \lstinline{\\} to start a new line.
\begin{lstlisting}
\author{author 1\\ org. 1 \and author 2 \\ org. 2 }
\end{lstlisting}
\item \textit{How to display bilingual abstracts?}\\
Please refer to \href{https://github.com/ElegantLaTeX/ElegantPaper/issues/5}{GitHub::ElegantPaper/issues/5}
\end{enumerate}
\section{Acknowledgement}
Thank \href{https://github.com/sikouhjw}{sikouhjw} and \href{https://github.com/syvshc}{syvshc} for their quick response to Github issues and continuously support work for ElegantLaTeX. Thank ChinaTeX and \href{http://www.latexstudio.net/}{LaTeX Studio} for their promotion.
\printbibliography[heading=bibintoc, title=\ebibname]
\appendix
%\appendixpage
\addappheadtotoc
\end{document} \end{document}

View File

@@ -4,9 +4,10 @@
% Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper % Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper
% --- Class structure: identification part % --- Class structure: identification part
\ProvidesClass{elegantpaper}[2020/04/12 v0.09 ElegantLaTeX Paper class] \ProvidesClass{elegantpaper}[2022/12/31 v0.11 ElegantLaTeX Paper class]
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
%%%
\RequirePackage{kvoptions} \RequirePackage{kvoptions}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{calc} \RequirePackage{calc}
@@ -20,12 +21,13 @@
\DeclareStringOption[cm]{math} \DeclareStringOption[cm]{math}
\DeclareStringOption[numbers]{cite} \DeclareStringOption[numeric-comp]{citestyle}
\DeclareVoidOption{numbers}{\ekv{cite=numbers}} \DeclareStringOption[numeric]{bibstyle}
\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}}
\DeclareVoidOption{super}{\ekv{cite=super}} \DeclareStringOption[biber]{bibend}
\DeclareVoidOption{biber}{\ekv{bibend=biber}}
\DeclareVoidOption{bibtex}{\ekv{bibend=bibtex}}
\DeclareStringOption[apalike]{bibstyle}
\DeclareStringOption[ctexfont]{chinesefont} \DeclareStringOption[ctexfont]{chinesefont}
\DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}} \DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}}
@@ -78,7 +80,7 @@
\graphicspath{{image/}{figure/}{fig/}{img/}} \graphicspath{{image/}{figure/}{fig/}{img/}}
% caption settings % caption settings
\RequirePackage[font=small,labelfont={bf}]{caption} \RequirePackage[labelfont={bf}]{caption}
\captionsetup[table]{skip=3pt} \captionsetup[table]{skip=3pt}
\captionsetup[figure]{skip=3pt} \captionsetup[figure]{skip=3pt}
@@ -101,35 +103,58 @@
% font settings % font settings
\PassOptionsToPackage{no-math}{fontspec}
\ifdefstring{\ELEGANT@lang}{cn}{
\ifXeTeX
\ifdefstring{\ELEGANT@chinesefont}{founder}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}{FZKai-Z03}
\setCJKfamilyfont{zhfs}{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{ \PassOptionsToPackage{no-math}{fontspec}
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} \PassOptionsToPackage{quiet}{fontspec}
\else \RequirePackage{iftex}
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax} \ifXeTeX
\fi \RequirePackage[no-math]{fontspec}
\setmainfont{texgyretermes}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 1.0]
\setsansfont{texgyreheros}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 0.9]
\else
\RequirePackage{newtxtext}
\RequirePackage[scaled=.90]{helvet}
\fi
\ifdefstring{\ELEGANT@lang}{cn}{
\ifdefstring{\ELEGANT@chinesefont}{founder}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\AfterEndPreamble{ \AfterEndPreamble{
% \renewcommand{\itshape}{\kaishu} \setlength\parindent{2\ccwd}}
\setlength\parindent{2\ccwd}}}{\relax} }{\relax}
\ifcsname kaishu\endcsname \ifcsname kaishu\endcsname
\newcommand{\citshape}{\kaishu} \newcommand{\citshape}{\kaishu}
@@ -148,7 +173,6 @@
\newcommand{\cfs}{\normalfont} \newcommand{\cfs}{\normalfont}
\fi \fi
\RequirePackage{newtxtext}
\ifdefstring{\ELEGANT@math}{newtx}{ \ifdefstring{\ELEGANT@math}{newtx}{
\RequirePackage{newtxmath} \RequirePackage{newtxmath}
\let\Bbbk\relax \let\Bbbk\relax
@@ -168,6 +192,12 @@
\DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51} \DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51}
}{\relax} }{\relax}
\RequirePackage[
backend=\ELEGANT@bibend,
citestyle=\ELEGANT@citestyle,
bibstyle=\ELEGANT@bibstyle]{biblatex}
\RequirePackage{appendix} \RequirePackage{appendix}
\ifdefstring{\ELEGANT@lang}{cn}{ \ifdefstring{\ELEGANT@lang}{cn}{
@@ -191,6 +221,7 @@
\renewcommand\tablename{}% \renewcommand\tablename{}%
\newcommand\versiontext{}% \newcommand\versiontext{}%
\newcommand\updatetext{}% \newcommand\updatetext{}%
\newcommand{\ebibname}{}
\renewcommand\abstractname{\hspace{2em}} \renewcommand\abstractname{\hspace{2em}}
\setlength\parindent{2\ccwd} \setlength\parindent{2\ccwd}
\renewcommand{\abstracttextfont}{\small\citshape\noindent\ignorespaces} \renewcommand{\abstracttextfont}{\small\citshape\noindent\ignorespaces}
@@ -198,12 +229,6 @@
\newcommand{\keywords}[1]{\vskip2ex\par\noindent\normalfont{\bfseries : } #1} \newcommand{\keywords}[1]{\vskip2ex\par\noindent\normalfont{\bfseries : } #1}
\newcommand\figref[1]{{\bfseries ~\ref{#1}}} \newcommand\figref[1]{{\bfseries ~\ref{#1}}}
\newcommand\tabref[1]{{\bfseries ~\ref{#1}}} \newcommand\tabref[1]{{\bfseries ~\ref{#1}}}
\RequirePackage{gbt7714}
\ifdefstring{\ELEGANT@cite}{authoryear}{
\bibliographystyle{gbt7714-author-year}}{
\bibliographystyle{gbt7714-numerical}}
\ifdefstring{\ELEGANT@cite}{numbers}{
\citestyle{numbers}}{\relax}
\renewcommand{\appendixtocname}{} \renewcommand{\appendixtocname}{}
\renewcommand{\appendixpagename}{}}{\relax} \renewcommand{\appendixpagename}{}}{\relax}
@@ -230,10 +255,9 @@
\newcommand{\keywords}[1]{\vskip 2ex\par\noindent\normalfont{\bfseries Keywords: } #1} \newcommand{\keywords}[1]{\vskip 2ex\par\noindent\normalfont{\bfseries Keywords: } #1}
\newcommand\figref[1]{{\bfseries Figure~\ref{#1}}} \newcommand\figref[1]{{\bfseries Figure~\ref{#1}}}
\newcommand\tabref[1]{{\bfseries Table~\ref{#1}}} \newcommand\tabref[1]{{\bfseries Table~\ref{#1}}}
\RequirePackage[\ELEGANT@cite,sort&compress]{natbib} \newcommand{\ebibname}{Bibliography}}{\relax}
\bibliographystyle{\ELEGANT@bibstyle}}{\relax}
\setlength{\bibsep}{0.0pt}
\def\bibfont{\footnotesize} \def\bibfont{\footnotesize}
\AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}} \AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}}
@@ -343,5 +367,5 @@
% restore the tt default family to lmodern tt family
\renewcommand\ttdefault{lmtt}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB