0

I have set a bibliography style (nature) such that \cite{key1} produces "[1]" in the text. Given two .bib-entries with keys key1 and key2, I want to write

Statement A is true [1]. Therefore, following the discussion in ref. 2, statement B is also true.

It is preferred to avoid the square brackets of "... in ref. [2], ..." that would appear with the naive ... in ref. \cite{key2}, .... What is a good way to write ref. 2 without square brackets?

I am using the biblatex package, so any solution using natbib's \citenum command seems incompatible. And the solution provided in this post doesn't work for me.

1

All the ingredients for a command like this are available, we just have to put them together.

We define a new command \refcite based on the default definition of \cite. But in the precode we inject some code that prints "ref." or "refs." (depending on the number of citation as stored in citetotal).

You can find the original definition of \cite as used by nature.cbx in numeric-comp.cbx (ll. 209-216 in v3.16).

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

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

\NewBibliographyString{ref}
\NewBibliographyString{refs}
\DefineBibliographyStrings{english}{
  ref  = {ref\adddot},
  refs = {refs\adddot},
}

\newbibmacro{cite:intro:ref}{%
  \ifnumgreater{\value{citetotal}}{1}
    {\bibstring{refs}}
    {\bibstring{ref}}%
  \printunit{\addnbspace}}

\DeclareCiteCommand{\refcite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}%
   \usebibmacro{cite:intro:ref}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}
\newrobustcmd*{\Refcite}{\bibsentence\refcite}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \refcite{sigfridsson}

Lorem \refcite{nussbaum}

Lorem \refcite{nussbaum,geer}

\Refcite{sigfridsson}

Lorem \autocite{sigfridsson}

\printbibliography
\end{document}

Lorem ref. 1//Lorem ref. 2//Lorem refs. 2, 3//Ref. 1//Lorem 1


If you just want a naked citation without any brackets, you can define something like

\DeclareCiteCommand{\barecite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

Again, this definition is based on \cite, but it omits the wrapper [\mkbibbrackets].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.