12

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?

2
  • 1
    I think this doesn't work because dates are printed with the \printdate command and not the \printfield command.
    – Alan Munn
    Aug 14, 2011 at 16:28
  • 1
    @Alan: Yes, that is my take, but then there is no \DeclareDateFormat!
    – Joseph Wright
    Aug 14, 2011 at 17:12

1 Answer 1

10

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}
3
  • Interesting approach - not one I'd thought of.
    – Joseph Wright
    Aug 14, 2011 at 17:12
  • @Joseph: It the same trick as for urldate. The command \DeclareFieldFormat{urldate}... exists in biblatex.def. So I looked to the definition and than I used it :-) Aug 14, 2011 at 17:57
  • @JosephWright: Please see my updated answer. I think it could be interesting for you. Nov 14, 2011 at 6:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .