Straightforward implementation of a "new feature" from an anonymous(?)
source:

xalignat und xxalignat are de facto obsolete and
and can be replaced by flalign.
-> ftp://ftp.ams.org/pub/tex/doc/amsmath/amsldoc.pdf

This cannot break anything.
Ok to apply?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
Index: lib/ui/default.ui
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ui/default.ui,v
retrieving revision 1.100
diff -u -r1.100 default.ui
--- lib/ui/default.ui   19 Sep 2002 15:55:46 -0000      1.100
+++ lib/ui/default.ui   10 Oct 2002 15:10:47 -0000
@@ -155,6 +163,7 @@
        Item "Displayed formula|D" "math-mutate equation"
        Item "Eqnarray environment|q" "math-mutate eqnarray"
        Item "Align environment|A" "math-mutate align"
+       Item "flAlign environment|f" "math-mutate flalign"
        Item "AlignAt environment" "math-mutate alignat"
        Item "XAlignAt environment" "math-mutate xalignat"
        Item "XXAlignAt environment" "math-mutate xxalignat"
@@ -205,11 +222,12 @@
        Item "Menu Separator|M" "menu-separator-insert"
     End
 
     Menu "insert_math"
        Item "Inline Formula|I" "math-mode"
        Item "Display Formula|D" "math-display"
        Item "Eqnarray environment|E" "command-sequence math-mode; math-mutate 
eqnarray;"
        Item "AMS align environment|A" "command-sequence math-mode; math-mutate align;"
+       Item "AMS flalign environment|f" "command-sequence math-mode; math-mutate 
+flalign;"
        Item "AMS alignat environment|t" "command-sequence math-mode; math-mutate 
alignat;"
        Item "AMS xalignat environment|x" "command-sequence math-mode; math-mutate 
xalignat;"
        Item "AMS xxalignat environment" "command-sequence math-mode; math-mutate 
xxalignat;"
Index: src/mathed/math_hullinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v
retrieving revision 1.58
diff -u -r1.58 math_hullinset.C
--- src/mathed/math_hullinset.C 29 Aug 2002 06:49:27 -0000      1.58
+++ src/mathed/math_hullinset.C 10 Oct 2002 15:35:45 -0000
@@ -38,6 +38,8 @@
                        return 3;
                if (type == "align")
                        return 2;
+               if (type == "flalign")
+                       return 2;
                if (type == "alignat")
                        return 2;
                if (type == "xalignat")
@@ -77,6 +79,7 @@
                if (s == "xxalignat") return 7;
                if (s == "multline")  return 8;
                if (s == "gather")    return 9;
+               if (s == "flalign")   return 10;
                lyxerr << "unknown hull type '" << s << "'\n";
                return 0;
        }
@@ -151,7 +154,7 @@
                return 0;
        if (type_ == "xalignat")
                return (col & 1) ? 20 : 0;
-       if (type_ == "xxalignat")
+       if (type_ == "xxalignat" || type_ == "flalign")
                return (col & 1) ? 40 : 0;
        return 0;
 }
@@ -278,6 +281,7 @@
 {
        return
                type_ == "align" ||
+               type_ == "flalign" ||
                type_ == "multline" ||
                type_ == "gather" ||
                type_ == "alignat" ||
@@ -353,7 +357,7 @@
                        os << "\\[\n";
        }
 
-       else if (type_ == "eqnarray" || type_ == "align")
+       else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign")
                        os << "\\begin{" << type_ << star(n) << "}\n";
 
        else if (type_ == "alignat" || type_ == "xalignat")
@@ -388,8 +392,8 @@
                else
                        os << "\\]\n";
 
-       else if (type_ == "eqnarray" || type_ == "align" || type_ == "alignat"
-             || type_ == "xalignat")
+       else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign"  
+            || type_ == "alignat" || type_ == "xalignat")
                os << "\n\\end{" << type_ << star(n) << "}\n";
 
        else if (type_ == "xxalignat" || type_ == "multline" || type_ == "gather")
@@ -403,7 +407,7 @@
 bool MathHullInset::colChangeOK() const
 {
        return
-               type_ == "align" || type_ == "alignat" ||
+               type_ == "align" || type_ == "flalign" ||type_ == "alignat" ||
                type_ == "xalignat" || type_ == "xxalignat";
 }
 
Index: src/mathed/math_parser.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.C,v
retrieving revision 1.252
diff -u -r1.252 math_parser.C
--- src/mathed/math_parser.C    30 Sep 2002 06:48:53 -0000      1.252
+++ src/mathed/math_parser.C    10 Oct 2002 15:35:46 -0000
@@ -1016,6 +1016,11 @@
                                parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, 
!stared(name));
                        }
 
+                       else if (name == "flalign" || name == "flalign*") {
+                               cell->push_back(MathAtom(new 
+MathHullInset("flalign")));
+                               parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, 
+!stared(name));
+                       }
+
                        else if (name == "alignat" || name == "alignat*") {
                                // ignore this for a while
                                getArg('{', '}');

Reply via email to