# Alignment numbered apalike bibliography style

I prefer the apalike bibliography style with the number in brackets in front (see also this post and this post). However what I am curious about is how to align the first and subsequent text lines neatly next to the number in brackets.

Does anyone know how to do this?

• I know how to do this with biblatex, but this is not apalike bib style, as far as I know: it is a numeric style. – Bernard Jan 12 '16 at 10:56
• Could you give an example? I would like to have something similar to apa style but then with squared numbers – user89685 Jan 13 '16 at 16:25
• Apa style would label something like Alziary & al. 1997, possibly between brackets, since it an authoryear style. – Bernard Jan 13 '16 at 16:54

You can update some of the settings loaded by the thebibliography environment to a set of fixed lengths:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
author  = {B Alziary and JP D{\'e}camps and PF Koehl},
title   = {A {PDE} approach to {A}sian options: {A}nalytical and numerical evidence},
journal = {Journal of Banking \& Finance},
year    = {1997},
volume  = {21},
number  = {5},
pages   = {613-640}
}
\end{filecontents*}

\usepackage[numbers]{natbib}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\thebibliography}{\c@NAT@ctr\z@}{\c@NAT@ctr\z@
\renewcommand{\makelabel}[1]{\makebox[1.2em][r]{##1\hfill}}%
\setlength{\labelwidth}{1.2em}%
\setlength{\labelsep}{.5em}%
\setlength{\leftmargin}{\dimexpr\labelwidth+\labelsep}%
}{}{}
\makeatother

\begin{document}

\nocite{*}

\bibliographystyle{apalike}

\bibliography{\jobname}

\end{document}


You can increase the two length measures 1.2em that forms part of \makelabel and setting \labelwidth if you have more than 9 references.

• +1 for assuring that the words Asian and Analytical aren't lowercased. :-) – Mico Mar 25 '16 at 3:36
• Do you by any chance know how to make this work if the multibib package is used? I have posted this question, because the solution here does not seem to work with this package. – SampleTime Jan 19 at 18:41