[Tex/LaTex] How to alter sort order to place online url references at the end of the bibliography

abbrvnat.bstbibtexnatbib

I wish to place less weight on @misc entries in my bibliography by moving them at the end, after academic conference publications. I like the way abbrvnat presents the bibliography items otherwise. I'm also using natbib to get number citations and compaction.

By default it sorts citations by author names (which is fine), and when no author name is available, it seems to be using something else (title?) as a sort field in the bibliography.

What's the easiest way to send all the @misc references at the end of the document, while keeping their relative order?

An example document:

\documentclass[11pt]{article}
\usepackage[hyphens]{url}
\usepackage[numbers,sort&compress]{natbib}

\begin{document}

Articles: \cite{bogus, greenwade93}

Website: \cite{example}

\bibliographystyle{abbrvnat}
\bibliography{biblio}

\end{document}

\bibliographystyle{myabbrvnat}
\bibliography{biblio}

Example biblio:

@misc{example,
  title = {{Example.org Home Page}},
  howpublished = {\url{http://example.org/}},
  note = {Accessed: June 2017.}
}

@article{bogus,
  aurhor =  {Bogus Redwade},
  title = {A Bogus Article},
  year = {1993},
}

@article{greenwade93,
  author  = {George D. Greenwade},
  title   = {The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})},
  year    = {1993},
  journal = {TUGBoat},
  volume  = {14},
  number  = {3},
  pages   = {342--351}
}

In that example, I would like the website to move to the end of the list. If there are multiple websites, then their relative order should be kept.

screenshot

Best Answer

Given that you are willing to alter the bibliography file, you can use the well-known \noopsort workaround (see https://tex.stackexchange.com/search?q=noopsort) to sort the misc entries after the rest. Because sorting is performed on author, you should also change the title field of the misc entries to author. For this solution you don't need to change the .bst-file.

Example:

@PREAMBLE{ {\providecommand{\noopsort}[1]{}} }

@misc{example,
  author = {{\noopsort{zzz-example}}{Example.org Home Page}},
  howpublished = {\url{http://example.org/}},
  note = {Accessed: June 2017.}
}

Result:

enter image description here

Alternatively, using biblatex it can be done without changing the bibliography file, by printing separate reference sections based on type. Adapted from https://tex.stackexchange.com/a/6966:

\printbibliography[nottype=misc,title={References}]
\vspace{-6mm}
\printbibliography[heading=none,type=misc]

Small problem here is that the second bibliography section, even without heading, still introduces some extra space that needs to be removed (for example with a negative vspace).

Related Question