listings 包与 polyglossia 冲突

listings 包与 polyglossia 冲突

我删减了最小工作示例;我正在使用。除非我注释该行或该行,XeTeX否则以下代码不起作用。当我编译以下示例时,它会打开文件并指向:\setotherlanguage{arabic}\usepackage{listings}xelatex/bidi/listings-xetex-bidi.def

\ProvidesFile{listings-xetex-bidi.def}[2017/01/14 v1.4 bidi adaptations for listings package for XeTeX engine]
\lst@Key{captiondirection}{textdirection}{%
    \lstKV@SwitchCases{#1}%
    {textdirection&\\%
     RTL&\chardef\bidi@lst@caption@direction\@ne\\%
     LTR&\chardef\bidi@lst@caption@direction\z@%
    }{\PackageError{Listings}{direction #1 unknown}\@ehc}}

并给了我错误信息:

! Package Listings Error: direction textdirection unkown.

代码:

\documentclass[11pt, b6paper, landscape, oneside]{memoir}

\usepackage{listings}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}

\begin{document}

Hello

\end{document}

相关内容