Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

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

1 Answer 1

up vote 6 down vote accepted

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}
share|improve this answer
    
Interesting approach - not one I'd thought of. –  Joseph Wright Aug 14 '11 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 :-) –  Marco Daniel Aug 14 '11 at 17:57
    
@JosephWright: Please see my updated answer. I think it could be interesting for you. –  Marco Daniel Nov 14 '11 at 6:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.