On Mon, Apr 03, 2000 at 10:07:05AM +0200, Juergen Vigna wrote:
> On 01-Apr-2000 Dekel Tsur wrote:
> > I'm considering of adding a new inset (InsetNumber) for the purpose of
> > entering numbers in Right-To-Left text: when you press a digit key, instead
> > of inserting the digit into the current paragraph, a InsetNumber is inserted
> > and the digit is inserted to the inset.
> >
>
> I really don't see the advantage of such an inset? Could you enlighten me?
There are two problems with numbers in Hebrew:
1. In the LaTeX output, the number should be enclosed by \beginL / \endL
(e.g., \beginL 123 \endL).
2. While writing the text, you should not press a special key for telling the
editor when you are starting/ending a number. Instead, it should be done
automatically (the Unicode standard defines the rules for deciding when a number
starts/ends).
For example, typing 'abc 123.' [suppose that a,b,c are Hebrew letters], then the
period is not part of the number, and the result on screen should be
.123 cba
But when typing 'abc 123.4' then the period is part of the number, and the
result should be
123.4 cba
The purpose of the InsetNumber is taking care of (1) & (2).
Now, because of the bugs (sorry, missing features :) in the InsetText,
I began coding a different solution for numbers (without the number inset):
I've added a field named 'number' to the FontBits structure which stores
whether the text belongs to a number. The code for (2) is in LyXText::InsertChar.
It appears to work better than the number inset, but I need to do more
checks.