0

Every time I try to use the \textcite command in the "unified" style, I get an "undefined control sequence" error from Overleaf. But when I switch to the "authoryear" style, the error goes away. How do I fix this? Here's part of my preamble:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{example-sentences}
\usepackage[backend=biber, style=unified, natbib=true]{biblatex}
\addbibresource{references.bib}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

And here's the error message I get from Overleaf:

\blx@biblinkstart [#1]->\blx@sfsave 
                                    \hyper@natlinkstart {\the \c@refsection ...
l.23 ...ime today," from \textcite{rior_gen_2021}}
                                                  .
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence. \blx@biblinkstart ...x@sfsave \hyper@natlinkstart {\the \c@refsection @#1}\b... l.23 ...ime today," from \textcite{rior_gen_2021}} . The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

And again, none of this happens if I use the authoryear style (but I would like to use the unified style instead). What should I do please?

JamesT
  • 3,169

1 Answers1

2

The implementation of unified's \textcite command requires that you load hyperref. It uses code inspired by https://tex.stackexchange.com/a/27615/35864. See for example https://github.com/semprag/biblatex-sp-unified/issues/48.

The documentation states

The unified citation style relies on hyperlinking between in-text citations and the bibliography. So, the hyperref package is required. It is automatically loaded by sp.cls but if you use a different document class and hyperref is not loaded by that class, you need to add \usepackage{hyperref} to your preamble as well.

Add \usepackage{hyperref} to your document preamble. (Note that apart from a few documented exceptions, hyperref should generally be the last package you load). The following MWE compiles just fine

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=unified]{biblatex} \usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\begin{document} Lorem \textcite{sigfridsson}

\printbibliography \end{document}

Lorem Sigfridsson & Ryde (1998)

as is, but will throw an error if you omit the \usepackage{hyperref} line.

moewe
  • 175,683