1

I want the macro \finalnamedelim to behave differently for the citations and bib entries.

Especially in the case of exactly two authors (if we have more, the citation style uses "et al" anyway), in the citation it should use "and" as a seperator, but a comma in the bib entry.

Here my MWE:

\documentclass[a4paper,12pt,oneside]{scrreprt}
% ----------------------------------------------------------
\usepackage[%
    style=authoryear,
    bibstyle=authoryear,
    maxcitenames=2,
    dashed=false,
    firstinits=true
    backend=biber,
]{biblatex}
% ----------------------------------------------------------
\renewcommand*{\finalnamedelim}{\addcomma\space}
\renewcommand*{\revsdnamepunct}{}
% ----------------------------------------------------------
\addbibresource{biblatex-examples.bib}
% ----------------------------------------------------------
\begin{document}

\parencite{bertram}

\printbibliography
\end{document}

Which results in this citation: enter image description here and this bib entry: enter image description here

However I want to achieve this: enter image description here enter image description here

What is the best way to do that?

Best regards, David

DeBe
  • 115
  • 2
    \AtBeginBibliography{\renewcommand*{\finalnamedelim}{\addcomma\space}}? Then the standard is used for citations and in the bibliography it is changed to a comma with space. Cf. the general approach used in http://tex.stackexchange.com/a/57622/35864 – moewe Mar 26 '16 at 13:46
  • @moewe Hey, that was easier than expected. Thank you! – DeBe Mar 26 '16 at 13:49
  • Do you think your question is a duplicate of the one linked to or do you want an answer? – moewe Mar 26 '16 at 13:50
  • I don't think, thats it is an actual duplicate - the linked answer just applies well to this also. I could maybe change the title to something like "Apply biblatex macro changes to either citations or the bibliography" to make it more apparent if someone searches for a solution like this. – DeBe Mar 26 '16 at 13:54
  • OK, if you would like an answer instead I can write one up. – moewe Mar 26 '16 at 13:55
  • I'd appreciate it :) – DeBe Mar 26 '16 at 13:56

1 Answers1

1

You can apply certain settings to the bibliography only using the \AtBeginBibliography hook

\AtBeginBibliography{\renewcommand*{\finalnamedelim}{\addcomma\space}}

The \AtEveryCite hooks does the same for citations, so you could, in principle, also go with

\renewcommand*{\finalnamedelim}{\addcomma\space}
\AtEveryCite{%
  \renewcommand*{\finalnamedelim}{%
    \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
    \addspace\bibstring{and}\space}}

but why would you?


There are also \AtEveryCitekey and \AtEveryBibitem, those hooks are executed in a context where the bibliographic data of the entry in question is already available. This is not important for the commands used here, but \clearfield and friends will only work with \AtEveryCitekey and \AtEveryBibitem.

You can read more about these code hooks in §4.10.6 General Purpose Hooks, pp. 244-246, of the biblatex documentation.

moewe
  • 175,683