2

With csquotes, the title of the reference under \printbibiolograhy, in the code below, comes out spuriously bracketed by ?, and conversely without it. The *bib file was processed with Biber.

What is the problem, how to fix it?

With Without

\documentclass{article}
\usepackage{babel}
\usepackage[style=numeric, maxnames=999, backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@phdthesis{jd-2005,
        author = {John Doe},
        title = {TITLE},
        year = {2005}
}
\end{filecontents}
\addbibresource{\jobname.bib}
%\usepackage{csquotes} 
\usepackage{hyperref}

\listfiles

\title{TITLE}

\author{John Doe}
\date{\today}

\begin{document}

\maketitle
\tableofcontents

\cite[pp. 25-27]{jd-2005}

\phantomsection
%\addcontentsline{toc}{section}{References}
\printbibliography[heading=subbibliography]

\end{document}
Erwann
  • 2,100

2 Answers2

6

With csquotes the MWE produces the following warning

Package csquotes Warning: No style for language 'nil'.
(csquotes)                Using fallback style on input line 22.

and also (though slightly less relevant here)

Package biblatex Warning: Language 'nil' not supported.
(biblatex)                Using fallback language 'english' on input line 22.

Essentially, the MWE loads babel and sets no language at all, which causes babel to pretend a language nil was loaded. Neither biblatex nor csquotes can deal properly with nil.

The solution is to always pass at least one language option when you load babel (or not to load babel at all). For most intents and purposes english is the standard language, so english (either globally in \documentclass or directly as a package option to babel) is the straightforward choice here, but you can of course select any language supported by biblatex and csquotes.

\documentclass[english]{article}
\usepackage{babel}
\usepackage[style=numeric, maxnames=999, backend=biber]{biblatex}
\usepackage{csquotes} 
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite[25-27]{sigfridsson}

\printbibliography[heading=subbibliography]
\end{document}

Bibliography with nicely typeset quotation marks.


I seem to remember that in older versions of babel, babel would error or at least throw a warning if no language was selected at all.


Note that there is no need to manually put the pp. in the postnote, biblatex can detect page ranges and adds the appropriate page prefix automatically.

There should also be no need for \addcontentsline{toc}{section}{References} and \phantomsection to make the bibliography appear in the table of contents. Have a look at other values of the heading option (e.g. subbibintoc).

moewe
  • 175,683
0

I believe I was able to fix it by using the English option for babel, although I must concede that I'm not entirely sure why this worked. The code follows:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[style=numeric, maxnames=999, backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@phdthesis{jd-2005,
        author = {John Doe},
        title = {TITLE},
        year = {2005}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{csquotes} 
\usepackage{hyperref}

\listfiles

\title{TITLE}

\author{John Doe}
\date{\today}

\begin{document}

\maketitle
\tableofcontents

\cite[pp. 25-27]{jd-2005}

\phantomsection
%\addcontentsline{toc}{section}{References}
\printbibliography[heading=subbibliography]

\end{document}

screenshot of output

bclzyjhr
  • 437