From b520657039c5e37a9173837560f3a328b2d51cff Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 29 Jul 2010 15:44:17 +0000 Subject: [PATCH] HTML for xarrows. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35026 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathXArrow.cpp | 18 ++++++++++++++++++ src/mathed/InsetMathXArrow.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/mathed/InsetMathXArrow.cpp b/src/mathed/InsetMathXArrow.cpp index 54d7356381..31c9c0c5d8 100644 --- a/src/mathed/InsetMathXArrow.cpp +++ b/src/mathed/InsetMathXArrow.cpp @@ -86,9 +86,27 @@ void InsetMathXArrow::mathmlize(MathStream & ms) const } +void InsetMathXArrow::htmlize(HtmlStream & os) const +{ + char const * const arrow = name_ == "xleftarrow" + ? "←" : "→"; + os << MTag("span", "class='xarrow'") + << MTag("span", "class='xatop'") << cell(0) << ETag("span") + << MTag("span", "class='xabottom'") << arrow << ETag("span") + << ETag("span"); +} + + void InsetMathXArrow::validate(LaTeXFeatures & features) const { features.require("amsmath"); + if (features.runparams().math_flavor == OutputParams::MathAsHTML) + // CSS adapted from eLyXer + features.addPreambleSnippet(""); InsetMathNest::validate(features); } diff --git a/src/mathed/InsetMathXArrow.h b/src/mathed/InsetMathXArrow.h index ac6eaae0f9..f63eb2be19 100644 --- a/src/mathed/InsetMathXArrow.h +++ b/src/mathed/InsetMathXArrow.h @@ -34,6 +34,8 @@ public: /// void mathmlize(MathStream &) const; /// + void htmlize(HtmlStream &) const; + /// void validate(LaTeXFeatures & features) const; /// InsetCode lyxCode() const { return MATH_XARROW_CODE; } -- 2.39.2