}
-void InsetMathBig::draw(PainterInfo & pi, int x, int y) const
+docstring InsetMathBig::word() 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).
// Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco
// would treat it as |.
- docstring const delim = (delim_ == "\\|") ? from_ascii("Vert") :
- (delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\");
+ if (delim_ == "\\|")
+ return from_ascii("Vert");
+ if (delim_ == "\\\\")
+ return from_ascii("\\");
+ return support::ltrim(delim_, "\\");
+}
+
+
+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(pi, x + 1, y - dim.ascent(), 4, dim.height(),
- delim);
+ word());
}
"<", ">", "\\\\", "\\backslash",
"\\langle", "\\lceil", "\\lfloor",
"\\rangle", "\\rceil", "\\rfloor",
+ "\\llbracket", "\\rrbracket",
"\\downarrow", "\\Downarrow",
"\\uparrow", "\\Uparrow",
"\\updownarrow", "\\Updownarrow", ""
void InsetMathBig::validate(LaTeXFeatures & features) const
{
+ validate_math_word(features, word());
if (features.runparams().math_flavor == OutputParams::MathAsHTML)
features.addCSSSnippet(
"span.bigsymbol{font-size: 150%;}\n"
// The delimiters may be used without \left or \right as well.
// Therefore they are listed in lib/symbols, and if they have
// requirements, we need to add them here.
- MathWordList const & words = mathedWordList();
- MathWordList::const_iterator it = words.find(left_);
- if (it != words.end())
- {
- string const req = it->second.requires;
- if (!req.empty())
- features.require(req);
- }
- it = words.find(right_);
- if (it != words.end())
- {
- string const req = it->second.requires;
- if (!req.empty())
- features.require(req);
- }
+ validate_math_word(features, left_);
+ validate_math_word(features, right_);
}
#include "InsetMathSymbol.h"
#include "Length.h"
#include "MathData.h"
+#include "MathFactory.h"
#include "MathParser.h"
#include "MathStream.h"
+#include "LaTeXFeatures.h"
#include "MetricsInfo.h"
#include "frontends/FontLoader.h"
}
+void validate_math_word(LaTeXFeatures & features, docstring const & word)
+{
+ MathWordList const & words = mathedWordList();
+ MathWordList::const_iterator it = words.find(word);
+ if (it != words.end()) {
+ string const req = it->second.requires;
+ if (!req.empty())
+ features.require(req);
+ }
+}
+
+
} // namespace lyx