using std::auto_ptr;
-InsetMathSplit::InsetMathSplit(string const & name)
- : InsetMathGrid(1, 1), name_(name)
+InsetMathSplit::InsetMathSplit(string const & name, char valign)
+ : InsetMathGrid(1, 1, valign, string()), name_(name)
{
- setDefaults();
}
if (ws.fragile())
ws << "\\protect";
ws << "\\begin{" << name_ << '}';
+ if (name_ != "split" && valign() != 'c')
+ ws << '[' << valign() << ']';
if (name_ == "alignedat")
ws << '{' << static_cast<unsigned int>((ncols() + 1)/2) << '}';
InsetMathGrid::write(ws);
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);
}