4

I've finally given in and gone over to biblatex, at least for my thesis. I'm using a superscripted numeric reference style, and that works nicely. However it's sometimes useful to be able to say something like "Data taken from reference 1". If I use cite{some_ref}, I get "...from reference [1]". This is by design according to the manual, but I had a nice way of doing this in bibtex -- so how can I replicate this?

Also (I suspect the answer will be related) my bibliography is listed with the citation numbers in square brackets.

I'm starting to wish I'd stuck with bibtex - the benefits of using biblatex seem tiny compared to the hassle of switching mid document.

1
  • 1
    Don't lose your faith in biblatex. Admittedly, its documentation is quite full-on and hard to fathom at times; but I dare say it is second-to-none when it comes to customising the output to fit your needs, and often these solutions turn out to be quite elegant and short.
    – moewe
    Commented Dec 31, 2013 at 13:08

1 Answer 1

6

You might like to try

\DeclareFieldFormat{labelnumberwidth}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}

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

In your preamble.

The first two commands make sure no brackets are around the numbers in the bibliography. While the second block strips brackets from the \cite{} (and its multicite version \cites{}; \parencite{} still has brackets, though).

\documentclass[english]{article}  
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=numeric, backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{labelnumberwidth}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}

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

\begin{document}
  See \cite{wilde} as noted before\supercite{wilde}.
  \printbibliography
\end{document}

produces

enter image description here


Since the OP seems to use numeric-comp, the fix for that is

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

instead of the redefinition of \cite above.

For numeric-verb it's

\DeclareCiteCommand{\cite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
3
  • You might like to try \DeclareFieldFormat{labelnumberwidth}{#1\adddot} \DeclareFieldFormat{shorthandwidth}{#1\adddot} to get "1. Oscar Wilde ..." in the bibliography.
    – moewe
    Commented Dec 31, 2013 at 13:19
  • Many, many thanks for all of this. For reference, when using numeric-comp, at least (and possibly without), the DeclareCiteCommand needs to be more like the one given at [this answer] (tex.stackexchange.com/a/25967/28808) (cite->cite:comp suppresses an error, but results in no output for the bare citations)
    – Chris H
    Commented Dec 31, 2013 at 14:05
  • Thanks again - I was on numeric when I asked, after a scattergun debug process, but shouldn't have been.
    – Chris H
    Commented Dec 31, 2013 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .