MWE for the problem I encountered:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{biblatextest1.bib}
@BOOK{BookA03,
author = {Author Aaa},
title = {Some Title},
publisher = {Some Publisher},
year = 2003
}
@BOOK{BookB02,
author = {Author Bbb},
title = {Some Title},
publisher = {Some Publisher},
year = 2002
}
\end{filecontents}
\begin{filecontents}{biblatextest2.bib}
@MISC{LinkC04,
author = {Author Ccc},
title = {Some Title},
year = 2004,
url = www.test1.com/bild.jpg,
}
@MISC{LinkD01,
author = {Author Ddd},
title = {Some Title},
year = 2001,
url = www.test2.com/bild.jpg
}
\end{filecontents}
\usepackage[backend = biber, defernumbers = true, style = alphabetic]{biblatex}
\addbibresource{biblatextest1.bib}
\addbibresource{biblatextest2.bib}
%Append keywords to identify different bibliography entries.
\DeclareSourcemap{
\maps[datatype=bibtex, overwrite]{
\map{
\perdatasource{biblatextest1.bib}
\step[fieldset=KEYWORDS, fieldvalue=primary, append]
}
\map{
\perdatasource{biblatextest2.bib}
\step[fieldset=KEYWORDS, fieldvalue=secondary, append]
}
}
}
%Declare new sorting scheme for refernence bibliography.
\DeclareSortingScheme{appearance}{
\sort{\citeorder}
}
%Copied from numeric.cbx to imitate numerical citations.
\providebool{bbx:subentry}
\newbibmacro*{citenum}{%Note: the original macro was called "cite". I did not redefine "cite", but instead defined a new macro "citenum", because the author-year citations use the "cite" macro too. "\renewbibmacro*{cite}" would have caused all the author-year citations to become numeric too.
\printtext[bibhyperref]{%If you ever want to use hyperref
\printfield{prefixnumber}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}}
%Copied from numeric.cbx to define a new numeric citation command for @online entries.
\DeclareCiteCommand{\cnume}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citenum}}%Note: this was originally "cite" but I changed it to "citenum" to avoid clashes with the author-year style.
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
The first two citations \cnume{LinkD01} and \cite{BookB02}.
The others are \cnume{LinkC04} and \cite{BookA03}.
\printbibliography[title=Bibliography, keyword=primary]
%Redefine the bibliography environment to imitate the numeric citation style
\defbibenvironment{bibliographyNUM}
{\list
{\printfield[labelnumberwidth]{labelnumber}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\labelsep}{1em}
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}\hspace{-1.1em}}
\newrefcontext[sorting=none]
\printbibliography[env=bibliographyNUM,title=References, keyword=secondary, resetnumbers]
\end{document}
The problem: I need two bibliographies, the first one with alphabetic style and sorted by author name. The second in numeric style sorted by cite order. Both have no common references. Somehow I'm searching for something like this in biblatex:
\bibliographystyle{style = alphabetic}
\printbibliography{books.bib}
\bibliographystyle{style = numerical, sorting = none}
\printbibliography{links.bib}
I thought biblatex is especially written to work with multiple bibliographies, but I haven't found any other way than the one shown in the MWE (which is obviously a hack). Actually it works pretty good until I want the other sorting. When I use
\newrefcontext[sorting=none]
The cite numbers turn to zero.
biblatex
is written to support split/multiple bibliographies (amongst many other features), but it doesn't official support mixing different bibliography styles in one document.