
我剛剛對我的發行版(2015)中的所有軟體包進行了更新,現在我在將+與軟體包texlive
組合時遇到了問題。biber
biblatex
microtype
該錯誤似乎僅在文件中使用“特殊”字元時bib
以及僅當我要求列印參考書目時才會出現。這是一個最小的例子:
\documentclass{article}
\usepackage{filecontents}
\usepackage{microtype}
\usepackage[backend=biber]{biblatex}
\begin{filecontents}{\jobname.bib}
@book{renyi1970,
author = {R\'enyi, Alfr\'ed},
location = {San Francisco},
publisher = {Holden-Day},
title = {Foundations of Probability},
year = {1970},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{renyi1970}
\printbibliography
\end{document}
我收到的錯誤訊息如下所示:
! Argument of \MT@res@a has an extra }.
<inserted text>
\par
l.23
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
##1,\OT1/cmr/m/n/10 ,##2##3\@nnil {\ifx ##2\@empty \MT@inlist@false \else \ETC.
! Paragraph ended before \MT@res@a was complete.
<to be read again>
\par
l.23
\printbibliography
如果我刪除該命令,即使我使用引用樣式,問題也會消失,authoryear
這樣單獨的變音符號就不會產生問題。也就是說,以下內容如預期編譯:
\documentclass{article}
\usepackage{filecontents}
\usepackage{microtype}
\usepackage[backend=biber, citestyle=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@book{renyi1970,
author = {R\'enyi, Alfr\'ed},
location = {San Francisco},
publisher = {Holden-Day},
title = {Foundations of Probability},
year = {1970},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{renyi1970}
\end{document}
microtype
該錯誤似乎與和之間的交互有關biber
,因為它不僅僅與其中之一有關(我嘗試microtype
使用bibtex
作為後端biblatex
,它工作得很好;我也嘗試過biber
不使用microtype
,它也工作得很好)。
據我所知,microtype
自 2013 年以來就沒有更新過,所以我假設問題是由較新版本的biber
(2.4) 或較新版本biblatex
(3.3) 引入的。
答案1
我想說這是一個錯誤biblatex
:
在biblatex_.sty
(這是與 一起使用的非舊版本biber
)中,我們在開頭找到:
% Tests for emptiness, regardless whether the arg is macro or literal
% Expand everything and test as string
\def\ifempty#1{%
\edef\z{#1}%
\expandafter\ifblank\expandafter{\z}}
現在,\edef
處理使用者輸入是永遠不應該做的事情。
\edef
如果我替換為\protected@edef
(這是乳膠的“用戶安全”版本), OP的最小示例對我有用\edef
,但我無法預見這可能會產生哪些其他後果。
答案2
這是由於 biblatex 的變化造成的。我試圖盡可能地使用戶免受名稱部分更改的影響,但由於這種後果,這實際上並不可行。如前所述,如果您使用 fontenc ,則問題不存在,我認為您無論如何都應該這樣做。不過,我在 DEV 上的 biblatex 3.4 中更改了有問題的測試,問題不再出現。
答案3
\usepackage[T1]{fontenc}
如果我只加.則不會出現錯誤。microtype
當編碼為 OT1 時,並不清楚哪裡會阻塞。
biblatex 2016/03/03 v3.3
和biber version: 2.4
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{renyi1970,
author = {R\'enyi, Alfr\'ed},
location = {San Francisco},
publisher = {Holden-Day},
title = {Foundations of Probability},
year = {1970},
}
\end{filecontents}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\usepackage{microtype}
\addbibresource{\jobname.bib}
\begin{document}
\cite{renyi1970}
\printbibliography
\end{document}
答案4
運行biber
與
biber --output-safechars <file>
不過,這樣寫起來更有意義
author = {Rényi, Alfréd},
並使用lualatex
或至少`
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
為了pdflatex