Mostafa Vahedi wrote:
Mostafa Vahedi wrote:
Currently (only) Unicode is used for Farsi as the input encoding. Moreover in Unicode the openning parenthesis is always the left one (independent of the language) I have modified the code to reverse the direction of the character-pairs when it wants to display the characters whenever the language is Arabic or Farsi.
 Maybe the direction should be changed
only when the
language is Farsi (not Arabic), but only one parameter, i.e. bool Arabic, is sent to the function).
Mostafa

Hi Mostafa!

This patch looks good, but I'm not sure that it should be applied for Arabic. Currently (before applying your patch, but with what you previously put in already in place) I'm getting backwards parentheses in Arabic. As I see it, there are two ways to go about solving this:

1) If the parentheses really do need to be reversed when using Unicode input (I'm not set up for Unicode input, I don't th
ink, so I can't test this), then
the patch *should* be applied also for arabic.
Then,
however, when using the keymap, parentheses are backwards --- but we can just fix that in the keymap itself, by adding

\kmap ( )
\kmap ) (

2) If for Arabic Unicode the patch should not be applied, then it should be applied only for farsi.

Either way, it probably wouldn't be a bad idea to add a separate bool variable for farsi --- there's no real reason why farsi and arabic should share the variable...

(I haven't tried your patch, because I'm having trouble with the spacing copying it from the email. Could you attach it --- or one modified according to the above suggestions -- as an attachment next time, then I'll test it.)

Dov

Dear Dov,

The problem is independent of the language, rather
it depends on
  the encoding. In other
words it does not depend on Arabic or Farsi
but it depends
 on the encoding we would like to save
our texts.
First we should make it clear for ourselves what the
internal encoding of the LyX file (not the LaTeX file) is. If it is Unicode then we should obey the unicode rules. In Unicode we always use the LATIN-left paranthesis as the opening one but during the representation or display we consider the context and display the correct one.

Clearly there is some sort of encoding mapping during
the generation of the LaTeX file. In my opinion
there we should change the direction of the paranthesis in case it is needed.

What is the internal encoding of a LyX file? Where is
the point at which we can consider reversing the direction of the character pairs when converting a LyX file to a LaTeX file in case it is needed?


Mostafa, your explanation sounds good. I don't really know enough about this to be helpful (as the whole ArabTeX business shows :( ). If you send in patches, I will test them and let you know if they are OK in terms of the user experience as it seems to me that it should be.

Currently, the user experience in Hebrew is good, in Arabic (both ArabTeX and Arabi) it is not (in both cases, using *keymap* input). Your patch I like in terms of the code, but of course it doesn't change the user experience in Arabic. Hebrew remains untouched, which is good. If you are able to solve this for Arabic, then probably it should be applied to Hebrew as well. Again, I'll test patches.

Dov

Reply via email to