It's not possible to choose a sorting style using bibtopic.
Items are always printed in alphabetical order when using \btPrintCited
and sorted according to the order in the .bib file otherwise.
That said, it's possible to emulate unsrt
(or any sorting), by removing all items that are not cited from the .bib file, manually reordering the others according to the desired sorting (e.g. by year) and using \btPrintAll
to print them.
However, this is really cumbersome and totally against the spirit of LaTeX ;-) If any kind of non-alphabetical sorting is a requirement, it is definetely better to use biblatex.
I do not have the bibliography style you used in your MWE. Do you have a link to the style so that we can use it?
So I changed your MWE to show you how you can get the wanted result. The trick is to use the bibliography style unsrt
. Then you get the bibliography list in the order of the cite calls. Package filecontents
is used to have the bib file and the tex code in one MWE:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@misc{hfs,
Date-Added = {2012-10-18 15:39:01 +0100},
Date-Modified = {2012-10-18 15:44:41 +0100},
Howpublished = {\url{http://developer.apple.com/legacy/mac/library/#technotes/tn/tn1150.html}},
Institution = {Apple Computer, Inc.},
Month = {March},
Number = {Technical Note TN1150},
Title = {HFS Plus Volume Format},
Year = {2004},
key = {Apple2},
}
\end{filecontents*}
\documentclass[a4paper,11pt,twocolumn]{article}
%\usepackage{ICPhS2015}
\usepackage{graphicx}
\usepackage{hyperref}
\title{this is the title of my paper}
\author{test}
\begin{document}
Words \cite{hfs} words \cite{adams} words \cite{companion} words
\bibliographystyle{unsrt}
\bibliography{\jobname}
\end{document}
See the order of entries in the bib file and the order of calls in the MWE.
I get the following pdf file:
Can you adapt this to your needs?
Best Answer
Usually BibTeX takes care of sorting your bibliography. And BibTeX is pretty good at that, so I strongly suggest you let BibTeX sort your bibliography. If you use
.bib
files it is much easier to re-use your bibliographic data should you have to change the style.In case of cite-order sorting (
unsrt
), you can getthebibliography
To sort the bibliography for you automatically with some low-level hacking if you additionally accept a slight change in the syntax of\bibitem
.Normally
\bibitem
works like\item
and takes only one argument (the entry key) and an optional argument (the fixed label), the entry data itself is not an argument of\bibitem
. For the code below to work the entry data needs to be an argument of\bibitem
. That means that entries inthebibliography
can't look likethey must look like
Since you have these braces in your question already, I trust this is not a deal-breaker for you.
You may have to run LaTeX three times until all citation labels are resolved correctly, but you should get re-run warnings when a further run is required.
The main idea is that whenever you
\cite
an entry LaTeX writes the key to a list of all entry keys. This is implemented via the\citation
macro in the.aux
file, which means that the complete citation order is available at the beginning of the document, but requires two LaTeX runs.thebibliography
works in two steps, first it just collects all entries and their data (that's why we need the additional argument, so\bibitem
can grab the data), then in a second step it prints the entries in the order given by the entry list.The code is based on the standard definitions of
\citation
and\bibitem
from the LaTeX kernel andthebibliography
fromarticle.cls
. For a different document class or packages likecite
ornatbib
the definitions may have to be tweaked a bit (the code is compatible withhyperref
already, though).edit: Fix for
cite
package, see Multiple Reference Citation in order of appearance without Bibtex.