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
This commit is contained in:
José Matox 2004-08-13 11:00:34 +00:00
parent 3d3fdcf032
commit b241721780
2 changed files with 25 additions and 12 deletions

View File

@ -1,4 +1,7 @@
2004-08-13 José Matos <jamatos@lyx.org>
* math_hullinset.C (docbook): add awareness of the distinction
between the sgml and xml versions of docbook.
2004-08-12 André Pönitz <poenitz@gmx.net>

View File

@ -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;
}