diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-01 20:58:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-01 20:58:55 +0000 |
commit | 4f7a2c33e49915f226131d182a2762f3467e5831 (patch) | |
tree | dd9ed85613d29b633928c23e70c00df74c70bfd3 /Master/texmf-dist/tex/latex/cnltx/cnltx.bbx | |
parent | 89dbbe700a3907ad449d129bf84e04f8767b5f4d (diff) |
cnltx (1nov19)
git-svn-id: svn://tug.org/texlive/trunk@52601 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cnltx/cnltx.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/cnltx/cnltx.bbx | 97 |
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 |