8

I'm putting together a linguistics bibliography using lsalike.bib and lsalike.sty. I'm generating it by using \nocite{*} and would like the references to be numbered (but kept in the usual order).

I'm fairly new to LaTeX, but here's my attempt at a MWE. This is as close as I've been able to get so far.

Document:

\documentclass{article}
\usepackage{lsalike}

\makeatletter
\renewcommand\@biblabel[1]{\@arabic\c@enumi}
\makeatother

\begin{document}

\nocite{*}

\bibliographystyle{lsalike}
\bibliography{mwe-bib}
\end{document}

Bibliography file:

@phdthesis{Nossalik:2009aa,
    Author = {Larissa Nossalik},
    School = {McGill University},
    Title = {L2 Acquisition of {R}ussian Aspect},
    Year = {2009}
    }

 @article{Bermel:1995aa,
    Author = {Neil Bermel},
    Journal = {{R}ussian {L}inguistics},
    Number = {3},
    Pages = {333--348},
    Title = {Aspect and the Shape of Action in {O}ld {R}ussian},
    Volume = {19},
    Year = {1995}
    }

This gives me a list of references with a 0 before each one. Is there a way to display 1 before the first reference in the list, 2 before the second, et c.?

3 Answers 3

6

The lsalike package is meant to do author-year citations:

The "lsalike" bibliography style (lsalike.bst) creates citations with labels like

  \citeauthoryear{author-info}{year}

These labels are processed by the following commands: [...]

So the bibliography is meant not to have numbers. If you'd like to have numbers anyway, you can do a different patch:

\usepackage{etoolbox}
\patchcmd{\thebibliography}{\setlength}{\usecounter{enumiv}\setlength}{}{}
\makeatletter
\renewcommand\@biblabel[1]{\stepcounter{enumiv}[\arabic{enumiv}]}
\makeatother

The numbers will appear in the margin.

enter image description here

With Guido's suggestion the numbers can be pushed inside the margin:

\renewcommand\@biblabel[1]{\stepcounter{enumiv}\hspace{\bighang}[\arabic{enumiv}] }
3
  • 1
    To avoid the numbers appearing in the margin use \renewcommand\@biblabel[1]{\hspace{\bibhang}\stepcounter{enumiv}\arabic{enumiv}. } @egreg Wouldn't it be better to define a new counter instead using enumiv?
    – Guido
    Sep 15, 2012 at 22:46
  • Thanks @egreg, this is exactly what I was trying to do. @Guido, when I try your edit, I get an Undefined control sequence error regarding the \bighang command. Do I need to load another package for this? Sep 16, 2012 at 18:28
  • Woops, figured it out. \bibhang, not \bighang. Sep 16, 2012 at 18:54
4

I don't know how fixed you are to this lsalike style, but with biblatex this would be a quite simple task:

\begin{filecontents}{mwe-bib.bib}
@phdthesis{Nossalik:2009aa,
    Author = {Larissa Nossalik},
    School = {McGill University},
    Title = {L2 Acquisition of {R}ussian Aspect},
    Year = {2009}
    }

 @article{Bermel:1995aa,
    Author = {Neil Bermel},
    Journal = {{R}ussian {L}inguistics},
    Number = {3},
    Pages = {333--348},
    Title = {Aspect and the Shape of Action in {O}ld {R}ussian},
    Volume = {19},
    Year = {1995}
    }

\end{filecontents}

\documentclass{article}
%\usepackage{lsalike}
\usepackage[
    sorting=nyt,
    style=numeric,
    backend=bibtex,
]{biblatex}

%\makeatletter
%\renewcommand\@biblabel[1]{\@arabic\c@enumi}
%\makeatother

\bibliography{mwe-bib}

\begin{document}
\cite{Nossalik:2009aa}
\cite{Bermel:1995aa}
\nocite{*}

\printbibliography

%\bibliographystyle{lsalike}
%\bibliography{mwe-bib}
\end{document}

And I think adapting the biblatex style to fit the lsalike style might be much easier than introducing some weird counters into a existing bibliography style

2

A solution alternative to that proposed by @egeg is

\usepackage{etoolbox}
\newcounter{lsaref}
\makeatletter
\apptocmd{\@lbibitem}{\stepcounter{lsaref}\arabic{lsaref}.}{}{}
\makeatother

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .