From b2417217804608c6d501409e5420d2af57350fe7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Fri, 13 Aug 2004 11:00:34 +0000 Subject: [PATCH] add awareness of the sgml/xml distinction for math output in docbook git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8896 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 3 +++ src/mathed/math_hullinset.C | 34 ++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index f616f76382..b1fb5ac0cc 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,4 +1,7 @@ +2004-08-13 José Matos + * math_hullinset.C (docbook): add awareness of the distinction + between the sgml and xml versions of docbook. 2004-08-12 André Pönitz diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 77fd77d9c8..232fa8ebdf 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -1263,17 +1263,27 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os, OutputParams const & runparams) const { MathMLStream ms(os); - string name="equation"; - if (! label(0).empty()) name += " id=\"" + label(0)+ "\""; - ms << MTag(name.c_str()); - ms << MTag("alt"); - ms << "<[CDATA["; - int res = plaintext(buf, ms.os(), runparams); - ms << "]]>"; - ms << ETag("alt"); - ms << MTag("math"); - MathGridInset::mathmlize(ms); - ms << ETag("math"); - ms << ETag("equation"); + int res = 0; + string name; + if (getType() == "simple") + name= "inlineequation"; + else + name = "informalequation"; + + string bname = name; + if (! label(0).empty()) bname += " id=\"" + label(0)+ "\""; + ms << MTag(bname.c_str()); + + if (runparams.flavor == OutputParams::XML) { + ms << MTag("math"); + MathGridInset::mathmlize(ms); + ms << ETag("math"); + } else { + ms << MTag("alt"); + res = latex(buf, ms.os(), runparams); + ms << ETag("alt"); + } + + ms << ETag(name.c_str()); return ms.line() + res; } -- 2.39.2