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 have problem on how to make the bibliography item left-aligned. My current bibliography output is below.

sample output

As you can see, the reference item code is currently right-aligned, and I need it to be left-aligned. Any idea on how to achieve that?

My current code for the bibliography is

\usepackage{natbib}
%....
\nocite{*}
\bibliographystyle{alpha}
\bibliography{references}

Thank you.

update

Below is the code after i reduce many of it. The problem still occur on this code. I use MiKTeX 2.9.

\documentclass[bahasa, 12pt, a4paper, final]{report}
\usepackage{babel}
\usepackage{natbib}
\usepackage{url}


\begin{document}
    \nocite{*}
    \bibliographystyle{alpha}
    \bibliography{references}
\end{document}
share|improve this question
2  
Which document class are you using? The standard behaviour (at least in book, report, and article) is for the labels to be left aligned, so there must be something else in your document. Can yo please add a minimal working example to your question illustrating the mentioned behaviour? –  Gonzalo Medina Jun 21 '11 at 21:56
    
I just updated with the minimal working example. (hope it's minimal enough) –  Petra Barus Jun 22 '11 at 13:33

2 Answers 2

up vote 2 down vote accepted

Put this in your document preamble:

\makeatletter
\renewcommand{\@biblabel}[1]{[#1]\hfill}
\makeatother
share|improve this answer
    
Hey, it works like a charm. Thanks! –  Petra Barus Jun 22 '11 at 21:26

You are using the alpha bibliography style. If you use natbib, I recommend you switch the bibliography style to plainnat:

\documentclass[bahasa, 12pt, a4paper, final]{report}
\usepackage{babel}
\usepackage[options]{natbib}
\usepackage{url}

\begin{document}
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}

You can find more useful options for natbib package in Reference sheet for natbib usage. As example, author-year citations are default. If you want numerical citations you can use numbers as option.

share|improve this answer
    
@Petra I exposed the right way. alpha style is not part of natbib, and plainnat do what you were looking. But, if you prefer some magic commands. OK! –  Eloy Mello Jun 23 '11 at 13:05

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.