## LaTeX forum ⇒ General ⇒ BibLaTeX Combination of bibstyle=authoryear and citestyle=al

LaTeX specific issues not fitting into one of the other forums of this category.
dianamehl
Posts: 1
Joined: Sat Jan 23, 2016 12:42 pm

### BibLaTeX Combination of bibstyle=authoryear and citestyle=al

Hey,

I am currently writing my thesis and I have a problem with my bibliography:

I am using the bibstyle authoryear and the citestyle alphabetic in BibLaTex.
How can I show the citation-code in my bibliography?

Thanks

Johannes_B
Site Moderator
Posts: 4183
Joined: Thu Nov 01, 2012 4:08 pm
Welcome, the question is just as unclear as in german.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Johannes_B
Site Moderator
Posts: 4183
Joined: Thu Nov 01, 2012 4:08 pm
User Henri gave the answer on TeXwelt.de

Henri wrote:To get an authoryear bibliography including the labels of the
alphabetic style you need to take a closer look at the internals.
In short, the bibliography is a list, whose appearance can be
controlled, for example the label.

biblatex defines a few commands, for example
\DeclareFieldFormat to control the formatting of a
field; or \defbibenvironment to control the
appearance of the list.

biblatex loads file authoryear.bbx to achieve an author-year
bibliography. To get the label from alphabetic, the relevant code
is used from alphabetic.bbx. To get the missing bracket, you can
use
\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}.

\documentclass{article}
\usepackage[citestyle=alphabetic,bibstyle=authoryear]{biblatex}

% begin: excerpt from alphabetic.bbx'
\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliography}
{\list
{\printtext[labelalphawidth]{%
\printfield{prefixnumber}%
\printfield{labelalpha}%
\printfield{extraalpha}}}
{\setlength{\labelwidth}{\labelalphawidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{##1\hss}}
{\endlist}
{\item}
% end: excerpt from alphabetic.bbx'

\begin{document}
\cite{glashow,weinberg,salam}
\printbibliography
\end{document}

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.