Suppose that I have a display formula \[ \sum_{i > 1} \]
and I change it to \sum\nolimits_{i > 1} by pressing M-m l.
After a while, I change my mind and want to remove the \nolimits.
So I go into the inset and presses M-m l, and from the display on screen it
looks like \nolimits was removed. However, what was really happened is that
the \nolimits was replaced by \limits. There is no way to remove
the \nolimits.

I think that this behavior is bad. A better behavior might be
1. 'math-extern limits' generates \limits
2. 'math-extern nolimits' generate \nolimits
3. 'math-extern' will add \nolimits if the current style is display
or remove it if \nolimits already exist.
If the current style is not display, math-extern will add/remove \limits.
A patch that implements this is attached.

BTW, LyX 1.1.6 behaves like rule #3.
Index: mathed/math_scriptinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_scriptinset.C,v
retrieving revision 1.74
diff -u -p -r1.74 math_scriptinset.C
--- mathed/math_scriptinset.C   30 Sep 2002 06:48:53 -0000      1.74
+++ mathed/math_scriptinset.C   25 Oct 2002 22:20:37 -0000
@@ -491,7 +491,17 @@ MathInset::result_type MathScriptInset::
        (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
 {
        if (cmd.action == LFUN_MATH_LIMITS) {
-               limits_ = limits_ < 0 ? 1 : -1;
+               if (!cmd.argument.empty()) {
+                       if (cmd.argument == "limits")
+                               limits_ = 1;
+                       else if (cmd.argument == "nolimits")
+                               limits_ = -1;
+                       else
+                               limits_ = 0;
+               } else if (limits_ == 0)
+                       limits_ =  (hasLimits()) ? -1 : 1;
+               else
+                       limits_ = 0;
                return DISPATCHED;
        }
 

Reply via email to