[Tex/LaTex] Formatting the year in biblatex bibliograpy driver (.bbx) files

biblatex

Normally, to set the format of a field using biblatex, the \DeclareFieldFormat macro can be used, for example

\DeclareFieldFormat[article]{title}{\mkbibemph{#1}}

However, this approach fails for the year. Trying either

\DeclareFieldFormat{year}{\mkbibbobld{#1}}

or

\DeclareFieldFormat{date}{\mkbibbold{#1}}

Makes no difference to the output. You can do something like

\renewbibmacro*{date}{\mkbibbold{\printdate}}

to format the date, but this looses the link to bibliography entry type and thus requires more work for type-dependent appearance. Is there a better approach, ideally sticking to \DeclareFieldFormat?

Best Answer

Update:

Today (14 nov) biblatex v 1.7 is available. In the new version special field formats date, urldate, origdate, eventdate were added.


When you redefine the bibmacro date in the following way you can use such a definition:

\renewbibmacro*{date}{\printtext[date]{\printdate}}

The following example shows the result

\begin{filecontents}{bib.bib}
@book{book1,
 Author = {Vorname Nachname},
 Date = {1998},
 Publisher = {Verlag},
 Title = {Der Mythos},
 urldate={2002-06-02}
}
@book{book2,
 Author = {Hans Nachname},
 Date = {2001-07-08},
 Publisher = {Verlag},
 Title = {Der Mythos},
 urldate={2002-06-02}
}
\end{filecontents}
\documentclass[fontsize=12pt,ngerman]{scrartcl}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\DeclareFieldFormat{date}{\textbf{#1}}
\renewbibmacro*{date}{\printtext[date]{\printdate}}
\addbibresource{bib.bib}
\begin{document}

text \cite{book1}

text \cite{book2}

\printbibliography
\end{document}