Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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

share|improve this answer
    
Thanks. 2 more questions to your solution: 1) Is there a way to get the labels ([Aut42], ...) in boldface? 2) At the moment if there are for example labels [RT09] and [Hum96] (of different width) there is a large space between the label and the text. Is there a way that the text start directly after the label? Something like [Aut42]~A.~Author. –  Ivo Mar 3 '13 at 20:28
    
@Ivo I've added the code; it's better to act on \@bibitem than on \@lbibitem. –  egreg Mar 3 '13 at 22:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.