[XeTeX] bidi, math, and amstext

Mike Maxwell maxwell at umiacs.umd.edu
Sat Sep 27 22:12:26 CEST 2014


On 9/27/2014 12:24 AM, Vafa Khalighi wrote:
> Well, I suppose you do not use low-level commands like \RL to typeset say
> Arabic. Do you?

We have been; perhaps relevant is the fact that we're typesetting small amounts 
of text in various right-to-left scripts in the middle of a bunch of 
left-to-right text (a grammar).

> One usually defines an environment like:
>
> \newfontfamily\arabicfont[ExternalLocation,Script=Arabic]{amiri-regular}
> \newenvironment{arabtext}{\begin{RTL}\@Latinfalse\arabicfont}{\end{RTL}
>
> or if you are defining commands:
>
> \newcommand*{\textarab}[1]{\RL{\@Latinfalse\arabicfont #1}}

Ok, tried that; it (and also my original attempt at redefining \RL) fails for 
some reason in captions.  The minimal example is
---------------
\documentclass{report}
\usepackage{fontspec}
\newfontfamily\ArabicFont[Script=Arabic]{Scheherazade}

\usepackage{bidi}
\makeatletter
\@Latintrue
\newcommand*{\ArabicScript}[1]{\RL{\@Latinfalse\ArabicFont #1}}
\makeatother

\begin{document}

\begin{table}
\caption{{\ArabicScript{دن}}}
\end{table}
\end{document}
-----------

The error msg is
     ! Incomplete \iffalse; all text was ignored after line 15.
     <inserted text>
                     \fi
     <*> RLBug.xetex
-- 
	Mike Maxwell
	maxwell at umiacs.umd.edu
	"My definition of an interesting universe is
	one that has the capacity to study itself."
         --Stephen Eastmond


More information about the XeTeX mailing list