On Sun, Mar 29, 2009 at 11:05:43PM +1100, وفا خلیقی wrote: > one more question, why if I use \setRTL at the beginning of the document it > does not works which is defined as > > \newif...@rtl > \...@rtl\pagedir TRT \bodydir TRT \pardir TRT \textdir TRT \else \pagedir TLT > \ > bodydir TLT \pardir TLT \textdir TLT \fi > \def\setrt...@rtltrue} > \def\setlt...@rtlfalse}
I don't know much about TeX macros, but I'd rather use lua here.
For example, this macro will switch direction based on the current text
direction. Not exactly what you are doing, but shows some of LuaTeX's
flexibility.
%%%%%%
\catcode`|=\active
\def|#1|{%
\directlua{%
if tex.textdir == "TLT" then
tex.print("{".."\luaescapestring{\textdir TRT}".."#1".."}")
elseif tex.textdir == "TRT" then
tex.print("{".."\luaescapestring{\textdir TLT}".."#1".."}")
else
texio.write_nl("I don't know how to deal with "..tex.textdir.."
direction")
tex.print("#1")
end
}}
\obeylines
Hello |World| of wonders!
\textdir TRT
Hello |World| of wonders!
\textdir TLB
Hello |World| of wonders!
\bye
%%%%%%
Regards,
Khaled
--
Khaled Hosny
Arabic localiser and member of Arabeyes.org team
Free font developer
signature.asc
Description: Digital signature
