]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathParser.C
Support lgathered and rgathered math environments
[lyx.git] / src / mathed / MathParser.C
index 826d61529ec680da64093d3e2c68862a57830c65..b8268eb72a9647ef18a0498c5152c0962758a777 100644 (file)
@@ -39,6 +39,7 @@ following hack as starting point to write some macros:
 #include <config.h>
 
 #include "MathParser.h"
+
 #include "InsetMathArray.h"
 #include "InsetMathBig.h"
 #include "InsetMathBrace.h"
@@ -47,20 +48,19 @@ following hack as starting point to write some macros:
 #include "InsetMathComment.h"
 #include "InsetMathDelim.h"
 #include "InsetMathEnv.h"
-#include "MathFactory.h"
 #include "InsetMathKern.h"
 #include "InsetMathMacro.h"
-#include "MathMacroArgument.h"
-#include "MathMacroTemplate.h"
 #include "InsetMathPar.h"
+#include "InsetMathRef.h"
 #include "InsetMathRoot.h"
 #include "InsetMathScript.h"
+#include "InsetMathSplit.h"
 #include "InsetMathSqrt.h"
-#include "MathSupport.h"
 #include "InsetMathTabular.h"
-
-//#include "insets/insetref.h"
-#include "InsetMathRef.h"
+#include "MathMacroTemplate.h"
+#include "MathFactory.h"
+#include "MathMacroArgument.h"
+#include "MathSupport.h"
 
 #include "lyxlex.h"
 #include "debug.h"
@@ -1100,16 +1100,16 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                parse2(cell->back(), FLAG_END, InsetMath::TEXT_MODE, false);
                        }
 
-                       else if (name == "split" || name == "cases" ||
-                                name == "gathered" || name == "aligned") {
+                       else if (name == "split" || name == "cases") {
                                cell->push_back(createInsetMath(name));
                                parse2(cell->back(), FLAG_END, mode, false);
                        }
 
                        else if (name == "alignedat") {
+                               string const valign = parse_verbatim_option() + 'c';
                                // ignore this for a while
                                getArg('{', '}');
-                               cell->push_back(createInsetMath(name));
+                               cell->push_back(MathAtom(new InsetMathSplit(name, valign[0])));
                                parse2(cell->back(), FLAG_END, mode, false);
                        }
 
@@ -1174,6 +1174,18 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                if (l->inset == "matrix") {
                                        cell->push_back(createInsetMath(name));
                                        parse2(cell->back(), FLAG_END, mode, false);
+                               } else if (l->inset == "split") {
+                                       string const valign = parse_verbatim_option() + 'c';
+                                       cell->push_back(MathAtom(new InsetMathSplit(name, valign[0])));
+                                       parse2(cell->back(), FLAG_END, mode, false);
+                               } else {
+                                       dump();
+                                       lyxerr << "found math environment `" << name
+                                              << "' in symbols file with unsupported inset `"
+                                              << l->inset << "'." << endl;
+                                       // create generic environment inset
+                                       cell->push_back(MathAtom(new InsetMathEnv(name)));
+                                       parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
                                }
                        }