TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can thebibliography be sorted by citation order? Or is there a solution with an inlined bibliography that can be sorted?

Not having an additional .bib file would be preferable.

My current bilbiography is inluded in the rest of the article inside a thebibliography block.

The citations in\cite{ne} the bibliography should\cite{flowers} be ordered 
according which order they appear in the text. 


\bibitem{fetebok} \emph{Internal Combustion Engine Fundamentals}

\bibitem{ne} \emph{Förbränningsmotorer}

\bibitem{flowers} \emph{HCCI Research Towards Development for Stationary Power 


Should output:

The citations in[1] the bibliography should[2] be ordered 
according which order they appear in the text. 

[1] Förbränningsmotorer
[2] HCCI Research Towards Development for Stationary Power Applications
[3] Internal Combustion Engine Fundamentals
share|improve this question
Welcome to tex.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. – Joseph Wright May 4 '11 at 9:41
The standard unsrt style does exactly this: a minimal example of your code would be very useful to give a more targeted answer. – Joseph Wright May 4 '11 at 9:42
This is a duplicate of tex.stackexchange.com/questions/14976/…. This qn is a bit more clearly phrased and easier to find than the older qn, so it might be an idea to close the older one as a duplicate of this one. – Charles Stewart May 4 '11 at 10:48
\bibliographystyle{unsrt} doesn't seem to work with \begin{thebibliography}. Nothing is changing anyway. – Robert Foss May 4 '11 at 17:10
You might need to delete your .aux and .bbl files before it will work properly... – Seamus May 4 '11 at 17:13
up vote 25 down vote accepted

If you really need a bibliography sorted by citation order you have two choices:

(1) write the entries in thebibliography in citation order

(2) use a .bib file, \bibliographystyle{unsrt} and BibTeX.

There is a third choice, actually, but I did it just to prove it's possible:


     \expandafter\xdef\csname uns@cite#1\endcsname{\arabic{mycite}}%
       \csname uns@bibitem#1\endcsname}%

% Define here the bibliography entries
\mybibitem{fetebok}{\emph{Internal Combustion Engine Fundamentals}}
\mybibitem{flowers}{\emph{HCCI Research Towards Development for Stationary 
  Power Applications}}

The citations in~\unscite{ne} the bibliography should~\unscite{flowers}
be ordered according which order they appear in the text. 



Notice that this \unscite can't process lists of references or the optional argument like the usual \cite. It might be done, but I advise you against this approach.

share|improve this answer
Could you elaborate how option 2 works please? – Argyll May 28 at 8:07
@Argyll Usage of BibTeX is covered in any LaTeX primer. – egreg May 28 at 8:09
Well, the options I use is [style=phys,sorting=none,backend=bibtex]. It sorts the references for most of my documents. Just not the one I am currently working on, which follows the order of references in the .bib file. I have no clue of the reason. – Argyll May 28 at 8:12
And btw, \bibliographystyle{unsrt} gives errors in the output and the file would not compile with the phrase – Argyll May 28 at 8:14
@Argyll This is biblatex, a different thing – egreg May 28 at 11:57

Yes there is a way to sort \bibitems in the order order of appearance in the text. Have a look at https://code.google.com/p/latex-bibitemstyler/, a nice little program that does this job like a charm.

share|improve this answer
This a duplicate answer. See Is it acceptable to add a duplicate answer to several questions? for why this should be avoided and how to provide better answers. – Andrew Swann Nov 15 '13 at 10:38
Thank you for pointing this out to me (newbie). I adjusted the answers (same solution for different questions). – Günther Nov 15 '13 at 11:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.