From 6a702a2f99af4308973fb5b088db6edcc49fbe90 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 31 Mar 2010 21:17:30 +0000 Subject: [PATCH] HTML for substack. Sort of. There's an odd problem here, that is actually a general LyX bug, but I'll report that to the list. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33991 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathSubstack.cpp | 18 +++++++++++++++++- src/mathed/InsetMathSubstack.h | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp index 544230a659..5f7e9f644b 100644 --- a/src/mathed/InsetMathSubstack.cpp +++ b/src/mathed/InsetMathSubstack.cpp @@ -118,9 +118,25 @@ void InsetMathSubstack::maple(MapleStream & os) const } +void InsetMathSubstack::htmlize(HtmlStream & os) const +{ + os << MTag("span", "class='substack'"); + for (row_type row = 0; row < nrows(); ++row) + os << MTag("span") << cell(index(row, 0)) << ETag("span"); + os << ETag("span"); +} + + void InsetMathSubstack::validate(LaTeXFeatures & features) const { - features.require("amsmath"); + if (features.runparams().isLaTeX()) + features.require("amsmath"); + else if (features.runparams().math_flavor == OutputParams::MathAsHTML) + features.addPreambleSnippet(""); + InsetMathGrid::validate(features); } diff --git a/src/mathed/InsetMathSubstack.h b/src/mathed/InsetMathSubstack.h index fbf5f756cc..612187ae89 100644 --- a/src/mathed/InsetMathSubstack.h +++ b/src/mathed/InsetMathSubstack.h @@ -39,11 +39,13 @@ public: /// void write(WriteStream & os) const; /// + void htmlize(HtmlStream &) const; + /// void normalize(NormalStream &) const; /// void maple(MapleStream &) const; /// - void validate(LaTeXFeatures & features) const; + void validate(LaTeXFeatures &) const; /// InsetCode lyxCode() const { return MATH_SUBSTACK_CODE; } -- 2.39.2