[Tex/LaTex] Make Bibliography in order of appearance of citation using {unsrt}

bibliographiesbibtexsorting

I'm a total newbie at LaTeX, and I'm trying to figure out how to sort citations within a paper I'm writing for a conference based on their appearance in the document itself. The conference has a specific style they want for the paper/bibliography, so I tried using this code for my paper. When I compiled the first time, this went fine and everything was ordered properly, but then I went in to edit a citation, and recompiled in Bibtex and then LaTeX, and it went back to being alphabetically. Am I doing something wrong? What's the best way to make the bibliography sort by appearance of citation?

Thanks so much!

\documentclass[a4paper,11pt,twocolumn]{article}
\usepackage{ICPhS2015}
\usepackage{graphicx}
\title{this is the title of my paper}
\author{XXX}
\organization{XXX}
\email{XXX}
\begin{document}    

\begin{document}

Words \cite{gu_smoothing_2002} words \cite{_matlab_2012} words \cite{gu2007gss} words \cite {r_developmentcoreteam_r:_2007} words 

\bibliographystyle{ICPhS2015}{unsrt}
\bibliography{ICPhS2015}
\end{document}

And here's an example of the bibliography, which I want to sort by citation appearance, not by alphabetical order…

\begin{thebibliography}{10}

\bibitem{r_developmentcoreteam_r:_2007}
{DevelopmentCoreTeam}, R. 2007.
\newblock {\em R: A language and environment for statistical computing}.
\newblock R Foundation for Statistical Computing.

\bibitem{gu_smoothing_2002}
Gu, C. 2002.
\newblock {\em Smoothing Spline {ANOVA} Models}.
\newblock Springer Series in Statistics. Springer New York.

\bibitem{gu2007gss}
Gu, C. 2007.
\newblock gss: General smoothing splines.
\newblock http://cran.r-project.org/web/packages/gss/gss.pdf.

\bibitem{_matlab_2012}
MATLAB,  2012.
\newblock {\em Version 7.14.0.039 (R2012a)}.
\newblock The {MathWorks} Inc.
\end{thebibliography}

Best Answer

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:

Resulting pdf file

Can you adapt this to your needs?