# csquotes and invalid nesting with two nested \mkbibquotes

I was surprised when today I got the error message Package csquotes Error: Unbalanced groups or invalid nesting. After a while I found the culprit in my bibliography-file. It is a bib-item whose title contains two nested \mkbibquote-commands like

Title = {aaa aaa \mkbibquote{bbb bbb \mkbibquote{ccc ccc} bbb bbb} aaa aaa}


I have to say, I was rather surprised that this caused any problem at all, in particulalr since David has demonstrated to me elsewhere that the biblatex commands "are defined to expand to the normal ones by default". By "normal ones" he meant commands such as \enquote and it surely is alright to write aaa aaa \enquote{bbb bbb \enquote{ccc ccc} bbb bbb} aaa aaa, or isn't it?

So what's wrong with my bib-item?

MWE:

% !TEX TS-program = lualatexmk
\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}

\usepackage{csquotes}
\usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{example,
Author = {Author},
Journaltitle = {Journaltitle},
Title = {aaa aaa \mkbibquote{bbb bbb \mkbibquote{ccc ccc} bbb bbb} aaa aaa},
Year = {2014}}
\end{filecontents}

\begin{document}

\fullcite{example}.

\end{document}


Looking in the log file you will see:

Level 3 quote invalid at this point. The maximum level is 2.

caused by the title being inside a bibmkquote=enquote already. Just change the maximum level allowed by passing the maxlevel opiton to csquotes:

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Times New Roman}

\usepackage[maxlevel=3]{csquotes}
\usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{example,
Author = {Author},
Journaltitle = {Journaltitle},
Title = {aaa aaa \mkbibquote{bbb bbb \mkbibquote{ccc ccc} bbb bbb} aaa aaa},
Year = {2014}}
\end{filecontents}

\begin{document}

\fullcite{example}.

\end{document}

• Thanks. That's good to know! Any ideas as to why there is a default maxlevel=2 at all? Shouldn't that be up to the sanity of the author? – ClintEastwood Sep 9 '14 at 7:23
• I guess it is 2 as there are only two distinct pair of symbols, so the author should make a conscious decision to use deeper nesting. The author should also be thinking of the sanity of the reader. – Andrew Swann Sep 9 '14 at 18:33