diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/cnltx/cnltx.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/cnltx/cnltx.bbx | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx new file mode 100644 index 00000000000..16b887ab95c --- /dev/null +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx @@ -0,0 +1,130 @@ +\@ifclassloaded{cnltx-doc}{}{% + \GenericError + {(cnltx.bbx)\@spaces\@spaces\@spaces\@spaces} + {cnltx bibliography style error: invalid class} + {See the cnltx bundle documentation for explanation.} + {% + The `cnltx' bibliography style can only be used with the `cnltx-doc' + document class% + }% +} +\ProvidesFile{cnltx.bbx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info] + +\RequireBibliographyStyle{alphabetic} +\ExecuteBibliographyOptions{block=ragged} + +\DeclareBibliographyDriver{latex}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \usebibmacro{maintainer}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title+subtitle}% + \printfield{version}% + \setunit{\addcomma\addspace}% + \usebibmacro{date}% + \newunit\newblock + \usebibmacro{url+urldate}% + \newunit\newblock + \usebibmacro{finentry}% +} +\DeclareBibliographyAlias{package}{latex} +\DeclareBibliographyAlias{class}{latex} +\DeclareBibliographyAlias{bundle}{latex} + +\newbibmacro{title+subtitle}{% + \iffieldundef{title}{}{% + \printfield{title}% + \ifbibindex{\indexfield{title}}{}% + \setunit{\adddot\addspace}% + \iffieldundef{subtitle}{}{% + \printfield{subtitle}% + \setunit{\adddot\addspace}% + }% + }% +} + +\newbibmacro*{maintainer}{% + \printtext{% + \ifnameundef{maintainer} + {} + {% + \addcomma\addspace + \ifnumgreater{\value{maintainer}}{1} + {\GetTranslation{cnltx-maintainers}} + {\GetTranslation{cnltx-maintainer}}% + \addcolon\addspace + \printnames{maintainer}% + }% + }% +} + +\DeclareNameAlias[package]{maintainer}{default} +\DeclareNameAlias[class]{maintainer}{default} +\DeclareNameAlias[bundle]{maintainer}{default} + +\DeclareIndexNameAlias[package]{maintainer}{default} +\DeclareIndexNameAlias[class]{maintainer}{default} +\DeclareIndexNameAlias[bundle]{maintainer}{default} + +\DeclareFieldFormat[package]{title}{\pkg*{#1}} +\DeclareFieldFormat[class]{title}{\cls*{#1}} +\DeclareFieldFormat[bundle]{title}{\bnd*{#1}} + +\DeclareIndexFieldFormat[package]{title}{% + \ifstrequal{#1}{\KOMAScript} + {\pkgidx[KOMA-Script]{\KOMAScript}} + {\pkgidx{#1}}% +} +\DeclareIndexFieldFormat[class]{title}{% + \ifstrequal{#1}{\KOMAScript} + {\clsidx[KOMA-Script]{\KOMAScript}} + {\clsidx{#1}}% +} +\DeclareIndexFieldFormat[bundle]{title}{% + \ifstrequal{#1}{\KOMAScript} + {\bndidx[KOMA-Script]{\KOMAScript}} + {\bndidx{#1}}% +} + +\DeclareIndexFieldFormat[package]{indextitle}{% + \ifstrequal{#1}{\KOMAScript} + {\pkgidx[KOMA-Script]{\KOMAScript}} + {\pkgidx{#1}}% +} +\DeclareIndexFieldFormat[class]{indextitle}{% + \ifstrequal{#1}{\KOMAScript} + {\clsidx[KOMA-Script]{\KOMAScript}} + {\clsidx{#1}}% +} +\DeclareIndexFieldFormat[bundle]{indextitle}{% + \ifstrequal{#1}{\KOMAScript} + {\bndidx[KOMA-Script]{\KOMAScript}} + {\bndidx{#1}}% +} + +\DeclareFieldFormat[package]{subtitle}{\mkbibemph{#1}} +\DeclareFieldFormat[class]{subtitle}{\mkbibemph{#1}} +\DeclareFieldFormat[bundle]{subtitle}{\mkbibemph{#1}} + +\DeclareLabelname[package,class,bundle]{% + \field{shortauthor} + \field{author} + \field{maintainer} + \field{shorteditor} + \field{editor} + \field{translator} +} + +\DeclareDriverSourcemap[datatype=bibtex]{ + \map{ + \step[fieldsource=info, fieldtarget=subtitle] + } +} + +\endinput + +HISTORY: + +2013/10/04 v0.7a - added drivers `@class' and `@bundle' + |