summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/cnltx/cnltx.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx.bbx97
1 files changed, 61 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
index 1fd4dc2b1bc..c5409b04e7f 100644
--- a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
+++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
@@ -8,7 +8,7 @@
% Web: https://github.com/cgnieder/cnltx/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
-% Copyright 2013-2014 Clemens Niederberger
+% Copyright 2013--2019 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -28,8 +28,9 @@
\RequirePackage{cnltx-base}
\ProvidesFile{cnltx.bbx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
-\cnltx@load@modules{example,tools,translations}
+\cnltx@load@modules{example,tools,translations,names}
+\RequireBiber
\RequireBibliographyStyle{alphabetic}
\ExecuteBibliographyOptions{block=ragged,useprefix=true}
@@ -40,9 +41,7 @@
\usebibmacro{maintainer}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title+subtitle}%
- \printfield{version}%
- \setunit{\addcomma\addspace}%
- \usebibmacro{date}%
+ \usebibmacro{version+date}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
@@ -52,7 +51,7 @@
\DeclareBibliographyAlias{class}{latex}
\DeclareBibliographyAlias{bundle}{latex}
-\newbibmacro{title+subtitle}{%
+\newbibmacro*{title+subtitle}{%
\iffieldundef{title}{}{%
\printfield{title}%
\ifbibindex{\indexfield{title}}{}%
@@ -64,6 +63,31 @@
}%
}
+\NewBibliographyString{version}
+\NewBibliographyString{or-newer}
+\DefineBibliographyStrings{english}{
+ version = {version} ,
+ or-newer = {or newer}
+}
+
+\DefineBibliographyStrings{german}{
+ version = {Version} ,
+ or-newer = {oder neuer}
+}
+
+\newbibmacro*{version+date}{%
+ \iffieldundef{version}{}{%
+ \bibstring{version}%
+ \addspace
+ \printfield{version}%
+ \addcomma\addspace
+ }%
+ \usebibmacro{date}%
+ \addspace
+ \bibstring[\mkbibparens]{or-newer}%
+ \setunit{\adddot\addspace}%
+}
+
\newbibmacro*{maintainer}{%
\printtext{%
\ifnameundef{maintainer}
@@ -79,9 +103,9 @@
}%
}
-\renewcommand*{\mkbibnamelast}[1]{\cnltx@write@lastname{#1}}
-\renewcommand*{\mkbibnamefirst}[1]{\cnltx@write@firstname{#1}}
-\renewcommand*{\mkbibnameprefix}[1]{\cnltx@write@lastname{#1}}
+\renewcommand*\mkbibnamefamily[1]{\cnltx@write@lastname{#1}}
+\renewcommand*\mkbibnamegiven[1]{\cnltx@write@firstname{#1}}
+\renewcommand*\mkbibnameprefix[1]{\cnltx@write@lastname{#1}}
\DeclareNameAlias[package]{maintainer}{default}
\DeclareNameAlias[class]{maintainer}{default}
@@ -100,6 +124,10 @@
\DeclareFieldFormat[class]{title}{\cls*{#1}}
\DeclareFieldFormat[bundle]{title}{\bnd*{#1}}
+\DeclareFieldFormat[package]{version}{#1}
+\DeclareFieldFormat[class]{version}{#1}
+\DeclareFieldFormat[bundle]{version}{#1}
+
\DeclareIndexFieldFormat[package]{title}{%
\ifstrequal{#1}{\KOMAScript}
{\pkgidx[KOMA-Script]{\KOMAScript}}
@@ -132,34 +160,28 @@
{\bndidx{#1}}%
}
-\def\cnltx@onlyonefirstname#1\bibnamedelima#2\q@stop{#1}
-
\DeclareIndexNameFormat{cnltx}{%
- \cnltx@if@in{#3}{\bibnamedelima}
- {%
- \usebibmacro{index:entry}{\index}{%
- \ifblank{#5}{}{#5 }%
- \@firstofone#1%
- \ifblank{#3}{}{, \cnltx@onlyonefirstname#3\q@stop}%
- \actualoperator
- \ifblank{#5}
- {\cnltx@write@lastname{#1}}
- {\cnltx@write@lastname{#5 #1}}%
- \ifblank{#3}{}{, \cnltx@write@firstname{\cnltx@onlyonefirstname#3\q@stop}}%
- }%
- }
- {%
- \usebibmacro{index:entry}{\index}{%
- \ifblank{#5}{}{#5 }%
- \@firstofone#1%
- \ifblank{#3}{}{, #3}%
- \actualoperator
- \ifblank{#5}
- {\cnltx@write@lastname{#1}}
- {\cnltx@write@lastname{#5 #1}}%
- \ifblank{#3}{}{, \cnltx@write@firstname{#3}}%
- }%
+ \nameparts{#1}%
+ \expandafter\notblank\expandafter{\namepartgiven}{%
+ \usebibmacro{index:entry}{\index}{%
+ \namepartfamily, \namepartgiven
+ \actualoperator
+ \expandafter\notblank\expandafter{\namepartprefix}
+ {\cnltx@write@lastname\namepartprefix\space}
+ {}%
+ \cnltx@write@lastname\namepartfamily,
+ \cnltx@write@firstname\namepartgiven
+ }%
+ }{%
+ \usebibmacro{index:entry}{\index}{%
+ \namepartfamily
+ \actualoperator
+ \expandafter\notblank\expandafter{\namepartprefix}
+ {\cnltx@write@lastname\namepartprefix\space}
+ {}%
+ \cnltx@write@lastname\namepartfamily
}%
+ }%
}
\DeclareIndexNameAlias{labelname}{cnltx}
@@ -202,4 +224,7 @@ HISTORY:
module;
this is going to need tests if it really is consistent
for different types of name formats (prefixes, affixes...)
-
+2016/03/11 v0.13b - adapt bib style to biblatex v3.3
+2017/02/04 v0.14 - new bibmacro `version+date', use said macro in the `latex'
+ driver
+2019/11/01 v0.15 - fix problems with name format