修改后的 marginpar 与 biblatex 引用相冲突

修改后的 marginpar 与 biblatex 引用相冲突

考虑下面的 MWE:

\documentclass[10pt,twoside,onecolumn,openright,draft]{memoir}
\usepackage{fontspec}
\usepackage{filecontents}
\usepackage{calc}
\usepackage[french]{babel}
\usepackage{mparhack}
\usepackage{csquotes}
\usepackage[authordate,strict,backend=biber,babel=other]{biblatex-chicago}

%\let\oldmarginpar\marginpar
%\renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize\hspace{0pt}#1]%
%{\raggedright\footnotesize\hspace{0pt}#1}}

\begin{filecontents}{references.bib}
@book{Thomsen:SL,
    author = {Thomsen, Marie-Louise},
title = {The Sumerian Language},
    subtitle = {An Introduction to its History and Grammatical Structure},
    shorttitle = {Sumerian Language},
    shorthand = {SL},
    edition = {2},
    series = {Mesopotamia Copehagen Studies in Assyriology},
    number = {10},
    location = {Copenhagen},
    publisher = {\foreignlanguage{danish}{Akademisk Forlag}},
    date = {1987},
    year = {1987}
}
\end{filecontents}
\bibliography{references.bib}

\begin{document}
Texte\marginpar{\cite[§228]{Thomsen:SL}} et encore.
\end{document}

编译没问题。然而,当我取消注释 marginpar 的重新定义(我已经成功使用了几年)时,我得到了

./minimal:33: Argument of \blx@citeargs@i has an extra }

重新定义是有问题的,或者这会导致某种冲突biblatex-chicago

有什么想法吗?

答案1

如果参数中存在,则会遇到问题],因为可选参数的解析会出错,因此需要一个{}组来隐藏内部的]

\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\-\oldmarginpar[{\raggedleft\footnotesize\hspace{0pt}#1\par}]%
{\raggedright\footnotesize\hspace{0pt}#1}}

相关内容