X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathBig.cpp;h=969dd472c72fd5e512df6675cd30cda043952037;hb=6de3c19fd63f810eed90ef3bc4469faf28e949c2;hp=463b628dbecfe343186864c5fcebab189452278d;hpb=c060a85d811674888c31db9ee0407d8b5cc37b6e;p=lyx.git diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index 463b628dbe..969dd472c7 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -12,6 +12,7 @@ #include "InsetMathBig.h" +#include "LaTeXFeatures.h" #include "MathSupport.h" #include "MathStream.h" #include "MetricsInfo.h" @@ -46,9 +47,11 @@ InsetMathBig::size_type InsetMathBig::size() const { // order: big Big bigg Bigg biggg Biggg // 0 1 2 3 4 5 + char_type const c = name_[name_.size() - 1]; + int const base_size = (c == 'l' || c == 'm' || c == 'r') ? 4 : 3; return name_[0] == 'B' ? - 2 * (name_.size() - 4) + 1: - 2 * (name_.size() - 4); + 2 * (name_.size() - base_size) + 1: + 2 * (name_.size() - base_size); } @@ -149,6 +152,60 @@ void InsetMathBig::mathmlize(MathStream & os) const } +void InsetMathBig::htmlize(HtmlStream & os) const +{ + std::string name; + switch (size()) { + case 0: case 1: name = "big"; break; + case 2: case 3: name = "bigg"; break; + 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"); +} + + void InsetMathBig::infoize2(odocstream & os) const { os << name_; @@ -161,7 +218,7 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim) static char const * const delimiters[] = { "(", ")", "\\{", "\\}", "\\lbrace", "\\rbrace", "[", "]", "|", "/", "\\slash", "\\|", "\\vert", "\\Vert", "'", - "\\\\", "\\backslash", + "<", ">", "\\\\", "\\backslash", "\\langle", "\\lceil", "\\lfloor", "\\rangle", "\\rceil", "\\rfloor", "\\downarrow", "\\Downarrow", @@ -172,4 +229,14 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim) } +void InsetMathBig::validate(LaTeXFeatures & features) const +{ + if (features.runparams().math_flavor == OutputParams::MathAsHTML) + features.addCSSSnippet( + "span.bigsymbol{font-size: 150%;}\n" + "span.biggsymbol{font-size: 200%;}\n" + "span.bigggsymbol{font-size: 225%;}"); +} + + } // namespace lyx