16 Commits

Author SHA1 Message Date
OsbertWang
5abcd8ffd3 Merge pull request #94 from myhsia/master
类似 ElegantBook: PR #249, 规范一些用法
2026-02-28 16:39:32 +08:00
myhsia
e5e85d55a0 Replaced latexmk -xelatex to latexmk -pdfxe as OsbertWang suggested 2026-02-28 16:18:27 +08:00
myhsia
1851d4967e Similar to ElegantBook 2026-02-28 16:08:55 +08:00
ranwang
3298966253 删除 build.lua 的 synctex 2026-02-28 13:51:41 +08:00
ranwang
b420debc5d build.lua eol 2026-02-28 13:13:18 +08:00
ranwang
11ffdf9d67 add l3build file build.lua 2026-02-28 13:06:37 +08:00
ranwang
c49463a813 gitattributes 2026-02-28 12:01:26 +08:00
ranwang
366d1e095a re-release since 2026 2026-02-27 10:40:06 +08:00
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
9 changed files with 151 additions and 46 deletions

9
.gitattributes vendored Normal file
View File

@@ -0,0 +1,9 @@
* text=auto
*.tex text eol=lf
.gitignore text eol=lf
LICENSE text eol=lf
*.md text eol=lf
.gitattributes text eol=lf
*.cls text eol=lf
*.bib text eol=lf
build.lua text eol=lf

3
.gitignore vendored
View File

@@ -44,6 +44,9 @@ elegant*-en.pdf
*.synctex.gz *.synctex.gz
*.synctex.gz(busy) *.synctex.gz(busy)
*.pdfsync *.pdfsync
/build
*.curlopt
*.zip
## Auxiliary and intermediate files from other packages: ## Auxiliary and intermediate files from other packages:
# algorithms # algorithms

View File

