3

I am trying to sort my publication list with year and month to differentiate publications from the same year. I am kind of struggling to get this right. I used one of your implementation and i manage to split in various subsection the right items calling my own .bib file but the sorting in each subsection is wrong. any help?

\documentclass{article}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage[french]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath, amssymb}
\usepackage[backend=biber,sorting=ndymdt,style=phys]{biblatex}

\DeclareFieldFormat{labelnumberwidth}{}
\setlength{\biblabelsep}{0pt}

\DeclareSortingScheme{ndymdt}{
    \sort{
        \field{presort}
    }
    \sort[final]{
        \field{sortkey}
    }
    \sort{
        \name{sortname}
        \name{author}
        \name{editor}
        \name{translator}
        \field{sorttitle}
        \field{title}
    }
    \sort[direction=descending]{
        \field{sortyear}
        \field{year}
        \literal{9999}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{month}
        \literal{99}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{day}
        \literal{99}
    }
    \sort{
        \field{sorttitle}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=4,padchar=0]{volume}
        \literal{9999}
    }
}

\addbibresource{mybiblio2016.bib}

\begin{document}
    \nocite{*}
    \printbibliography[type=article,title={Journal articles}]
    \printbibliography[type=inproceedings,title={Conference papers}]
    \printbibliography[type=book,title={Books chapters}]
    \printbibliography[type=unpublished,title={Presentations}]
    \printbibliography[type=misc,title={Invited talks}]
    \printbibliography[type=artwork,title={Posters}]
    \printbibliography[type=report,title={Technical notes}]
    \printbibliography[type=thesis,title={Thesis}]
    \printbibliography[type=patent,title={Patents}]
\end{document}
8
  • Without the .bib file we cannot really test your MWE. And from your description it is not entirely clear to me what exactly is wrong? But maybe the option defernumbers=true can help you. Note that you will have to delete the temporary .aux, .bcf and .bbl files before you re-compile for a change in this option to take effect. – moewe Jan 30 '16 at 18:47
  • Dear Moewe, I tried your recommendation but not much progress. I just want my references to be sorted by year and month in descending order from 2015 to 2001 for each susbections. here is a link to the bib file. hope somebody can help. dropbox.com/s/zcww0t2bbr6f6cg/mybiblio2016.bib?dl=0 – MKS Jan 30 '16 at 19:22
  • Do you want to sort by year and month only and ignore the names? Because currently you are sorting by names, then year and month. Your .bib file is quite massive, so I'm not sure where to focus on exactly. – moewe Jan 30 '16 at 19:43
  • just year then month. for instance i have a few articles all in 2015 I want them to appear in the proper descending order. no need to sort names they appear as entered in the .bib. in My bib exported via zotero each item is labelled as article, inproceeding. I got the item in the proper subsection (jouranl article, conference...) but I missing the date sorting. appreciate your help. – MKS Jan 30 '16 at 19:49
  • Mhh, what I'm asking is should "Aaardvark 2010" be sorted before or after "Zoingbert 2015"? Currently from what I can see works are ordered by the author first and then (if all authors are the same) the year comes into play, which from what I can see is not too often. – moewe Jan 30 '16 at 19:55
3

The sorting ndymdt in your MWE sorts first by name (sortname, author, editor etc.), then by year, month and day, and then by title. So you might get

Aaardvark 2010

Banana 2011

Bar 2009

Foo 2009

Zoidberg 2015

If you want to sort by date first and then by name and finally by title to get

Zoidberg 2015

Banana 2011

Aaardvark 2010

Bar 2009

Foo 2009

you need

\DeclareSortingScheme{ddatent}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort[direction=descending]{
    \field[strside=left,strwidth=4]{sortyear}
    \field[strside=left,strwidth=4]{year}
    \literal{9999}
  }
  \sort[direction=descending]{
    \field[padside=left,padwidth=2,padchar=0]{month}
    \literal{00}
  }
  \sort[direction=descending]{
    \field[padside=left,padwidth=2,padchar=0]{day}
    \literal{00}
  }
  \sort[direction=descending]{
    \field[padside=left,padwidth=4,padchar=0]{volume}
    \literal{9999}
  }
  \sort{
    \name{sortname}
    \name{author}
    \name{editor}
    \name{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sorttitle}
    \field{title}
  }
}

which you use with sorting=ddatent.

2
  • looks great , really appreciate, so now i can use with any style right? – MKS Jan 30 '16 at 20:22
  • @user97118 That should be possible, yes. – moewe Jan 30 '16 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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