0

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

1 Answer 1

2

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}
4
  • Thank you, worked perfectly +1. To anyone who may come across this who, like myself, has never seen \newrobustcmd before this contains a brief explanation.
    – user245306
    Mar 18, 2022 at 12:27
  • If I change from numeric to numeric-comp (to use ranges) it says that \cite is undefined - is this a new question or does the existing answer contain a trivial solution that could be edited please if possible for both numeric and numeric-comp? I understand its a related but different style and may change the question entirely. Will delete this comment if new question is required, thanks.
    – user245306
    Mar 18, 2022 at 12:58
  • 1
    @LaccaseTVersicolor See the edited answer, please.
    – moewe
    Mar 18, 2022 at 13:10
  • I changed the title and intro to include numeric-comp as well so the question and answers fit better and are easier to search for, thank you for your help and advice.
    – user245306
    Mar 18, 2022 at 13:16

You must log in to answer this question.