Latex BibStyle, how to change it

How can I get my bibliography style to be as follows:

Last Name, First Initial.,.....

The references should appear in the paper as [1] and appear in alphabetical order in the bibliography. An example is in http://www.doria.fi/bitstream/handle/10024/103747/d%C3%ADaz_natalia.pdf?sequence=2

I've been trying every style, but none seem to quite fit the bill.

EDIT An example of the citation should be:

Agostini, A., Bettini, C., and Riboni, D. (2009). Hybrid reasoning in
the CARE middleware for context awareness. Int. J. Web Eng. Technol.,
5(1):3–23.


Currently, I can only seem to find styles to make them like:

A. Agostini, C. Bettini, and D. Riboni. (2009). Hybrid reasoning in
the CARE middleware for context awareness. Int. J. Web Eng. Technol.,
5(1):3–23.

• Could you post a minimal example? Jul 6 '15 at 13:02
• I made an edit that hopefully should clarify a bit more. Jul 6 '15 at 13:24
• Did you have a look at this list: cs.stir.ac.uk/~kjt/software/latex/showbst.html Jul 6 '15 at 14:40
• This does something similar with biblatex. Jul 7 '15 at 20:14

Here is a way of getting what you want, I think, with biblatex+biber:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{filecontents}

\begin{filecontents}{testlastfirst.bib}
@article{ago09,
author = {Agostini, A. and Bettini, C. and Riboni, D.},
title = { Hybrid reasoning in the CARE middleware for context awareness},
journal = {Int. J. Web Eng. Technol.},
volume = {5},
number = {1},
year = {2009},
pages = {3–23}
}
\end{filecontents}

\usepackage[bibstyle=authoryear,labelnumber, firstinits,backend=biber]{biblatex}%

\DeclareNameAlias{sortname}{last-first}

\defbibenvironment{numlabel}
{\list
{\printtext[labelnumberwidth]{%
\iffieldundef{shorthand}
{\printfield{prefixnumber}%
\printfield{labelnumber}}
{\printfield{shorthand}}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}

\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}

\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\mkbibparens {%
\printfield{number}}%
\printfield{eid}}

\renewbibmacro{in:}{\relax}

\DefineBibliographyStrings{english}{%
pages = {\relax}%
}%

\usepackage{xpatch}

\xpatchbibmacro{journal+issuetitle}{%
\usebibmacro{journal}%
}{%
\usebibmacro{journal}%
}{}{}

\begin{document}

\printbibliography[env =numlabel]

\end{document}


• @user2694306: I've just added a solution with biblatex. Jul 6 '15 at 20:12

I think your best bet is to modify the .bst file. Take the style that is closest, and make a copy of it (so you don't mess up the original ;)!). Then mess about with the copy until you find where to modify the code to suit your needs.

I am not very good with code myself, but have managed to adapt .bst to my need with (lots of!) trial and error. The search function is your friend :)

edit: it's a good idea to mark what you changed with a %% comment, for future reference

• When I use \bibliographystyle{apa} I get the Last Names before the initials, though... For example: Schatz, Henriette, F. (1989). Code-switching or borrowing?: English elements in the Dutch of Dutch-American immigrants. ITL International Journal of Applied Linguistics, 83-84:125–162.
– Emma
Jul 6 '15 at 13:55