Italic citation numbers and normal font brackets with biblatex numeric or numeric-comp style

biblatex

Problem: I would like for the citation numbers of a numeric or numeric-comp style biblatex to be in italics but not the enclosing brackets. My efforts thus far have failed. I would not like for the bibliography entries to be modified in anyway if this is possible.

What I have tried: I tried modifying the code in the MWEB as such:

\DeclareCiteCommand{\cite}[\mkbibparens\mkbibemph]

and

\DeclareCiteCommand{\cite}[\mkbibemph\mkbibparens]

Both of which made the citation number appear outside the bracket. I also tried the answer by Gonzalo Medina which had no effect (I am not even sure if it would with biblatex).

How it currently looks:

enter image description here

How I would like it to look:

enter image description here

My vision may not be the best but I believe that the brackets enclosing the citation numbers are normal and not in italics.

MWEB:

\documentclass{article}

\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{biblatex-examples.bib}

% Change in-text citations to round brackets - moewe: https://tex.stackexchange.com/a/341043/245306
\DeclareCiteCommand{\cite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\cites}[\mkbibparens]{\cite}{\multicitedelim}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

and I am compiling with:

% arara: pdflatex
% arara: biber
% arara: pdflatex

Best Answer

You are almost there. The wrapper command is a good idea to do this, but you need to make sure that the command you give there absorbs one argument. \mkbibparens\mkbibemph doesn't do that, because it essentially expands to \mkbibparens{\mkbibemph}.

\documentclass{article}

\usepackage[backend=biber,style=numeric]{biblatex}

\newrobustcmd*{\mkbibparensitalic}[1]{%
  \mkbibparens{\mkbibitalic{#1}}}

\DeclareCiteCommand{\cite}[\mkbibparensitalic]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\cites}[\mkbibparensitalic]{\cite}{\multicitedelim}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}

\cites{sigfridsson}{nussbaum}

\printbibliography
\end{document}

(2) (2, 1) [numbers italic; brackets upright]


The same strategy can be used for most styles, but if you switch styles you may need to make sure that the definition of \cite you have here is compatible with your style.

Specifically for numeric-comp the code would have to look like

\documentclass{article}

\usepackage[backend=biber,style=numeric-comp]{biblatex}

\newrobustcmd*{\mkbibparensitalic}[1]{%
  \mkbibparens{\mkbibitalic{#1}}}

\DeclareCiteCommand{\cite}[\mkbibparensitalic]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

\DeclareMultiCiteCommand{\cites}[\mkbibparensitalic]{\cite}{\multicitedelim}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}

\cites{sigfridsson,nussbaum,worman}

\printbibliography
\end{document}