下面的 MWE(现在有一个!)\indexprologue
没有输出。如果我注释掉阿拉伯语的语言设置,它就会输出。这里的问题是什么?我该如何解决?
\documentclass{book}
\usepackage{kantlipsum}
\usepackage{imakeidx}
\makeindex
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{arabic} % Comment this and the indexprologue appears
\begin{document}
\kant[1]
\index{entry}
\indexprologue{\kant[1]}
\printindex
\end{document}
答案1
bidi
这是一个掌握主动权的问题,毫无理由地恢复了环境book
的定义theindex
。
\documentclass{book}
\usepackage{polyglossia}
\usepackage{kantlipsum}
\usepackage{imakeidx}
% nullify bidi redefinition
% this should go after polyglossia and imakeidx have been loaded
\let\imakeidxtheindex\theindex
\let\imakeidxendtheindex\endtheindex
\AtBeginDocument{%
\let\theindex\imakeidxtheindex
\let\endtheindex\imakeidxendtheindex
}
\makeindex
\setdefaultlanguage{english}
\setotherlanguage{arabic} % Comment this and the indexprologue appears
\begin{document}
\kant[1]
\index{entry}
\indexprologue{\kant[1]}
\printindex
\end{document}