GeneralBibLaTeX Combination of bibstyle=authoryear and citestyle=al

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

BibLaTeX Combination of bibstyle=authoryear and citestyle=al

Post by dianamehl »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

BibLaTeX Combination of bibstyle=authoryear and citestyle=al

Post by Johannes_B »

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.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

BibLaTeX Combination of bibstyle=authoryear and citestyle=al

Post by Johannes_B »

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}}.

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage[citestyle=alphabetic,bibstyle=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
% 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}%
\addtolength{\leftmargin}{\labelsep}%
\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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Image
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply