diff --git a/elegantpaper-cn.pdf b/elegantpaper-cn.pdf index 3dd4f81..a25b4ab 100644 Binary files a/elegantpaper-cn.pdf and b/elegantpaper-cn.pdf differ diff --git a/elegantpaper-cn.tex b/elegantpaper-cn.tex index 1a1cd49..cf8bbf9 100644 --- a/elegantpaper-cn.tex +++ b/elegantpaper-cn.tex @@ -4,19 +4,17 @@ \title{ElegantPaper: 一个优美的 \LaTeX{} 工作论文模板} \author{\href{https://ddswhu.me/}{邓 东 升}} -\institute{Elegant\LaTeX{} 项目组} -\version{0.03} +\institute{\href{https://github.com/ElegantLaTeX/}{Elegant\LaTeX{} 项目组}} +\version{0.04} \date{\today} - - \begin{document} \maketitle \begin{abstract} -\noindent \sffamily 本文为 ElegantPaper 的说明文档(中文)。此模板基于 \LaTeX{} 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒适,简便的写作体验。如果你有其他问题或者建议,请联系我,我的邮箱是:\email{ddswhu@outlook.com}。如果你想了解更多由 Elegant\LaTeX{} 项目组设计的模板,请访问 \href{https://ddswhu.me/resource/}{Elegant\LaTeX{} 资源中心}。 +\noindent 本文为 \href{https://github.com/ElegantLaTeX/ElegantPaper/}{ElegantPaper} 的说明文档(中文)。此模板基于 \LaTeX{} 的 article 类,专为工作论文写作而设计。设计这个模板的初衷是让作者不用关心工作论文的格式,专心写作,从而有更加舒适,简便的写作体验。如果你有其他问题、建议或者报告 bug,可以在 \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{ElegantPaper/issues} 留言。如果你想了解更多由 Elegant\LaTeX{} 项目组设计的模板,请访问 \href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}。 \end{abstract} \section{模板介绍} @@ -36,7 +34,7 @@ \begin{itemize} \item \lstinline{newtxtext} 用于文档正文字体,类似于 Times New Roman 字体。 \item \lstinline{newtxmath} 用于数学字体,搭配 \lstinline{newtx} 非常合适,类似于过时的 \lstinline{times} 宏包的效果。 - \item \lstinline{newtxtt} 用于打字机字体, 并使用了 \lstinline{scale=0.8} 选项缩放字体。 + \item \lstinline{FiraMono} 用于打字机字体。 \item \lstinline{ctex} 用于中文字体设置,并使用了 \lstinline{scheme=plain} 选项。 \end{itemize} @@ -47,22 +45,24 @@ \RequirePackage{fontenc} \RequirePackage[no-math]{fontspec} \setmainfont{Times New Roman} +%\setmainfont{Times New Roman}[NFSSFamily=ntxtlf] \setsansfont{Arial} -%\setmonofont[Scale=0.8]{Courier New} +%\setmonofont[Scale=0.9]{Courier New} \RequirePackage{xeCJK} \RequirePackage{xunicode} \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} \setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi} -\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.8]{Microsoft YaHei} +\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.9]{Microsoft YaHei} \RequirePackage{newtxmath} -\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n} +\DeclareSymbolFont{operators}{OT1}{ntxtlf}{m}{n} +\SetSymbolFont{operators}{bold}{OT1}{ntxtlf}{b}{n} \end{lstlisting} \subsubsection{其他设置} 这几个包由于都是一个系列的,字体搭配起来非常合适,字体宽度非常契合!唯独数学字体中的大型运算符,比如求和符号和积分符号不是很好看,为此,我把它们又改回了原先的字体效果。公式~(\ref{eq:binom}) 展示了最终的数学字体的效果。 \begin{equation} -(a+3b)^{n} = \sum_{k=0}^{n} C_{n}^{k} a^{n-k} (3b)^k \label{eq:binom} +(a+3b)^{n} = \sum_{k=0}^{n} C_{n}^{k} a^{n-k} (3b)^k \label{eq:binom} \end{equation} 我把行距设定为 1.3,并且使用了 \lstinline{microtype} 宏包调整字体的间距,为了去除字体字号,字形警告信息,我使用了 \lstinline{type1cm} 宏包。 @@ -176,8 +176,13 @@ \subsection{参考文献} -此模板使用了 Bib\TeX{} 来生成参考文献,默认使用的文献样式(bib style)是 \lstinline{aer}。参考文献示例:~\cite{Chen2018} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{wpref.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 Bib\TeX{} 编译。 +此模板使用了 Bib\TeX{} 来生成参考文献,默认使用的文献样式(bib style)是 \lstinline{aer}。参考文献示例:~\cite{Chen2018} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。 +你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{wpref.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 Bib\TeX{} 编译。如果你想在参考文献中添加未引用的文献,可以使用 + +\begin{lstlisting} +\nocite{EINAV2010, Havrylchyk2018} +\end{lstlisting} \section{示例} 在这部分,我提供一个示例文档: diff --git a/elegantpaper-en.pdf b/elegantpaper-en.pdf index 341604b..48c4070 100644 Binary files a/elegantpaper-en.pdf and b/elegantpaper-en.pdf differ diff --git a/elegantpaper-en.tex b/elegantpaper-en.tex index 7671851..f747cf9 100644 --- a/elegantpaper-en.tex +++ b/elegantpaper-en.tex @@ -3,8 +3,8 @@ \title{ElegantPaper: An Elegant \LaTeX{} Template for Working Papers} \author{\href{https://ddswhu.me/}{Dongsheng Deng}} -\institute{Elegant\LaTeX{} Program} -\version{0.03} +\institute{\href{https://github.com/ElegantLaTeX}{Elegant\LaTeX{} Program}} +\version{0.04} \date{\today} @@ -13,7 +13,7 @@ \maketitle \begin{abstract} -\sffamily This paper illustrates the usage of the ElegantPaper template, which is designed for writing a working paper. 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 or suggestions, please contact me at: \email{ddswhu@outlook.com}. Looking for other templates designed by Elegant\LaTeX{} Group? Please visit: \href{https://ddswhu.me/resource/}{Elegant\LaTeX{} Resource}. +This paper illustrates the usage of the \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} template, which is designed for writing a working paper. 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 visit \href{https://github.com/ElegantLaTeX/ElegantPaper/issues}{ElegantPaper/issues}. Looking for other templates designed by Elegant\LaTeX{} Group? Please visit: \href{https://github.com/ElegantLaTeX}{https://github.com/ElegantLaTeX}. \end{abstract} \section{Introduction} @@ -34,7 +34,7 @@ If you choose \lstinline{PDFLaTeX} to process your paper, the default article fo \begin{itemize} \item \lstinline{newtxtext} package for text fonts, similar to times new roman font. \item \lstinline{newtxmath} package for math fonts, close to \lstinline{times} package. - \item \lstinline{newtxtt} package for typewriter fonts, with option \lstinline{scale=0.8}. + \item \lstinline{FiraMono} package for typewriter fonts. \item \lstinline{ctex} package for Chinese fonts, with option \lstinline{scheme=plain}. \end{itemize} @@ -51,7 +51,7 @@ If you choose \lstinline{XeLaTeX} to process your paper, I use \lstinline{fontsp \RequirePackage{xunicode} \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} \setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi} -\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.8]{Microsoft YaHei} +\setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.9]{Microsoft YaHei} \RequirePackage{newtxmath} \DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n} \end{lstlisting} @@ -59,7 +59,7 @@ If you choose \lstinline{XeLaTeX} to process your paper, I use \lstinline{fontsp \subsubsection{Other Settings} These packages operate perfectly but are inappropriate for big operators, for example \lstinline{\sum} and \lstinline{\prod}, thus, I change these operators back to computer modern font. Equation~(\eqref{eq:binom}) shows the effects of these fonts: \begin{equation} -(a+3b)^{n} = \sum_{k=0}^{n} C_{n}^{k} a^{n-k} (3b)^k \label{eq:binom} +(a+3b)^{n} = \sum_{k=0}^{n} C_{n}^{k} a^{n-k} (3b)^k \label{eq:binom} \end{equation} @@ -95,10 +95,7 @@ You can use \lstinline{itemize}, \lstinline{enumerate}, or \lstinline{descriptio \end{minipage} \subsection{Table} -I strongly recommend you to use the \lstinline{booktabs} package in your paper. It adds three commands to make the table prettier, ie. \lstinline{\toprule}, \lstinline{\midrule} and \lstinline{\bottomrule}. Here is an example. - - - +I strongly recommend you to use the \lstinline{booktabs} package in your paper. It adds three commands to make the table prettier, ie. \lstinline{\toprule}, \lstinline{\midrule} and \lstinline{\bottomrule}. \tabref{tab:reg} is an example. \begin{lstlisting} \begin{table}[htbp] @@ -166,9 +163,9 @@ To include a graphic, you can use figure environment as usual. \figref{fig:scatt \end{figure} \subsection{Bibliography} -This template uses Bib\TeX{} to generate the bibliography, the default bibliography style is \lstinline{aer}. ~\cite{Chen2018} use 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 Bib\TeX{}, 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. +This template uses Bib\TeX{} to generate the bibliography, the default bibliography style is \lstinline{aer}. Let's take a glance at the citation effect, ~\cite{Chen2018} use data from a major peer-to-peer lending marketplace in China to study whether female and male investors evaluate loan performance differently. -The Bib\TeX{} will automatically generate the bibliography for you for the reference you cited. If you want to add some noncited reference to the bibliography, you can use +If you want to use Bib\TeX{}, 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. The Bib\TeX{} will automatically generate the bibliography for you for the reference you cited. If you want to add some noncited reference to the bibliography, you can use \begin{lstlisting} \nocite{EINAV2010, Havrylchyk2018} diff --git a/elegantpaper.cls b/elegantpaper.cls index 24aa2b5..14fc749 100644 --- a/elegantpaper.cls +++ b/elegantpaper.cls @@ -1,11 +1,11 @@ -% Current Version: 0.03 +% Current Version: 0.04 % Author: ddswhu % Homepage: https://ddswhu.me/ % Email: ddswhu@outlook.com % Lastest Version: https://github.com/EthanDeng/ElegantPaper \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{elegantpaper}[2018/1/13 v0.03 ElegantLaTeX Paper class] +\ProvidesClass{elegantpaper}[2018/01/16 v0.04 ElegantLaTeX Paper class] \LoadClass[11pt]{article} @@ -32,7 +32,7 @@ % font setting for text and math \RequirePackage{amsthm} -\RequirePackage{amsmath} +\RequirePackage{amsmath,amssymb,accents} %\RequirePackage{newtxtext} %\RequirePackage{newtxmath} % @@ -50,7 +50,8 @@ \RequirePackage{graphicx} \RequirePackage{fancyvrb} \RequirePackage{type1cm} - +\RequirePackage{abstract} +\renewcommand{\abstracttextfont}{\sffamily\small} \graphicspath{{image/}{figure/}{fig/}{img/}} % caption settings @@ -95,24 +96,24 @@ \RequirePackage[no-math]{fontspec} \setmainfont{Times New Roman} \setsansfont{Arial} - %\setmonofont[Scale=0.8]{Courier New} + %\setmonofont[Scale=0.9]{Courier New} \RequirePackage{xeCJK} \RequirePackage{xunicode} \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} \setCJKsansfont[BoldFont={SimHei},ItalicFont={KaiTi}]{KaiTi} - \setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.8]{Microsoft YaHei} + \setCJKmonofont[BoldFont={SimHei},ItalicFont={KaiTi},Scale=0.9]{Microsoft YaHei} \XeTeXlinebreaklocale "zh" \XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt \RequirePackage{newtxmath} - \DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n} + \DeclareSymbolFont{operators}{OT1}{ntxtlf}{m}{n} + \SetSymbolFont{operators}{bold}{OT1}{ntxtlf}{b}{n} \else - \RequirePackage[T1]{fontenc} + \RequirePackage{fontenc} \RequirePackage{newtxtext} \RequirePackage{newtxmath} - \RequirePackage[scale=0.8]{newtxtt} \RequirePackage[UTF8, scheme=plain]{ctex} \fi - +\RequirePackage{FiraMono} % \ifdefstring{\ELEGANT@lang}{cn}{ @@ -209,9 +210,9 @@ breaklines=true, keywordstyle=\bf\color{winered}\ttfamily, commentstyle=\color{gray}, - emph={elegantpaper,fontenc,fontspec,xeCJK,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,newtx,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm}, + emph={elegantpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,ctex,microtype,description,times,newtx,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm}, emphstyle={\color{frenchplum}}, - morekeywords={DeclareSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle}, + morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle}, frame=none, tabsize=2, backgroundcolor=\color{lightgrey} @@ -219,4 +220,3 @@ \bibliographystyle{aer} -