2001-09-04 André Pönitz <poenitz@gmx.net>
+ * math_defs.h:
* math_parser.C:
- math_matrixinset.C: some support for [x][x]alignat environments
+ * math_matrixinset.C: some support for the AMS 'alignat', 'xalignat',
+ 'xxalignt', 'gather' and 'multiline' environments
* math_cursor.C: fix handling of | and \|
bool MathMatrixInset::numberedType() const
{
- if (getType() == LM_OT_SIMPLE)
+ if (getType() == LM_OT_SIMPLE || getType() == LM_OT_XXALIGNAT)
return false;
for (int row = 0; row < nrows(); ++row)
if (!nonum_[row])
os << "\\begin{xxalignat}" << "{" << ncols()/2 << "}\n";
break;
+ case LM_OT_MULTLINE:
+ os << "\\begin{multline}\n";
+ break;
+
+ case LM_OT_GATHER:
+ os << "\\begin{gather}\n";
+ break;
+
default:
os << "\\begin{unknown" << star(n) << "}";
}
os << "\\end{xxalignat}\n";
break;
+ case LM_OT_MULTLINE:
+ os << "\\end{multline}\n";
+ break;
+
+ case LM_OT_GATHER:
+ os << "\\end{gather}\n";
+ break;
+
default:
os << "\\end{unknown" << star(n) << "}";
}
return LM_OT_XXALIGNAT;
if (s == "multline")
return LM_OT_MULTLINE;
+ if (s == "gather")
+ return LM_OT_GATHER;
return LM_OT_SIMPLE;
}
}
}
break;
+ case LM_OT_MULTLINE:
+ switch (newtype) {
+ case LM_OT_GATHER:
+ setType(LM_OT_GATHER);
+ break;
+ default:
+ lyxerr << "mutation from '" << getType()
+ << "' to '" << newtype << "' not implemented\n";
+ break;
+ }
+
+ case LM_OT_GATHER:
+ switch (newtype) {
+ case LM_OT_MULTLINE:
+ setType(LM_OT_MULTLINE);
+ break;
+ default:
+ lyxerr << "mutation from '" << getType()
+ << "' to '" << newtype << "' not implemented\n";
+ break;
+ }
+
default:
lyxerr << "mutation from '" << getType()
<< "' to '" << newtype << "' not implemented\n";
return p;
}
+ if (name == "multline" || name == "multline*") {
+ MathMatrixInset * p = new MathMatrixInset(LM_OT_MULTLINE);
+ parse_lines(p, !stared(name), true);
+ return p;
+ }
+
+ if (name == "gather" || name == "gather*") {
+ MathMatrixInset * p = new MathMatrixInset(LM_OT_GATHER);
+ parse_lines(p, !stared(name), true);
+ return p;
+ }
+
lyxerr[Debug::MATHED] << "1: unknown math environment: " << name << "\n";
return 0;
}