Support lgathered and rgathered math environments

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

	* src/mathed/MathFactory.C
	(createInsetMath): create InsetMathSplit if the latexkey is "split"

	* src/mathed/MathParser.C
	(Parser::parse1): remove "gathered" and "aligned", since these are
	now handled via lib/symbols
	(Parser::parse1): create InsetMathSplit if the latexkey is "split"

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


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15224 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-10-03 19:45:43 +00:00
parent fd6fa1e2af
commit 368f6a53a8
4 changed files with 26 additions and 8 deletions

View File

@ -109,6 +109,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

@ -110,6 +110,8 @@ void InsetMathSplit::infoize(std::ostream & os) const
void InsetMathSplit::validate(LaTeXFeatures & features) const
{
features.require("amsmath");
InsetMathNest::validate(features);
if (name_ == "split" || name_ == "gathered" || name_ == "aligned" ||
name_ == "alignedat")
features.require("amsmath");
InsetMathGrid::validate(features);
}

View File

@ -275,6 +275,8 @@ MathAtom createInsetMath(string const & s)
return MathAtom(new InsetMathFontOld(l));
if (inset == "matrix")
return MathAtom(new InsetMathAMSArray(s));
if (inset == "split")
return MathAtom(new InsetMathSplit(s));
if (inset == "big")
// we can't create a InsetMathBig, since the argument
// is missing.

View File

@ -1105,12 +1105,6 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags,
parse2(cell->back(), FLAG_END, mode, false);
}
else if (name == "gathered" || name == "aligned") {
string const valign = parse_verbatim_option() + 'c';
cell->push_back(MathAtom(new InsetMathSplit(name, valign[0])));
parse2(cell->back(), FLAG_END, mode, false);
}
else if (name == "alignedat") {
string const valign = parse_verbatim_option() + 'c';
// ignore this for a while
@ -1180,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);
}
}