I'm using the authoryear-comp citestyle of biblatex and I'd like the author and year to appear in italics in in-text citations. After some research, I've found the following command, but it only italicizes the author:
\renewcommand{\mkbibnamelast}[1]{\mkbibemph{#1}}
Does anyone know, on the basis of the following example, how to get the year italicized as well?
\documentclass{scrbook}
\usepackage[backend=biber, bibstyle=authoryear, citestyle=authoryear-comp,sorting=nyt]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Knu86,
author = {Knuth, Donald E.},
year = {1986},
title = {The \TeX book},
}
\end{filecontents*}
Many thanks for having a look at this and best wishes,
Best Answer
One way to make citation italic is to inject a
\mkbibemph
into the wrapper code of\DeclareCiteCommand
for the relevant\...cite
commands you want to be in italic.You can find the
\DeclareCiteCommand
declarations in<citestyle>.cbx
(in your caseauthoryear-comp.cbx
). Note that these definitions can differ between styles, so you need to make sure you have got the correct ones.In the example we show how to make
\cite
/\cite*
and\parencite
/\parencite*
italic. The original definitions can be found inauthoryear-comp.cbx
, ll. 160-190 in v3.18b: For\cite
we just add\mkbibemph
as wrapper command (because\cite
does not have a wrapper). For\parencite
we combine\mkbibemph
with the wrapper\mkbibparens
(change the order of\mkbibemph
and\mkbibparens
in\mkbibemphparens
to make the parentheses italic too).