1

I am trying to recreate the effect of the square option in natbib using biblatex. If I start with the following bib file (named test.bib)

@Article{person24:_test,
  author =       {A. Person and B. Human},
  title =        {Test title},
  journal =      {Journal of Studies},
  year =         2024}

and the following latex code:

\documentclass{article}
\usepackage[square]{natbib}
\begin{document}
\citet{person24:_test}
\bibliography{test}
\bibliographystyle{plainnat}
\end{document}

The citation renders as

Person and Human [2024]

However, if I use the following biblatex code, as suggested by another satckoverflow answer,

\documentclass{article}
\usepackage[style=authoryear,backend=biber,maxcitenames=4,sorting=nyt,natbib=true]{biblatex}
\addbibresource{test.bib}
\begin{document}
\citet{person24:_test}
\printbibliography
\end{document}

I get a rendering with parenthesis instead of square brackets:

Person and Human (2024)

I could not find a way to change the parenthesis in the biblatex version to square brackets. (I am using biblatex instead of natbib because it is easier to customize the number of authors to list before "et al." abbreviations are used.)

Note that the question at Biblatex, author-year, square brackets is different: there they want to enclose the whole citation in square brackets, and the solution offered seems to involve editing biblatex style files. Since I just want to recreate functionality that is available in natbib with just an option, I was wondering if there is a similar solution with biblatex as well.

1 Answer 1

3

This needs a bit of fiddling with standard biblatex, but is extremely easy with biblatex-ext and its cite delimiters feature (§5.3 Delimiters for citation commands in the biblatex-ext documentation [v0.18]). See for example Configuring `biblatex` to put brackets around the year in citations.

You want to change the inner citation delimiters for \textcite (\textcite is the biblatex name of \citet). (For good measure we also change the outer citation delimiters for \parencite/\citep as shown in https://tex.stackexchange.com/a/480059/35864, but of course you can just drop that line.)

\documentclass{article}
\usepackage[
  backend=biber,
  style=ext-authoryear,
  maxcitenames=4,
  natbib=true,
]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareInnerCiteDelims{textcite}{\bibopenbracket}{\bibclosebracket}
\DeclareOuterCiteDelims{parencite}{\bibopenbracket}{\bibclosebracket}

\begin{document}
\textcite{sigfridsson}

\citet{sigfridsson}

\parencite{sigfridsson}

\citep{sigfridsson}

\printbibliography
\end{document}

Sigfridsson and Ryde [1998]
Sigfridsson and Ryde [1998]
[Sigfridsson and Ryde, 1998]
[Sigfridsson and Ryde, 1998]

You must log in to answer this question.

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