0

For a scientific paper using the BibLaTeX package, I am requested to format the citation numbers as following:

  • When citing references, use superscript numbers and half-width closing parentheses ")" in the right corner of the text to indicate: "this method was investigated1) in the past";
  • When printing references in bibliography, use numbers and half-width parentheses: "(1) Author, etc."

Given an arbitrary style, how can I achieve this?

Here is a MWE:

\documentclass{article}
\usepackage[style=numeric, sorting=none]{biblatex}
\addbibresource{\jobname.bib}

\begin{filecontents}{\jobname.bib} @book{key, author = {Author, A.}, year = {2001}, title = {Title}, publisher = {Publisher}, } \end{filecontents}

\begin{document}

This method was investigated\cite{key} in the past.

\printbibliography

\end{document}

Neraste
  • 333

1 Answers1

0

Citing reference

The answer depends on what citation command we are using.

BibLaTeX provides the command \supercite for superscript citations, that we can redefine (from this answer):

\DeclareCiteCommand{\supercite}[\mkbibsuperscript]
{\iffieldundef{prenote}
  {}
  {\BibliographyWarning{Ignoring prenote argument}}%
  \iffieldundef{postnote}
  {}
  {\BibliographyWarning{Ignoring postnote argument}}}
{\usebibmacro{citeindex}%
  \usebibmacro{cite})}
{\supercitedelim}
{}

It is possible to replace other citation commands (e.g. \parencite).

\textcite is more complicated, we have to redefine this macro (from this answer):

\makeatletter
\renewbibmacro*{textcite}{%
  \iffieldequals{namehash}{\cbx@lasthash}
  {\usebibmacro{cite}}
  {%
    \ifbool{cbx:parens}
    {\bibclosebracket\global\boolfalse{cbx:parens}}
    {}%
    \iffirstcitekey
    {}
    {\textcitedelim}%
    \ifnameundef{labelname}
    {\printfield[citetitle]{labeltitle}}
    {\printnames{labelname}}%
    \addspace
    \ifnumequal{\value{citecount}}{1}
    {\usebibmacro{prenote}}
    {}%
    \mkbibsuperscript{\usebibmacro{cite})}%
    \stepcounter{textcitecount}%
    \savefield{namehash}{\cbx@lasthash}}}
\makeatother

One can improve this solution by adding a space between consecutive citations:

\renewcommand{\supercitedelim}{, }

However, this solution uses BibLaTeX macros that are defined by the bibliography style itself (e.g. \usebibmacro{cite}), which is numeric here. It may not work with other styles without adaptation.

Printing reference

Inspired from this answer. We simply change a field format:

\DeclareFieldFormat{labelnumberwidth}{(#1)}

The result for the MWE, with replacing \cite by \supercite:

Neraste
  • 333