Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[biblatex]: sorting order problem

433 views
Skip to first unread message

Uwe Siart

unread,
Sep 2, 2012, 8:29:14 AM9/2/12
to
Hy all,

I try to implement a bibliography in chronologically descending order.
Therefore I declared a sorting scheme in the order "year descending",
"month descending", "day descending", "name", "title". However, in the
following example April is ranged before August. Any hint what I did
wrong? Seems like ISO-date is not treated equivalent to the fields day,
month, year.

Thanks
Uwe

% --------------------
\begin{filecontents}{bb.bib}
@Article{author12:first,
author = {First author},
title = {First title},
journaltitle = {First journal},
date = {2012-08-01},
}

@Article{author12:second,
author = {Second author},
title = {Second title},
journaltitle = {Second journal},
day = {1},
month = {4},
year = {2012},
}

@Article{author12:third,
author = {Third author},
title = {Third title},
journaltitle = {Third journal},
date = {2012-02-01},
}
\end{filecontents}
\documentclass{article}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}

\usepackage[backend=biber,
style=numeric,
sorting=ydmdddnt,
dateabbrev=false,
babel=other]{biblatex}

\addbibresource{bb.bib}

\DeclareSortingScheme{ydmdddnt}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort[direction=descending]{
\field{year}
}
\sort[direction=descending]{
\field{month}
}
\sort[direction=descending]{
\field{day}
}
\sort{
\field{journaltitle}
}
\sort{
\name{author}
\name{editor}
}
\sort{
\field{title}
}
}

\begin{document}
\nocite{*}
\printbibliography
\end{document}
% --------------------

Ulrike Fischer

unread,
Sep 3, 2012, 5:06:51 AM9/3/12
to
Am Sun, 02 Sep 2012 14:29:14 +0200 schrieb Uwe Siart:

> Hy all,
>
> I try to implement a bibliography in chronologically descending order.
> Therefore I declared a sorting scheme in the order "year descending",
> "month descending", "day descending", "name", "title". However, in the
> following example April is ranged before August. Any hint what I did
> wrong? Seems like ISO-date is not treated equivalent to the fields day,
> month, year.

You can use this to add leading zeros to the month:

\sort[direction=descending]{
\field[padside=left,padwidth=2,padchar=0]{month}
}

--
Ulrike Fischer
http://www.troubleshooting-tex.de/

Uwe Siart

unread,
Sep 3, 2012, 12:48:36 PM9/3/12
to
Ulrike Fischer <ne...@nililand.de> writes:

> \sort[direction=descending]{
> \field[padside=left,padwidth=2,padchar=0]{month}
> }

Many thanks, Ulrike! This solves the problem. I'd never hit on this by
myself. Leading zeros ... my God!

--
Uwe
0 new messages