LaTeX forum ⇒ GeneralBibLaTeX 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

Postby dianamehl » Sat Jan 23, 2016 12:47 pm

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

User avatar
Johannes_B
Site Moderator
Posts: 4183
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jan 23, 2016 1:39 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.

User avatar
Johannes_B
Site Moderator
Posts: 4183
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jan 23, 2016 2:14 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}
\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}

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


Return to “General”

Who is online

Users browsing this forum: No registered users and 9 guests