@@ -1,20 +1,22 @@
<!-- Author: Dongsheng Deng --> <!-- Author: Dongsheng Deng & Ran Wang -->
<!-- Email: ddswhu@outlook.com --> <!-- Email: ddswhu@outlook.com & ranwang.osbert@outlook.com -->
# ElegantPaper # ElegantPaper
[Homepage](https://elegantlatex.org/) | [Github](https://github.com/ElegantLaTeX/ElegantPaper) | [CTAN](https://ctan.org/pkg/elegantpaper) | [Download](https://github.com/ElegantLaTeX/ElegantPaper/releases) | [Wiki](https://github.com/ElegantLaTeX/ElegantPaper/wiki) | [Weibo](https://weibo.com/elegantlatex) [Github](https://github.com/ElegantLaTeX/ElegantPaper) | [CTAN](https://ctan.org/pkg/elegantpaper) | [Download](https://github.com/ElegantLaTeX/ElegantPaper/releases) | [Wiki](https://github.com/ElegantLaTeX/ElegantPaper/wiki)
![License](https://img.shields.io/ctan/l/elegantpaper.svg) ![License](https://img.shields.io/ctan/l/elegantpaper.svg)
![CTAN Version](https://img.shields.io/ctan/v/elegantpaper.svg) ![CTAN Version](https://img.shields.io/ctan/v/elegantpaper.svg)
![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)
**本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。**
**This template was discontinued as of January 1, 2023, and its use was not recommended. However, due to its large user base, it has been re-released since 2026. To ensure that users of previous versions can still access the documentation, this documentation retains past information.**
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 ranwang.osbert@outlook.com.
此模板基于 LaTeX 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒适,简便的写作体验。如果你有其他问题、建议或者报告 bug可以提交 issues 或者给我们发邮件:elegantlatex2e@gmail.com。用户 QQ 交流群Q 群692108391欢迎加入。 此模板基于 LaTeX 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒适,简便的写作体验。如果你有其他问题、建议或者报告 bug可以提交 issues 或者给我们发邮件:ranwang.osbert@outlook.com。用户 QQ 交流群Q 群692108391欢迎加入。
The official user guide is [here](https://github.com/ElegantLaTeX/ElegantPaper/releases), or you can refer to the [wiki](https://github.com/ElegantLaTeX/ElegantPaper/wiki). The official user guide is [here](https://github.com/ElegantLaTeX/ElegantPaper/releases), or you can refer to the [wiki](https://github.com/ElegantLaTeX/ElegantPaper/wiki).

97
build.lua Normal file
View File

@@ -0,0 +1,97 @@
--[==========================================[--
L3BUILD FILE FOR ELEGANTPAPER
Check PDF File & Directory After Build
--]==========================================]--
--[==========================================[--
Basic Information
Do Check Before Upload
--]==========================================]--
module = "elegantpaper"
version = "0.12"
maintainer = "Ran Wang"
uploader = maintainer
maintainid = "ElegantLaTeX"
email = "ranwang.osbert@outlook.com"
repository = "https://github.com/" .. maintainid .. "/" .. module
announcement = ""
note = ""
summary = "An Elegant LaTeX Template for Working Papers"
description = [[ElegantPaper is designed for writing working papers, 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.]]
--[==========================================[--
Build, Pack and Upload To CTAN
Do not Modify Unless Necessary
--]==========================================]--
ctanzip = module
excludefiles = {"*~"}
textfiles = {"*.md", "LICENSE", "*.lua", "*.cls", "*.bib"}
typesetexe = "latexmk -pdf"
typesetfiles = {module .. "-cn.tex", module .. "-en.tex"}
typesetopts = "-interaction=nonstopmode"
typesetruns = 1
typesetsuppfiles = {"*.cls", "*.bib"}
imagesuppdir = "image"
specialtypesetting = specialtypesetting or {}
specialtypesetting[module .. "-cn.tex"] = {cmd = "latexmk -pdfxe"}
uploadconfig = {
pkg = module,
version = version,
author = maintainer,
uploader = uploader,
email = email,
summary = summary,
description = description,
announcement = announcement,
note = note,
license = "lppl1.3c",
ctanPath = "/macros/latex/contrib/" .. module .. "/",
home = repository,
support = repository .. "/issues",
bugtracker = repository .. "/issues",
repository = repository,
development = "https://github.com/" .. maintainid,
update = true
}
function tex(file, dir, cmd)
dir = dir or "."
cmd = cmd or typesetexe .. " " .. typesetopts
return run(dir, cmd .. " " .. file)
end
-- Copy required files into the typeset build dir
function docinit_hook()
-- Copy .cls, .bib support files
for _, glob in pairs(typesetsuppfiles) do
cp(glob, currentdir, typesetdir)
end
-- Copy image subdirectory
local dest = typesetdir .. "/" .. imagesuppdir
mkdir(dest)
cp("*", imagesuppdir, dest)
-- Copy tex source files
for _, texfile in pairs(typesetfiles) do
cp(texfile, currentdir, typesetdir)
end
return 0
end
-- Pack CTAN directory
function copyctan()
local pkgdir = ctandir .. "/" .. ctanpkg
mkdir(pkgdir)
for _, glob in pairs(typesetsuppfiles) do
cp(glob, currentdir, pkgdir)
end
for _, texfile in pairs(typesetfiles) do
cp(texfile, currentdir, pkgdir)
end
for _, glob in pairs(pdffiles or {"*.pdf"}) do
cp(glob, typesetdir, pkgdir)
end
local dest = pkgdir .. "/" .. imagesuppdir
mkdir(dest)
cp("*", imagesuppdir, dest)
end

View File

@@ -1,57 +1,53 @@
%!TEX program = xelatex \documentclass[lang=cn,a4paper,newtx]{elegantpaper}
% 完整编译: xelatex -> biber/bibtex -> xelatex -> xelatex
\documentclass[lang=cn,11pt,a4paper]{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://github.com/ElegantLaTeX}{Elegant\LaTeX\ 项目组}}
\version{0.10}
\date{\zhtoday}
\version{0.12}
\date{\zhdate{2026/2/27}}
% 本文档命令 % 本文档命令
\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}
\maketitle \maketitle
\begin{abstract} \begin{abstract}
本文为 \href{https://github.com/ElegantLaTeX/ElegantPaper/}{ElegantPaper} 的说明文档。此模板基于 \LaTeX{} 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒心的写作体验。如果你有其他问题、建议或者报告 bug可以在 \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{GitHub::ElegantPaper/issues} 留言。如果你想了解更多 Elegant\LaTeX{} 项目组设计的模板,请访问 \href{https://github.com/ElegantLaTeX/}{GitHub::ElegantLaTeX} 本文为 \href{https://github.com/ElegantLaTeX/ElegantPaper/}{ElegantPaper} 的说明文档。此模板基于 \LaTeX\ 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒心的写作体验。如果你有其他问题、建议或者报告 bug可以在 \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{GitHub::ElegantPaper/issues} 留言。如果你想了解更多 Elegant\LaTeX\ 项目组设计的模板,请访问 \href{https://github.com/ElegantLaTeX/}{GitHub::ElegantLaTeX}
\keywords{Elegant\LaTeX{},工作论文,模板} \keywords{Elegant\LaTeX{},工作论文,模板}
\end{abstract} \end{abstract}
\section{模板使用须知} \section{模板使用须知}
\textcolor{red}{\bfseries 本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}
\subsection{注意事项} \subsection{注意事项}
\textbf{文献部分}:我们将 bibtex 的默认文献编译方式改为 biblatex不过我们也提供了两个后端\lstinline{bibend=biber}\lstinline{bibend=bibtex}。特别需要注意的是从 0.10 开始,文献文件改为 \lstinline{reference.bib},与 ElegantBook 保持一致,而参考文献的引文样式等更多格式,请参考后文参考文献部分,更多样式可以参考 biblatex 文档。
时隔两年,本模板迎来更新,中间发生了很多变化,两个主要变化是参考文献与字体设定,\textbf{使用前请务必仔细阅读本文档} \textbf{字体部分},我们将 newtxtext 宏包的支持方式改为了字体名称设定方式,设定英文字体为 TeX Gyre Terms/Heros英文字体部分根据编译方式选择不同字体。对于一般用户而言不太需要关心这部分内容
\textbf{文献部分}:我们将 bibtex 的默认文献编译方式改为 biblatex不过我们也提供了两个后端\lstinline{bibend=biber}\lstinline{bibend=bibtex}。特别需要注意的是,从 0.10 开始,文献文件改为 \lstinline{reference.bib},与 ElegantBook 保持一致,而参考文献的引文样式等更多格式,请参考后文参考文献部分,更多样式可以参考 biblatex 文档。
\textbf{字体部分},我们将 newtxtext 宏包的支持方式改为了字体名称设定方式,设定英文字体为 TeX Gyre Terms/Heros英文字体部分根据编译方式选择不同字体。对于一般用户而言不太需要关心这部分内容。
另外,中文请务必使用 \hologo{XeLaTeX} 编译。 另外,中文请务必使用 \hologo{XeLaTeX} 编译。
\subsection{模板介绍} \subsection{模板介绍}
此模板基于 \LaTeX{} 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。 此模板基于 \LaTeX\ 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。
\begin{lstlisting} \begin{lstlisting}
\documentclass[a4paper,11pt]{elegantpaper} \documentclass[a4paper,11pt]{elegantpaper}
\end{lstlisting} \end{lstlisting}
\textbf{注意}Elegant\LaTeX{} 系列模板已经全部上传至 \href{https://www.overleaf.com/latex/templates/elegantpaper-template/yzghrqjhmmmr}{Overleaf} 上,用户可以在线使用。另外,为了方便国内用户,模板也已经传至\href{https://gitee.com/ElegantLaTeX/ElegantPaper}{码云} \textbf{注意}Elegant\LaTeX\ 系列模板已经全部上传至 \href{https://www.overleaf.com/latex/templates/elegantpaper-template/yzghrqjhmmmr}{Overleaf} 上,用户可以在线使用。另外,为了方便国内用户,模板也已经传至\href{https://gitee.com/ElegantLaTeX/ElegantPaper}{码云}
\subsection{全局选项} \subsection{全局选项}
此模板定义了一个语言选项 \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} 宏包后自行设置字体。
@@ -63,7 +59,7 @@
本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个: 本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个:
\begin{enumerate} \begin{enumerate}
\item \lstinline{math=cm}(默认),使用 \LaTeX{} 默认数学字体(推荐,无需声明); \item \lstinline{math=cm}(默认),使用 \LaTeX\ 默认数学字体(推荐,无需声明);
\item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。 \item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。
\item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。 \item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。
\end{enumerate} \end{enumerate}
@@ -78,7 +74,7 @@
\end{enumerate} \end{enumerate}
\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 用户请右键选择为全部用户安装,否则会找不到字体。}
\begin{figure}[!htb] \begin{figure}[!htb]
\centering \centering
@@ -104,9 +100,9 @@
\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}:为摘要环境添加关键词。

View File

@@ -1,27 +1,27 @@
%!TEX program = pdflatex
% Full chain: pdflatex -> biber/bibtex -> pdflatex -> pdflatex
\documentclass[11pt,en]{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.10} \version{0.12}
\date{\today} \date{Feb. 27, 2026}
% 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
\begin{abstract} \begin{abstract}
This documentation illustrates the usage of the \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} template. This template is based on the standard \LaTeX{} article class, which is designed for working paper writing. With this template, you can get rid of all the worries about the format and merely focus on writing. For any question, please leave a message on \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{GitHub::ElegantPaper/issues}. Want to know more about Elegant\LaTeX{} Templates? Please visit: \href{https://github.com/ElegantLaTeX}{https://github.com/ElegantLaTeX}.\par This documentation illustrates the usage of the \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} template. This template is based on the standard \LaTeX\ article class, which is designed for working paper writing. With this template, you can get rid of all the worries about the format and merely focus on writing. For any question, please leave a message on \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{GitHub::ElegantPaper/issues}. Want to know more about Elegant\LaTeX\ Templates? Please visit: \href{https://github.com/ElegantLaTeX}{https://github.com/ElegantLaTeX}.\par
\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. However, due to its user base, maintenance has resumed and the template has been re-released as of 2026.}
\section*{Update Notes} \section*{Update Notes}
@@ -33,7 +33,7 @@ This version changes two important parts: fonts and bibliography.
\section{Introduction} \section{Introduction}
This template is based on the standard \LaTeX{} article class, hence the arguments of article class are acceptable (\lstinline{a4paper}, \lstinline{10pt} and etc.). Alternative engines are \hologo{pdfLaTeX} and \hologo{XeLaTeX}. This template is based on the standard \LaTeX\ article class, hence the arguments of article class are acceptable (\lstinline{a4paper}, \lstinline{10pt} and etc.). Alternative engines are \hologo{pdfLaTeX} and \hologo{XeLaTeX}.
\begin{lstlisting} \begin{lstlisting}
\documentclass[a4paper,11pt]{elegantpaper} \documentclass[a4paper,11pt]{elegantpaper}
@@ -44,7 +44,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}
@@ -56,14 +56,14 @@ Language mode option \lstinline{lang} allows two alternative inputs, \lstinline{
This template defines a new option (\lstinline{math}), with three options: This template defines a new option (\lstinline{math}), with three options:
\begin{enumerate} \begin{enumerate}
\item \lstinline{math=cm} (default), use \LaTeX{} default math font (recommended). \item \lstinline{math=cm} (default), use \LaTeX\ default math font (recommended).
\item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs). \item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs).
\item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font. \item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font.
\end{enumerate} \end{enumerate}
\subsection{Custom Commands} \subsection{Custom 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: 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}.

