diff --git a/elegantpaper-cn.pdf b/elegantpaper-cn.pdf index 5a3d6e2..6a3d8bb 100644 Binary files a/elegantpaper-cn.pdf and b/elegantpaper-cn.pdf differ diff --git a/elegantpaper-cn.tex b/elegantpaper-cn.tex index 659f9cd..02a2fd4 100644 --- a/elegantpaper-cn.tex +++ b/elegantpaper-cn.tex @@ -1,7 +1,7 @@ %!TEX program = xelatex % 完整编译方法 1 pdflatex -> bibtex -> pdflatex -> pdflatex % 完整编译方法 2: xelatex -> bibtex -> xelatex -> xelatex -\documentclass[lang=cn,11pt]{elegantpaper} +\documentclass[lang=cn,11pt,numbers]{elegantpaper} \title{ElegantPaper: 一个优美的 \LaTeX{} 工作论文模板} \author{\href{https://ddswhu.me/}{邓东升}} @@ -177,7 +177,6 @@ The content of conclusion section. \end{lstlisting} \nocite{*} - \bibliography{wpref} \end{document} diff --git a/elegantpaper-en.pdf b/elegantpaper-en.pdf index 6aee7ed..5c5008a 100644 Binary files a/elegantpaper-en.pdf and b/elegantpaper-en.pdf differ diff --git a/elegantpaper-en.tex b/elegantpaper-en.tex index 8238def..0b51059 100644 --- a/elegantpaper-en.tex +++ b/elegantpaper-en.tex @@ -173,6 +173,7 @@ The content of conclusion section. \end{lstlisting} \nocite{en1,en2} + \bibliography{wpref} \end{document} diff --git a/elegantpaper.cls b/elegantpaper.cls index 47c618f..38bd5eb 100644 --- a/elegantpaper.cls +++ b/elegantpaper.cls @@ -20,6 +20,10 @@ \DeclareVoidOption{cn}{\ekv{lang = cn}} \DeclareVoidOption{en}{\ekv{lang = en}} +\DeclareStringOption[numbers]{cite}[numbers] +\DeclareVoidOption{numbers}{\ekv{cite=numbers}} +\DeclareVoidOption{authoryear}{\ekv{cite=authoryear}} +\DeclareVoidOption{super}{\ekv{cite=super}} % \PassOptionsToClass{11pt}{article} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{article}} @@ -61,7 +65,16 @@ \definecolor{winered}{rgb}{0.5,0,0} % bib-settings -\RequirePackage{natbib} +\ifdefstring{\ELEGANT@cite}{authoryear}{ + \RequirePackage[authoryear,sort&compress]{natbib} +}{\relax} +\ifdefstring{\ELEGANT@cite}{numbers}{ + \RequirePackage[numbers,sort&compress]{natbib} +}{\relax} +\ifdefstring{\ELEGANT@cite}{super}{ + \RequirePackage[super,sort&compress]{natbib} +}{\relax} + \setlength{\bibsep}{0.0pt} \def\bibfont{\footnotesize} @@ -127,7 +140,7 @@ \newcommand{\keywords}[1]{\vskip2ex\par\noindent\normalfont{\bfseries 关键词: } #1} \newcommand\figref[1]{{\bfseries 图~\ref{#1}}} \newcommand\tabref[1]{{\bfseries 表~\ref{#1}}} - \RequirePackage[authoryear]{gbt7714} + \RequirePackage{gbt7714} }{\relax} \ifdefstring{\ELEGANT@lang}{en}{ \theoremstyle{plain}% default diff --git a/kvoptions.pdf b/kvoptions.pdf deleted file mode 100644 index 1313f05..0000000 Binary files a/kvoptions.pdf and /dev/null differ