[Tex/LaTex] Order by first author only (not all names) than by year or Sort by a partial entry in biblatex

biblatexsorting

I need to sort my biblatex entries on the base of the first author only (authortitle style), but I need the complete list of authors in the bibliography. I can use something like

\DeclareSortingScheme{mio}{
 \sort{\field{author}}
}

but how can I extract the first author only?
Otherwise said, how can I extract partial infos from bibtex entries (the first author as an example?)

Can anyone help me?

Thank you

I use biblatex biber teklive

Order of reference here should be the inverse

enter image description here

Example:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{filecontents}
\usepackage[natbib = true, backend = biber, style = authoryear, sorting = nyt]{biblatex}

\begin{filecontents}{\jobname.bib}

@article{A2014,
author={A,B and C,D},
title={Test},
year = {2014}
}

@article{A2000,
author={A,B and D,E},
title={Test},
year = {2000}
}

\end{filecontents} 

\addbibresource{\jobname.bib}

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

\end{document}

UPDATE

I have the answer right now, but I edited the question anyway because I think this could be a common problem for newbies like me and I didn't find an example on the net

Therefore, please answer this question giving also some detail about the use of sortname, \DeclareSourcemap \DeclareSortingScheme to help me learn.

Best Answer

How I commented in your question I see two possibilities for sorting the bibliographies entries:

The first: Using only the Last Name of the First Author

How you are using biber, you are able to use labelalpha (biblatex.pdf. page 59). Using labelalpha you can use only one author, with the maxalphanames. Then if it is set to 1 biber only use the first author (really the lastname) for make the labelalpha. Finally, it is necessary to specify a sorting scheme that use labelalpha for example anyt (Page 254, biblatex.pdf). Then load biblatex whith:

\usepackage[maxalphanames=1,labelalpha,maxbibnames=99, sorting=anyt, style=authoryear, natbib=true,  backend=biber]{biblatex}

MWE

\documentclass{article}
\begin{filecontents}{MWE.bib}
@article{A2014,
author={A,B and C,D},
title={Test},
year = {2014}
}

@article{A2000,
author={A,B and D,E},
title={Test},
year = {2000}
}

\end{filecontents}
\usepackage[maxalphanames=1,labelalpha,maxbibnames=99, sorting=anyt, style=authoryear, natbib=true,  backend=biber]{biblatex}
\addbibresource{MWE.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

enter image description here

The maxbibanames=99 is for printed the full authors in the bibliography.

The second: Using the fullname of the First Author

This is possible using DeclareStyleSourcemap. The most the default alphabetic sorting schemes of biblatex are able to use sortname field. Then it is possible use DeclareStyleSourcemap for copy the fullname of the first author in the sortname field. For a explains about Regular Expressions read the perl documentation here.

\DeclareStyleSourcemap{
    \maps[datatype=bibtex]{
      \map{
        \step[fieldsource=author, match=\regexp{(.+)\sand}, final]
        \step[fieldset=sortname, fieldvalue=$1, final]  }
}}

MWE

\documentclass{article}
\begin{filecontents}{MWE.bib}
@article{A2014,
author={A,Bo and M,M},
title={Test},
year = {2014}
}

@article{A2000,
author={A,Co and D,E},
title={Test},
year = {2000}
}

\end{filecontents}

\RequirePackage[maxbibnames=99, sorting=nyt, style=authoryear,  backend=biber]{biblatex}

\DeclareStyleSourcemap{
    \maps[datatype=bibtex]{
      \map{
        \step[fieldsource=author, match=\regexp{(.+)\sand}, final]
        \step[fieldset=sortname, fieldvalue=$1, final]  }
}}

\addbibresource{MWE.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

enter image description here