Hi, I have a long bibliography file for a latex document and I must put the references in order. Unfortunately the different authors have used different styles, so that I have two blocks. In the first block all references look like
------------------------------------------------------------ \bibitem[ {Aarseth}, 1999]{Aarseth99}{Aarseth}, S.~J. (1999).\newblock {From NBODY1 to NBODY6: The Growth of an Industry}.\newblock {\em PASP}, 111:1333--1346. \bibitem[ {Aarseth}, 2003]{Aarseth03}{Aarseth}, S.~J. (2003).\newblock {Black hole binary dynamics}.\newblock {\em Ap\&SS}, 285:367--372. \bibitem[ {Alexander} and {Hopman}, 2003]{AH03}{Alexander}, T. and {Hopman}, C. (2003).\newblock {Orbital inspiral into a massive black hole in a galactic center}.\newblock {\em ApJ Lett.}, 590:L29--L32. ---------------------------------------------------------- (note that each entry is a single row) And in the second block I have ---------------------------------------------------------- \bibitem{stroeer06emri} Stroeer A, Gair J R and Vecchio A, 2006, Proceedings of 6th LISA Symposium submitted, preprint gr-qc/0605227 \bibitem{farmer} Farmer A J and Phinney E S, 2003, Mon.~Not.~Roy.~Astron.~Soc.~{\bf 346} 1197 \bibitem{sesana05} Sesana A, Haardt F, Madau P and Volonteri M 2005 {\it Astrophys. J.} {\bf 623} 23 \bibitem{emriconf} Barack L and Cutler C 2004 \PR D {\bf 70} 122002 ---------------------------------------------------------- (idem, single rows) This means that (for these four entries) the final result should be --------------------------------------------------------------------------------------- \bibitem[ {Aarseth}, 1999]{Aarseth99}{Aarseth}, S.~J. (1999).\newblock {From NBODY1 to NBODY6: The Growth of an Industry}.\newblock {\em PASP}, 111:1333--1346. \bibitem[ {Aarseth}, 2003]{Aarseth03}{Aarseth}, S.~J. (2003).\newblock {Black hole binary dynamics}.\newblock {\em Ap\&SS}, 285:367--372. \bibitem[ {Alexander} and {Hopman}, 2003]{AH03}{Alexander}, T. and {Hopman}, C. (2003).\newblock {Orbital inspiral into a massive black hole in a galactic center}.\newblock {\em ApJ Lett.}, 590:L29--L32. \bibitem{emriconf} Barack L and Cutler C 2004 \PR D {\bf 70} 122002 \bibitem{farmer} Farmer A J and Phinney E S, 2003, Mon.~Not.~Roy.~Astron.~Soc.~{\bf 346} 1197 \bibitem{sesana05} Sesana A, Haardt F, Madau P and Volonteri M 2005 {\it Astrophys. J.} {\bf 623} 23 \bibitem{stroeer06emri} Stroeer A, Gair J R and Vecchio A, 2006, Proceedings of 6th LISA Symposium submitted, preprint gr-qc/0605227 ------------------------------------------------------------------------------------------------------ My first feeling was to try something like visual + ! sort -k but this doesn't work... any idea? I have more than 200 references and I don't feel like doing this per hand! Thanks Pau