Latex leaves blank space in references

I am using the official IEEE template for writing a paper in latex. The references are not stored in a separate file, but are appended at the end of the main .tex file in the \begin{thebibliography} block. Everything works fine, including the citation of references in the text.

There is though a problem: for the references 1-9, the text is displayed in the generated pdf file correctly. For references with the number greater than 10, the text is "indented" by some blank spaces, which makes it look horrible:

[8]   Author 1, book 1, year
[9]   Author 2, book 2, year
[10]   Author 3, book 3, year
[11]   Author 4, book 4, year

What I want is to force latex display every first letter of each reference at the same (imaginary) vertical line as the others. Is this possible?

-

migrated from stackoverflow.comFeb 5 '13 at 18:04

This question came from our site for professional and enthusiast programmers.

The thebibliography environment takes an argument that represents the maximum width of enumerated \bibitems. Here's an example:

\documentclass{article}
\begin{document}
\noindent\begin{minipage}{.5\textwidth}
\begin{thebibliography}{1}
\bibitem{a1}A\bibitem{b1}A\bibitem{c1}A\bibitem{d1}A\bibitem{e1}A
\bibitem{f1}A\bibitem{g1}A\bibitem{h1}A\bibitem{i1}A\bibitem{j1}A
\end{thebibliography}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\begin{thebibliography}{11}
\bibitem{a2}A\bibitem{b2}A\bibitem{c2}A\bibitem{d2}A\bibitem{e2}A
\bibitem{f2}A\bibitem{g2}A\bibitem{h2}A\bibitem{i2}A\bibitem{j2}A
\end{thebibliography}
\end{minipage}
\end{document}


To have the \bibitems lined up (horizontally), provide a number that contains the number of digits in the largest item (11 in my example).

-
Thank you very much, it works! –  darie moldovan Feb 5 '13 at 21:58