31

In my report I would like to have the square brackets around the citations as superscripts (like in the Wikipedia style) using \supercite command.

The default \supercite{} command in biblatex package gives a number without brackets.

I have found a good reference in Biblatex cite with footnote only once, with use of brackets. However I am interested in such citation style just in normal text - not for the footnotes.

I know that I have to redefine some command but a lack of knowledge does not allow me to complete the task. Could anyone help me?

1
  • 6
    This was the top result on google when searching for 'supercite brackets' but a much better version is available here. Feb 26, 2014 at 11:32

2 Answers 2

35

Would this work for you?

enter image description here

\documentclass{article}

\usepackage{biblatex}

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

\usepackage{filecontents}

\begin{filecontents}{test.bib}
@book{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@book{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
@article{C03,
  author = {Cuthor, C.},
  year = {2003},
  title = {Charlie},
}
\end{filecontents}

\addbibresource{test.bib}

\let\cite=\supercite

\begin{document}

We are citing \supercite{A01,C03} and \supercite{B02} and \cite{C03}

\printbibliography

\end{document}

You can comment out \let\cite=\supercite if you don't want \cite to behave like \supercite (but I thought you might, seeing as it is shorter to write).

For information, what was needed is added \bibopenbracket and \bibclosebracket around the citation command.

(And I shamelessly stole @lockstep's sample bib file, I pray for forgiveness).

7
  • 2
    Thank you very much. Exactly what I wanted. I'm always surprised how short is typical response time here. Jun 23, 2012 at 7:28
  • @VladimirS.: If this answers your question, you should mark the answer as accepted by clicking the tick mark next to it. You should also upvote answers and questions that you find useful, by clicking the upward pointing arrow next to the posts.
    – Jake
    Jun 23, 2012 at 7:31
  • 2
    Is this solution outdated? I always get the error: Package biblatex: Bibliography macro 'cite' undefined
    – ju.
    Oct 28, 2020 at 13:53
  • @ju. Not that I know. Are you using the standard biblatex styles? The ``cite` macro is the one called by the \cite command, but it could differ in other citation styles. You can still achieve the same result by replacing it with whatever macro you call for citation. Please ask a new question if needed.
    – ienissei
    Nov 1, 2020 at 1:28
  • Is there a way to have all numbers in a single bracket, such as [12,13,14] rather than [12],[13],[14] ?
    – user22744
    Jan 18, 2022 at 16:56
1

Adding square brackets around the raised citations can be done from the natbib package with one simple command:

\usepackage[super,square]{natbib}
2
  • 3
    Note that natbib is incompatible with (read: a "competitor" to) the biblatex package. See here for a very detailed discussion: tex.stackexchange.com/q/25701/59034
    – user59034
    Sep 14, 2016 at 19:48
  • 1
    This is a useful answer for bibtex users. In fact, I landed here when searching for how to obtain this end result using bibtex. Can we move/link this answer to a separate question (if such a one doesn't already exist?) Aug 23, 2019 at 16:29

You must log in to answer this question.

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