>
> I think the key issue is that LyX understands insets (or perhaps I should
> call them subenvironments?) -- things that are argument to LaTeX functions.
> So if you create a fraction, which translates to \frac{#1}{#2} with the
> arguments substituted, LyX knows what constitutes the numerator and what
> constitutes the denominator. I don't think LyX will parse "y = x + 2z" and
> recognize "x" as an addend, "2z" as an addend, etc., because there's no
> need
> to do so in order to translate to LaTeX (nor does LaTeX do that sort of
> parsing, AFAIK).
>
> So I very much doubt, barring a major change to the code, that you can do
> better than what it currently does.
>
> Paul
>
>
Paul,

surely I do not demand to lyx to recognize addends in a formula like "y = x
+ 2z".
Maybe I can explain better myself with an example, so please let me write a
formula with a few markers for the cursor position.

Consider

  \frac{1}{2}  +  \left(1+1\right)  =  2.5

^               ^   ^                    ^         ^
A              B  C                   D         E

Wherever I am, if I hit ctrl+right I am driven to E.
What I would like is that if I am in A I land in B and if I am in C I go to
D

Please note that if I hit shift+right and I am in A then all the A-B
portion of the formula is selected and similarly if I am in C with
shift+right I get C-D selected.
This means that lyx can recognize these chunks of code because, as you
said, lyx understands insets (or subenvironments, if you prefer).

What I have not been able to understand is which function I should bind to
ctrl+right so that this combination drives me from A to B or from C to D
instead of from everywhere to E

Incidentally, I also do not like very much the fact that if in A then
shift+right selects all the A-B portion of the formula: in my view, this
should be the behavior of
ctrl+shift+right, whereas shift+right should select only the very next
character (that is, the numerator if I am in A).

I wish I have explained better my question.
For completeness and reproducibility, I add that some of my current
bindings (the ones which seem relevant to me) are:

shift+right:  char-right-select
ctrl+right:  word-right
ctrl+shift+right: word-right-select

Thank you

Reply via email to