Ordering citations in Latex documents

Last modified: Aug 2002.

Most articles written in LaTeX use the \cite and \bibitem commands to handle references. I have written a Python script that shuffles the \bibitem entries to occur in the same order that they are cited.

It has a few limitations: it cannot handle a \cite{...} command with a newline in the middle, and it is quite naive about escape characters ( [opt\]ion] will confuse it) but it should process most LaTeX articles correctly.