mirror of
https://github.com/ElegantLaTeX/ElegantPaper.git
synced 2026-03-28 18:24:38 +08:00
Compare commits
8 Commits
v0.11
...
5abcd8ffd3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5abcd8ffd3 | ||
|
|
e5e85d55a0 | ||
|
|
1851d4967e | ||
|
|
3298966253 | ||
|
|
b420debc5d | ||
|
|
11ffdf9d67 | ||
|
|
c49463a813 | ||
|
|
366d1e095a |
9
.gitattributes
vendored
Normal file
9
.gitattributes
vendored
Normal 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
3
.gitignore
vendored
@@ -44,6 +44,9 @@ elegant*-en.pdf
|
||||
*.synctex.gz
|
||||
*.synctex.gz(busy)
|
||||
*.pdfsync
|
||||
/build
|
||||
*.curlopt
|
||||
*.zip
|
||||
|
||||
## Auxiliary and intermediate files from other packages:
|
||||
# algorithms
|
||||
|
||||
14
README.md
14
README.md
@@ -1,22 +1,22 @@
|
||||
<!-- Author: Dongsheng Deng -->
|
||||
<!-- Email: ddswhu@outlook.com -->
|
||||
<!-- Author: Dongsheng Deng & Ran Wang -->
|
||||
<!-- Email: ddswhu@outlook.com & ranwang.osbert@outlook.com -->
|
||||
|
||||
# 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)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
**Caution: This template will no longer be maintained since January 1st, 2023.**
|
||||
**本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。**
|
||||
|
||||
**注意:本模板自 2023 年 1 月 1 日开始,不再维护,不建议使用本系列模板!**
|
||||
**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).
|
||||
|
||||
|
||||
97
build.lua
Normal file
97
build.lua
Normal 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
|
||||
@@ -1,13 +1,11 @@
|
||||
%!TEX program = xelatex
|
||||
% 完整编译: xelatex -> biber/bibtex -> xelatex -> xelatex
|
||||
\documentclass[lang=cn,a4paper,newtx]{elegantpaper}
|
||||
|
||||
\title{ElegantPaper: 一个优美的 \LaTeX{} 工作论文模板}
|
||||
\title{ElegantPaper: 一个优美的 \LaTeX\ 工作论文模板}
|
||||
\author{作者1 \\ 某某大学/机构 \and 作者2 \\ 某某大学/机构}
|
||||
\institute{\href{https://elegantlatex.org/}{Elegant\LaTeX{} 项目组}}
|
||||
\institute{\href{https://github.com/ElegantLaTeX}{Elegant\LaTeX\ 项目组}}
|
||||
|
||||
\version{0.11}
|
||||
\date{\zhdate{2022/12/31}}
|
||||
\version{0.12}
|
||||
\date{\zhdate{2026/2/27}}
|
||||
|
||||
% 本文档命令
|
||||
\usepackage{array}
|
||||
@@ -19,13 +17,13 @@
|
||||
\maketitle
|
||||
|
||||
\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{},工作论文,模板}
|
||||
\end{abstract}
|
||||
|
||||
\section{模板使用须知}
|
||||
|
||||
\textcolor{red}{\bfseries 本模板自 2023 年 1 月 1 日开始,不再维护,不建议使用本系列模板!为了保证之前版本的用户仍然能查到说明文档,本说明文档仍然保留过去的信息。}
|
||||
\textcolor{red}{\bfseries 本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}
|
||||
|
||||
\subsection{注意事项}
|
||||
\textbf{文献部分}:我们将 bibtex 的默认文献编译方式改为 biblatex,不过我们也提供了两个后端,\lstinline{bibend=biber} 和 \lstinline{bibend=bibtex}。特别需要注意的是从 0.10 开始,文献文件改为 \lstinline{reference.bib},与 ElegantBook 保持一致,而参考文献的引文样式等更多格式,请参考后文参考文献部分,更多样式可以参考 biblatex 文档。
|
||||
@@ -36,13 +34,13 @@
|
||||
|
||||
\subsection{模板介绍}
|
||||
|
||||
此模板基于 \LaTeX{} 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。
|
||||
此模板基于 \LaTeX\ 的标准文类 article 设计,所以 article 文类的选项也能传递给本模板,比如 \lstinline{a4paper, 11pt} 等等。
|
||||
|
||||
\begin{lstlisting}
|
||||
\documentclass[a4paper,11pt]{elegantpaper}
|
||||
\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{全局选项}
|
||||
@@ -61,7 +59,7 @@
|
||||
|
||||
本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个:
|
||||
\begin{enumerate}
|
||||
\item \lstinline{math=cm}(默认),使用 \LaTeX{} 默认数学字体(推荐,无需声明);
|
||||
\item \lstinline{math=cm}(默认),使用 \LaTeX\ 默认数学字体(推荐,无需声明);
|
||||
\item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。
|
||||
\item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。
|
||||
\end{enumerate}
|
||||
@@ -76,7 +74,7 @@
|
||||
\end{enumerate}
|
||||
|
||||
\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]
|
||||
\centering
|
||||
@@ -102,7 +100,7 @@
|
||||
|
||||
|
||||
\subsection{自定义命令}
|
||||
此模板并没有修改任何默认的 \LaTeX{} 命令或者环境\footnote{目的是保证代码的可复用性,请用户关注内容,不要太在意格式,这才是本工作论文模板的意义。}。另外,本模板可以使用的 4 个额外命令:
|
||||
此模板并没有修改任何默认的 \LaTeX\ 命令或者环境\footnote{目的是保证代码的可复用性,请用户关注内容,不要太在意格式,这才是本工作论文模板的意义。}。另外,本模板可以使用的 4 个额外命令:
|
||||
\begin{enumerate}
|
||||
\item \lstinline{\email}:创建邮箱地址的链接,比如 \email{xxx@outlook.com};
|
||||
\item \lstinline{\figref}:用法和 \lstinline{\ref} 类似,但是会在插图的标题前添加 <\textbf{图 n}> ;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
%!TEX program = pdflatex
|
||||
% Full chain: pdflatex -> biber/bibtex -> pdflatex -> pdflatex
|
||||
\documentclass[11pt,en]{elegantpaper}
|
||||
|
||||
\title{ElegantPaper: An Elegant \LaTeX{} Template for Working Papers}
|
||||
\title{ElegantPaper: An Elegant \LaTeX\ Template for Working Papers}
|
||||
\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.11}
|
||||
\date{Dec. 31, 2022}
|
||||
\version{0.12}
|
||||
\date{Feb. 27, 2026}
|
||||
|
||||
% cmd for this doc
|
||||
\usepackage{array}
|
||||
@@ -19,11 +17,11 @@
|
||||
\maketitle
|
||||
|
||||
\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}
|
||||
\end{abstract}
|
||||
|
||||
\textcolor{red}{\bfseries Caution: This template will no longer be maintained since January 1st, 2023.}
|
||||
\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}
|
||||
|
||||
@@ -35,7 +33,7 @@ This version changes two important parts: fonts and bibliography.
|
||||
|
||||
\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}
|
||||
\documentclass[a4paper,11pt]{elegantpaper}
|
||||
@@ -58,14 +56,14 @@ Language mode option \lstinline{lang} allows two alternative inputs, \lstinline{
|
||||
This template defines a new option (\lstinline{math}), with three options:
|
||||
|
||||
\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=mtpro2}, use \lstinline{mtpro2} package to set math font.
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
\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}
|
||||
\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}.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
% Author: Dongsheng Deng
|
||||
% Homepage: https://ddswhu.me/
|
||||
% Email: elegantlatex2e@gmail.com
|
||||
% Author: Dongsheng Deng & Ran Wang
|
||||
% Email: ranwang.osbert@outlook.com
|
||||
% Lastest Version: https://github.com/ElegantLaTeX/ElegantPaper
|
||||
|
||||
% --- Class structure: identification part
|
||||
\ProvidesClass{elegantpaper}[2022/12/31 v0.11 ElegantLaTeX Paper class]
|
||||
\ProvidesClass{elegantpaper}[2026/2/27 v0.12 ElegantLaTeX Paper class]
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
|
||||
%%%
|
||||
|
||||
Reference in New Issue
Block a user