From: Richard Heck Date: Thu, 17 Dec 2009 15:54:49 +0000 (+0000) Subject: Fix MathML output of sums. X-Git-Tag: 2.0.0~4782 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2ae6331072e25b28652a954e6e0b8f5280d5bcae;p=features.git Fix MathML output of sums. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32566 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp index 5313f0adc3..bc26c05f53 100644 --- a/src/mathed/InsetMathExInt.cpp +++ b/src/mathed/InsetMathExInt.cpp @@ -124,11 +124,41 @@ void InsetMathExInt::mathematica(MathematicaStream & os) const void InsetMathExInt::mathmlize(MathStream & os) const { + if (symbol_ == "sum") { + bool const lower = !cell(1).empty(); + bool const upper = !cell(3).empty(); + if (lower && upper) + os << MTag("msubsup"); + else if (lower) + os << MTag("msub"); + else if (upper) + os << MTag("msup"); + os << MTag("mrow") << MTag("mo") << "∑" << ETag("mo") << ETag("mrow"); + if (lower) { + os << MTag("mrow"); + os << cell(1); + if (!cell(2).empty()) + os << MTag("mo") << "=" << ETag("mo") + << cell(2); + os << ETag("mrow"); + } + if (upper) + os << MTag("mrow") << cell(3) << ETag("mrow"); + if (lower && upper) + os << ETag("msubsup"); + else if (lower) + os << ETag("msub"); + else if (upper) + os << ETag("msup"); + os << cell(0); + return; + } + // some kind of integral InsetMathSymbol sym(symbol_); //if (hasScripts()) // mathmlize(sym, os); //else - sym.mathmlize(os); + sym.mathmlize(os); os << cell(0) << "" << MTag("mrow") << "" << cell(1) << ETag("mrow");