[luatex] Simple bidi
listas at tex-tipografia.com
Sun Jul 30 18:13:08 CEST 2017
I was intrigued by the possibility to devise a simple bidi algorithm
based on some assumptions -- Arabic by default, flat text (ie, no
nested directions), no math, etc. Since TeX is a markup language, I've
just ignored LRE, PDF end the like. One of my aims was to set
directions with just one loop, instead a series of them.
I managed to do it, with a second smaller loop for a special
case. Attached is the resulting code, which works in typical cases. I
tried to emulate the unicode behavior, but I'm not sure it's fully
compliant (I'd say it's not, but who knows :-)). I have to add a few
things (eg, NSM, but little more, I hope).
Please, let me know if you find cases where the result is not what you
would expect, to improve it. The text has been copy-pasted from
Wikipedia (the only changes are % -> \%, and an extra [; I think
%68.3- has been wrongly entered).
(The bidi database is that by Khaled Hosny.)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 53831 bytes
Desc: not available
More information about the luatex