Tzafrir Cohen wrote on 2003-07-07:

> On Mon, Jul 07, 2003 at 06:09:23PM +0300, Beni Cherniavsky wrote:
> > - Define and implement a preprocessor from implicit to explicit bidi
> >   for LaTeX and/or HTML (HTML already does most of it, you just need
> >   to derive dir attributes; LaTeX is non-trivial).
>
> Actually, the basic algorithm is pretty clear. A simple unicode text -> Hebrew
> latex convertor should be doable. And I'm sure there are options for
> optimizations. The idea is to ask fribidi to give the embedding levels
> of the string, and then insert \L{} -s and \R{}-s where appropriate.
>
The main technical obstacle I think would be matching opening/closing
constructs and telling apart horizontal from vertical contexts in the
LaTeX source.  I think you can only aim for 95% coverage at this; one
can always define some tricky macros to fool you (well, that's a
genrall problem with LaTeX source).

> This is indeed quite within the scope of such a project.
>
> The other direction is basically done by replacing \L{} with LRE ...
> PDF but it will require some analisys of the html.  It is probably
> possible as simple addition extention to latex2html because there
> you can basically "reimplement" those macros.
>
For HTML I didn't mean only latex-derived output.  It would be useful
to define an algorithm for implicitly deriving dir attributes in HTML
so that paragraph alignment can be implicit as well, not only the
paragraph content.  Then it would perhaps be possible to use
completely bidi-ignorant tools with logical implicit hebrew and
post-process their HTML and get correct bidi - from only the bidi
categories of the original text + LRM / RLM (you would also need
either explicit embedding codes or at least a neutral structuring
device, like <span>, to handle complex cases with embedding).  If
successful, this approach would mean that we don't have to add bidi
constructs to every format on earth (like was done to HTML/CSS) and we
can use bidi-unaware format translation tools and still get our bidi
right.  I'm now working on figuring out these ideas and writing a
document on it; I'll post it when it's ready.

-- 
Beni Cherniavsky <[EMAIL PROTECTED]>

If I don't hack on it, who will?  And if I don't GPL it, what am I?
And if it itches, why not now?  [With apologies to Hilel ;]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to