我对以下 MWE 的行为感到困惑。据我所知,条目没有任何问题.bib
。但是,尝试编译此文档(biblatex v3.3 和 biber v2.4)会导致以下错误:
! Extra }, or forgotten $.
<recently read> }
l.42
?
如果您进行相关更改natbib
以便使用,MWE 就可以很好地编译。
% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = arara
% arara: lualatex: { synctex: no }
% arara: biber
% arara: lualatex: { synctex: yes }
\begin{filecontents*}{\jobname.bib}
@article{belletti1988,
Author = {Belletti, Adriana and Rizzi, Luigi},
Doi = {10.1007/BF00133902},
Journal = {Natural Language \& Linguistic Theory},
Month = {August},
Number = {3},
Pages = {291--352},
Title = {Psych-Verbs and $\theta$-Theory},
Volume = {6},
Year = {1988}}
\end{filecontents*}
\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage
[
style=apa,
backend=biber
]
{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{\jobname.bib}
\begin{document}
\textcite{belletti1988}
\printbibliography
\end{document}
.bbl
据我所知,生成的文件看起来不错,这让我认为这是一个问题biblatex
,但我真的不确定。以下是生成的.bbl
文件:
% $ biblatex auxiliary file $
% $ biblatex bbl format version 2.6 $
% Do not modify the above lines!
%
% This is an auxiliary file used by the 'biblatex' package.
% This file may safely be deleted. It will be recreated by
% biber as required.
%
\begingroup
\makeatletter
\@ifundefined{[email protected]}
{\@latex@error
{Missing 'biblatex' package}
{The bibliography requires the 'biblatex' package.}
\aftergroup\endinput}
{}
\endgroup
\refsection{0}
\sortlist[entry]{apa/global}
\entry{belletti1988}{article}{}
\name{author}{2}{}{%
{{uniquename=0,hash=2c14abe3cc130a5e92d3a9be58ce2a7a}{%
family={Belletti},
family_i={B\bibinitperiod},
given={Adriana},
given_i={A\bibinitperiod}}}%
{{uniquename=0,hash=3a9997806c8053ebfb136c367b21844b}{%
family={Rizzi},
family_i={R\bibinitperiod},
given={Luigi},
given_i={L\bibinitperiod}}}%
}
\strng{namehash}{fdc76b94e4c47018bee5a5282eb818bb}
\strng{fullhash}{fdc76b94e4c47018bee5a5282eb818bb}
\field{sortinit}{B}
\field{sortinithash}{4ecbea03efd0532989d3836d1a048c32}
\field{labelyear}{1988}
\field{labelmonth}{08}
\field{datelabelsource}{year}
\field{labelnamesource}{author}
\field{labeltitlesource}{title}
\field{journaltitle}{Natural Language \& Linguistic Theory}
\field{month}{08}
\field{number}{3}
\field{title}{Psych-Verbs and $\theta$-Theory}
\field{volume}{6}
\field{year}{1988}
\field{pages}{291\bibrangedash 352}
\range{pages}{62}
\verb{doi}
\verb 10.1007/BF00133902
\endverb
\endentry
\endsortlist
\endrefsection
\endinput
最有趣的是,如果你用$\theta$
括号括起来,一切都会正常,例如:
Title = {Psych-Verbs and {$\theta$}-Theory},
据我所知,Biber 从未要求过这一点biblatex
。是我错了,还是这是一个错误?
答案1
的定义\MakeSentenceCase
需要允许数学模式。可能的解决方法是
\makeatletter
\def\blx@mksc@init{%
\blx@mkcp@init
\def\blx@mkcp@nil{\noexpand\blx@mkcp@nil\noexpand}%
\def\i{\blx@mkcp@nil\i}\def\j{\blx@mkcp@nil\j}%
\def\do##1{%
\ifx##1\relax
\else
\def##1{\blx@mkcp@nil##1}%
\expandafter\do
\fi}%
\expandafter\do\@uclclist\relax
\let\(=$\let\)=$}
\def\blx@mksc@eval{%
\ifx\@let@token\blx@mksc@end
\expandafter\blx@mksc@end
\fi
\ifx\@let@token\bgroup
\expandafter\blx@mksc@group
\fi
\ifx\@let@token\@sptoken
\expandafter\blx@mksc@space
\fi
\ifx\@let@token\blx@mkcp@nil
\expandafter\blx@mksc@getone
\fi
\ifx\@let@token\blx@mkcp@iec
\expandafter\blx@mksc@getiec
\fi
\ifx\@let@token\blx@mkcp@bbl
\expandafter\blx@mksc@gettwo
\fi
\ifx\@let@token\blx@mkcp@sgl
\expandafter\blx@mksc@gettwo
\fi
\ifx\@let@token\blx@mkcp@dbl
\expandafter\blx@mksc@getthree
\fi
\ifx\@let@token$%
\expandafter\blx@mksc@getmath
\fi
\if\noexpand\@let@token\relax
\expandafter\blx@mksc@cs
\fi
\blx@mksc@other}
\def\blx@mksc@getmath#1\blx@mksc@other$#2${\blx@mksc@other{{$#2$}}}
\makeatother