[Tex/LaTex] Fixing the bibliography key margin when using AMSALPHA

bibliographiesindentation

I'm using the following bibliography code at the end of my document:

\documentclass[...]{book}
...
\begin{singlespace}
\begin{footnotesize}
\addcontentsline{toc}{chapter}{References}
\bibliographystyle{amsalpha}
\renewcommand{\bibname}{References}
\bibliography{thesis}
\end{footnotesize}
\end{singlespace}

But, I would like to widen a little the margin between the citation Key and the Full Entry, because some of the citation keys are big and protrude intro the description. For example:

alt text


UPDATE: Using Lev's answer, I almost got it working:

alt text

But now the left square bracket always appear right aligned, with an empty space in the reference key.


Bonus question: If possible, amsalpha also seems to only use the + sufix when the number of authors is greater than 4 (e.g. [SAJ+02]). Is it possible to decrease the threshold to 3?

Best Answer

I guess the problem is that amsalpha.bst uses the bibtex width$ primitive for calculating the longest label. But this calculation is based on "using cmr10 of June 1987". If you are using a font with different metrics then this doesn't always work. There are various ways to work around this, the simplest probably being to edit the .bbl file \begin{thebibliography}{longestlabel} line. A "better" solution would be to use the eqparbox package. For example, using natbib this is as easy as putting in the preamble:

\usepackage{eqparbox}
\usepackage[numbers]{natbib}
\renewcommand*{\bibnumfmt}[1]{\eqparbox[t]{bblnm}{[#1]}}

To change the number of authors before abbreviation, you can edit amsalpha.bst. The format.lab.names function seems to be the place to do this.