4

I am using biblatex package. I am including all bibitems in a document. I want to sort items first by the author X when he is first author, seconds etc and then by year. Is there any simple way of going it?

Update:

Here is an example code

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{fruits,
  title = {The apple and the banana},
  publisher = {Tomatopress},
  editor = {Straw Berry},
  author = {Straw Berry and Annoying Orange},
  year = {2015}
}
@book{fruits2,
  title = {The pineapple and the banana},
  publisher = {Tomatopress},
  editor = {Straw Berry},
  author = {Annoying Orange, Straw Berry and Tom Ato},
  year = {2015}
}
@book{fruits3,
  title = {Thank your for your attention},
  publisher = {Tomatopress},
  editor = {Straw Berry},
  author = {Tom Ato, Annoying Orange and Peachy Pear},
  year = {2014}
}
@book{fruits4,
  title = {Advance title},
  publisher = {Tomatopress},
  editor = {Straw Berry},
  author = {Cu Cumber, Annoying Orange and Peachy Pear},
  year = {2014}
}
@book{fruits5,
  title = {Fancy title},
  publisher = {Tomatopress},
  editor = {Straw Berry},
  author = {Annoying Orange and Peachy Pear},
  year = {2013}
}
\end{filecontents*}


\usepackage[utf8]{inputenc}
\usepackage[backend=bibtex,maxbibnames=99,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}


\begin{document}
Hello world 

\nocite{fruits,fruits2,fruits3,fruits4,fruits5}.
\printbibliography

\end{document}

This results in: Result of the above code

What I want is to first sort by when Annoying Orange is first author and then sort by years, further sort by when Annoying Orange is second author and then by year etc.

so that the significants of the authorship is emphasized for a particular author.

  • Can you please show us some code what you are doing ... – Mensch Feb 19 '15 at 8:25
  • You will find that your name lists are not properly formatted, it should be Name One and Name Two and Name Three, not Name One, Name Two and Name Three. – moewe Mar 30 '15 at 8:53
2

I don't think a fully automatic solution for this is easily implemented, but regex-Biber wizards might surprise me here. So this solution will require some manual work.

First of all, you need to input name list correctly. That is all names have to be separated by an and. Do not say author = {Cu Cumber, Annoying Orange and Peachy Pear},, correct is author = {Cu Cumber and Annoying Orange and Peachy Pear},. See How to write properly multiple authors in bibtex file?.

Then you would need to add sortname = {Annoying Orange} to all fields.

Finally comes the trick. Add presort = {<n>}, to the entry if "Annoying Orange" is the n-th author.

@book{fruits,
  title     = {The apple and the banana},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Straw Berry and Annoying Orange},
  year      = {2015},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits2,
  title     = {The pineapple and the banana},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Annoying Orange and Straw Berry and Tom Ato},
  year      = {2015},
  presort   = {1},
  sortname  = {Annoying Orange},
}
@book{fruits3,
  title     = {Thank your for your attention},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Tom Ato and Annoying Orange and Peachy Pear},
  year      = {2014},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits4,
  title     = {Advance title},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Cu Cumber and Annoying Orange and Peachy Pear},
  year      = {2014},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits5,
  title     = {Fancy title},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Annoying Orange and Peachy Pear},
  year      = {2013},
  presort   = {1},
  sortname  = {Annoying Orange},
}

Then all entries are ordered first by the position Annoying Orange takes, then by year.

MWE

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{fruits,
  title     = {The apple and the banana},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Straw Berry and Annoying Orange},
  year      = {2015},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits2,
  title     = {The pineapple and the banana},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Annoying Orange and Straw Berry and Tom Ato},
  year      = {2015},
  presort   = {1},
  sortname  = {Annoying Orange},
}
@book{fruits3,
  title     = {Thank your for your attention},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Tom Ato and Annoying Orange and Peachy Pear},
  year      = {2014},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits4,
  title     = {Advance title},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Cu Cumber and Annoying Orange and Peachy Pear},
  year      = {2014},
  presort   = {2},
  sortname  = {Annoying Orange},
}
@book{fruits5,
  title     = {Fancy title},
  publisher = {Tomatopress},
  editor    = {Straw Berry},
  author    = {Annoying Orange and Peachy Pear},
  year      = {2013},
  presort   = {1},
  sortname  = {Annoying Orange},
}
@book{fruits6,
  title     = {Very Advance title},
  publisher = {Tomatopress},
  author    = {Cu Cumber and Peachy Pear and Annoying Orange},
  year      = {2015},
  presort   = {3},
  sortname  = {Annoying Orange},
}
\end{filecontents*}


\usepackage[utf8]{inputenc}
\usepackage[backend=bibtex,maxbibnames=99,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}


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

enter image description here

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.