From e6947f6187929b215a01de04cd9ef258c5ba894a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 14 Feb 2002 14:19:52 +0000 Subject: [PATCH] full support for vmatrix and Vmatrix, added missing parts for pmatrix and bmatrix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3539 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_amsarrayinset.C | 8 ++++++++ src/mathed/math_factory.C | 12 ++++++++++++ src/mathed/math_parser.C | 15 +++++---------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/mathed/math_amsarrayinset.C b/src/mathed/math_amsarrayinset.C index dd45853cdc..4e395791db 100644 --- a/src/mathed/math_amsarrayinset.C +++ b/src/mathed/math_amsarrayinset.C @@ -32,6 +32,10 @@ char const * MathAMSArrayInset::name_left() const { if (name_ == "bmatrix") return "["; + if (name_ == "vmatrix") + return "|"; + if (name_ == "Vmatrix") + return "Vert"; return "("; } @@ -40,6 +44,10 @@ char const * MathAMSArrayInset::name_right() const { if (name_ == "bmatrix") return "]"; + if (name_ == "vmatrix") + return "|"; + if (name_ == "Vmatrix") + return "Vert"; return ")"; } diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 02a5d98687..c6332eed8d 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -1,8 +1,10 @@ #include #include "math_parser.h" +#include "math_amsarrayinset.h" #include "math_binominset.h" #include "math_boxinset.h" +#include "math_casesinset.h" #include "math_decorationinset.h" #include "math_dotsinset.h" #include "math_funcinset.h" @@ -17,6 +19,7 @@ #include "math_rootinset.h" #include "math_sizeinset.h" #include "math_spaceinset.h" +#include "math_splitinset.h" #include "math_specialcharinset.h" #include "math_sqrtinset.h" #include "math_stackrelinset.h" @@ -99,6 +102,15 @@ MathAtom createMathInset(string const & s) if (s == "xrightarrow") return MathAtom(new MathXArrowInset(s)); + if (s == "split") + return MathAtom(new MathSplitInset(1)); + + if (s == "cases") + return MathAtom(new MathCasesInset); + + if (s == "pmatrix" || s == "bmatrix" || s == "vmatrix" || s == "Vmatrix") + return MathAtom(new MathAMSArrayInset(s)); + latexkeys const * l = in_word_set(s); if (l) return createMathInset(l); diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 7faa4a7c88..92c33cf725 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -52,9 +52,7 @@ point to write some macros: #include "math_parser.h" #include "math_inset.h" #include "math_arrayinset.h" -#include "math_amsarrayinset.h" #include "math_braceinset.h" -#include "math_casesinset.h" #include "math_charinset.h" #include "math_deliminset.h" #include "math_factory.h" @@ -69,7 +67,6 @@ point to write some macros: #include "math_sqrtinset.h" #include "math_scriptinset.h" #include "math_specialcharinset.h" -#include "math_splitinset.h" #include "math_sqrtinset.h" #include "math_support.h" #include "math_xyarrowinset.h" @@ -1082,14 +1079,12 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code) string const halign = getArg('{', '}'); array.push_back(MathAtom(new MathArrayInset(valign[0], halign))); parse_lines(array.back(), false, false); - } else if (name == "split") { - array.push_back(MathAtom(new MathSplitInset(1))); + } else if (name == "split" || name == "cases") { + array.push_back(createMathInset(name)); parse_lines(array.back(), false, false); - } else if (name == "cases") { - array.push_back(MathAtom(new MathCasesInset)); - parse_lines(array.back(), false, false); - } else if (name == "pmatrix" || name == "bmatrix") { - array.push_back(MathAtom(new MathAMSArrayInset(name))); + } else if (name == "pmatrix" || name == "bmatrix" || + name == "vmatrix" || name == "Vmatrix") { + array.push_back(createMathInset(name)); parse_lines2(array.back(), false); } else lyxerr << "unknow math inset begin '" << name << "'\n"; -- 2.39.2