Saving Aristotle: How can Biblatex redefinitions be made conditional on the style selected (or otherwise made more fool-proof)?
The current styles are stored in the internal macros \blx@bbxfile
and \blx@cbxfile
. Happy branching!
\documentclass{article}
\usepackage[style=authoryear,citestyle=verbose]{biblatex}
\begin{document}
\csname blx@bbxfile\endcsname
\csname blx@cbxfile\endcsname
\end{document}
This is a supplement to Henri Menke's answer, just in case anybody else needs something like this. Based on that answer, here's how I set the conditionalisation up in biblatex.cfg
.
% ateb Henri Menke: https://tex.stackexchange.com/a/365438/
% bibstyle name: \csname blx@bbxfile\endcsname
% citestyle name: \csname blx@cbxfile\endcsname
\newif\ifcfr@biblatex@authorcomp
\cfr@biblatex@authorcompfalse
\def\cfr@blx@splitfile#1-#2\@null{#1}
\edef\tempa{\expandafter\cfr@blx@splitfile\blx@cbxfile-x\@null}
\edef\tempb{authoryear}
\edef\tempc{authortitle}
\edef\tempd{alphabetic}
\edef\tempe{numeric}
\edef\tempf{reading}
\ifx\tempa\tempb
\cfr@biblatex@authorcomptrue
\else\ifx\tempa\tempc
\cfr@biblatex@authorcomptrue
\else\ifx\tempa\tempd
\cfr@biblatex@authorcomptrue
\else\ifx\tempa\tempe
\cfr@biblatex@authorcomptrue
\else\ifx\tempa\tempf
\cfr@biblatex@authorcomptrue
\fi
\fi
\fi
\fi
\fi
\ifcfr@biblatex@authorcomp
...
\else
...
\fi
It turns out that pretty much any style but verbose
is fine with the redefinitions provided by moewe. But, just to be on the safe-side, I've gone for a more long-winded check against standard styles which work OK, excluding verbose
, which isn't OK, and draft
and debug
which are special cases.