add super/numbers/authoryear

This commit is contained in:
EthanDeng
2019-08-12 23:09:32 +08:00
parent 58424daeb4
commit 9b4af83c49
6 changed files with 17 additions and 4 deletions

Binary file not shown.

View File

@@ -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}

Binary file not shown.

View File

@@ -173,6 +173,7 @@ The content of conclusion section.
\end{lstlisting}
\nocite{en1,en2}
\bibliography{wpref}
\end{document}

View File

@@ -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

Binary file not shown.