X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathBox.cpp;h=8b3cb2b427b1c1938cf980bae60959072eebe8a9;hb=6de3c19fd63f810eed90ef3bc4469faf28e949c2;hp=482b2b1fed9141839a281caede99a94381cb6409;hpb=07ca26fa270a516107d706a221205d89cedbe081;p=lyx.git
diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp
index 482b2b1fed..8b3cb2b427 100644
--- a/src/mathed/InsetMathBox.cpp
+++ b/src/mathed/InsetMathBox.cpp
@@ -102,13 +102,9 @@ void InsetMathBox::validate(LaTeXFeatures & features) const
// It'd be better to be able to get this from an InsetLayout, but at present
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
if (features.runparams().math_flavor == OutputParams::MathAsMathML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("mstyle.mathbox { font-style: normal; }");
else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("span.mathbox { font-style: normal; }");
if (name_ == "tag" || name_ == "tag*")
features.require("amsmath");
@@ -192,13 +188,11 @@ void InsetMathFBox::validate(LaTeXFeatures & features) const
// It'd be better to be able to get this from an InsetLayout, but at present
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
if (features.runparams().math_flavor == OutputParams::MathAsMathML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet(
+ "mstyle.fbox { border: 1px solid black; font-style: normal; padding: 0.5ex; }");
else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet(
+ "span.fbox { border: 1px solid black; font-style: normal; padding: 0.5ex; }");
cell(0).validate(features);
InsetMathNest::validate(features);
@@ -224,7 +218,7 @@ void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const
Dimension wdim;
static docstring bracket = from_ascii("[");
- mathed_string_dim(mi.base.font, bracket, wdim);
+ metricsStrRedBlack(mi, wdim, bracket);
int w = wdim.wid;
Dimension dim0;
@@ -288,9 +282,9 @@ void InsetMathMakebox::write(WriteStream & os) const
{
ModeSpecifier specifier(os, TEXT_MODE);
os << (framebox_ ? "\\framebox" : "\\makebox");
- if (cell(0).size() || !os.latex()) {
+ if (!cell(0).empty() || !os.latex()) {
os << '[' << cell(0) << ']';
- if (cell(1).size() || !os.latex())
+ if (!cell(1).empty() || !os.latex())
os << '[' << cell(1) << ']';
}
os << '{' << cell(2) << '}';
@@ -340,13 +334,9 @@ void InsetMathMakebox::validate(LaTeXFeatures & features) const
// It'd be better to be able to get this from an InsetLayout, but at present
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
if (features.runparams().math_flavor == OutputParams::MathAsMathML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("mstyle.framebox { border: 1px solid black; }");
else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("span.framebox { border: 1px solid black; }");
InsetMathNest::validate(features);
}
@@ -422,13 +412,9 @@ void InsetMathBoxed::validate(LaTeXFeatures & features) const
// It'd be better to be able to get this from an InsetLayout, but at present
// InsetLayouts do not seem really to work for things that aren't InsetTexts.
if (features.runparams().math_flavor == OutputParams::MathAsMathML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("mstyle.boxed { border: 1px solid black; }");
else if (features.runparams().math_flavor == OutputParams::MathAsHTML)
- features.addPreambleSnippet("");
+ features.addCSSSnippet("span.boxed { border: 1px solid black; }");
InsetMathNest::validate(features);
}