2014-09-27 22:12 GMT+02:00 Mike Maxwell <maxw...@umiacs.umd.edu>: > 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
Your definition is fragile but a robust macro is needed inside \caption. Use \DeclareRobustCommand instead of \newcommand, the syntax is the same. > --------------- > \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 > maxw...@umiacs.umd.edu > "My definition of an interesting universe is > one that has the capacity to study itself." > --Stephen Eastmond > > > > -------------------------------------------------- > Subscriptions, Archive, and List information, etc.: > http://tug.org/mailman/listinfo/xetex -- Zdeněk Wagner http://hroch486.icpf.cas.cz/wagner/ http://icebearsoft.euweb.cz -------------------------------------------------- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex