TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I typeset Arabic text with LuaLaTeX. I am using the following definitions and it works nicely:

\newcommand{\arabtext}[1]       % Arabic inside LTR
    {\bgroup\luatextextdir TRT\arabicfont #1\egroup}

(More expanded version here.)

A while ago, though, I've been told through a comment that "[my] definition ... is wrong" and that I might have a look at the bidi-package. Indeed I looked at it several times but never got it to work on my system. In fact, I can not even compile an example taken from the bidi-documentation itself:

% !TEX TS-program = lualatex
\newfontfamily\Parsifont[Script=Arabic]{Arabic Typesetting}
Anyone who reads Old and Middle English \LRE{Short LTR text} literary texts will be familiar with the mid-brown volumes of the EETS, with the symbol of Alfred's jewel embossed on the front cover.
Anyone who reads Old and Middle English \RLE{Short RTL text} literary texts will be familiar with the mid-brown volumes of the EETS, with the symbol of Alfred's jewel embossed on the front cover.

The only result is LaTeX Error: Environment RTL undefined.

Why is that so? is bidi incompatible with LuaLaTeX?

I am asking, because I do believe that bidi could be a better solution than mine offered above (because, e.g., bidi has many other feature such as RTL footnotes etc.) and would like to try and to use it.

share|improve this question
Nothing in the documentation suggests bidi can be used with LuaLaTeX. – egreg Feb 7 '13 at 11:27
@egreg : my reading was that nothing suggests that it can't, either. Much more so, since the above mentioned comment that "[my] definition ... is wrong" (presumably written by the bidi-author himself?) IMHO seemed to justify the believe that it could be used with LuaLaTex. – ClintEastwood Feb 7 '13 at 11:41
General question of efficiency: Why do documentations of packages not by default declare on the first page by which engines and processing methods (TeX, LaTeX2e, LuaLaTeX, XeTeX, etc.) they can be used?? – ClintEastwood Feb 7 '13 at 11:44
The definition of \RTL and \endRTL are in xetex-bidi.def. There is a luatex-bidi.def file that simply enables some LuaTeX primitives, but doesn't define anything else. – egreg Feb 7 '13 at 11:47
up vote 4 down vote accepted

bidi is basically XeTeX-only: the author has moved his LuaTeX code to a (commercial) alternative. XeTeX and LuaTeX use different RTL models, so completely different approaches are needed at a low level. On the documentation side: this depends on the package author. I'd always include a test in the code, with appropriate warnings/errors, but not everyone does.

(The LaTeX3 team have recently been looking into this to try to abstract some interfaces, but that is very much 'work in progress'.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.