csquotes 和两个嵌套的 \mkbibquotes 的无效嵌套

csquotes 和两个嵌套的 \mkbibquotes 的无效嵌套

今天收到错误消息时我感到很惊讶Package csquotes Error: Unbalanced groups or invalid nesting。过了一会儿,我在我的书目文件中找到了罪魁祸首。它是一个书目项目,其标题包含两个嵌套\mkbibquote命令,例如

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

我不得不说,我很惊讶这竟然会引起任何问题,尤其是 David 向我演示了别处biblatex 命令“被定义为默认扩展为常规命令”。他所说的“常规命令”是指诸如 这样的命令\enquote,这样写肯定没aaa aaa \enquote{bbb bbb \enquote{ccc ccc} bbb bbb} aaa aaa问题,不是吗?

我的胸围物品有什么问题?

梅威瑟:

% !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}

\addbibresource{\jobname.bib}

\begin{document}

\fullcite{example}.

\end{document}

答案1

查看文件log你会看到:

此时 3 级报价无效。最高级别为 2。

导致标题已在 内。只需将选项bibmkquote=enquote传递给 即可更改允许的最大级别:maxlevelcsquotes

示例输出

\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}

\addbibresource{\jobname.bib}

\begin{document}

\fullcite{example}.

\end{document}

相关内容