Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch to workaround biblatex oddities with the natbib option in versions < 3.5
% biblatex authoryear with natbib does a million stray commas in versions < 3.5
% see: https://tex.stackexchange.com/q/312539/
% this works around it for versions 3.3 and 3.4
\ifthenelse{\equal{\abx@version}{3.4}}{%
\DeclareDelimFormat[cbx@textcite]{nameyeardelim}{\addspace}
}{\ifthenelse{\equal{\abx@version}{3.3}}{%
% Workaround following http://golatex.de/neue-biber-version-ploetzlich-komma-bei-zitierung-t17005.html
% (in German...), which changes \nameyeardelim / \nonameyeardelim to \addspace
% in the citation style's textcite macro.
% sigh....
\renewbibmacro*{textcite}{%
\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\usebibmacro{cite:label}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}% This was changed
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite:labelyear+extrayear}}
{\usebibmacro{cite:shorthand}}}
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\addspace\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{citeyear}}}
}{%
% version is not 3.3 or 3.4; assuming we're good :)
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.