X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmathed%2FInsetMathBig.cpp;h=76efc571dbf853dcc03a56e10cc2568a1346a8da;hb=02e82157ec583c3900e359de86be79fac6512387;hp=9745b76e2b602fdd334e0f58877172d2af790a89;hpb=fe7196a545ca82dec11e046525dc30ca93de6175;p=lyx.git
diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp
index 9745b76e2b..76efc571db 100644
--- a/src/mathed/InsetMathBig.cpp
+++ b/src/mathed/InsetMathBig.cpp
@@ -12,7 +12,9 @@
#include "InsetMathBig.h"
+#include "Dimension.h"
#include "LaTeXFeatures.h"
+
#include "MathSupport.h"
#include "MathStream.h"
#include "MetricsInfo.h"
@@ -67,6 +69,7 @@ double InsetMathBig::increase() const
void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ Changer dummy = mi.base.changeEnsureMath();
double const h = theFontMetrics(mi.base.font).ascent('I');
double const f = increase();
dim.wid = 6;
@@ -77,6 +80,7 @@ void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetMathBig::draw(PainterInfo & pi, int x, int y) const
{
+ Changer dummy = pi.base.changeEnsureMath();
Dimension const dim = dimension(*pi.base.bv);
// mathed_draw_deco does not use the leading backslash, so remove it
// (but don't use ltrim if this is the backslash delimiter).
@@ -86,7 +90,6 @@ void InsetMathBig::draw(PainterInfo & pi, int x, int y) const
(delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\");
mathed_draw_deco(pi, x + 1, y - dim.ascent(), 4, dim.height(),
delim);
- setPosCache(pi, x, y);
}
@@ -107,48 +110,9 @@ void InsetMathBig::normalize(NormalStream & os) const
void InsetMathBig::mathmlize(MathStream & os) const
{
- os << "";
- if (delim_ == "(" || delim_ == ")"
- || delim_ == "[" || delim_ == "]"
- || delim_ == "|" || delim_ == "/")
- os << delim_;
- else if (delim_ == "\\{" || delim_ == "\\lbrace")
- os << "{";
- else if (delim_ == "\\}" || delim_ == "\\rbrace")
- os << "}";
- else if (delim_ == "\\slash")
- os << "/";
- else if (delim_ == "\\|" || delim_ == "\\vert")
- os << "|";
- else if (delim_ == "\\Vert")
- os << "∥";
- else if (delim_ == "\\\\" || delim_ == "\\backslash")
- os <<" \\";
- else if (delim_ == "\\langle")
- os << "<";
- else if (delim_ == "\\rangle")
- os << ">";
- else if (delim_ == "\\lceil")
- os << "⌈";
- else if (delim_ == "\\rceil")
- os << "⌉";
- else if (delim_ == "\\lfloor")
- os << "⌊";
- else if (delim_ == "\\rfloor")
- os << "⌋";
- else if (delim_ == "\\downarrow")
- os << "↓";
- else if (delim_ == "\\uparrow")
- os << "↑";
- else if (delim_ == "\\Downarrow")
- os << "⇓";
- else if (delim_ == "\\Uparrow")
- os << "⇑";
- else if (delim_ == "\\updownarrow")
- os << "↕";
- else if (delim_ == "\\Updownarrow")
- os << "⇕";
- os << "";
+ os << ""
+ << convertDelimToXMLEscape(delim_)
+ << "";
}
@@ -161,48 +125,9 @@ void InsetMathBig::htmlize(HtmlStream & os) const
case 4: case 5: name = "biggg"; break;
default: name = "big"; break;
}
- os << MTag("span", "class='" + name + "symbol'");
- if (delim_ == "(" || delim_ == ")"
- || delim_ == "[" || delim_ == "]"
- || delim_ == "|" || delim_ == "/")
- os << delim_;
- else if (delim_ == "\\{" || delim_ == "\\lbrace")
- os << "{";
- else if (delim_ == "\\}" || delim_ == "\\rbrace")
- os << "}";
- else if (delim_ == "\\slash")
- os << "/";
- else if (delim_ == "\\|" || delim_ == "\\vert")
- os << "|";
- else if (delim_ == "\\Vert")
- os << "∥";
- else if (delim_ == "\\\\" || delim_ == "\\backslash")
- os <<" \\";
- else if (delim_ == "\\langle")
- os << "<";
- else if (delim_ == "\\rangle")
- os << ">";
- else if (delim_ == "\\lceil")
- os << "⌈";
- else if (delim_ == "\\rceil")
- os << "⌉";
- else if (delim_ == "\\lfloor")
- os << "⌊";
- else if (delim_ == "\\rfloor")
- os << "⌋";
- else if (delim_ == "\\downarrow")
- os << "↓";
- else if (delim_ == "\\uparrow")
- os << "↑";
- else if (delim_ == "\\Downarrow")
- os << "⇓";
- else if (delim_ == "\\Uparrow")
- os << "⇑";
- else if (delim_ == "\\updownarrow")
- os << "↕";
- else if (delim_ == "\\Updownarrow")
- os << "⇕";
- os << ETag("span");
+ os << MTag("span", "class='" + name + "symbol'")
+ << convertDelimToXMLEscape(delim_)
+ << ETag("span");
}
@@ -232,11 +157,10 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim)
void InsetMathBig::validate(LaTeXFeatures & features) const
{
if (features.runparams().math_flavor == OutputParams::MathAsHTML)
- features.addPreambleSnippet("");
+ "span.bigggsymbol{font-size: 225%;}");
}