- features.amsstyle = ams();
-
- // Validation is necessary only if not using AMS math.
- // To be safe, we will always run mathedvalidate.
- //if (features.amsstyle)
- // return;
-
- features.boldsymbol = true;
- //features.binom = true;
-
- MathNestInset::validate(features);
-}
-
-
-void MathMatrixInset::header_write(std::ostream & os) const
-{
- bool n = numberedType();
-
- switch (getType()) {
- case LM_OT_SIMPLE:
- os << '$';
- if (cell(0).empty())
- os << ' ';
- break;
-
- case LM_OT_EQUATION:
- if (n)
- os << "\\begin{equation" << star(n) << "}\n";
- else
- os << "\\[\n";
- break;
-
- case LM_OT_EQNARRAY:
- os << "\\begin{eqnarray" << star(n) << "}\n";
- break;
-
- case LM_OT_ALIGN:
- os << "\\begin{align" << star(n) << "}";
- break;
-
- case LM_OT_ALIGNAT:
- os << "\\begin{alignat" << star(n) << "}"
- << "{" << ncols()/2 << "}\n";
- break;
- default:
- os << "\\begin{unknown" << star(n) << "}";
- }
-}
-
-
-void MathMatrixInset::footer_write(std::ostream & os) const
-{
- bool n = numberedType();
-
- switch (getType()) {
- case LM_OT_SIMPLE:
- os << '$';
- break;
-
- case LM_OT_EQUATION:
- if (n)
- os << "\\end{equation" << star(n) << "}\n";
- else
- os << "\\]\n";
- break;
-
- case LM_OT_EQNARRAY:
- os << "\\end{eqnarray" << star(n) << "}\n";
- break;
-
- case LM_OT_ALIGN:
- os << "\\end{align" << star(n) << "}\n";
- break;
-
- case LM_OT_ALIGNAT:
- os << "\\end{alignat" << star(n) << "}\n";
- break;
-
- default:
- os << "\\end{unknown" << star(n) << "}";
- }
-}
-
-
-void MathMatrixInset::addRow(int row)
-{
- nonum_.insert(nonum_.begin() + row + 1, !numberedType());
- label_.insert(label_.begin() + row + 1, string());
- MathGridInset::addRow(row);
-}
-
-void MathMatrixInset::appendRow()
-{
- nonum_.push_back(!numberedType());
- label_.push_back(string());
- MathGridInset::appendRow();
-}
-
-
-void MathMatrixInset::delRow(int row)
-{
- MathGridInset::delRow(row);
- nonum_.erase(nonum_.begin() + row);
- label_.erase(label_.begin() + row);
-}
-
-void MathMatrixInset::addCol(int col)
-{
- switch (getType()) {
- case LM_OT_EQUATION:
- mutate(LM_OT_EQNARRAY);
- break;
-
- case LM_OT_EQNARRAY:
- mutate(LM_OT_ALIGN);
- addCol(col);
- break;
-
- case LM_OT_ALIGN:
- case LM_OT_ALIGNAT:
- MathGridInset::addCol(col);
- halign(col, 'l');
- MathGridInset::addCol(col);
- halign(col, 'r');
- break;
-
- default:
- break;
- }
-}
-
-void MathMatrixInset::delCol(int col)
-{
- switch (getType()) {
- case LM_OT_ALIGN:
- MathGridInset::delCol(col);
- break;
-
- default:
- break;