General ⇒ BibLaTeX Combination of bibstyle=authoryear and citestyle=al
BibLaTeX Combination of bibstyle=authoryear and citestyle=al
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
BibLaTeX Combination of bibstyle=authoryear and citestyle=al
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
BibLaTeX Combination of bibstyle=authoryear and citestyle=al
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
\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}