diff --git a/lib/symbols b/lib/symbols index a812911158..65a6958dc0 100644 --- a/lib/symbols +++ b/lib/symbols @@ -87,6 +87,14 @@ smallmatrix matrix none vmatrix matrix none CD matrix none +# split environments with optional valign argument. +# the others (split and alignedat) are hardcoded. +aligned split none +gathered split none +# from Morten H\o gholm's mathtools.sty: +lgathered split none +rgathered split none + # references pageref ref none prettyref ref none diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index f3c5faf381..024d54cf04 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -276,6 +276,8 @@ MathAtom createMathInset(string const & s) return MathAtom(new MathFontOldInset(l)); if (inset == "matrix") return MathAtom(new MathAMSArrayInset(s)); + if (inset == "split") + return MathAtom(new MathSplitInset(s)); return MathAtom(new MathSymbolInset(l)); } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 65b4f661ec..4d01de5f85 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1178,6 +1178,18 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (l->inset == "matrix") { cell->push_back(createMathInset(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 MathSplitInset(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 MathEnvInset(name))); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } } diff --git a/src/mathed/math_splitinset.C b/src/mathed/math_splitinset.C index 44938c79df..4f9005b774 100644 --- a/src/mathed/math_splitinset.C +++ b/src/mathed/math_splitinset.C @@ -109,6 +109,8 @@ void MathSplitInset::infoize(std::ostream & os) const void MathSplitInset::validate(LaTeXFeatures & features) const { - features.require("amsmath"); - MathNestInset::validate(features); + if (name_ == "split" || name_ == "gathered" || name_ == "aligned" || + name_ == "alignedat") + features.require("amsmath"); + MathGridInset::validate(features); } diff --git a/status.14x b/status.14x index 0fe422c492..d88d2ff636 100644 --- a/status.14x +++ b/status.14x @@ -36,6 +36,8 @@ What's new - Parse the optional argument of the AMS math environments aligned, gathered and alignedat. +- Support lgathered and rgathered math environments. + * User Interface: - Fix a crash that occured on exit if the clipboard was not empty (only on