On Sun, Apr 10, 2005 at 12:32:19PM +0200, Helge Hafting wrote: > On Sun, Apr 10, 2005 at 10:52:54AM +0300, Martin Vermeer wrote: > > On Sun, Apr 10, 2005 at 12:05:29AM +0200, Andre Poenitz wrote: > > > On Sat, Apr 09, 2005 at 04:46:45PM +0200, Helge Hafting wrote: > > > > The problem is mostly the same if applying the n-root, one expect > > > > the selection to go under the root, not above it. So perhaps > > > > the n-root ought to be a little special? It'd be consistent > > > > with the square root. > > > > > > Simply swap the meaning of idx == 0 and idx == 1 in MathRootInset then. > > > Auto-insertion goes to cell 0, if that should be the part below the > > > root, this cell should have index 0. > > > > > > Andre' > > > > Makes absolute, perfect sense. Helge, this is easy to do. Just open up > > math_rootinset.C and replace all occurrences of cell(0) with cell(1), > > and vice versa. > > > > Let us know if it works... and post the patch here ;-) > > Tried it, and it had "intereesting" side effects, as expected. > > I swapped cell(0) and cell(1) everywhere. Test results: > > 1. Applying n-root over a selection improved. (Good) > 2. DVI output still matches what's on screen (no change) > 3. "edit->math->computer algebra->maxima" > results still correct. (no change) > 4. An old saved document with the fourth root of 81 > now loaded as the 81th root of four. Saving and > reloading also swaps the n-root components. (Quite bad!) > 5. Keyboard navigation is now silly - passing through > an n-root with right-arrow goes under the root first > and then into the n-part, and finally exits > the n-root and moves on through the math. (Bad!) > 6. The third root special now sticks the "3" under > the root sign. (Wrong) > > So I wonder if this was the right approach - or would a special > case in pasting be better? > > If we go with this approach, I believe I could track down issue(3). > The "write" part in math_rootinset.C was changed, and we need > a corresponding change wherever the "read" takes place.
Probably, yes. Wherever that is. What does the written out LyX file look like, i.e., is it semantically correct? > Issue(6) > is probably not that hard either, or the third root > special could be removed as suggested. > > But what to do about issue(5)? Have a look at the idxUpDown method in math_rootinset.C. > Will that require special cases > for the n-root in math navigation? Where would that be? > > I wonder if this was the right approach - or would a special > case in pasting be better? Let's not give up yet ;-) > Helge Hafting > - Martin
pgpZ6IIlaO50o.pgp
Description: PGP signature