Skip to content

Commit

Permalink
improve biblatex and bibtex support
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangruiMo committed Jul 22, 2020
1 parent 01967e9 commit 9cb5a1e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

* `2020-07-22` [hushidong, zepinglee, issue #296](https://github.com/mohuangrui/ucasthesis/issues/296),完善 biblatex 和 bibtex 样式。文献样式更多讨论可见:[文献样式](https://github.com/mohuangrui/ucasthesis/wiki/%E6%96%87%E7%8C%AE%E6%A0%B7%E5%BC%8F)

* `2020-07-17` [GitatHub, hushidong, issue #296](https://github.com/mohuangrui/ucasthesis/issues/296),更新 bibtex 国标样式 [gbt7714-bibtex-style](https://github.com/CTeX-org/gbt7714-bibtex-style) ,增加 biblatex 国标样式 [biblatex-gb7714-2015](https://github.com/hushidong/biblatex-gb7714-2015),默认从 CTAN 调用上述国标样式。文献样式更多讨论可见:[文献样式](https://github.com/mohuangrui/ucasthesis/wiki/%E6%96%87%E7%8C%AE%E6%A0%B7%E5%BC%8F)
* `2020-07-17` [GitatHub, hushidong, issue #296](https://github.com/mohuangrui/ucasthesis/issues/296),更新 bibtex 国标样式 [gbt7714-bibtex-style](https://github.com/CTeX-org/gbt7714-bibtex-style) ,增加 biblatex 国标样式 [biblatex-gb7714-2015](https://github.com/hushidong/biblatex-gb7714-2015)。文献样式更多讨论可见:[文献样式](https://github.com/mohuangrui/ucasthesis/wiki/%E6%96%87%E7%8C%AE%E6%A0%B7%E5%BC%8F)

* `2020-05-22` [lipcaty, issue #281](https://github.com/mohuangrui/ucasthesis/issues/281) 修复 ctex 移除 xeCJKfntef 后对 ulem 的加载。

Expand Down
28 changes: 18 additions & 10 deletions Style/artratex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,13 @@
%-
%-> Bibliography processor and package
%-
\def\artxbibref{Biblio/ref.bib}% bibliography reference file
\def\artxbibtexnum{Biblio/gbt7714-numerical}% bibtex numbers bst
\def\artxbibtexauy{Biblio/gbt7714-author-year}% bibtex authoryear bst
\def\artxbibtexalp{alpha}% bibtex alpha bst
\def\artxbibernum{Biblio/gb7714-2015}% biber numbers bst
\def\artxbiberauy{Biblio/gb7714-2015ay}% biber authoryear bst
\def\artxbiberalp{alphabetic}% biber alpha bst
%- Bibtex processor + natbib package
\ifartx@bibtex%
% Set punctuation and mode of citation style
Expand All @@ -469,16 +476,16 @@
\else
\citestyle{numbers}%
\fi
\bibliographystyle{gbt7714-numerical}% numbered scheme
\bibliographystyle{\artxbibtexnum}% numbered scheme
\fi
\ifartx@authoryear% enable author year citation style
\RequirePackage{natbib}% author year citation mode
\citestyle{authoryear}%
\bibliographystyle{gbt7714-author-year}% author year scheme
\bibliographystyle{\artxbibtexauy}% author year scheme
\fi
\ifartx@alpha% enable alpha citation style
\RequirePackage[square,comma,numbers]{natbib}% alpha citation mode
\bibliographystyle{alpha}% alpha scheme
\bibliographystyle{\artxbibtexalp}% alpha scheme
\fi
\providecommand*{\citetns}[2][]{% text embedded \citet in superscripted mode
\begingroup\citestyle{numbers}\citet[#1]{#2}\endgroup%
Expand All @@ -492,25 +499,26 @@
\AtEndPreamble{\RequirePackage{hyperref}}% enable biblatex detection of hyperref
\ifartx@numbers% enable numbered citation style
\ifartx@super% enable superscripted citation style
\RequirePackage[backend=biber,style=gb7714-2015,gbcitelocal=chinese,mincitenames=1,maxcitenames=2]{biblatex}%
\RequirePackage[backend=biber,style=\artxbibernum,mincitenames=1,maxcitenames=2]{biblatex}%
\else
\RequirePackage[backend=biber,style=gb7714-2015,gbcitelocal=chinese,mincitenames=1,maxcitenames=2]{biblatex}%
\RequirePackage[backend=biber,style=\artxbibernum,mincitenames=1,maxcitenames=2]{biblatex}%
\renewrobustcmd*{\citet}{\textcite}%
\renewrobustcmd*{\citep}{\parencite}%
\fi
\fi
\ifartx@authoryear% enable author year citation style
\RequirePackage[backend=biber,style=gb7714-2015ay,gbcitelocal=chinese,mincitenames=1,maxcitenames=2]{biblatex}%
\RequirePackage[backend=biber,style=\artxbiberauy,mincitenames=1,maxcitenames=2]{biblatex}%
\renewrobustcmd*{\citet}{\textcite}%
\renewrobustcmd*{\citep}{\parencite}%
\fi
\ifartx@alpha% enable alpha citation style
\RequirePackage[backend=biber,style=alphabetic]{biblatex}%
\RequirePackage[backend=biber,style=\artxbiberalp]{biblatex}%
\fi
\addbibresource{Biblio/ref.bib}%
\addbibresource{\artxbibref}%
\providecommand{\citep}[1]{\parencite{#1}}% compatibility
\providecommand{\citet}[1]{\textcite{#1}}% compatibility
\providecommand{\bibetal}{et al.}%
\providecommand{\biband}{and}%
\providecommand{\bibetal}{et al.}% compatibility
\providecommand{\biband}{and}% compatibility
\DefineBibliographyStrings{english}{%
andincite = {\biband},
andothersincite = {\bibetal{}},
Expand Down

0 comments on commit 9cb5a1e

Please sign in to comment.