]> git.lyx.org Git - features.git/commitdiff
support for AMS flalign environment
authorAndré Pönitz <poenitz@gmx.net>
Mon, 14 Oct 2002 12:56:21 +0000 (12:56 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 14 Oct 2002 12:56:21 +0000 (12:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5388 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/ui/default.ui
src/mathed/ChangeLog
src/mathed/math_hullinset.C
src/mathed/math_parser.C

index fa0e34495c49c7c99afa9fdf5a23f8ad2fd57b63..700a6a45a49319e29a1c479ff6ad34c44caa5c11 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-14  André Pönitz <poenitz@gmx.net>
+
+       * ui/default.ui: support for flalign
+
 2002-10-11  Dekel Tsur  <dekelts@tau.ac.il>
 
        * lyx2lyx/lyxconvert_218.py (remove_oldert): Fix bug.
index 84da614c03ecba5004884435d3315c23b3ea8410..c6c4b5e11f0e318fa0b31671da9041e9d658e117 100644 (file)
@@ -156,8 +156,9 @@ Menuset
        Item "Eqnarray environment|q" "math-mutate eqnarray"
        Item "Align environment|A" "math-mutate align"
        Item "AlignAt environment" "math-mutate alignat"
-       Item "XAlignAt environment" "math-mutate xalignat"
-       Item "XXAlignAt environment" "math-mutate xxalignat"
+       Item "Flalign environment|f" "math-mutate flalign"
+       #Item "XAlignAt environment" "math-mutate xalignat"
+       #Item "XXAlignAt environment" "math-mutate xxalignat"
        Item "Gather environment" "math-mutate gather"
        Item "Multline environment" "math-mutate multline"
     End
@@ -211,8 +212,9 @@ Menuset
        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 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;"
+       Item "AMS flalign environment|f" "command-sequence math-mode; math-mutate flalign;"
+       #Item "AMS xalignat environment|x" "command-sequence math-mode; math-mutate xalignat;"
+       #Item "AMS xxalignat environment" "command-sequence math-mode; math-mutate xxalignat;"
        Item "AMS gather environment" "command-sequence math-mode; math-mutate gather;"
        Item "AMS multline environment" "command-sequence math-mode; math-mutate multline;"
   Separator
index 946f06538f9997363b980a41b7c6557e7d36b14f..4a5066ccacc7831499e1bffd5eede73034574401 100644 (file)
@@ -3,6 +3,9 @@
 
        * formulabase.C: support pasting stuff into formulas using button3
 
+       * math_parser.C:
+         math_hullinset.C: Herbert's patch to support flalign
+
 2002-10-10  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * formulabase.C (localDispatch): make LFUN_WORDLEFTSEL and
index 4f5a81d29b9d640feb48e1006cc34819102eba8a..5c99996614b94bf685bd16441fffc0acce0b487e 100644 (file)
@@ -38,6 +38,8 @@ namespace {
                        return 3;
                if (type == "align")
                        return 2;
+               if (type == "flalign")
+                       return 2;
                if (type == "alignat")
                        return 2;
                if (type == "xalignat")
@@ -77,6 +79,7 @@ namespace {
                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 @@ int MathHullInset::defaultColSpace(col_type col)
                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 @@ bool MathHullInset::ams() const
 {
        return
                type_ == "align" ||
+               type_ == "flalign" ||
                type_ == "multline" ||
                type_ == "gather" ||
                type_ == "alignat" ||
@@ -353,7 +357,7 @@ void MathHullInset::header_write(WriteStream & os) const
                        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 @@ void MathHullInset::footer_write(WriteStream & os) const
                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 @@ void MathHullInset::footer_write(WriteStream & os) const
 bool MathHullInset::colChangeOK() const
 {
        return
-               type_ == "align" || type_ == "alignat" ||
+               type_ == "align" || type_ == "flalign" ||type_ == "alignat" ||
                type_ == "xalignat" || type_ == "xxalignat";
 }
 
@@ -588,7 +592,7 @@ void MathHullInset::mutate(string const & newtype)
 
        else if (type_ == "multline") {
                if (newtype == "gather" || newtype == "align" ||        
-                          newtype == "xalign" || newtype == "xxalign")
+                   newtype == "xalignat" || newtype == "xxalignat" || newtype == "flalign")
                        setType(newtype);
                else if (newtype == "eqnarray") {
                        MathGridInset::addCol(1);
index 6cfa4f05721e635e9647a046ac69c774498f2297..ff4447c2d895115bcadf5190f1bd62bcad829269 100644 (file)
@@ -1016,6 +1016,11 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                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('{', '}');