[XeTeX] Turning off polyglossia's "bidi" algorithm.

C. Scott Ananian cscott at cscott.net
Fri Jan 10 23:43:10 CET 2014


This is a follow-up to my previous message a few weeks ago.

I've implemented the Unicode Bidirectional Algorithm manually, using
the [node-icu-bidi] package to expose the implementation in ICU to my
code.

Now I am generating explicit \setLTR, \setRTL, \LRE, \RLE etc commands
to guide the xelatex bidi package.  However, polyglossia still seems
to be doing some ad-hoc directional overrides when the arabic language
is selected, in particular with parentheses and commas.

For example:
--- begin file ---
\documentclass{article}
\usepackage{bidi}
\title{Testing Basic Bidi Direction Change}
\author{C. Scott Ananian}
\begin{document}
\maketitle

Here's some LTR text.

Williams، Richard (24 April 2008).

\setRTL
Now we're in RTL mode.

Williams، Richard (24 April 2008).

\LR{Williams، Richard (24 April 2008).}

\end{document}
--- end file ---

Note the arabic comma in the example text.  Nevertheless, this file is
laid out as I expect; that is, the final line of the LTR region
displays identically to the final line of the RTL region (although it
is, as expected, right-justified in the RTL region).

Using polyglossia, however:
--- begin file ---
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage[]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
\title{Testing Basic Bidi Direction Change}
\author{C. Scott Ananian}
\begin{document}
\maketitle

\setLTR
Here's some LTR text.

Williams، Richard (24 April 2008).

\setRTL
Now we're in RTL mode.

Williams، Richard (24 April 2008).

\LR{Williams، Richard (24 April 2008).}
\end{document}
--- end file ---

Now both final lines display as "24) April .(2008". That is, the
parentheses and period have been reordered, even when I explicitly
request LTR mode.  What's going on here?  How do I turn this
(mis)feature off?
  --scott

[node-icu-bidi]: https://github.com/cscott/node-icu-bidi

-- 
                         ( http://cscott.net/ )



More information about the XeTeX mailing list