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);
class InsetMathSplit : public InsetMathGrid {
public:
///
- explicit InsetMathSplit(std::string const & name);
+ explicit InsetMathSplit(std::string const & name, char valign = 'c');
///
void draw(PainterInfo & pi, int x, int y) const;
#include "InsetMathRef.h"
#include "InsetMathRoot.h"
#include "InsetMathScript.h"
+#include "InsetMathSplit.h"
#include "InsetMathSqrt.h"
#include "InsetMathTabular.h"
#include "MathMacroTemplate.h"
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 == "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
getArg('{', '}');
- cell->push_back(createInsetMath(name));
+ cell->push_back(MathAtom(new InsetMathSplit(name, valign[0])));
parse2(cell->back(), FLAG_END, mode, false);
}