View File

@@ -1,10 +1,9 @@
% Author: Dongsheng Deng % Author: Dongsheng Deng & Ran Wang
% Homepage: https://ddswhu.me/ % Email: ranwang.osbert@outlook.com
% Email: elegantlatex2e@gmail.com
% Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper % Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper
% --- Class structure: identification part % --- Class structure: identification part
\ProvidesClass{elegantpaper}[2022/04/09 v0.10 ElegantLaTeX Paper class] \ProvidesClass{elegantpaper}[2026/2/27 v0.12 ElegantLaTeX Paper class]
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
%%% %%%
@@ -197,7 +196,6 @@
backend=\ELEGANT@bibend, backend=\ELEGANT@bibend,
citestyle=\ELEGANT@citestyle, citestyle=\ELEGANT@citestyle,
bibstyle=\ELEGANT@bibstyle]{biblatex} bibstyle=\ELEGANT@bibstyle]{biblatex}
\defbibheading{elegantbook}[\ebibname]{#1}
\RequirePackage{appendix} \RequirePackage{appendix}
@@ -366,7 +364,7 @@
backgroundcolor=\color{lightgrey} backgroundcolor=\color{lightgrey}
} }
\addbibresource[location=local]{reference.bib}
% restore the tt default family to lmodern tt family % restore the tt default family to lmodern tt family
\renewcommand\ttdefault{lmtt} \renewcommand\ttdefault{lmtt}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB