# Change entry label to [Jones,82]

I'm trying to set a bibliography this way:

\documentclass[12pt,french]{report}
\usepackage[backend=bibtex,
style=alphabetic
]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Cha65,
author = {Charles, Daniel},
year = {1965},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


Which biblatex's style allows me to display citation this way [AuthorName, Last_two_integers_of_year_number], please ?

Thanks a lot!

• Please post complete code i.e. a complete, small document which includes the class, packages, \begin{document}... \end{document} and which demonstrates the issue. A complete Minimal Working Example is much more useful than mere fragments. Could you also explain the problem? Is it that you are missing a comma and space? – cfr Apr 11 '14 at 23:42
• @cfr, I've updated my post. – dgs Apr 11 '14 at 23:48
• Thanks for providing an MWE! Is biber an option? – cfr Apr 11 '14 at 23:49
• @cfr, I'm beginner to this. You can use what you want until the it answers the question. – dgs Apr 11 '14 at 23:58

This solution modifies the default template for the label. This requires biber rather than bibtex as the backend. This means that the compilation sequence needs to be altered, too:

pdflatex <filename>.tex
biber <filename>
pdflatex <filename>.tex


pdflatex <filename>.tex


It will work fine with latex rather than pdflatex - just biber is essential.

\documentclass[12pt,french]{report}
\usepackage{babel}% needed for french
\usepackage[utf8]{inputenc}% needed for sample bib entry
\usepackage{csquotes}% recommended in output (biblatex)
\MakeAutoQuote*{“}{”}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\DeclareLabelalphaTemplate{% adjust the template for the label based on the default one - requires biber
\labelelement{%
\field[final]{shorthand}% if shorthand specified, use it
\field{label}% if label specified, use it
\field[strside=left]{labelname}% if not, use the labelname e.g. author
}
\labelelement{%
}
\labelelement{%
\field[strwidth=2,strside=right]{year}% take the rightmost 2 numbers from the year
}
}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Cha65,
author = {Charles, Daniel},
year = {1965},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


Note that you should check your MWE compiles before posting it. Yours spewed errors which required me to modify it in order to get to the point where I could begin thinking about your question. Minimal is great and definitely what's needed - just make sure it isn't so minimal it doesn't work!

# Too Many Names

The above code will cause havoc if your entries have too many authors (or, indeed, if they have names which are too long). The following code will use only the first name but it will append a + if there are other names in the entry. (This seems to be default.)

\documentclass[12pt,french]{report}
\usepackage{babel}% needed for french
\usepackage[utf8]{inputenc}% needed for sample bib entry
\usepackage{csquotes}% recommended in output (biblatex)
\MakeAutoQuote*{“}{”}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\DeclareLabelalphaTemplate{% adjust the template for the label based on the default one - requires biber
\labelelement{%
\field[final]{shorthand}% if shorthand specified, use it
\field{label}% if label specified, use it
\field[names=1,strside=left]{labelname}% if not, use the labelname e.g. author
}
\labelelement{%
}
\labelelement{%
\field[strwidth=2,strside=right]{year}% take the rightmost 2 numbers from the year
}
}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Cha65,
author = {Charles, Daniel},
year = {1965},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
@article{Cha66,
author = {Charles, Daniel and Christmas, Father and Fairy, Tooth and Pan, Peter and Beanstalk, Jack},
year = {1966},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


If an individual author has a very long name, you have a couple of options. One is to truncate all names to some number of letters. (The standard label uses this method with 2 letters but you can specify a different number.) The following uses the first 8 characters of the first author's name:

\documentclass[12pt,french]{report}
\usepackage{babel}% needed for french
\usepackage[utf8]{inputenc}% needed for sample bib entry
\usepackage{csquotes}% recommended in output (biblatex)
\MakeAutoQuote*{“}{”}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\DeclareLabelalphaTemplate{% adjust the template for the label based on the default one - requires biber
\labelelement{%
\field[final]{shorthand}% if shorthand specified, use it
\field{label}% if label specified, use it
\field[strwidth=8,names=1,strside=left]{labelname}% if not, use the labelname e.g. author - use the first 8 characters of the first author's name
}
\labelelement{%
}
\labelelement{%
\field[strwidth=2,strside=right]{year}% take the rightmost 2 numbers from the year
}
}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Cha65,
author = {Charles, Daniel},
year = {1965},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
@article{Cha66,
author = {Charles, Daniel and Christmas, Father and Fairy, Tooth and Pan, Peter and Beanstalk, Jack},
year = {1966},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
@article{Cha67,
author = {CharlesChristmasFairtyPanBeanstalk, Daniel and Christmas, Father and Fairy, Tooth and Pan, Peter and Beanstalk, Jack},
year = {1967},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


The other option is to override the default labelling for specific entries:

\documentclass[12pt,french]{report}
\usepackage{babel}% needed for french
\usepackage[utf8]{inputenc}% needed for sample bib entry
\usepackage{csquotes}% recommended in output (biblatex)
\MakeAutoQuote*{“}{”}
\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\DeclareLabelalphaTemplate{% adjust the template for the label based on the default one - requires biber
\labelelement{%
\field[final]{shorthand}% if shorthand specified, use it
\field{label}% if label specified, use it
\field[names=1,strside=left]{labelname}% if not, use the labelname e.g. author - use the first 8 characters of the first author's name
}
\labelelement{%
}
\labelelement{%
\field[strwidth=2,strside=right]{year}% take the rightmost 2 numbers from the year
}
}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Cha65,
author = {Charles, Daniel},
year = {1965},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
@article{Cha66,
author = {Charles, Daniel and Christmas, Father and Fairy, Tooth and Pan, Peter and Beanstalk, Jack},
year = {1966},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
@article{Cha67,
label = {CharlesCh},
author = {CharlesChristmasFairtyPanBeanstalk, Daniel and Christmas, Father and Fairy, Tooth and Pan, Peter and Beanstalk, Jack},
year = {1967},
title = {Entr’acte: “Formal” or “Informal” Music?},
journaltitle = {The Musical Quarterly},
volume = {51},
number = {1},
pages = {144--165},
}
\end{filecontents}


• How are you compiling it? Did you run biber? – cfr Apr 12 '14 at 0:28
• Oh! When I run biber, I get : INFO - This is Biber 1.5 ,INFO - Logfile is 'fullPathName.tex.blg', ERROR - Cannot find control file 'fullPathName.tex.bcf' - did you pass the "backend=biber" option to BibLaTeX? – dgs Apr 12 '14 at 0:33
• You are trying to run biber on the .tex file. Don't. It will make no sense of it. Don't specify an extension at all. Just write biber fullPathName. Note in my example above, I drop the extension for the biber run. – cfr Apr 12 '14 at 0:39