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.

the alphabetic style of biblatex is already very close to my requirements, but considering the following entry

@BOOK{smith1,
  author = {John Smith and Mike Someone},
  title = {The book with a very very very very very long title},
  year = {2005},
  publisher = {Publisher},
  location = {New York}
}

I would like to have a label like [Smith, 2005] instead of [Smi+05]. In other words:

[<first author's last name>, <year with 4 digits>]

In case there is more than one entry with the same author and the same year, a single letter should be added right behind the year like in [Smith, 2005a] (alphabetic already does this by default).

share|improve this question
1  
That looks much more like an author-year style to me, only with square brackets. Have you tried that? Have you looked at this answer for changing the bracket shape (tex.stackexchange.com/questions/16765/…)? –  Paul Stanley Aug 26 '12 at 14:46
    
I already tried that, but the format of the bibliography entries is nearly exactly what I want when I use "alphabetic", whereas "authoryear" would need to be modified in this regard as well. I just thought it would be easier to choose the style that comes closest to my requirements in order to modify as little as possible :). –  ph4nt0m Aug 26 '12 at 15:43
    
Welcome to TeX.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. –  henrique Sep 20 '12 at 20:54

1 Answer 1

up vote 14 down vote accepted

With biblatex 2+ and biber 1+ you can customize alphabetic labels with \DeclareLabelalphaTemplate. Here's an example.

\documentclass{article}
\usepackage[style=alphabetic,maxalphanames=1]{biblatex}
\addbibresource{biblatex-examples.bib}

\renewcommand*{\labelalphaothers}{}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{labelname}
    \field{label}
  }
  \labelelement{
    \literal{,\addhighpenspace}
  }
  \labelelement{
    \field{year}
  }
}

\begin{document}
\cite{knuth:ct:a,knuth:ct:b,knuth:ct:c,baez/article,baez/online}
\printbibliography
\end{document}

enter image description here

A couple notes:

  • The argument to \literal should be defined globally. Typically we specify one or more characters. We can also use biblatex's whitespace commands. Unlike biblatex's punctuation commands (e.g. \addcomma), they aren't restricted to citations and bibliographies.

  • Similar results could be obtained with BibTeX by modifying an author-year style (e.g. Bibliography styles like authordate2 in biblatex or natbib?), but getting the right item label alignment in the bibliography isn't easy.

share|improve this answer
    
Fantastic, that's exactly what I wanted. Thank you very much :-). –  ph4nt0m Aug 26 '12 at 17:01
    
@ph4nt0m don't forget to upvote Audrey's answer using the up arrow- this gives her 10 reputation points –  cmhughes Aug 26 '12 at 17:09
    
I would love to do this, but "Vote Up requires 15 reputation" :-( –  ph4nt0m Aug 26 '12 at 17:48

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.