6

Suppose you have this MWE using numeric style with Biblatex

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}

\usepackage[italian]{babel}
\usepackage{csquotes} % needed if also biblatex is used

\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{references.bib}

\begin{document}

\section{Conclusion}
Adams said ``I always thought something was fundamentally wrong with the universe'' \cite{adams1995hitchhiker}.

\printbibliography

\end{document}

What is the best way to replace square brackets with round brackets in both citations and bibliography?

8

With

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

you get round brackets in the bibliography, for citations you need to copy the definitions from numeric.cbx and change \mkbibbrackets into \mkbibparens

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

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite}{\multicitedelim}

More radical is

\renewrobustcmd{\mkbibbrackets}{\mkbibparens}

or even

\let\bibopenbracket\bibopenparen
\let\bibclosebracket\bibcloseparen

where all square brackets are replaced by round brackets. This can lead to problems if you do want square brackets in other places in your citations/bibliography.


Note that you will need more intricate tricks for some of the more advanced numeric-derived styles and \textcite.

| improve this answer | |
  • @mmj Note that the trick is not only radical, but might also take things too far (\mkbibrackets will now always come out as \mkbibparens, not only the citation/bibliography label brackets). – moewe Nov 26 '16 at 15:00
  • I thought there must be an option to toggle this somewhere, as it seemed an obvious thing to want to do, but I couldn't find one and gather that's because there isn't one. Is the idea that somebody who wanted this should really create a new version of the numeric styles? It would be nice if there was something like csquotes which could flip inner and outer brackets in the same way as inner and outer quotes. – cfr Nov 26 '16 at 17:22
  • @cfr Unfortunately, there is no such thing. If it only was the labelnumberwidth field format, that would be OK, but the problem really is that one has to delve into the .cbx files, modify some \DeclareCiteCommands and even some bibmacros for \textcite. Maybe we should try and make that easier in the core... – moewe Nov 27 '16 at 7:18
  • @moewe It does seem a bit surprising this can't be toggled when so much else can. Thanks for the confirmation. – cfr Nov 27 '16 at 13:20
  • The radical trick seems to work (at least with basic usage) even with numeric-comp style. – mmj Nov 27 '16 at 14:33

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.