Support lgathered and rgathered math environments

* src/mathed/math_splitinset.C
	(MathSplitInset::validate): Only require amsmath for AMS stuff

	* src/mathed/math_factory.C
	(createMathInset): create MathSplitInset if the latexkey is "split"

	* src/mathed/math_parser.C
	(Parser::parse1): create MathSplitInset if the latexkey is "split"

	* lib/symbols: Add aligned, gathered, lgathered and rgathered


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@15227 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-10-03 20:11:00 +00:00
parent 006106094d
commit 411024615c
5 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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));
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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