# Square brackets in Bibliography with apalike style

I have a document with this setup:

\usepackage[square,authoryear]{natbib}
...
\bibliographystyle{apalike}
\bibliography{bib}


Which is producing Bibliography entries like:

Batty, M. (2007). Cities and Complexity. MIT Press.

However, as the PennState references page shows, I would expect something like:

[Batty, 2007] Batty, M. Cities and Complexity. MIT Press. 2007.

What should I do to get a formulation closer to the later?

• Nothing to get closer, as it is wrong. The output you get is correct. Aug 20, 2015 at 20:01
• This is what the apa style is like. See Verbal descriptions of bibliography styles for a description of the basic kinds of styles available. You might want to use biblatex instead, since it has lots more options in one package, and they are easier to customize. See also What to do to switch to biblatex? and bibtex vs. biber and biblatex vs. natbib Aug 20, 2015 at 20:23
• I switched to biblatex and found that it is not easier to use square brackets... it still requires a ton of code :( Nov 27, 2017 at 5:06

A style file close to the one you want is the named style, which is not compatible with natbib, however, and has nothing to do with apa specifications.

If you want to use it, add the following lines in the preamble

\makeatletter
\let\@internalcite\cite
\def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
\def\shortcite{\def\citeauthoryear##1##2{##2}\@internalcite}
\def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
\makeatother


and then use

\bibliographystyle{named}


MWE:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Batty:2007,
author    = {Michael Batty},
title     = {Cities and Complexity},
publisher = {MIT Press},
year      = 2007}
\end{filecontents*}

\makeatletter
\let\@internalcite\cite
\def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
\def\shortcite{\def\citeauthoryear##1##2{##2}\@internalcite}
\def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
\makeatother

\begin{document}

This a citation \cite{Batty:2007}

\bibliographystyle{named}
\bibliography{\jobname}

\end{document}


Output: