summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def110
1 files changed, 75 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def b/Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def
index 279b7e5281f..bb46b2eb748 100644
--- a/Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def
+++ b/Master/texmf-dist/tex/latex/biblatex-caspervector/blx-caspervector-base.def
@@ -1,6 +1,6 @@
% Casper Ti. Vector's biblatex style
%
-% Copyright (c) 2012-2018 Casper Ti. Vector
+% Copyright (c) 2012-2019 Casper Ti. Vector
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, either version 1.3 of this license or (at
@@ -23,17 +23,19 @@
% blx-caspervector-utf8.def
\ProvidesFile{blx-caspervector-base.def}%
- [2018/06/29 v0.3.3 Casper Ti. Vector's biblatex library]
+ [2019/11/13 v0.3.4 Casper Ti. Vector's biblatex library]
\RequireBiber[3]
\newtoggle{bbx:gbk}
\newtoggle{bbx:ugly}
+\newtoggle{bbx:cparen}
\newtoggle{bbx:bfdate}\toggletrue{bbx:bfdate}
\DeclareBibliographyOption{utf8}[true]{\togglefalse{bbx:gbk}}
\DeclareBibliographyOption{gbk}[true]{\toggletrue{bbx:gbk}}
\DeclareBibliographyOption{ugly}[true]{\settoggle{bbx:ugly}{#1}}
+\DeclareBibliographyOption{cparen}[true]{\settoggle{bbx:cparen}{#1}}
\ExecuteBibliographyOptions{%
- gbk, ugly = false, autopunct = false, alldates = iso,
+ gbk, ugly = false, cparen = false, autopunct = false, alldates = iso,
minnames = 3, minitems = 3, maxcitenames = 2, mincitenames = 1%
}
\AtEndOfPackage{%
@@ -88,10 +90,17 @@
}}%
}
+\NewBibliographyString{cnauthor, cneditor, cntranslator}
\newcommand*{\bbx@cetext}[2]{\iffieldequalstr{userf}{zh}{#1}{#2}}
-\newcommand*{\bbx@cietext}[2]{\ifboolexpr{%
+\newcommand*{\bbx@cietext}[2]{\ifboolexpr{
test {\ifcitation} or test {\iffieldequalstr{userf}{zh}}
}{#1}{#2}}
+\newcommand*{\bbx@cieparen}[2]{\ifboolexpr{
+ test {\ifcitation} and test {\iftoggle{bbx:cparen}}
+}{#1}{#2}}
+\newcommand*{\bbx@ifstrg}[3]{\ifboolexpr{%
+ test {\ifstrequal{#1}{author}} and test {\iffieldundef{authortype}}
+}{#3}{#2}}
\newcommand*{\bbx@cecomma}{\bbx@cepunct{\bbx@cncomma}{\addcomma\addspace}}
\newcommand*{\bbx@cecolon}{\bbx@cepunct{\bbx@cncolon}{\addcolon\addspace}}
\newcommand*{\bbx@cescolon}{\bbx@cepunct{\bbx@cnscolon}{\addsemicolon\addspace}}
@@ -109,9 +118,12 @@
\DefineBibliographyExtras{english}{%
\renewcommand*{\finalandcomma}{}%
}
+\renewcommand*{\bibleftparen}{\bbx@cieparen{\bbx@cnlparen}{\blx@postpunct(}}
+\renewcommand*{\bibrightparen}%
+ {\bbx@cieparen{\bbx@cnrparen}{\blx@postpunct)\midsentence}}
+\DeclareDelimFormat[textcite]{nameyeardelim}{\bbx@cieparen{}{\addspace}}
+\DeclareDelimFormat[textcite]{nonameyeardelim}{\bbx@cieparen{}{\addspace}}
-\DefineBibliographyStrings{english}%
- {bibliography = {\bbx@cnbib}, references = {\bbx@cnbib}}
\DeclareFieldFormat*{pages}{#1}
\DeclareFieldFormat*{url}{\url{#1}}
\DeclareFieldFormat*{urldate}{#1}
@@ -124,51 +136,79 @@
{\ifinteger{#1}{\mkbibordedition{#1}~\bibstring{edition}}{#1\isdot}}%
}
\newcommand*{\bbx@print}[1]{\iffieldundef{#1}{}{\printfield{#1}}}
-\newcommand*{\bbx@byspace}[1]%
- {\ifnumgreater{\value{#1}}{\value{maxnames}}{}{\addspace}}
+\newbibmacro*{cntypedelim}[1]{\ifandothers{#1}{}{\printtext{\andothersdelim}}}
\newbibmacro*{cein:}%
{\printtext{\bbx@cetext{\bbx@cnin}{In}\bbx@cecolon}\printtext{}}
-\newbibmacro*{ceedtrans}[1]{%
+\newbibmacro*{cnauedstrg}[2]{%
+ \printtext[#1type]{\iffieldundef{#1type}{\bibstring{cn#2}}{%
+ \ifbibxstring{cn\thefield{#1type}}%
+ {\bibstring{cn\thefield{#1type}}}{\thefield{#1type}}%
+ }}%
+}
+\newbibmacro*{cnauthorstrg}{\usebibmacro{cnauedstrg}{author}{author}}
+\newbibmacro*{cneditorstrg}{\usebibmacro{cnauedstrg}{editor}{editor}}
+\newbibmacro*{cntranslatorstrg}{\printtext{\bibstring{cntranslator}}}
+
+\newbibmacro*{ceauedtrans}[1]{%
\ifboolexpr{test {\iftoggle{blx@use#1}} and not test {\ifnameundef{#1}}}{%
- \printnames{#1}%
- \bbx@cetext%
- {\printtext{\bbx@byspace{#1}\@nameuse{bbx@cn#1}}}%
- {\setunit{\printdelim{#1typedelim}}\usebibmacro{#1strg}}%
- \clearname{#1}%
+ \printnames{#1}\bbx@ifstrg{#1}{%
+ \bbx@cetext%
+ {\usebibmacro{cntypedelim}{#1}\usebibmacro{cn#1strg}}%
+ {\setunit{\printdelim{#1typedelim}}\usebibmacro{#1strg}}%
+ }{}\ifstrequal{#1}{author}{}{\clearname{#1}}%
}{}%
}
-\renewbibmacro*{editor}{\usebibmacro{ceedtrans}{editor}}
-\renewbibmacro*{translator}{\usebibmacro{ceedtrans}{translator}}
+\renewbibmacro*{author}{\usebibmacro{ceauedtrans}{author}}
+\renewbibmacro*{editor}{\usebibmacro{ceauedtrans}{editor}}
+\renewbibmacro*{translator}{\usebibmacro{ceauedtrans}{translator}}
\newbibmacro*{bookauthor/editor}{%
\ifnameundef{bookauthor}%
- {\usebibmacro{ceedtrans}{editor}}{\printnames{bookauthor}}%
+ % Differs from `\usebibmacro{editor}' in caspervector-ay.
+ {\usebibmacro{ceauedtrans}{editor}}{\printnames{bookauthor}}%
}
-\newbibmacro*{cebyauthx}[1]{%
- \ifboolexpr{
- test {\ifnameundef{#1}} or
- (test {\ifstrequal{#1}{author}} and test {\ifuseauthor})
- }{}{%
+\newbibmacro*{cebyauedbase}[2]{%
+ \bbx@cetext{%
+ \printnames[by#1]{#1}\usebibmacro{cntypedelim}{#1}%
+ \usebibmacro{cnauedstrg}{#1}{#2}%
+ }{%
+ \usebibmacro{bytypestrg}{#1}{#2}%
+ \setunit{\addspace}\printnames[by#1]{#1}%
+ }%
+}
+\renewbibmacro*{byauthor}{%
+ \ifboolexpr{test {\ifuseauthor} or test {\ifnameundef{author}}}%
+ {}{\usebibmacro{cebyauedbase}{author}{author}}%
+}
+\renewbibmacro*{byeditor}{%
+ \ifnameundef{editor}{}%
+ {\usebibmacro{cebyauedbase}{editor}{editor}\setunit*{\bbx@cescolon}}%
+ \ifnameundef{editora}{}%
+ {\usebibmacro{cebyauedbase}{editora}{editor}\setunit*{\bbx@cescolon}}%
+ \ifnameundef{editorb}{}%
+ {\usebibmacro{cebyauedbase}{editorb}{editor}\setunit*{\bbx@cescolon}}%
+ \ifnameundef{editorc}{}%
+ {\usebibmacro{cebyauedbase}{editorc}{editor}\setunit*{\bbx@cescolon}}%
+}
+\renewbibmacro*{bytranslator}{%
+ \ifnameundef{translator}{}{%
\bbx@cetext{%
- \printnames[by#1]{#1}%
- \printtext{\bbx@byspace{#1}\@nameuse{bbx@cn#1}}%
+ \printnames[bytranslator]{translator}%
+ \usebibmacro{cntypedelim}{translator}\usebibmacro{cntranslatorstrg}%
}{%
- \bibstring{by#1}\setunit{\addspace}%
- \printnames[by#1]{#1}%
+ \printtext{\bibstring{bytranslator}}%
+ \setunit{\addspace}\printnames[bytranslator]{translator}%
}%
}%
}
-\renewbibmacro*{byauthor}{\usebibmacro{cebyauthx}{author}}
-\renewbibmacro*{byeditor}{\usebibmacro{cebyauthx}{editor}}
-\renewbibmacro*{bytranslator}{\usebibmacro{cebyauthx}{translator}}
\newbibmacro*{byauthor+byeditor+bytranslator}{%
\usebibmacro{byauthor}\setunit*{\bbx@cescolon}%
\usebibmacro{byeditor}\setunit*{\bbx@cescolon}%
\usebibmacro{bytranslator}%
}
-\providebibmacro*{bbx:ifnodate}[2]{#2}
+\providebibmacro*{bbx:ifmergeddate}[2]{#2}
\newbibmacro*{journaltitle/title}{%
\iffieldundef{journaltitle}%
{\bbx@print{title}}{\printfield[title]{journaltitle}}%
@@ -178,8 +218,8 @@
\ifboolexpr{test {\iflistundef{location}} and test {\iflistundef{publisher}}}%
{}{\setunit{\bbx@cecomma}}%
\usebibmacro{date}\setunit*{\bbx@cecomma}\printfield{note}%
- \ifboolexpr{%
- (test {\usebibmacro{bbx:ifnodate}} or test {\ifdateunknown}) and
+ \ifboolexpr{
+ (test {\usebibmacro{bbx:ifmergeddate}} or test {\ifdateunknown}) and
test {\iffieldundef{note}}
}{}{\setunit{\bbx@cecolon}}%
\printfield{pages}%
@@ -188,8 +228,8 @@
\usebibmacro{date}%
\iffieldundef{volume}{}{\setunit*{\bbx@cecomma}\printfield{volume}}%
\bbx@print{number}\setunit*{\bbx@cecomma}\printfield{note}%
- \ifboolexpr{%
- (test {\usebibmacro{bbx:ifnodate}} or test {\ifdateunknown}) and
+ \ifboolexpr{
+ (test {\usebibmacro{bbx:ifmergeddate}} or test {\ifdateunknown}) and
test {\iffieldundef{volume}} and test {\iffieldundef{number}} and
test {\iffieldundef{note}}
}{}{\setunit{\bbx@cecolon}}%
@@ -199,7 +239,7 @@
\printfield{eid}\setunit*{\bbx@cecomma}%
\printfield{url}\setunit*{\bbx@cecomma}%
\iffieldundef{urlyear}{}{%
- \printtext{\bbx@cetext{\bbx@cnretr}{retrieved on}\addspace}%
+ \printtext{\bbx@cetext{\bbx@cnretr}{accessed on}\addspace}%
\printurldate%
}%
}