From 8bd80f2b4edbef02ed63ad8cb758b58e7ac1b1e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 14 Oct 2002 12:56:21 +0000 Subject: [PATCH] support for AMS flalign environment git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5388 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/ui/default.ui | 10 ++++++---- src/mathed/ChangeLog | 3 +++ src/mathed/math_hullinset.C | 16 ++++++++++------ src/mathed/math_parser.C | 5 +++++ 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index fa0e34495c..700a6a45a4 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2002-10-14 André Pönitz + + * ui/default.ui: support for flalign + 2002-10-11 Dekel Tsur * lyx2lyx/lyxconvert_218.py (remove_oldert): Fix bug. diff --git a/lib/ui/default.ui b/lib/ui/default.ui index 84da614c03..c6c4b5e11f 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -156,8 +156,9 @@ Menuset Item "Eqnarray environment|q" "math-mutate eqnarray" Item "Align environment|A" "math-mutate align" Item "AlignAt environment" "math-mutate alignat" - Item "XAlignAt environment" "math-mutate xalignat" - Item "XXAlignAt environment" "math-mutate xxalignat" + Item "Flalign environment|f" "math-mutate flalign" + #Item "XAlignAt environment" "math-mutate xalignat" + #Item "XXAlignAt environment" "math-mutate xxalignat" Item "Gather environment" "math-mutate gather" Item "Multline environment" "math-mutate multline" End @@ -211,8 +212,9 @@ Menuset Item "Eqnarray environment|E" "command-sequence math-mode; math-mutate eqnarray;" Item "AMS align environment|A" "command-sequence math-mode; math-mutate align;" Item "AMS alignat environment|t" "command-sequence math-mode; math-mutate alignat;" - Item "AMS xalignat environment|x" "command-sequence math-mode; math-mutate xalignat;" - Item "AMS xxalignat environment" "command-sequence math-mode; math-mutate xxalignat;" + Item "AMS flalign environment|f" "command-sequence math-mode; math-mutate flalign;" + #Item "AMS xalignat environment|x" "command-sequence math-mode; math-mutate xalignat;" + #Item "AMS xxalignat environment" "command-sequence math-mode; math-mutate xxalignat;" Item "AMS gather environment" "command-sequence math-mode; math-mutate gather;" Item "AMS multline environment" "command-sequence math-mode; math-mutate multline;" Separator diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 946f06538f..4a5066ccac 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -3,6 +3,9 @@ * formulabase.C: support pasting stuff into formulas using button3 + * math_parser.C: + math_hullinset.C: Herbert's patch to support flalign + 2002-10-10 Jean-Marc Lasgouttes * formulabase.C (localDispatch): make LFUN_WORDLEFTSEL and diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 4f5a81d29b..5c99996614 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -38,6 +38,8 @@ namespace { return 3; if (type == "align") return 2; + if (type == "flalign") + return 2; if (type == "alignat") return 2; if (type == "xalignat") @@ -77,6 +79,7 @@ namespace { if (s == "xxalignat") return 7; if (s == "multline") return 8; if (s == "gather") return 9; + if (s == "flalign") return 10; lyxerr << "unknown hull type '" << s << "'\n"; return 0; } @@ -151,7 +154,7 @@ int MathHullInset::defaultColSpace(col_type col) return 0; if (type_ == "xalignat") return (col & 1) ? 20 : 0; - if (type_ == "xxalignat") + if (type_ == "xxalignat" || type_ == "flalign") return (col & 1) ? 40 : 0; return 0; } @@ -278,6 +281,7 @@ bool MathHullInset::ams() const { return type_ == "align" || + type_ == "flalign" || type_ == "multline" || type_ == "gather" || type_ == "alignat" || @@ -353,7 +357,7 @@ void MathHullInset::header_write(WriteStream & os) const os << "\\[\n"; } - else if (type_ == "eqnarray" || type_ == "align") + else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign") os << "\\begin{" << type_ << star(n) << "}\n"; else if (type_ == "alignat" || type_ == "xalignat") @@ -388,8 +392,8 @@ void MathHullInset::footer_write(WriteStream & os) const else os << "\\]\n"; - else if (type_ == "eqnarray" || type_ == "align" || type_ == "alignat" - || type_ == "xalignat") + else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign" + || type_ == "alignat" || type_ == "xalignat") os << "\n\\end{" << type_ << star(n) << "}\n"; else if (type_ == "xxalignat" || type_ == "multline" || type_ == "gather") @@ -403,7 +407,7 @@ void MathHullInset::footer_write(WriteStream & os) const bool MathHullInset::colChangeOK() const { return - type_ == "align" || type_ == "alignat" || + type_ == "align" || type_ == "flalign" ||type_ == "alignat" || type_ == "xalignat" || type_ == "xxalignat"; } @@ -588,7 +592,7 @@ void MathHullInset::mutate(string const & newtype) else if (type_ == "multline") { if (newtype == "gather" || newtype == "align" || - newtype == "xalign" || newtype == "xxalign") + newtype == "xalignat" || newtype == "xxalignat" || newtype == "flalign") setType(newtype); else if (newtype == "eqnarray") { MathGridInset::addCol(1); diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 6cfa4f0572..ff4447c2d8 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1016,6 +1016,11 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); } + else if (name == "flalign" || name == "flalign*") { + cell->push_back(MathAtom(new MathHullInset("flalign"))); + parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + } + else if (name == "alignat" || name == "alignat*") { // ignore this for a while getArg('{', '}'); -- 2.39.2