\\blx@imc@printtext 的使用与其定义不符

\\blx@imc@printtext 的使用与其定义不符

我刚刚从 Ubuntu 16 升级到 18,现在我的 LaTeX 文件(其中包含大量 biblatex/biber 内容)也出现这种情况。错误是什么?

! Use of \\blx@imc@printtext doesn't match its definition.
\text@command #1->\def \reserved@a {
                                    #1}\ifx \reserved@a \@empty \let \check@...
l.692 ...rding to \textcite[288]{Kirby:traveller},
                                                   this hall is named from t...

答案1

根据关于此问题的错误报告(https://github.com/plk/biber/issues/237) 和https://github.com/plk/biblatex/issues/768,相关宏已更改为对它们接受的非数字输入稍微更宽容。请参阅https://github.com/plk/biblatex/pull/813. 现场完全任意的东西year仍然可能会损坏。

正如所讨论的https://github.com/plk/biber/issues/237可以使用.bib类似以下内容的条目重现此问题

@book{appleby,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service},
  year    = {\circa{1980}},
}

\circa定义为的宏一起

\newcommand{\circa}[1]{\textit{c}.#1} 

出现特定问题的原因是,\textit在 的定义中是不可扩展的,而当 选项设置为(默认和初始值)时,在测试中(由 提供)\circa年份字段会完全展开。\IfIntegerxstringdatezerostrue

以下 MWE 展示了解决当前问题的快速方法,并展示了输入大约日期的首选方法以及对默认值的修改,以重现所需的输出

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber, datecirca=true]{biblatex}

\newcommand{\circa}[1]{\textit{c}.#1}

% disable datezeros and friends, but allow \circa to work in year fields (appleby)
\makeatletter
\protected\def\blx@imc@forcezerosy#1{#1}
\let\blx@imc@mkyearzeros\blx@imc@forcezerosy
\makeatother

% use EDTF (elk)
\DefineBibliographyStrings{english}{circa = {\mkbibemph{c}\adddot}}
\DeclareDelimFormat{datecircadelim}{}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{appleby,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service},
  year    = {\circa{1980}},
}
@book{elk,
  author  = {Humphrey Appleby},
  title   = {A Theory on Brontosauruses},
  date    = {1970~},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{elk,appleby}
\printbibliography
\end{document}

Appleby *c*.1970; Appleby *c*.1980//参考文献//Appleby, Humphrey (*c*.1980)。《论公务员制度的重要性》。//— (*c*.1970)。《关于雷龙的理论》。

相关内容