[Tex/LaTex] Omit hanging indent in bibtex

bibliographiesboldformattingindentation

I use \bibliographystyle{alpha} with bibtex (not biblatex). The document class is scrreprt. The output looks like

[Abc07] Example Abc. The title and all other stuff.
        dddd. 2007.
[Bcd08] Ex Bcd. The title, the journal and all other stuff.
        cccc. 2008.

But I want something like

[Abc07] Example Abc. The title and all other stuff.
dddd. 2007.

[Bcd08] Ex Bcd. The title, the journal and all other stuff.
cccc. 2008.

where the labels [Abc07] and [Bcd08] should be bold. So I don't want the hanging indent. But with a small vertical space between the entries.

Can someone help me?

Best Answer

The thebibliography environment is a list environment and you should change the parameters for it. Basically, instead of setting the \leftmargin we set the \itemindent to contain the label and the separation, while keeping the \leftmargin to zero.

\begin{filecontents*}{\jobname.bib}
@article{A,
 author={Author, A.},
 title={The title of this article that should be long enough to wrap},
 journal={Journal of Irreproducible Results},
 year={2042},
}
@article{B,
 author={Buthor, B.},
 title={The title of this article that should be long enough to wrap},
 journal={Journal of Irreproducible Results},
 year={2042},
}
\end{filecontents*}

\documentclass{scrreprt}

%%% Code to add to your document
\usepackage{etoolbox}
\patchcmd{\thebibliography}
  {\advance\leftmargin\labelsep}
  {\leftmargin=0pt\itemindent=\labelwidth\advance\itemindent\labelsep}
  {}{}
%%% end of code to add    

\begin{document}
\nocite{*}
\bibliographystyle{alpha}
\bibliography{\jobname}
\end{document}

The example uses a filecontents* environment, but all you need is the marked code.

enter image description here

If you want that the labels are rendered in boldface, with a normal space after them, the code to add is

\patchcmd{\thebibliography}
  {\advance\leftmargin\labelsep}
  {\leftmargin=0pt\labelwidth=0pt\labelsep=0pt}
  {}{}
\makeatletter
\renewcommand{\@biblabel}[1]{[\textbf{#1}]~}
\makeatother

Here's a picture:

enter image description here

Related Question