[Tex/LaTex] Sorting the bibliography by entry type

bibtexsorting

I am using BibTeX. For overall configuration I use a .cls file. I am looking for a way to sort the bibliography in this order: Books, articles, and miscellaneous. Currently all types of materials get sorted according to author name. As I am not using author parameter for misc, all misc categories appear first, which I don't want to happen.

Best Answer

Here's how to do it using biblatex. (The defernumbers package option ensures that the numeric labels are assigned according to the order of entries in the bibliographies.)

\documentclass{article}

\usepackage[defernumbers=true]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@book{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
  location = {Location},
  publisher = {Publisher},
}
@article{C03,
  author = {Cuthor, C.},
  year = {2003},
  title = {Charlie},
  journaltitle = {Journal title},
  volume = {1},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography[type=book,title={Books}]

\printbibliography[type=article,title={Articles}]

\printbibliography[nottype=book,nottype=article,title={Miscellaneous}]

\end{document}

(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.)