Biblatex – Use Natbib’s \citenum in Biblatex

biblatexciting

The natbib package provides the command \citenum, which returns just the number of the citation, unlike the typeset reference of \cite. Is a similar command available for biblatex?

Best Answer

Given that the numeric-comp style is used, it is possible to implement \citenum as follows:

\DeclareCiteCommand{\citenum}
  {}
  {\printfield{labelnumber}}
  {}
  {}

It can be use with other styles as well using the labelnumber package option.

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
  @article{article1,
    author = {Author, First},
    title  = {Title 1},
    year   = 1993,
    month  = may,
    pages  = {10--15}
  }

  @inproceedings{article2,
    author = {Author, Second},
    booktitle  = {Conference Title},
    title  = {Article 2},
    year   = 1975,
    month  = aug,
    pages  = {120--125}
  }
\end{filecontents}

\usepackage[style=authoryear,citecounter,natbib,labelnumber]{biblatex}
\addbibresource{\jobname.bib}
%\ExecuteBibliographyOptions{labelnumber}

\DeclareCiteCommand{\citenum}
  {}
  {\printfield{labelnumber}}
  {}
  {}

\begin{document}

\cite{article1}

\cite{article2}

\citenum{article1}

\citenum{article2}

\printbibliography  

\end{document}

enter image description here